Octopus
dm_propagation_oct_m Module Reference

Data Types

type  dmp_t
 

Functions/Subroutines

subroutine dmp_init (this, namespace, st, space, hm)
 Initialise an instance of density matrix dissipation. More...
 
subroutine, public dm_propagation_init_run (dmp, namespace, space, gr, ions, st, hm, mc, from_scratch)
 Initialise the adiabatic states prior to running TD propagation. More...
 
subroutine, public dm_end_run (system_grp, dmp)
 
subroutine, public dm_propagation_run (dmp, namespace, space, gr, ions, st, mc, hm, ks, iter, dt, ext_partners, update_energy)
 Density matrix propagation. More...
 
subroutine total_population (ik, st, gr, nrm2, pop)
 Calculate total population. More...
 
subroutine calc_overlap_single (ik, gr, st, psi, istart, iend, overlap, reduce)
 Calculates the dot products between a vector of mesh functions and a state within the (istart, iend) active space. More...
 
subroutine calc_overlap_state (ik, gr, ad_st, st, istart_ad, iend_ad, istart_st, iend_st, overlap)
 Calculate the overlap matrix between two states in the (istart, iend) active space. More...
 
subroutine population_in_adiabatic (ik, ad_st, st, overlap, istart, iend, pop)
 Calculate number of electrons in the adiabatic basis. More...
 
subroutine construct_residuals (gr, namespace, ad_st, st, ik, othn, istart, iend, overlap_ad_ks, nrm2_tdks, nresd, overlap_resd_ks, resd)
 Construct the residual basis and its overlap with TDKS wavefunctions. More...
 
subroutine construct_density_matrix (nresd, ik, st, istart, iend, overlap_ad_ks, overlap_resd_ks, rho_mat, rho_offd)
 Construct the full density matrix in the adiabatic and residual basis. More...
 
subroutine broadcast_occupation (occ, kpt, parstate, istart, iend)
 
subroutine dissipation (hm, st, namespace, nresd_k, dt, dmp, rho_mat_k)
 Evolve the density matrix in time under dissipation. More...
 
subroutine lindblad_uniform (dmp, kpt, nresd_k, dt, rho_mat_k)
 Evolve the density matrix in time under uniform dissipation. More...
 
subroutine transition_rate_uniform (uniform, ad_st, istart, iend, ik, rtrans)
 Calculate state transition rates assuming uniform electron-phonon coupling. More...
 
subroutine lindblad_operator_uniform (nresd, istart, iend, rtrans, den_mat, l_mat)
 Calculate the Lindblad dissipator matrix for uniform decay. More...
 
subroutine lindblad_2times (dmp, kpt, nresd_k, dt, rho_mat_k)
 Evolve the density matrix using the phenomenological two-time (T1/T2) relaxation model. More...
 
subroutine lindblad_from_epw (dmp, hm, kpt, system_grp, namespace, nresd_k, dt, rho_mat_k)
 Evolve the density matrix under EPW-derived Lindblad dissipation. More...
 
subroutine collision_from_epw (dmp, hm, kpt, system_grp, namespace, nresd_k, dt, rho_mat_k)
 Evolve the density matrix subject to the electron-phonon collision integral. More...
 
subroutine dm_propagation_update_trans_rate (this, hm, system_grp, namespace)
 Read and update the EPW transition matrix only when the vector field index changes. More...
 
subroutine iopar_open_trans_rate (namespace, ions, hm, system_grp, dmp)
 Read in metadata of transition rates, build intra/inter communicators and shared memory window. More...
 
subroutine iopar_read_trans_rate (ia, system_grp, namespace, dmp)
 Read in transition rates to the shared memory window and then broadcast via internode communicator. More...
 
subroutine iopar_close_trans_rate (system_grp, dmp)
 Finalize transition rate resources. More...
 
subroutine build_epw_kmap (namespace, kpoints, dmp)
 Map internal k-point indices to the 1D EPW Monkhorst-Pack grid and verify mesh compatibility. More...
 
integer function get_vector_field_index (dmp, hm, namespace)
 Get the flattened 1D index of the current vector potential on the discrete EPW vector field grid. More...
 
real(real64) function get_trans_rate (dmp, nik_mp, jbnd, ibnd, k, kq, p_block)
 Get transition rate from state (k, ibnd) to (kq, jbnd). More...
 
subroutine lindblad_operator_epw (dmp, ik, nik_skip, nresd, rho_diag, den_mat, l_mat)
 Calculate the Lindblad dissipator matrix using EPW electron-phonon scattering rates. More...
 
