lumeq.dynamics package
Submodules
lumeq.dynamics.dimers_in_crystal module
lumeq.dynamics.electronic_dynamics_gs module
- class CurvyStep(key)[source]
Bases:
ElectronicSteprefer: Herbert 2004 JCP 10.1063/1.1814934
- class ElectronicStep(key, **kwargs)[source]
Bases:
object- init_electronic_density_static(coords, *args, **kwargs)
- class ExtendedLagStep(key)[source]
Bases:
ElectronicStep- refer: Niklasson 2009 JCP 10.1063/1.3148075
Niklasson 2017 JCP 10.1063/1.4985893 Niklasson 2020 JCP 10.1063/1.5143270
- class GrassmannStep(key)[source]
Bases:
ElectronicStep
lumeq.dynamics.exciton_dynamics module
- class Exciton(key={}, **kwargs)[source]
Bases:
objectExciton class at each time for energy transport simulation. It builds the exciton Hamiltonian and update the exciton coefficients.
- analyze_wf_property(coefficients=None, c2=None)[source]
Analyze the exciton wavefunction properties including r-correlation and ipr.
- cal_energy(hamiltonian=None, coefficients=None)[source]
Calculate the exciton energy expectation value.
- cal_ipr_value(coefficients=None, c2=None)[source]
Calculate the inverse participation ratio (ipr) value.
- cal_r_correlation(coefficients=None, c2=None)[source]
Calculate the exciton r^2 - <r>^2 correlation value.
- cal_spectra(dipole=None, coefficients=None)[source]
Calculate the exciton absorption spectra.
- Parameters:
dipole (numpy.ndarray, optional) – Transition dipoles for each site with shape
(nsite*nstate, 3).coefficients (numpy.ndarray, optional) – Exciton coefficients with shape
(nsite*nstate,).
- Returns:
Exciton eigenvalues and oscillator strengths, each with shape
(nsite*nstate,).- Return type:
tuple
- convert_parameter_units(unit_dict={})[source]
Convert the input parameters into atomic unit for the calculations.
- exciton_couplings(coupling_j=None, neighbor_index=None, **kwargs)[source]
Build the exciton couplings part of exciton Hamiltonian.
- get_hamiltonian(energy=None, coupling_j=None, neighbor_index=None, **kwargs)[source]
Build the periodic exciton Hamiltonian of exciton part.
- Parameters:
energy (numpy.ndarray, optional) – Exciton energies for each state.
coupling_j (numpy.ndarray, optional) – Exciton-exciton couplings with shape
(ndimer, nstate, nstate).neighbor_index (list, optional) – Neighbor indices for the couplings.
**kwargs – Additional keyword arguments.
- Returns:
Exciton Hamiltonian with shape
(nsite*nstate, nsite*nstate).- Return type:
numpy.ndarray
- get_initial_coefficients(H=None, method=None, **kwargs)[source]
Get the initial exciton coefficients from the exciton Hamiltonian.
- Parameters:
H (numpy.ndarray, optional) – Exciton Hamiltonian with shape
(nsite*nstate, nsite*nstate).method (str, optional) – Method used to initialize the coefficients.
'random'gives random coefficients,'equal'gives an equal superposition state,'ground'gives the ground state, and'thermal'gives a thermal equilibrium state at the given temperature.
- Returns:
Squared exciton coefficients with shape
(nsite*nstate,).- Return type:
numpy.ndarray
- class ExcitonDynamics(key, **kwargs)[source]
Bases:
objectExciton dynamics for energy transport simulation. Wrapper class containing exciton and phonon dynamics steps.
- class ExcitonDynamicsMC(key, **kwargs)[source]
Bases:
ExcitonDynamicsExciton dynamics with Monte Carlo sampling Hamiltonian. Wrapper class containing exciton dynamics with MC disorders.
- class ExcitonMC(key={}, **kwargs)[source]
Bases:
ExcitonThermal fluctuations are accounted for by Monte Carlo sampling Hamiltonian.
- get_sampler(variance=0.1, seed=123, **kwargs)[source]
Get the sampler for Monte Carlo sampling of exciton Hamiltonian.
- Parameters:
variance (float) – Variance of the random numbers.
seed (int) – Seed for the random number generator.
- split_operator(dt=None, **kwargs)[source]
Get the split operator for time propagation.
Math exp(-i H dt) = exp(-i H_d dt/2) exp(-i H_c dt) exp(-i H_d dt/2)
- Parameters:
dt (float, optional) – Time step in atomic units.
- Returns:
Function that returns the time-propagation operator with shape
(nsite*nstate, nsite*nstate).- Return type:
callable
- class ExcitonStep(key={}, **kwargs)[source]
Bases:
ExcitonThermal fluctuations are accounted for by explicit vibrational oscillators. Requires the exciton-phonon couplings, and oscillator coordinates.
- cal_force(coordinate, coefficients=None)[source]
Calculate the forces on each oscillators from exciton-phonon couplings.
- exciton_couplings(coupling_j=None, neighbor_index=None, coupling_a=None, coordinate=None)[source]
Build the exciton couplings part with coordinate fluctuation.
- Parameters:
coupling_j (numpy.ndarray, optional) – Exciton-exciton couplings with shape
(ndimer, nstate, nstate).neighbor_index (list, optional) – Neighbor indices for the couplings.
coupling_a (numpy.ndarray, optional) – Off-diagonal exciton-phonon couplings with shape
(ndimer, nmode, nstate, nstate).coordinate (numpy.ndarray, optional) – Oscillator coordinates with shape
(nsite, nmode).
- Returns:
Exciton Hamiltonian with shape
(nsite*nstate, nsite*nstate).- Return type:
numpy.ndarray
- setup_exciton_dynamics(infile, key={}, nsteps=300)[source]
Run the exciton dynamics simulation.
- Parameters:
infile (str) – Input file for dynamics parameters.
key (dict) – Input parameters.
nsteps (int) – Total number of time steps for the dynamics.
- Returns:
Configured exciton-dynamics object.
- Return type:
lumeq.dynamics.molecular_dynamics module
lumeq.dynamics.oscillator_dynamics module
- class NuclearStep(key={}, **kwargs)[source]
Bases:
harmonic_oscillatorNuclear dynamics step class.
- get_potential_energy(mass=None, coordinate=None, omega2=None)[source]
Calculate the potential energy.
- init_coordinate_velocity(init_method=None)[source]
Generate the initial nuclear coordinate and velocity.
- Parameters:
init_method (str, optional) – Method used to initialize the coordinates and velocities.
'restart'reads stored values,'kick'sets zero initial velocity,'thermo'samples a Boltzmann distribution atinit_temp, and'random'uses random velocities with the given kinetic energy.
- init_velocity_random(etrans=None, sigma=0.0001, scale=0.1, seed=12345)[source]
Generate random kinetic energy for atoms at three directions.
- init_velocity_thermo(temp=None, seed=1385448536)[source]
Generate random velocity following Boltzmann distribution.
- project_force(force, mass=None, coords=None)[source]
Project out the translational and rotational components from the force.
- class OscillatorStep(key={}, **kwargs)[source]
Bases:
harmonic_oscillatorOscillator dynamics step class.
- class harmonic_oscillator(key={}, **kwargs)[source]
Bases:
objectHarmonic oscillator class.
- get_potential_energy(mass=None, coordinate=None, omega2=None)[source]
Calculate the potential energy.
- init_coordinate_velocity(n_site=None, init_method=None)[source]
Generate the initial oscillator coordinate and velocity.
- Parameters:
n_site (int, optional) – Total number of molecular sites.
init_method (str, optional) – Initialization method.
'thermo'uses the Boltzmann distribution atinit_temp.
- recursive_exploration_step(force, force_func, **kwargs)[source]
Recursive exploration integration step.
- update_coordinate_velocity(force, half=1, **kwargs)[source]
Update the oscillator coordinate and velocity, as well as the energy.
- Parameters:
force (numpy.ndarray) – Force acting on the oscillator.
half (int) –
1or2, indicating the first or second half of the update.
- Returns:
Projected force after the update, only for
half=2.- Return type:
numpy.ndarray
- remove_trans_rotat_force(force, mass, coords)[source]
Remove the translational and rotational components from the force.
- Parameters:
force (ndarray) – The forces acting on the particles (shape: (n_particles, 3)).
mass (ndarray) – The masses of the particles (shape: (n_particles,)).
coords (ndarray) – The coordinates of the particles (shape: (n_particles, 3)).
- Returns:
The projected forces with translational and rotational components removed.
- Return type:
force (ndarray)
- remove_trans_rotat_velocity(velocity, mass, coords)[source]
Remove the translational and rotational components from the velocity.
- Parameters:
velocity (ndarray) – The velocities of the particles (shape: (n_particles, 3)).
mass (ndarray) – The masses of the particles (shape: (n_particles,)).
coords (ndarray) – The coordinates of the particles (shape: (n_particles, 3)).
- Returns:
The projected velocities with translational and rotational components removed.
- Return type:
velocity (ndarray)
lumeq.dynamics.photon_dynamics module
- class PhotonStep2(key={}, **kwargs)[source]
Bases:
harmonic_oscillator
lumeq.dynamics.process_exciton_parameters module
- process_parameters(cif_file, n_cell, outfile_dir='./', nstate=2, npairs=50, center=0, debug=0)[source]
Process the input parameters and get real parameters: on-site energies, transition dipoles, state couplings for dimers.
- Parameters:
cif_file (str) – The cif file name
n_cell (list) – The number of unit cells in each direction
[nx, ny, nz].outfile_dir (str) – The output file directory
nstate (int) – The number of exciton states per site
npairs (int) – The number of neighboring pairs to be included
center (int) – The center site index needed to shift (0 for B, 1 for A)
debug (int) – The debug level
- Returns:
The unit cell information energy (numpy.ndarray): Exciton energies of each site in eV. coupling_j (numpy.ndarray): Exciton-exciton couplings between dimers in eV. dipole (numpy.ndarray): Transition dipole moments of two sites in au. neighbor_index (list): Neighbor-index list for each dimer. distances (numpy.ndarray): Distances between dimers in Angstrom. center_coords (numpy.ndarray): Center-of-mass coordinates of the sites in Angstrom.
- Return type:
unit_cell (dict)
- read_energy_coupling(outfile, nstate=2)[source]
Read exciton energy and Coulomb coupling from the output file.
- Parameters:
outfile (str) – The q-chem output file name
nstate (int) – The number of exciton states per site
- Returns:
Exciton energies with shape
(nstate,), exciton-exciton coupling matrix with shape(nstate, nstate), and transition dipoles with shape(2, nstate, 3).- Return type:
tuple
- set_model(neighbor_index, distances, model='AB', n_cell=[10, 1, 1], r_cutoff=10, debug=0)[source]
Pick the model parameters based on the model type.
- Parameters:
neighbor_index (list) – Neighbor-index list for each dimer.
distances (numpy.ndarray) – Distances between dimers in Angstrom.
model (str) – The model type, e.g., ‘AB’, ‘BC’, ‘ABAC’, ‘AB-C’, ‘any’
n_cell (list) – The number of unit cells in each direction
[nx, ny, nz].r_cutoff (float) – The cutoff distance in Angstrom (10, 17, 26)
debug (int) – The debug level
- Returns:
Cell indices based on the model. neighbor_index (list): Refined neighbor-index list based on the model.
- Return type:
cells (numpy.ndarray)