GreenTensorInterpolator

Class Methods

__init__()

Initialize a new Green tensor interpolator object.

get(kappa1, kappa2, transition_energy[, ...])

set_constant(kappa1, kappa2, tensor[, ...])

Set the scaled Green tensor to a constant entry.

set_list(kappa1, kappa2, tensors, ...[, ...])

Set the entries of the Green tensor for specified transition energies.

class GreenTensorInterpolator[source]

Green tensor interpolator for the multipole pair interactions.

This class is mainly used internally, a user usually only has to access the GreenTensor classes. It allows to define constant or frequency-dependent Green tensor interpolators, which can then be used for the interaction of a SystemPair (see SystemPair._set_green_tensor_interpolator()).

Examples

>>> from pairinteraction.green_tensor import GreenTensorInterpolator
>>> gt = GreenTensorInterpolator()
>>> distance_mum = 5
>>> transition_energy = 1  # planck_constant * GHz
>>> tensor = np.array([[1, 0, 0], [0, 1, 0], [0, 0, -2]]) / (distance_mum**3)
>>> tensor_unit = "hartree / (e * micrometer)^2"
>>> gt.set_constant(1, 1, tensor, tensor_unit)
GreenTensorInterpolator(...)
>>> tensor_sph = gt.get(1, 1, transition_energy, "planck_constant * GHz", unit=tensor_unit, scaled=True)
>>> print(tensor_sph.diagonal())
[ 0.008 -0.016  0.008]
__init__()[source]

Initialize a new Green tensor interpolator object.

The actual tensor can be set afterwards via the set_constant() or set_list() method.

Return type:

None

set_constant(kappa1, kappa2, tensor, tensor_unit=None, *, coordinates='cartesian')[source]

Set the scaled Green tensor to a constant entry.

Constant means, that \(\omega^2 G(\omega)\) (which is the quantity that enters the interaction) is constant and independent of omega.

Parameters:
  • kappa1 (int) – The rank of the first multipole operator.

  • kappa2 (int) – The rank of the second multipole operator.

  • tensor (ndarray[tuple[Any, ...], dtype[Any]] | PlainQuantity[ndarray[tuple[Any, ...], dtype[Any]]]) – The scaled green tensor including the prefactor for the interaction strength (see GreenTensorBase._get_prefactor_au()).

  • tensor_unit (str | None) – The unit of the tensor. Default None, which means that the tensor must be given as pint object.

  • coordinates (Literal['cartesian', 'spherical']) – The coordinate system in which the tensor is given. Default “cartesian”.

Return type:

Self

set_list(kappa1, kappa2, tensors, transition_energies, tensors_unit=None, transition_energies_unit=None, *, coordinates='cartesian', scaled=False)[source]

Set the entries of the Green tensor for specified transition energies.

Parameters:
  • kappa1 (int) – The rank of the first multipole operator.

  • kappa2 (int) – The rank of the second multipole operator.

  • tensors (Collection[PlainQuantity[ndarray[tuple[Any, ...], dtype[Any]]]] | Collection[ndarray[tuple[Any, ...], dtype[Any]]]) – A list of frequency-dependent green tensors in cartesian coordinates.

  • transition_energies (Collection[PlainQuantity[float]] | Collection[float]) – A list of transition energies at which the green tensors are defined.

  • tensors_unit (str | None) – The unit of the tensor. Default None, which means that the tensor must be given as pint object.

  • transition_energies_unit (str | None) – The unit of the transition energies. Default None, which means that the transition energies must be given as pint object.

  • coordinates (Literal['cartesian', 'spherical']) – The coordinate system in which the tensor is given. Default “cartesian”.

  • scaled (bool) – Whether the prefactor for the interaction strength (see GreenTensorBase._get_prefactor_au()) is already included in the given tensor. The unit has to be adjusted accordingly. Default False.

Return type:

Self

get(kappa1, kappa2, transition_energy, transition_energy_unit=None, unit=None, *, scaled=False, coordinates='spherical')[source]
Overloads:
  • self, kappa1 (int), kappa2 (int), transition_energy (float | PintFloat), transition_energy_unit (str | None), unit (None), scaled (bool), coordinates (Coordinates) → PintArray

  • self, kappa1 (int), kappa2 (int), transition_energy (float), transition_energy_unit (str), unit (str), scaled (bool), coordinates (Coordinates) → NDArray

  • self, kappa1 (int), kappa2 (int), transition_energy (PintFloat), unit (str), scaled (bool), coordinates (Coordinates) → NDArray

Parameters:
  • kappa1 (int)

  • kappa2 (int)

  • transition_energy (float | PlainQuantity[float])

  • transition_energy_unit (str | None)

  • unit (str | None)

  • scaled (bool)

  • coordinates (Literal['cartesian', 'spherical'])

Return type:

PlainQuantity[ndarray[tuple[Any, …], dtype[Any]]] | ndarray[tuple[Any, …], dtype[Any]]

Get the Green tensor in the given coordinates for the given ranks kappa1, kappa2 and transition energy.

kappa = 1 corresponds to dipole operator with the basis
  • spherical: [p_{1,-1}, p_{1,0}, p_{1,1}]

kappa = 2 corresponds to quadrupole operator with the basis
  • spherical: [p_{2,-2}, p_{2,-1}, p_{2,0}, p_{2,1}, p_{2,2}, p_{0,0}]

Parameters:
  • kappa1 (int) – The rank of the first multipole operator.

  • kappa2 (int) – The rank of the second multipole operator.

  • transition_energy (float | PlainQuantity[float]) – The transition energy at which to evaluate the Green tensor. Use transition_energy=0 for the static limit.

  • transition_energy_unit (str | None) – The unit of the transition energy. Default None, which means that the transition energy must be given as pint object (or is 0).

  • unit (str | None) – The unit to which to convert the result. Default None, which means that the result is returned as pint object.

  • scaled (bool) – If True, the Green tensor is returned with the prefactor for the interaction already included (the unit has to be adopted accordingly). Default False returns the bare Green tensor.

  • coordinates (Literal['cartesian', 'spherical']) – The coordinate system in which to return the tensor. Default “spherical”.

Returns:

The Green tensor as a 2D array.

Return type:

PlainQuantity[ndarray[tuple[Any, …], dtype[Any]]] | ndarray[tuple[Any, …], dtype[Any]]