subroutine lifetime (dmp, ik, ibnd, nik_skip, gam)
 Calculate the total scattering rate (inverse lifetime) for a given state. More...
 
subroutine get_gamma (dmp, ik, ibnd, nik_skip, gam_in, gam_out)
 Calculate in/out scattering rates (Gamma) for a specific state (ik, ibnd). More...
 
subroutine update_st (dmp, ik, gr, namespace, nresd, overlap_ad_ks, overlap_resd_ks, nrm2_tdks, resd, st, rho_mat, pop)
 Diagonalize the density matrix to update occupations and wavefunctions. More...
 
subroutine check_set_positive (locc, npos, ik, namespace, occ)
 Checks and truncates small negative eigenvalues to zero. More...
 
subroutine update_wfc_occ (ik, gr, istart, iend, nresd, ad_st, resd, occ, v_mat, st, pop)
 Update states directly from diagonalization (no Procrustes). More...
 
subroutine update_wfc_occ_procrustes (ik, gr, istart, iend, nresd, ad_st, resd, overlap_ad_ks, overlap_resd_ks, nrm2_tdks, occ_tilde, v_mat, st, pop)
 Update states using Procrustes transformation to ensure time continuity. More...
 
logical function is_hermitian (n, mat)
 Check if a matrix is Hermitian. More...
 
subroutine td_write_dm_proj_basis (this, out_dm_proj_basis, iter)
 Write density matrix information to file. More...
 

Variables

real(real32), dimension(:), pointer, volatile ave_trans
 Average transition rates in shared memory. More...
 

Function/Subroutine Documentation

◆ dmp_init()

