maxwelllink.mxl_drivers.python.models.lorentz_bath_model module¶
- class maxwelllink.mxl_drivers.python.models.lorentz_bath_model.LorentzBathModel[source]¶
Bases:
DummyModelA Lorentzian harmonic oscillator coupled to a bath of classical oscillators.
This class implements a Lorentz-Bath model for classical molecular dynamics, which can be integrated with the MaxwellLink framework. The Lorentz-Bath model represents the overall response of a molecular ensemble as a collective bright mode (represented by a single harmonic oscillator, or the Lorentzian oscillator) coupled to a set of independent dark modes (represented by a bath of classical oscillators).
By tuning the bath density distribution and couplings, this model can be used to simulate the interplay between polaritons and molecular dark modes, which is a key aspect of polaritonic chemistry.
The Hamiltonian for this Lorentz-Bath model is given by:
\(H = \frac{1}{2} \left(p_B - \sum_{j\in \rm{bath}} k_j q_j \right)^2 + \frac{1}{2} \omega^2 q_B^2 - \mu_{0} q_B \cdot E(t) + \sum_{j\in \rm{bath}} \left( \frac{1}{2} \omega_j^2 q_j^2 + \frac{1}{2} p_j^2\right)\)
If the anharmonic bath is used, the bath potential becomes \(V(q_j) = \frac{1}{2} \omega_j^2 q_j^2 - \omega_j^2 \sqrt{\frac{\chi}{2}} q_j^3 + \frac{7}{12}\omega_j^2\chi q_j^4\), where \(\chi\) is the anharmonicity parameter of the bath.
simulating individual molecules coupled to the EM field (such as LAMMPS+EM simulations).
TODO: 1) Adding the anharmonicity and thermal effects to the Lorentz-Bath model. TODO: 2) Adding simplified settings of the bath forms.
- __init__(omega=2.4188843e-1, mu0=1.870819866e2, orientation=2, relaxation=0.0, num_bath=None, bath_width=None, bath_form=None, bath_dephasing=0.0, bath_relaxation=0.0, bath_anharmonicity=0.0, omega_bath=None, k_bath=None, p_initial=0.0, q_initial=0.0, p_bath_initial=None, q_bath_initial=None, langevin_tau_au=None, initializer=None, temperature_au=0.0, random_seed=114514, checkpoint=False, restart=False, verbose=False)[source]¶
Initialize the necessary parameters for the SHO classical molecular 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).mu0 (float, default: 1.870819866e2) – Dipole-coordinate coupling prefactor in atomic units (a.u.). The instantaneous dipole is \(\mu(t) = \mu_{0}\, q(t)\). 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).relaxation (float, default: 0.0) – Relaxation rate of the Lorentzian oscillator in atomic units (a.u.). If not provided, the Lorentzian oscillator will not have relaxation.
num_bath (int, optional) – Number of bath oscillators. If not provided, the bath will not be defined via this convenient way.
bath_width (float, optional) – Frequency width of the bath oscillators in atomic units (a.u.). If not provided, the bath will not be defined via this convenient way.
bath_form (str, optional) – Form of the bath distribution, which can be “uniform”, “gaussian”, or “lorentzian”. If not provided, the bath will not be defined via this convenient way.
bath_dephasing (float, optional) – Dephasing rate from the bright state to the dark modes (bath oscillators) in atomic units (a.u.), which can be used to determine the coupling coefficients between the Lorentzian oscillator and the bath oscillators. If not provided, the bath will not be defined via this convenient way.
bath_relaxation (float, optional) – The direct relaxation rate of the bath oscillators in atomic units (a.u.). If not provided, the bath oscillators will not have relaxation.
bath_anharmonicity (float, optional) – The anharmonicity of the bath oscillators in atomic units (a.u.). For realistic molecules, this parameter can be set as 1% of the fundamental frequency
omega_bath (list of float, shape (N_bath,), optional) – Transition frequencies of the bath oscillators in atomic units (a.u.).
k_bath (list of float, shape (N_bath,), optional) – Coupling coefficients between the Lorentzian oscillator and the bath oscillators in atomic units (a.u.).
p_initial (float, default: 0.0) – Initial momentum of the oscillator.
q_initial (float, default: 0.0) – Initial position of the oscillator.
p_bath_initial (list of float, shape (N_bath,), optional) – Initial momenta of the bath oscillators.
q_bath_initial (list of float, shape (N_bath,), optional) – Initial positions of the bath oscillators.
langevin_tau_au (float, optional) – Damping time constant for the Langevin thermostat in atomic units (a.u.). Default is None, not applying the thermostat.
initializer (str, optional) – Type of initializer to use. Can be “maxwell_boltzmann”.
temperature_au (float, optional) – Temperature in atomic units (a.u.) for the thermostat and initializer. Must be positive.
random_seed (int, optional) – Random seed for reproducible results in the thermostat and initializer.
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 SHO model, and provide additional initialization for the SHO.
- 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 Lorentzian-bath model 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].