EffectiveSystemPair

Class Methods

__init__(ket_tuples)

check_for_resonances([required_overlap])

Check if states of the model space have strong resonances with states outside the model space.

copy()

Create a copy of the EffectiveSystemPair object (before it has been created).

get_effective_basis()

Get the effective basis of the pair system.

get_effective_basisvectors()

Get the eigenvectors of the perturbative Hamiltonian.

get_effective_hamiltonian([return_order, unit])

Get the effective Hamiltonian of the pair system.

get_pair_energies([unit])

Get the pair energies of the ket tuples for infinite distance (i.e. no interaction).

set_angle([angle, unit])

Set the angle between the atoms in degrees.

set_delta_l(delta_l)

Set the delta_l value for single-atom basis.

set_delta_m(delta_m)

Set the delta_m value for single-atom basis.

set_delta_n(delta_n)

Set the delta_n value for single-atom basis.

set_diamagnetism_enabled([enable])

Enable or disable diamagnetism for the system.

set_distance(distance[, angle_degree, unit])

Set the distance between the atoms using the specified distance and angle.

set_distance_vector(distance[, unit])

Set the distance vector between the atoms.

set_electric_field(electric_field[, unit])

Set the electric field for the single-atom systems.

set_interaction_order(order)

Set the interaction order of the pair system.

set_magnetic_field(magnetic_field[, unit])

Set the magnetic field for the single-atom systems.

set_maximum_number_of_ket_pairs(number_of_kets)

Set the maximum number of ket pairs in the basis pair.

set_minimum_number_of_ket_pairs(number_of_kets)

Set the minimum number of ket pairs in the basis pair.

set_perturbation_order(order)

Set the perturbation order for the effective Hamiltonian.

Class Attributes and Properties

basis_atoms

The basis objects for the single-atom systems.

basis_pair

The basis pair object for the pair system.

diamagnetism_enabled

Whether diamagnetism is enabled for the single-atom systems.

distance_vector

The distance vector between the atoms in the pair system.

electric_field

The electric field for the single-atom systems.

interaction_order

The interaction order for the pair system.

ket_tuples

The tuples of kets, which form the model space for the effective Hamiltonian.

magnetic_field

The magnetic field for the single-atom systems.

model_inds

The indices of the corresponding KetPairs of the given ket_tuples in the basis of the pair system.

perturbation_order

The perturbation order for the effective Hamiltonian.

system_atoms

The system objects for the single-atom systems.

system_pair

The system pair object for the pair system.

class EffectiveSystemPair[source]

Class for creating an effective SystemPair object and calculating the effective Hamiltonian.

Given a subspace spanned by tuples of KetAtom objects (ket_tuples), this class automatically generates appropriate BasisAtom, SystemAtom objects as well as a BasisPair and SystemPair object to calculate the effective Hamiltonian in the subspace via perturbation theory.

This class also allows to set magnetic and electric fields similar to the SystemAtom class, as well as the angle and distance between the two atoms like in the SystemPair class.

Examples

>>> import pairinteraction.real as pi
>>> from pairinteraction.perturbative import EffectiveSystemPair
>>> ket_atoms = {
...     "+": pi.KetAtom("Rb", n=59, l=0, j=0.5, m=0.5),
...     "0": pi.KetAtom("Rb", n=58, l=1, j=1.5, m=1.5),
...     "-": pi.KetAtom("Rb", n=58, l=0, j=0.5, m=0.5),
... }
>>> ket_tuples = [
...     (ket_atoms["+"], ket_atoms["-"]),
...     (ket_atoms["0"], ket_atoms["0"]),
...     (ket_atoms["-"], ket_atoms["+"]),
... ]
>>> eff_system = EffectiveSystemPair(ket_tuples)
>>> eff_system = eff_system.set_distance(10, angle_degree=45, unit="micrometer")
>>> eff_h = eff_system.get_effective_hamiltonian(unit="MHz")
>>> eff_h -= np.eye(3) * eff_system.get_pair_energies("MHz")[1]
>>> print(np.round(eff_h, 0), "MHz")
[[292.   3.   0.]
 [  3.   0.   3.]
 [  0.   3. 292.]] MHz
__init__(ket_tuples)[source]
Parameters:

ket_tuples (Sequence[tuple[KetAtom, KetAtom] | Sequence[KetAtom]])

Return type:

None

copy()[source]

Create a copy of the EffectiveSystemPair object (before it has been created).

Return type:

Self

Parameters:

self (Self)

property ket_tuples: list[tuple[KetAtom, KetAtom] | Sequence[KetAtom]]

The tuples of kets, which form the model space for the effective Hamiltonian.

property perturbation_order: int

The perturbation order for the effective Hamiltonian.

set_perturbation_order(order)[source]

Set the perturbation order for the effective Hamiltonian.

Return type:

Self

Parameters:
  • self (Self)

  • order (int)

property basis_atoms: tuple[BasisAtom[Any], BasisAtom[Any]]

The basis objects for the single-atom systems.

set_delta_n(delta_n)[source]

Set the delta_n value for single-atom basis.

Return type:

Self

Parameters:
  • self (Self)

  • delta_n (int)

set_delta_l(delta_l)[source]

Set the delta_l value for single-atom basis.

Return type:

Self

Parameters:
  • self (Self)

  • delta_l (int)

set_delta_m(delta_m)[source]

Set the delta_m value for single-atom basis.

Return type:

Self

Parameters:
  • self (Self)

  • delta_m (int)

property system_atoms: tuple[SystemAtom[Any], SystemAtom[Any]]

The system objects for the single-atom systems.