subroutine dm_propagation_oct_m::dmp_init ( class(dmp_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
type(states_elec_t), intent(in)  st,
class(space_t), intent(in)  space,
type(hamiltonian_elec_t), intent(in)  hm 
)
private

Initialise an instance of density matrix dissipation.

Definition at line 201 of file dm_propagation.F90.

◆ dm_propagation_init_run()

subroutine, public dm_propagation_oct_m::dm_propagation_init_run ( type(dmp_t), intent(inout)  dmp,
type(namespace_t), intent(in)  namespace,
type(electron_space_t), intent(in)  space,
type(grid_t), intent(in)  gr,
type(ions_t), intent(in)  ions,
type(states_elec_t), intent(in)  st,
type(hamiltonian_elec_t), intent(in)  hm,
type(multicomm_t), intent(in)  mc,
logical, intent(in)  from_scratch 
)

Initialise the adiabatic states prior to running TD propagation.

Definition at line 444 of file dm_propagation.F90.

◆ dm_end_run()

subroutine, public dm_propagation_oct_m::dm_end_run ( type(mpi_grp_t), intent(in)  system_grp,
type(dmp_t), intent(inout)  dmp 
)

Definition at line 501 of file dm_propagation.F90.

◆ dm_propagation_run()

subroutine, public dm_propagation_oct_m::dm_propagation_run ( type(dmp_t), intent(inout)  dmp,
type(namespace_t), intent(in)  namespace,
type(electron_space_t), intent(in)  space,
type(grid_t), intent(in)  gr,
type(ions_t), intent(in)  ions,
type(states_elec_t), intent(inout)  st,
type(multicomm_t), intent(in)  mc,
type(hamiltonian_elec_t), intent(inout)  hm,
type(v_ks_t), intent(inout)  ks,
integer, intent(in)  iter,
real(real64), intent(in)  dt,
type(partner_list_t), intent(in)  ext_partners,
logical, intent(in), optional  update_energy 
)

Density matrix propagation.

Parameters
[in,out]dmpDensity matrix propagation options
[in]spaceElectron space
[in]grGrid
[in,out]stTDKS
[in,out]hmHamiltonian, updated at each time step
[in,out]ksKohn-Sham potential
[in]iterTime step index
[in]dtTime step size
[in]ext_partnersExternal partners
[in]update_energyWhether to update the energy of the system

Definition at line 522 of file dm_propagation.F90.

◆ total_population()

subroutine dm_propagation_oct_m::total_population ( integer, intent(in)  ik,
type(states_elec_t), intent(in)  st,
type(grid_t), intent(in)  gr,
real(real64), dimension(:), intent(out), contiguous  nrm2,
real(real64), intent(inout)  pop 
)
private

Calculate total population.

\[ N = \sum_{k} \omega_{k} \sum_{n} |\psi_{n,k}|^2 f_{n,k} \]

Parameters
[in]ikk-point index
[in]stTDKS states
[in]grGrid
[out]nrm2Norm square of the TDKS wavefunctions
[in,out]popTotal population

Definition at line 637 of file dm_propagation.F90.

◆ calc_overlap_single()

subroutine dm_propagation_oct_m::calc_overlap_single ( integer, intent(in)  ik,
type(grid_t), intent(in)  gr,
type(states_elec_t), intent(in)  st,
complex(real64), dimension(:,:), intent(in), contiguous  psi,
integer, intent(in)  istart,
integer, intent(in)  iend,
complex(real64), dimension(:), intent(out)  overlap,
logical, intent(in), optional  reduce 
)
private

Calculates the dot products between a vector of mesh functions and a state within the (istart, iend) active space.

\[ S^{\phi,\psi}_{i} = \langle \phi_i | \psi \rangle \]

Definition at line 670 of file dm_propagation.F90.

◆ calc_overlap_state()

subroutine dm_propagation_oct_m::calc_overlap_state ( integer, intent(in)  ik,
type(grid_t), intent(in)  gr,
type(states_elec_t), intent(in)  ad_st,
type(states_elec_t), intent(in)  st,
integer, intent(in)  istart_ad,
integer, intent(in)  iend_ad,
integer, intent(in)  istart_st,
integer, intent(in)  iend_st,
complex(real64), dimension(:, :), intent(out)  overlap 
)
private

Calculate the overlap matrix between two states in the (istart, iend) active space.

\[ S^{\phi,\psi}_{ij} = <\phi_i | \psi_j> \]

Parameters
[in]istart_adstart index for ad_st
[in]iend_adend index for ad_st
[in]istart_ststart index for st
[in]iend_stend index for st

Definition at line 717 of file dm_propagation.F90.

◆ population_in_adiabatic()

subroutine dm_propagation_oct_m::population_in_adiabatic ( integer, intent(in)  ik,
type(states_elec_t), intent(inout)  ad_st,
type(states_elec_t), intent(in)  st,
complex(real64), dimension(:, :), intent(in), contiguous  overlap,
integer, intent(in)  istart,
integer, intent(in)  iend,
real(real64), intent(inout)  pop 
)
private

Calculate number of electrons in the adiabatic basis.

\[ pop_i = \sum_{j} f_j * |S^{\phi,\psi}_{i,j}|^2 \]

Parameters
[in]ikk-point index
[in,out]ad_stAdiabatic states

Definition at line 790 of file dm_propagation.F90.

◆ construct_residuals()

subroutine dm_propagation_oct_m::construct_residuals ( type(grid_t), intent(in)  gr,
type(namespace_t), intent(in)  namespace,
type(states_elec_t), intent(in)  ad_st,
type(states_elec_t), intent(in)  st,
integer, intent(in)  ik,
logical, intent(in)  othn,
integer, intent(in)  istart,
integer, intent(in)  iend,
complex(real64), dimension(:, :), intent(in), contiguous  overlap_ad_ks,
real(real64), dimension(:), intent(in), contiguous  nrm2_tdks,
integer, intent(out)  nresd,
complex(real64), dimension(:, :), intent(out), contiguous  overlap_resd_ks,
type(states_elec_t), intent(inout)  resd 
)
private

Construct the residual basis and its overlap with TDKS wavefunctions.

Two options are provided for constructing the residual basis:

  1. General basis (straightforward projection):

    \[ |d_j\rangle = |\psi_j\rangle - \sum_{i=1}^N S^{\phi,\psi}_{ij} |\phi_i\rangle \]

  2. Orthonormal basis (Gram-Schmidt with norm filtering):

    \[ |d_j\rangle = \mathcal{N} \left( |\psi_j\rangle - \sum_{i=1}^N S^{\phi,\psi}_{ij} |\phi_i\rangle - \sum_{k=1}^{N_{\mathrm{res}}} S^{d,\psi}_{kj} |d_k\rangle \right) \]

Where:

  • \( |\psi\rangle \): TDKS wavefunctions, \( |\phi\rangle \): GS/adiabatic states.
  • \( S^{\phi,\psi}_{ij} = \langle \phi_i | \psi_j \rangle \), \( S^{d,\psi}_{kj} = \langle d_k | \psi_j \rangle \).
  • \( \mathcal{N} \): Normalization factor (states with small initial norms are discarded).
    Parameters
    [in]grGrid
    [in]ad_stAdiabatic states
    [in]stTDKS states
    [in]ikk-point index
    [in]othnconstruct orthonormal basis or not
    [in]istartstarting index
    [in]iendending index
    [in]overlap_ad_ks<\phi | \psi>
    [in]nrm2_tdks<\psi | \psi>
    [out]nresdnumber of residual states
    [out]overlap_resd_ks<d | \psi>
    [in,out]resdResiduals

Definition at line 836 of file dm_propagation.F90.

◆ construct_density_matrix()

subroutine dm_propagation_oct_m::construct_density_matrix ( integer, intent(in)  nresd,
integer, intent(in)  ik,
type(states_elec_t), intent(in)  st,
integer, intent(in)  istart,
integer, intent(in)  iend,
complex(real64), dimension(:, :), intent(in), contiguous  overlap_ad_ks,
complex(real64), dimension(:, :), intent(in), contiguous  overlap_resd_ks,
complex(real64), dimension(:, :), intent(out), contiguous  rho_mat,
complex(real64), dimension(:), intent(out), contiguous  rho_offd 
)
private

Construct the full density matrix in the adiabatic and residual basis.

The density matrix is composed of four blocks. Exploiting Hermiticity, only the ad-ad, ad-resd, and resd-resd blocks need to be explicitly computed:

\[ \begin{aligned} \rho_{ij} &= \sum_{l=1}^N \left(S^{\phi,\psi}_{il} \sqrt{f_l} \right) \left( S^{\phi,\psi}_{jl} \sqrt{f_l} \right)^*, \quad &\text{(ad-ad)} \ \rho_{i,j+N} &= \sum_{l=1}^N \left(S^{\phi,\psi}_{il} \sqrt{f_l} \right) \left( S^{d,\psi}_{jl} \sqrt{f_l} \right)^*, \quad &\text{(ad-resd)} \ \rho_{i+N,j+N} &= \sum_{l=1}^N \left(S^{d,\psi}_{il} \sqrt{f_l} \right) \left( S^{d,\psi}_{jl} \sqrt{f_l} \right)^*. \quad &\text{(resd-resd)} \end{aligned} \]

The remaining resd-ad block is simply the complex conjugate transpose.

Parameters
[in]nresdNumber of irreducible residuals
[in]ikk-point index
[in]stTDKS states
[in]istartStart index
[in]iendEnd index
[in]overlap_ad_ks<phi | psi>
[in]overlap_resd_ks<d | psi>
[out]rho_matThe full density matrix
[out]rho_offdRecord off-diagonal elements

Definition at line 987 of file dm_propagation.F90.

◆ broadcast_occupation()

subroutine dm_propagation_oct_m::broadcast_occupation ( real(real64), dimension(:, :), intent(inout), contiguous  occ,
type(distributed_t), intent(in)  kpt,
logical, intent(in)  parstate,
integer, intent(in)  istart,
integer, intent(in)  iend 
)
private

Definition at line 1086 of file dm_propagation.F90.

◆ dissipation()

subroutine dm_propagation_oct_m::dissipation ( type(hamiltonian_elec_t), intent(in)  hm,
type(states_elec_t), intent(in)  st,
type(namespace_t), intent(in)  namespace,
integer, dimension(:), intent(in)  nresd_k,
real(real64), intent(in)  dt,
type(dmp_t), intent(inout)  dmp,
complex(real64), dimension(:, :, :), intent(inout)  rho_mat_k 
)
private

Evolve the density matrix in time under dissipation.

The dissipation process is governed by the open quantum system master equation. Depending on the calculation mode, the dissipation can be evaluated in two forms:

  1. Lindblad form (Master Equation):

    \[ \mathcal{L}_D[\rho] = \sum_{\mu} \gamma_{\mu} \left( L_{\mu} \rho L_{\mu}^{\dagger} - \frac{1}{2} \{L_{\mu}^{\dagger} L_{\mu}, \rho\} \right) \]

    where the damping rates and operators are determined by the chosen strategy (uniform decay, 2-times model, or rates read from EPW).
  2. Collision integral form: Evaluates the time evolution using the explicit electron-phonon scattering collision integral.

Definition at line 1149 of file dm_propagation.F90.

◆ lindblad_uniform()

subroutine dm_propagation_oct_m::lindblad_uniform ( type(dmp_t), intent(in)  dmp,
type(distributed_t), intent(in)  kpt,
integer, dimension(:), intent(in)  nresd_k,
real(real64), intent(in)  dt,
complex(real64), dimension(:, :, :), intent(inout)  rho_mat_k 
)
private

Evolve the density matrix in time under uniform dissipation.

The time integration is performed using a 4th-order Taylor expansion of the Lindblad master equation.

Definition at line 1190 of file dm_propagation.F90.

◆ transition_rate_uniform()

subroutine dm_propagation_oct_m::transition_rate_uniform ( real(real64), dimension(:), intent(in), contiguous  uniform,
type(states_elec_t), intent(in)  ad_st,
integer, intent(in)  istart,
integer, intent(in)  iend,
integer, intent(in)  ik,
real(real64), dimension(:, :), intent(out), contiguous  rtrans 
)
private

Calculate state transition rates assuming uniform electron-phonon coupling.

Assuming \( E_j > E_i \) and \( N_{ph} = [\exp(\Delta E / k_B T_{ph}) - 1]^{-1} \):

\[ \Gamma_{j \to i} = \Gamma^0 (1 - f_i)(1 + N_{ph}), \quad \Gamma_{i \to j} = \Gamma^0 (1 - f_j) N_{ph} \]

Definition at line 1257 of file dm_propagation.F90.

◆ lindblad_operator_uniform()

subroutine dm_propagation_oct_m::lindblad_operator_uniform ( integer, intent(in)  nresd,
integer, intent(in)  istart,
integer, intent(in)  iend,
real(real64), dimension(:, :), intent(in), contiguous  rtrans,
complex(real64), dimension(:, :), intent(in), contiguous  den_mat,
complex(real64), dimension(:, :), intent(out), contiguous  l_mat 
)
private

Calculate the Lindblad dissipator matrix for uniform decay.

\[ L_{il} = -\frac{1}{2} \sum_{j \neq i} \Gamma_{i \to j} \rho_{il}, \quad L_{li} = -\frac{1}{2} \sum_{j \neq i} \Gamma_{i \to j} \rho_{li}, \quad L_{jj} = \sum_{i \neq j} \Gamma_{i \to j} \rho_{ii} \]

Definition at line 1311 of file dm_propagation.F90.

◆ lindblad_2times()

subroutine dm_propagation_oct_m::lindblad_2times ( type(dmp_t), intent(in)  dmp,
type(distributed_t), intent(in)  kpt,
integer, dimension(:), intent(in)  nresd_k,
real(real64), intent(in)  dt,
complex(real64), dimension(:, :, :), intent(inout)  rho_mat_k 
)
private

Evolve the density matrix using the phenomenological two-time (T1/T2) relaxation model.

\[ \begin{aligned} \rho_{ii}(t+dt) &= \rho^{\mathrm{GS}}_{ii} + \left( \rho_{ii}(t) - \rho^{\mathrm{GS}}_{ii} \right) e^{-dt/T_1} \ \rho_{ij}(t+dt) &= \rho_{ij}(t) e^{-dt/T_2} \quad (i \neq j) \end{aligned} \]

Where \( \rho^{\mathrm{GS}}_{ii} \) corresponds to dmpocc_gs(ist, ik_), and \( T_1, T_2 \) are dmptmodel(1:2).

Definition at line 1356 of file dm_propagation.F90.

◆ lindblad_from_epw()

subroutine dm_propagation_oct_m::lindblad_from_epw ( type(dmp_t), intent(inout)  dmp,
type(hamiltonian_elec_t), intent(in)  hm,
type(distributed_t), intent(in)  kpt,
type(mpi_grp_t), intent(in)  system_grp,
type(namespace_t), intent(in)  namespace,
integer, dimension(:), intent(in)  nresd_k,
real(real64), intent(in)  dt,
complex(real64), dimension(:, :, :), intent(inout)  rho_mat_k 
)
private

Evolve the density matrix under EPW-derived Lindblad dissipation.

The time integration is performed using a 4th-order Taylor expansion of the Lindblad master equation.

Definition at line 1398 of file dm_propagation.F90.

◆ collision_from_epw()

subroutine dm_propagation_oct_m::collision_from_epw ( type(dmp_t), intent(inout)  dmp,
type(hamiltonian_elec_t), intent(in)  hm,
type(distributed_t), intent(in)  kpt,
type(mpi_grp_t), intent(in)  system_grp,
type(namespace_t), intent(in)  namespace,
integer, dimension(:), intent(in)  nresd_k,
real(real64), intent(in)  dt,
complex(real64), dimension(:, :, :), intent(inout)  rho_mat_k 
)
private

Evolve the density matrix subject to the electron-phonon collision integral.

The dissipative dynamics are modeled analytically over the time step \(dt\):

Populations (diagonals) evolve via Fermis Golden Rule:

\[\rho_{ii} \leftarrow \rho_{ii} e^{-\Gamma_{out} dt} + \frac{\Gamma_{in}}{\Gamma_{out}} (1 - e^{-\Gamma_{out} dt})\]

Coherences (off-diagonals) decay via the Relaxation Time Approximation:

\[\rho_{ij} \leftarrow \rho_{ij} e^{-(\Gamma_i + \Gamma_j) dt / 2}\]

Definition at line 1491 of file dm_propagation.F90.

◆ dm_propagation_update_trans_rate()

subroutine dm_propagation_oct_m::dm_propagation_update_trans_rate ( class(dmp_t), intent(inout)  this,
type(hamiltonian_elec_t), intent(in)  hm,
type(mpi_grp_t), intent(in)  system_grp,
type(namespace_t), intent(in)  namespace 
)
private

Read and update the EPW transition matrix only when the vector field index changes.

Definition at line 1559 of file dm_propagation.F90.

◆ iopar_open_trans_rate()

subroutine dm_propagation_oct_m::iopar_open_trans_rate ( type(namespace_t), intent(in)  namespace,
type(ions_t), intent(in)  ions,
type(hamiltonian_elec_t), intent(in)  hm,
type(mpi_grp_t), intent(in)  system_grp,
type(dmp_t), intent(inout)  dmp 
)
private

Read in metadata of transition rates, build intra/inter communicators and shared memory window.

Definition at line 1581 of file dm_propagation.F90.

◆ iopar_read_trans_rate()

subroutine dm_propagation_oct_m::iopar_read_trans_rate ( integer, intent(in)  ia,
type(mpi_grp_t), intent(in)  system_grp,
type(namespace_t), intent(in)  namespace,
type(dmp_t), intent(inout)  dmp 
)
private

Read in transition rates to the shared memory window and then broadcast via internode communicator.

Definition at line 1671 of file dm_propagation.F90.

◆ iopar_close_trans_rate()

subroutine dm_propagation_oct_m::iopar_close_trans_rate ( type(mpi_grp_t), intent(in)  system_grp,
type(dmp_t), intent(inout)  dmp 
)
private

Finalize transition rate resources.

Deallocates the k-map, closes the file handle, and frees the memory window.

Definition at line 1700 of file dm_propagation.F90.

◆ build_epw_kmap()

subroutine dm_propagation_oct_m::build_epw_kmap ( type(namespace_t), intent(in)  namespace,
type(kpoints_t), intent(in)  kpoints,
type(dmp_t), intent(inout)  dmp 
)
private

Map internal k-point indices to the 1D EPW Monkhorst-Pack grid and verify mesh compatibility.

Definition at line 1724 of file dm_propagation.F90.

◆ get_vector_field_index()

integer function dm_propagation_oct_m::get_vector_field_index ( type(dmp_t), intent(in)  dmp,
type(hamiltonian_elec_t), intent(in)  hm,
type(namespace_t), intent(in)  namespace 
)
private

Get the flattened 1D index of the current vector potential on the discrete EPW vector field grid.

Definition at line 1772 of file dm_propagation.F90.

◆ get_trans_rate()

real(real64) function dm_propagation_oct_m::get_trans_rate ( type(dmp_t), intent(in)  dmp,
integer, intent(in)  nik_mp,
integer, intent(in)  jbnd,
integer, intent(in)  ibnd,
integer, intent(in)  k,
integer, intent(in)  kq,
logical, intent(in), optional  p_block 
)
private

Get transition rate from state (k, ibnd) to (kq, jbnd).

Maps k-points and bands to a 1D index in shared memory. Applies Pauli blocking (1-f) by default.

Definition at line 1827 of file dm_propagation.F90.

◆ lindblad_operator_epw()

subroutine dm_propagation_oct_m::lindblad_operator_epw ( type(dmp_t), intent(in)  dmp,
integer, intent(in)  ik,
integer, intent(in)  nik_skip,
integer, intent(in)  nresd,
real(real64), dimension(:, :), intent(in), contiguous  rho_diag,
complex(real64), dimension(:, :), intent(in), contiguous  den_mat,
complex(real64), dimension(:, :), intent(out), contiguous  l_mat 
)
private

Calculate the Lindblad dissipator matrix using EPW electron-phonon scattering rates.

\[ \begin{aligned} L_{il} &= -\frac{1}{2} \sum_{j, kq} \Gamma_{(i,k) \to (j,kq)} \rho_{il} \ L_{li} &= -\frac{1}{2} \sum_{j, kq} \Gamma_{(i,k) \to (j,kq)} \rho_{li} \ L_{ii} &= \sum_{j, kq} f_{j,kq} \Gamma_{(j,kq) \to (i,k)} \end{aligned} \]

Definition at line 1870 of file dm_propagation.F90.

◆ lifetime()

subroutine dm_propagation_oct_m::lifetime ( type(dmp_t), intent(in)  dmp,
integer, intent(in)  ik,
integer, intent(in)  ibnd,
integer, intent(in)  nik_skip,
real(real64), intent(out)  gam 
)
private

Calculate the total scattering rate (inverse lifetime) for a given state.

\[ \Gamma_{i,k} = \sum_{kq, j} \left( \Gamma_{(i,k) \to (j,kq)} + f_{j,kq} \Gamma^{0}_{(j,kq) \to (i,k)} \right) \]

Definition at line 1921 of file dm_propagation.F90.

◆ get_gamma()

subroutine dm_propagation_oct_m::get_gamma ( type(dmp_t), intent(in)  dmp,
integer, intent(in)  ik,
integer, intent(in)  ibnd,
integer, intent(in)  nik_skip,
real(real64), intent(out)  gam_in,
real(real64), intent(out)  gam_out 
)
private

Calculate in/out scattering rates (Gamma) for a specific state (ik, ibnd).

The scattering rates are defined as:

\[ \Gamma_{out}(i, \mathbf{k}) = \sum_{j, \mathbf{k}_q} W_{i\mathbf{k} \rightarrow j\mathbf{k}_q} (1 - f_{j\mathbf{k}_q}) \]

\[ \Gamma_{in}(i, \mathbf{k}) = \sum_{j, \mathbf{k}_q} W_{j\mathbf{k}_q} \rightarrow i\mathbf{k} (1 - f_{i\mathbf{k}}) f_{j\mathbf{k}_q} \]

Definition at line 1961 of file dm_propagation.F90.

◆ update_st()

subroutine dm_propagation_oct_m::update_st ( type(dmp_t), intent(inout)  dmp,
integer, intent(in)  ik,
type(grid_t), intent(in)  gr,
type(namespace_t), intent(in)  namespace,
integer, intent(in)  nresd,
complex(real64), dimension(:, :), intent(in), contiguous  overlap_ad_ks,
complex(real64), dimension(:, :), intent(in), contiguous  overlap_resd_ks,
real(real64), dimension(:), intent(in), contiguous  nrm2_tdks,
type(states_elec_t), intent(inout)  resd,
type(states_elec_t), intent(inout)  st,
complex(real64), dimension(:, :), intent(inout), contiguous  rho_mat,
real(real64), intent(inout)  pop 
)
private

Diagonalize the density matrix to update occupations and wavefunctions.

Depending on the basis orthogonality, the routine solves either a standard or a generalized eigenvalue problem:

\[ \begin{aligned} \rho c_k &= \tilde{f}_k c_k \quad &\text{(Orthonormal basis)} \ \rho c_k &= \tilde{f}_k \mathbf{S} c_k \quad &\text{(General basis)} \end{aligned} \]

Where:

  • \( \rho \): Density matrix.
  • \( \mathbf{S} \): Overlap matrix of the combined (adiabatic + residual) basis.
  • \( \tilde{f}_k \): Updated intermediate occupations (eigenvalues).
  • \( c_k \): Eigenvectors used to construct the updated states \( |\tilde{\psi}\rangle \).

Definition at line 2008 of file dm_propagation.F90.

◆ check_set_positive()

subroutine dm_propagation_oct_m::check_set_positive ( integer, intent(in)  locc,
integer, intent(in)  npos,
integer, intent(in)  ik,
type(namespace_t), intent(in)  namespace,
real(real64), dimension(:), intent(inout)  occ 
)
private

Checks and truncates small negative eigenvalues to zero.

Applies the truncation to the last \( N_{\mathrm{pos}} \) elements of the occupation array:

\[ f_j = \max(f_j, 0) \]

Aborts execution if any evaluated eigenvalue is smaller than the numerical threshold.

Definition at line 2107 of file dm_propagation.F90.

◆ update_wfc_occ()

subroutine dm_propagation_oct_m::update_wfc_occ ( integer, intent(in)  ik,
type(grid_t), intent(in)  gr,
integer, intent(in)  istart,
integer, intent(in)  iend,
integer, intent(in)  nresd,
type(states_elec_t), intent(in)  ad_st,
type(states_elec_t), intent(in)  resd,
real(real64), dimension(:), intent(in), contiguous  occ,
complex(real64), dimension(:, :), intent(in), contiguous  v_mat,
type(states_elec_t), intent(inout)  st,
real(real64), intent(inout)  pop 
)
private

Update states directly from diagonalization (no Procrustes).

Reverses LAPACK ascending order ( \( m = N+N_{\mathrm{resd}}+1-j \)):

\[ |\psi^{\mathrm{new}}_j \rangle = \sum_i C_{i, m} |\phi, d \rangle_i, \quad f_j = \tilde{f}_{m} \]

( \(C\): v_mat, \(\tilde{f}\): occ, \(|\phi,d\rangle\): combined basis)

Definition at line 2141 of file dm_propagation.F90.

◆ update_wfc_occ_procrustes()

subroutine dm_propagation_oct_m::update_wfc_occ_procrustes ( integer, intent(in)  ik,
type(grid_t), intent(in)  gr,
integer, intent(in)  istart,
integer, intent(in)  iend,
integer, intent(in)  nresd,
type(states_elec_t), intent(in)  ad_st,
type(states_elec_t), intent(in)  resd,
complex(real64), dimension(:, :), intent(in), contiguous  overlap_ad_ks,
complex(real64), dimension(:, :), intent(in), contiguous  overlap_resd_ks,
real(real64), dimension(:), intent(in), contiguous  nrm2_tdks,
real(real64), dimension(:), intent(in), contiguous  occ_tilde,
complex(real64), dimension(:, :), intent(inout), contiguous  v_mat,
type(states_elec_t), intent(inout)  st,
real(real64), intent(inout)  pop 
)
private

Update states using Procrustes transformation to ensure time continuity.

\[ \begin{aligned} S^{\tilde{\psi},\psi} &= \mathrm{diag}(\sqrt{\tilde{f}}) \left( C_{\mathrm{ad}}^\dagger S^{\phi,\psi} + C_{\mathrm{resd}}^\dagger S^{d,\psi} \right) \mathrm{diag}(\sqrt{f}) \ U^{\mathrm{proj}} &= U V^\dagger \quad \text{(via SVD: } S^{\tilde{\psi},\psi} = U \Sigma V^\dagger \text{)} \ |\Psi^{\mathrm{temp}}_j \rangle &= \sum_{l} \left( \sum_{i} C_{li} \sqrt{\tilde{f}_i} U^{\mathrm{proj}}_{ij} \right) |\phi,d \rangle_l \ f^{\mathrm{new}}_j &= |\Psi^{\mathrm{temp}}_j|^2 \,/\, |\psi_j|^2, \quad |\psi^{\mathrm{new}}_j\rangle = |\Psi^{\mathrm{temp}}_j\rangle \,/\, \sqrt{f^{\mathrm{new}}_j} \end{aligned} \]

( \(\tilde{f}, f\): regularized occ_tilde, stocc; \(C\): v_mat; \(S^{\phi,\psi}, S^{d,\psi}\): overlap_ad/resd_ks)

Definition at line 2228 of file dm_propagation.F90.

◆ is_hermitian()

logical function dm_propagation_oct_m::is_hermitian ( integer, intent(in)  n,
complex(real64), dimension(:, :), intent(in)  mat 
)
private

Check if a matrix is Hermitian.

Definition at line 2363 of file dm_propagation.F90.

◆ td_write_dm_proj_basis()

subroutine dm_propagation_oct_m::td_write_dm_proj_basis ( class(dmp_t), intent(in)  this,
type(c_ptr), intent(inout)  out_dm_proj_basis,
integer, intent(in)  iter 
)
private

Write density matrix information to file.

Definition at line 2375 of file dm_propagation.F90.

Variable Documentation

◆ ave_trans

real(real32), dimension(:), pointer, volatile dm_propagation_oct_m::ave_trans
private

Average transition rates in shared memory.

Definition at line 196 of file dm_propagation.F90.