maxwelllink.mxl_drivers.python.models.tls_model module¶
- class maxwelllink.mxl_drivers.python.models.tls_model.TLSModel[source]¶
Bases:
DummyModelA two-level system (TLS) quantum dynamics model.
This class implements a simple two-level system model for quantum dynamics, which can be integrated with the MaxwellLink framework. The TLS model is characterized by its transition frequency, dipole moment, and orientation of the dipole moment.
Notes
Implementing this class is mostly for demonstration purposes. Users who want to enjoy model quantum system calculations should use QuTiPModel instead, which provides a very general and robust implementation of an arbitrary model Hamiltonian (with Lindbladian dissipation) based on the QuTiP library.
- __init__(omega=2.4188843e-1, mu12=1.870819866e2, orientation=2, pe_initial=0.0, checkpoint=False, restart=False, verbose=False)[source]¶
Initialize the necessary parameters for the TLS quantum dynamics model.
- Parameters:
omega (float, default: 2.4188843e-1) – Transition frequency in atomic units (a.u.). Default is
2.4188843e-1a.u. (1.0in MEEP units with[T]=0.1 fs).mu12 (float, default: 1.870819866e2) – Dipole moment in atomic units (a.u.). Default is
1.870819866e2a.u. (0.1in MEEP units with[T]=0.1 fs).orientation (int, default: 2) – Orientation of the dipole moment; can be
0(x),1(y), or2(z).pe_initial (float, default: 0.0) – Initial population in the excited state.
checkpoint (bool, default: False) – Whether to enable checkpointing.
restart (bool, default: False) – Whether to restart from a checkpoint if available.
verbose (bool, default: False) – Whether to print verbose output.
- append_additional_data()[source]¶
Append additional data to be sent back to MaxwellLink.
The data can be retrieved by the user via the Python interface:
maxwelllink.SocketMolecule.additional_data_history, whereadditional_data_historyis a list of dictionaries.- Returns:
A dictionary containing additional data.
- Return type:
dict
- calc_amp_vector()[source]¶
Update the source amplitude vector after propagating this molecule for one time step.
- Returns:
Amplitude vector in the form \([\mathrm{d}\mu_x/\mathrm{d}t,\ \mathrm{d}\mu_y/\mathrm{d}t,\ \mathrm{d}\mu_z/\mathrm{d}t]\).
- Return type:
numpy.ndarray of float, shape (3,)
- commit_step()¶
Commit the previewed step and return the staged amplitude.
This method applies the changes from the staged step to the internal state and returns the calculated amplitude vector.
Notes
This method should not be overridden by subclasses.
- Returns:
Amplitude vector in the form \([\mathrm{d}\mu_x/\mathrm{d}t,\ \mathrm{d}\mu_y/\mathrm{d}t,\ \mathrm{d}\mu_z/\mathrm{d}t]\).
- Return type:
numpy.ndarray of float, shape (3,)
- have_result()¶
Check if a staged step is ready to be committed.
Notes
This method should not be overridden by subclasses.
- Returns:
Whether a staged step is ready.
- Return type:
bool
- initialize(dt_new, molecule_id)[source]¶
Set the time step and molecule ID for this quantum dynamics model, and provide additional initialization for the TLS.
- Parameters:
dt_new (float) – The new time step in atomic units (a.u.).
molecule_id (int) – The ID of the molecule.
- propagate(effective_efield_vec)[source]¶
Propagate the quantum molecular dynamics given the effective electric field vector.
- Parameters:
effective_efield_vec (array-like of float, shape (3,)) – Effective electric field vector in the form
[E_x, E_y, E_z].
- stage_step(E_vec)¶
Stage a propagation step with the given effective electric field vector.
This method performs the propagation and calculates the amplitude vector, but does not commit the changes to the internal state. The result can be committed later using the
self.commit_stepmethod.Notes
This method should not be overridden by subclasses.
- Parameters:
E_vec (array-like of float, shape (3,)) – Effective electric field vector in the form
[E_x, E_y, E_z].