field

class maxwellbloch.field.Field(label: str = '', index: int = 0, coupled_levels: list[list[int]] | None = None, factors: list[float] | None = None, detuning: float = 0.0, detuning_positive: bool = True, counter_propagating: bool = False, factor_doppler_shift: float | None = None, rabi_freq: float = 1.0, rabi_freq_t_func: str | None = None, rabi_freq_t_args: dict[str, float] | None = None)[source]

Bases: object

Field object to address the OBAtom object, describing the atomic levels coupled, detuning and Rabi frequency function.

label

a name for the field e.g. “probe”.

Type:

string

index

index of the field, to reference within an OBAtom.

Type:

int

coupled_levels

pairs of levels coupled by the field. e.g. [[0,1], [0,2]]

Type:

list

factors

List of strength factors for each pair in coupled levels.

Type:

list

detuning

detuning of the fields from resonance with the coupled_levels transitions.

Type:

float

detuning_positive

is the detuning positive?

Type:

bool

counter_propagating

if True, this field travels in the opposite direction to the forward-propagating solver direction. Sets factor_doppler_shift = -1.0. Orthogonal to detuning_positive.

Type:

bool

factor_doppler_shift

multiplier applied to the thermal detuning Delta for each velocity class. Default 1.0 (co-propagating). Set to -1.0 for a counter-propagating field, or to an arbitrary float for schemes where wavelength differences matter (e.g. a three-photon ladder where k-vector magnitudes differ).

Type:

float

rabi_freq

Rabi frequency of the field on the transition.

Type:

float

rabi_freq_t_func

Time-dependency of rabi_freq as function of time f(t, args)

Type:

func

rabi_freq_t_args

arguments to be passed to rabi_freq_t_func.

Type:

dict

build_rabi_freq_t_args(rabi_freq_t_args: dict[str, float], index: int = 0) dict[str, float][source]
build_rabi_freq_t_func(rabi_freq_t_func: str | None, index: int = 0) Callable[[float | ndarray, dict[str, Any]], float | ndarray][source]
classmethod from_json(file_path: str) Field[source]
classmethod from_json_str(json_str: str) Field[source]
get_json_dict() dict[str, Any][source]

Return a dict representation of the Field object to be dumped to JSON.

Note

For the rabi_freq_t_func attribute generated with build_rabi_freq_t_func, a suffix for the index will have been added. We remove that. e.g. e.g. ramp_onoff_0 -> ramp_onoff

lower_levels() list[int][source]

Return the unique lower (ground) level indices coupled by this field.

Returns:

Sorted list of unique indices c[0] from coupled_levels.

to_json(file_path: str) None[source]
to_json_str() str[source]

Return a JSON string representation of the Field object.

Returns:

(string) JSON representation of the Field object.

upper_levels() list[int][source]

Return the unique upper (excited) level indices coupled by this field.

Returns:

Sorted list of unique indices c[1] from coupled_levels.