StateAtom

Class Methods

__init__(*args, **kwargs)

get_amplitude(other)

Calculate the amplitude of the state with respect to another state or ket.

get_coefficients()

Return the coefficients of the state as a 1d-array.

get_corresponding_ket()

Return the ket corresponding to the state (i.e. the ket with the maximal overlap).

get_corresponding_ket_index()

Return the index of the ket corresponding to the state (i.e. the ket with the maximal overlap).

get_label([max_kets])

Label representing the state.

get_matrix_element(other, operator, q[, unit])

Calculate the matrix element of the operator with respect to the state and another state or ket.

get_overlap(other)

Calculate the overlap of the state with respect to another state or ket.

Class Attributes and Properties

database

The database used for this object.

is_canonical

kets

Return a list containing the kets of the basis.

number_of_kets

Return the number of kets in the basis.

species

The atomic species.

class StateAtom[source]

State of a single atom.

A coefficient vector and a list of kets are used to represent an arbitrary single atom state.

Examples

>>> import pairinteraction.real as pi
>>> ket = pi.KetAtom("Rb", n=60, l=0, m=0.5)
>>> basis = pi.BasisAtom("Rb", n=(57, 63), l=(0, 3))
>>> state = basis.get_corresponding_state(ket)
>>> print(state)
StateAtom(1.00 |Rb:60,S_1/2,1/2⟩)
property database: Database

The database used for this object.

property species: str

The atomic species.

property is_canonical: bool
get_amplitude(other)[source]

Calculate the amplitude of the state with respect to another state or ket.

This means the inner product <self|other>.

Parameters:

other (Union[Self, KetAtom]) – Either a state or a ket for which the amplitude should be calculated.

Return type:

Union[float, complex]

Returns:

The amplitude between self and other.

get_overlap(other)[source]

Calculate the overlap of the state with respect to another state or ket.

This means calculate \(|\langle \mathrm{self} | \mathrm{other} \rangle|^2\).

Parameters:

other (Union[Self, KetAtom]) – Either a state or a ket for which the overlap should be calculated.

Return type:

Union[float, complex]

Returns:

The overlap between self and other.

get_matrix_element(other, operator, q, unit=None)[source]

Calculate the matrix element of the operator with respect to the state and another state or ket.

This means the inner product <self|operator|other>.

Parameters:
  • other (Union[KetAtom, Self]) – Either a state or a ket for which the matrix element should be calculated.

  • operator (Literal['zero', 'energy', 'electric_dipole', 'electric_quadrupole', 'electric_quadrupole_zero', 'electric_octupole', 'magnetic_dipole', 'arbitrary']) – The operator for which the matrix element should be calculated.

  • q (int) – The projection quantum number of the operator.

  • unit (Optional[str]) – The unit in which the result should be returned. Default None will return a pint.Quantity.

Return type:

Union[PlainQuantity[float], PlainQuantity[complex], float, complex]

Returns:

The matrix element between self and other.

__init__(*args, **kwargs)
Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

None

get_coefficients()

Return the coefficients of the state as a 1d-array.

The coefficients are stored in a numpy.array with shape (number_of_kets,).

The coefficients are normalized, i.e. the sum of the absolute values of the coefficients is equal to 1.

Return type:

ndarray[tuple[Any, ...], dtype[Any]]

get_corresponding_ket()

Return the ket corresponding to the state (i.e. the ket with the maximal overlap).

Return type:

TypeVar(KetType, bound= KetBase, covariant=True)

get_corresponding_ket_index()

Return the index of the ket corresponding to the state (i.e. the ket with the maximal overlap).

Return type:

int

get_label(max_kets=3)

Label representing the state.

Return type:

str

Returns:

The label of the ket in the given format.

Parameters:

max_kets (int)

property kets: list[KetType]

Return a list containing the kets of the basis.

property number_of_kets: int

Return the number of kets in the basis.