property electric_field: PlainQuantity[ndarray[tuple[Any, ...], dtype[Any]]]

The electric field for the single-atom systems.

set_electric_field(electric_field, unit=None)[source]

Set the electric field for the single-atom systems.

Parameters:
  • electric_field (Union[PlainQuantity[ndarray[tuple[Any, ...], dtype[Any]]], ndarray[tuple[Any, ...], dtype[Any]], Collection[float]]) – The electric field to set for the systems.

  • unit (Optional[str]) – The unit of the electric field, e.g. “V/cm”. Default None expects a pint.Quantity.

  • self (Self)

Return type:

Self

property magnetic_field: PlainQuantity[ndarray[tuple[Any, ...], dtype[Any]]]

The magnetic field for the single-atom systems.

set_magnetic_field(magnetic_field, unit=None)[source]

Set the magnetic field for the single-atom systems.

Parameters:
  • magnetic_field (Union[PlainQuantity[ndarray[tuple[Any, ...], dtype[Any]]], ndarray[tuple[Any, ...], dtype[Any]], Collection[float]]) – The magnetic field to set for the systems.

  • unit (Optional[str]) – The unit of the magnetic field, e.g. “gauss”. Default None expects a pint.Quantity.

  • self (Self)

Return type:

Self

property diamagnetism_enabled: bool

Whether diamagnetism is enabled for the single-atom systems.

set_diamagnetism_enabled(enable=True)[source]

Enable or disable diamagnetism for the system.

Parameters:
  • enable (bool) – Whether to enable or disable diamagnetism.

  • self (Self)

Return type:

Self

get_pair_energies(unit=None)[source]

Get the pair energies of the ket tuples for infinite distance (i.e. no interaction).

Parameters:

unit (Optional[str]) – The unit to which to convert the energies to. Default None will return a list of pint.Quantity.

Return type:

Union[list[float], list[PlainQuantity[float]]]

Returns:

The energies as list of float if a unit was given, otherwise as list of pint.Quantity.

property basis_pair: BasisPair[Any, Any]

The basis pair object for the pair system.

set_minimum_number_of_ket_pairs(number_of_kets)[source]

Set the minimum number of ket pairs in the basis pair.

Parameters:
  • number_of_kets (int) – The minimum number of ket pairs to set in the basis pair, by default we use 2000.

  • self (Self)

Return type:

Self

set_maximum_number_of_ket_pairs(number_of_kets)[source]

Set the maximum number of ket pairs in the basis pair.

Parameters:
  • number_of_kets (int) – The maximum number of ket pairs to set in the basis pair.

  • self (Self)

Return type:

Self

property system_pair: SystemPair[Any]

The system pair object for the pair system.

property interaction_order: int

The interaction order for the pair system.

set_interaction_order(order)[source]

Set the interaction order of the pair system.

Parameters:
  • order (int) – The interaction order to set for the pair system. The order must be 3, 4, or 5.

  • self (Self)

Return type:

Self

property distance_vector: PlainQuantity[ndarray[tuple[Any, ...], dtype[Any]]]

The distance vector between the atoms in the pair system.

set_distance(distance, angle_degree=0, unit=None)[source]

Set the distance between the atoms using the specified distance and angle.

Parameters:
  • distance (Union[float, PlainQuantity[float]]) – The distance to set between the atoms in the given unit.

  • angle_degree (float) – The angle between the distance vector and the z-axis in degrees. 90 degrees corresponds to the x-axis. Defaults to 0, which corresponds to the z-axis.

  • unit (Optional[str]) – The unit of the distance, e.g. “micrometer”. Default None expects a pint.Quantity.

  • self (Self)

Return type:

Self

set_distance_vector(distance, unit=None)[source]

Set the distance vector between the atoms.

Parameters:
  • distance (Union[ndarray[tuple[Any, ...], dtype[Any]], Collection[float], PlainQuantity[ndarray[tuple[Any, ...], dtype[Any]]]]) – The distance vector to set between the atoms in the given unit.

  • unit (Optional[str]) – The unit of the distance, e.g. “micrometer”. Default None expects a pint.Quantity.

  • self (Self)

Return type:

Self

set_angle(angle=0, unit='degree')[source]

Set the angle between the atoms in degrees.

Parameters:
  • angle (float) – The angle between the distance vector and the z-axis (by default in degrees). 90 degrees corresponds to the x-axis. Defaults to 0, which corresponds to the z-axis.

  • unit (Literal['degree', 'radian']) – The unit of the angle, either “degree” or “radian”, by default “degree”.

  • self (Self)

Return type:

Self

get_effective_hamiltonian(return_order=None, unit=None)[source]

Get the effective Hamiltonian of the pair system.

Parameters:
  • return_order (Optional[int]) – The order of the perturbation to return. Default None, returns the sum up to the perturbation order set in the class.

  • unit (Optional[str]) – The unit in which to return the effective Hamiltonian. If None, returns a pint array.

Return type:

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

Returns:

The effective Hamiltonian of the pair system in the given unit. If unit is None, returns a pint array, otherwise returns a numpy array.

get_effective_basisvectors()[source]

Get the eigenvectors of the perturbative Hamiltonian.

Return type:

csr_matrix

get_effective_basis()[source]

Get the effective basis of the pair system.

Return type:

BasisPair[Any, Any]

property model_inds: list[int]

The indices of the corresponding KetPairs of the given ket_tuples in the basis of the pair system.

check_for_resonances(required_overlap=0.9)[source]

Check if states of the model space have strong resonances with states outside the model space.

Return type:

None

Parameters:

required_overlap (float)