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 population_in_adiabatic (ik, ad_st, st, overlap, pop)
 Calculate number of electrons in the adiabatic basis. More...
 
subroutine construct_residuals (gr, namespace, ad_st, st, ik, othn, 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, overlap_ad_ks, overlap_resd_ks, rho_mat)
 Construct the full density matrix in the adiabatic and residual basis. More...
 
subroutine broadcast_occupation (occ, kpt, nst, parstate)
 
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, ik, rtrans)
 Calculate state transition rates assuming uniform electron-phonon coupling. More...
 
subroutine lindblad_operator_uniform (nst, nresd, 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 update_wfc_occ (ik, ad_st, resd, gr, nresd, occ, v_mat, st, pop)
 Update states directly from diagonalization (no Procrustes). More...
 
subroutine update_wfc_occ_procrustes (ik, ad_st, resd, gr, nresd, 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...
 

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 198 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 413 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 465 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 485 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)  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 601 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)  overlap,
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 633 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,
complex(real64), dimension(:, :), intent(in)  overlap_ad_ks,
real(real64), dimension(:), intent(in)  nrm2_tdks,
integer, intent(out)  nresd,
complex(real64), dimension(:, :), intent(out)  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]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 677 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,
complex(real64), dimension(:, :), intent(in)  overlap_ad_ks,
complex(real64), dimension(:, :), intent(in)  overlap_resd_ks,
complex(real64), dimension(:, :), intent(out)  rho_mat 
)
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]overlap_ad_ks<phi | psi>
[in]overlap_resd_ks<d | psi>
[out]rho_matThe full density matrix

Definition at line 805 of file dm_propagation.F90.

◆ broadcast_occupation()

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

Definition at line 885 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 939 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 976 of file dm_propagation.F90.

◆ transition_rate_uniform()

subroutine dm_propagation_oct_m::transition_rate_uniform ( real(real64), dimension(:), intent(in)  uniform,
type(states_elec_t), intent(in)  ad_st,
integer, intent(in)  ik,
real(real64), dimension(:, :), intent(out)  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 1042 of file dm_propagation.F90.

◆ lindblad_operator_uniform()

subroutine dm_propagation_oct_m::lindblad_operator_uniform ( integer, intent(in)  nst,
integer, intent(in)  nresd,
real(real64), dimension(:, :), intent(in)  rtrans,
complex(real64), dimension(:, :), intent(in)  den_mat,
complex(real64), dimension(:, :), intent(out)  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 1093 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 1135 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 1176 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 1265 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 1332 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 1354 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 1439 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 1468 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 1492 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 1540 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 1595 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)  rho_diag,
complex(real64), dimension(:, :), intent(in)  den_mat,
complex(real64), dimension(:, :), intent(out)  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 1638 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 1688 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 1728 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)  overlap_ad_ks,
complex(real64), dimension(:, :), intent(in)  overlap_resd_ks,
real(real64), dimension(:), intent(in)  nrm2_tdks,
type(states_elec_t), intent(inout)  resd,
type(states_elec_t), intent(inout)  st,
complex(real64), dimension(:, :), intent(inout)  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 1775 of file dm_propagation.F90.

◆ update_wfc_occ()

subroutine dm_propagation_oct_m::update_wfc_occ ( integer, intent(in)  ik,
type(states_elec_t), intent(in)  ad_st,
type(states_elec_t), intent(in)  resd,
type(grid_t), intent(in)  gr,
integer, intent(in)  nresd,
real(real64), dimension(:), intent(in)  occ,
complex(real64), dimension(:, :), intent(in)  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 1863 of file dm_propagation.F90.

◆ update_wfc_occ_procrustes()

subroutine dm_propagation_oct_m::update_wfc_occ_procrustes ( integer, intent(in)  ik,
type(states_elec_t), intent(in)  ad_st,
type(states_elec_t), intent(in)  resd,
type(grid_t), intent(in)  gr,
integer, intent(in)  nresd,
complex(real64), dimension(:, :), intent(in)  overlap_ad_ks,
complex(real64), dimension(:, :), intent(in)  overlap_resd_ks,
real(real64), dimension(:), intent(in)  nrm2_tdks,
real(real64), dimension(:), intent(in)  occ_tilde,
complex(real64), dimension(:, :), intent(inout)  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 1927 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 2038 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 193 of file dm_propagation.F90.