ob_atom

class maxwellbloch.ob_atom.OBAtom(label: str | None = None, num_states: int = 1, energies: list[float] | None = None, decays: list[dict] | None = None, initial_state: list[float] | None = None, fields: list[dict] | None = None)[source]

Bases: OBBase

add_field(field_dict: dict) None[source]

Add a Field to the list given a dict representing the field.

build_fields(field_dicts: list[dict]) list[Field][source]

Build the field list given a list of dicts representing fields.

build_initial_state(initial_state: list[float] | None = None) Qobj[source]

Build the initial density matrix for the atom.

The default is for all of the population to be in |0><0|.

Parameters:

rho0 – a list or array of populations, length num_states.

Returns:

A density matrix representing the initial

Return type:

Qu.Qobj

Notes

  • The elements must sum to 1 (as this will be the trace of the

    density matrix).

build_operators() None[source]

Build the quantum operators representing the bare Hamiltonian, collapse operators and interaction Hamiltonian.

classmethod from_json(file_path: str) OBAtom[source]
classmethod from_json_str(json_str: str) OBAtom[source]
get_detunings() list[float][source]

Returns a list of detunings, one for each field in fields.

get_field_args() dict[str, float][source]
get_fields_sum_coherence(states_t: ndarray | None = None) ndarray[source]
Returns the sum coherences of the atom density matrix for each

field, including the relative strength factors.

Parameters:

states_t – (optional) a states_t object. If not provided, use self.states_t()

Returns:

np.ndarray of shape (num_fields, t_steps+1)

get_json_dict() dict[str, Any][source]
is_field_td() bool[source]
mesolve(tlist: ndarray, e_ops: list | None = None, options: dict | None = None, recalc: bool = True, savefile: str | None = None, show_pbar: bool = False) Any[source]
set_H_Delta(detunings: list[float]) Qobj[source]
Set the detuning part of the interaction Hamiltonian, H_Delta,

given a list of detunings.

Parameters:

detunings – list of floats: detunings of each field in the list

set_H_Omega(rabi_freqs: list[float], rabi_freq_t_funcs: list, rabi_freq_t_args: list[dict]) list[source]
Parameters:
  • rabi_freqs – [floats]

  • rabi_freq_t_funcs – [strings]

  • rabi_freqs_t_args – [dicts]

Returns:

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

Return a JSON string representation of the Atom object.

Returns:

(string) JSON representation of the Atom object.