MoleCool.Bfield.Bfield#

class MoleCool.Bfield.Bfield(**kwargs)[source]#

Bases: object

Class defines a magnetic field configuration and methods to turn on a certain field strength and direction conveniently. When initializing a new system via system=System() a magnetic field instance with zero field strength is directly included in this System via system.Bfield.

Example

>>> B1 = Bfield()   # initialize Bfield instance
>>> B1.turnon(strength=5e-4,direction=[0,0,1],angle=60)
>>> print(B1)       # print properties
>>> B1.reset()      # reset magnetic field to zero.
Parameters:

**kwargs – Optional keyword arguments for directly turn on a certain magnetic field by using these keyword arguments within the the method turnon() (further information).

Methods

Bfield_vec()

Returns the magnetic field vector with its three components in T.

__init__(**kwargs)

Class defines a magnetic field configuration and methods to turn on a certain field strength and direction conveniently.

get_remix_matrix(grs[, remix_strength])

return a matrix to remix all adjacent ground hyperfine levels by a magnetic field with certain field strength.

reset()

Reset the magnetic field to default which is a magnetic field strength 0.0 and the direction [0.,0.,1.]

turnon([strength, direction, angle, ...])

Turn on a magnetic field with a certain strength and direction.

turnon_earth([vertical, towardsNorthPole])

Turn on the magnetic field of the earth at Germany with a strength of approximately 48 uT.

Attributes

Bvec_sphbasis

returns the magnetic field vector in the spherical basis.

turnon(strength=0.0005, direction=[0, 0, 1], angle=None, remix_strength=None)[source]#

Turn on a magnetic field with a certain strength and direction.

Parameters:
  • strength (float or np.ndarray, optional) – Strength in Tesla. The default is 5e-4.

  • direction (list or np.ndarray with shape (3,), optional) – Direction of the magnetic field vector. Doesn’t have to be given as normalized array. The default is [0,0,1].

  • angle (float or np.ndarray, optional) – Angle in degrees at which the magnetic field vector is pointing with respect to the direction argument. The default is None.

  • remix_strength (float, optional) – measure of the magnetic field strength (i.e. the magnetic remixing matrix is multiplied by 10^remix_strength). Reasonable values are between 6 and 9. The default is None.

turnon_earth(vertical='z', towardsNorthPole='x')[source]#

Turn on the magnetic field of the earth at Germany with a strength of approximately 48 uT. The vertical component is 44 uT and the horizontal component directing towards the North Pole is 20 uT.

Parameters:
  • vertical (str, optional) – vertical axis. Supported values are ‘x’, ‘y’ or ‘z’. The default is ‘z’.

  • towardsNorthPole (str, optional) – horizontal axis directing towards the North Pole. Supported values are ‘x’, ‘y’ or ‘z’.The default is ‘x’.

reset()[source]#

Reset the magnetic field to default which is a magnetic field strength 0.0 and the direction [0.,0.,1.]

get_remix_matrix(grs, remix_strength=None)[source]#

return a matrix to remix all adjacent ground hyperfine levels by a magnetic field with certain field strength. The default is False.

Parameters:
  • grs (ElectronicGrState) – for which the matrix is to be build.

  • remix_strength (float) – measure of the magnetic field strength (i.e. the magnetic remixing matrix is multiplied by 10^remix_strength). Reasonable values are between 6 and 9.

Returns:

magnetic remixing matrix.

Return type:

array

Bfield_vec()[source]#

Returns the magnetic field vector with its three components in T.

Returns:

magnetic field vector.

Return type:

np.ndarray(3)

property Bvec_sphbasis#

returns the magnetic field vector in the spherical basis.