Octopus
casida_oct_m Module Reference

This module implements the Casida equations for excited states. More...

Detailed Description

This module implements the Casida equations for excited states.

The linear-response (Casida) formalism casts the excitation energies as the eigenvalues of a coupled (A, B) matrix problem. For a pedagogic derivation of this polarization-propagator / RPA formulation see J. Oddershede, P. Joergensen, and D. L. Yeager, "Polarization propagator methods in atomic and molecular calculations", Comput. Phys. Rep. 2, 33 (1984); https: and M. E. Casida, "Time-Dependent Density Functional Response Theory for Molecules", in Recent Advances in Density Functional Methods, ed. D. P. Chong (World Scientific, 1995), p. 155; https:

The only difference between TDDFT (Casida) and TDHF (the RPA of Hartree-Fock) is the coupling kernel entering A and B: TDDFT uses the (semilocal) xc kernel f_xc, whereas TDHF uses the non-local Fock exchange. This is made explicit in Eqns. 12 and 13 (the A and B matrices) of W. Liang, S. A. Fischer, M. J. Frisch, and X. Li, J. Chem. Theory Comput. 7, 3540 (2011); https: The reduction of the full (A, B) problem to the Hermitian half-size problem solved here follows R. E. Stratmann, G. E. Scuseria, and M. J. Frisch, J. Chem. Phys. 109, 8218 (1998); https:

Data Types

type  casida_save_pot_t
 
type  casida_t
 This class contains all parameters, needed for Casida calculations. More...
 

Functions/Subroutines

subroutine, public casida_run (system, from_scratch)
 
subroutine casida_run_legacy (sys, fromScratch)
 
subroutine casida_count_pairs (st, namespace, n_pairs, n_occ, n_unocc, is_included, is_frac_occ)
 number of occupied-unoccupied pairs for Casida More...
 
subroutine casida_type_init (cas, sys)
 allocates stuff, and constructs the arrays pair_i and pair_j More...
 
subroutine casida_type_end (cas)
 
subroutine casida_work (sys, cas)
 this subroutine calculates electronic excitation energies using the matrix formulation of M. Petersilka, or of M. Casida More...
 
real(real64) function casida_matrix_factor (cas, sys)
 
subroutine qcasida_write (cas, namespace)
 
character(len=80) pure function theory_name (cas)
 
logical function isnt_degenerate (cas, st, ia, jb)
 
integer function get_global_row (cas, jb_local)
 
integer function get_global_col (cas, ia_local)
 
subroutine local_indices (cas, ia, jb, on_this_processor, ia_local, jb_local)
 
subroutine doscillator_strengths (cas, mesh, st)
 
real(real64) function, dimension(cas%n_pairs) dks_matrix_elements (cas, st, mesh, dv)
 
real(real64) function dtransition_matrix_element (cas, ia, xx)
 calculate transition matrix elements More...
 
subroutine dtransition_density (cas, st, mesh, ia, n0I)
 
subroutine dget_transition_densities (cas, sys)
 
subroutine dcasida_get_rho (st, mesh, ii, ia, kk, rho)
 
subroutine dcasida_calc_lr_hmat1 (sys, pert, hvar, lr_hmat1, is_saved, st_start, st_end, ik)
 calculate one-particle matrix elements of perturbation More...
 
subroutine dcasida_lr_hmat2 (cas, st, lr_hmat1, ik)
 calculate two-particle matrix elements of perturbation More...
 
subroutine dcasida_get_matrix (cas, namespace, hm, st, ks, gr, matrix, fxc, fxc_grad, fxc_grad_spin, restart_file, is_forces, matrixB)
 
subroutine dwrite_k_term (cas, mat_val, iunit, ia, jb)
 write matrix element to casida_restart file More...
 
subroutine dcasida_forces (cas, sys, gr, st)
 
subroutine dcasida_get_lr_hmat1 (cas, sys, iatom, idir, dl_rho, lr_hmat1)
 
subroutine dcasida_solve (cas, sys)
 
subroutine dcasida_write (cas, sys)
 
subroutine dwrite_implied_occupations (cas, iunit, ind)
 
subroutine dwrite_distributed_matrix (cas, matrix, filename)
 
real(real64) function dallreduce_sum (cas, variable)
 
subroutine zoscillator_strengths (cas, mesh, st)
 
complex(real64) function, dimension(cas%n_pairs) zks_matrix_elements (cas, st, mesh, dv)
 
complex(real64) function ztransition_matrix_element (cas, ia, xx)
 calculate transition matrix elements More...
 
subroutine ztransition_density (cas, st, mesh, ia, n0I)
 
subroutine zget_transition_densities (cas, sys)
 
subroutine zcasida_get_rho (st, mesh, ii, ia, kk, rho)
 
subroutine zcasida_calc_lr_hmat1 (sys, pert, hvar, lr_hmat1, is_saved, st_start, st_end, ik)
 calculate one-particle matrix elements of perturbation More...
 
subroutine zcasida_lr_hmat2 (cas, st, lr_hmat1, ik)
 calculate two-particle matrix elements of perturbation More...
 
subroutine zcasida_get_matrix (cas, namespace, hm, st, ks, gr, matrix, fxc, fxc_grad, fxc_grad_spin, restart_file, is_forces, matrixB)
 
subroutine zwrite_k_term (cas, mat_val, iunit, ia, jb)
 write matrix element to casida_restart file More...
 
subroutine zcasida_forces (cas, sys, gr, st)
 
subroutine zcasida_get_lr_hmat1 (cas, sys, iatom, idir, dl_rho, lr_hmat1)
 
subroutine zcasida_solve (cas, sys)
 
subroutine zcasida_write (cas, sys)
 
subroutine zwrite_implied_occupations (cas, iunit, ind)
 
subroutine zwrite_distributed_matrix (cas, matrix, filename)
 
complex(real64) function zallreduce_sum (cas, variable)
 

Variables

integer, parameter casida_eps_diff = 1
 
integer, parameter casida_petersilka = 2
 
integer, parameter casida_tamm_dancoff = 4
 
integer, parameter casida_variational = 8
 
integer, parameter casida_casida = 16
 
integer, parameter solver_elpa = 1
 
integer, parameter solver_scalapack = 2
 

Function/Subroutine Documentation

◆ casida_run()

subroutine, public casida_oct_m::casida_run ( class(*), intent(inout)  system,
logical, intent(in)  from_scratch 
)

Definition at line 317 of file casida.F90.

◆ casida_run_legacy()

subroutine casida_oct_m::casida_run_legacy ( type(electrons_t), intent(inout)  sys,
logical, intent(in)  fromScratch 
)
private

Definition at line 335 of file casida.F90.

◆ casida_count_pairs()

subroutine casida_oct_m::casida_count_pairs ( type(states_elec_t), intent(in)  st,
type(namespace_t), intent(in)  namespace,
integer, intent(out)  n_pairs,
integer, dimension(:), intent(out)  n_occ,
integer, dimension(:), intent(out)  n_unocc,
logical, dimension(:,:,:), intent(out), allocatable  is_included,
logical, intent(out)  is_frac_occ 
)
private

number of occupied-unoccupied pairs for Casida

Parameters
[out]n_pairsresult: number of pairs
[out]n_occresult: number of occ. states per k-point; dimension (1:nik)
[out]n_unoccresult: number of unocc. states per k-point;dimension (1:nik)
[out]is_includedresult: mask whether a state is included; dimension (st%d%nst, st%d%nst, st%d%nik)
[out]is_frac_occresult: are there fractional occupations?

Definition at line 810 of file casida.F90.

◆ casida_type_init()

subroutine casida_oct_m::casida_type_init ( type(casida_t), intent(inout)  cas,
type(electrons_t), intent(in)  sys 
)
private

allocates stuff, and constructs the arrays pair_i and pair_j

Definition at line 945 of file casida.F90.

◆ casida_type_end()

subroutine casida_oct_m::casida_type_end ( type(casida_t), intent(inout)  cas)
private

Definition at line 1072 of file casida.F90.

◆ casida_work()

subroutine casida_oct_m::casida_work ( type(electrons_t), intent(inout), target  sys,
type(casida_t), intent(inout)  cas 
)
private

this subroutine calculates electronic excitation energies using the matrix formulation of M. Petersilka, or of M. Casida

Definition at line 1129 of file casida.F90.

◆ casida_matrix_factor()

real(real64) function casida_oct_m::casida_matrix_factor ( type(casida_t), intent(in)  cas,
type(electrons_t), intent(in)  sys 
)
private

Definition at line 1341 of file casida.F90.

◆ qcasida_write()

subroutine casida_oct_m::qcasida_write ( type(casida_t), intent(in)  cas,
type(namespace_t), intent(in)  namespace 
)
private

Definition at line 1362 of file casida.F90.

◆ theory_name()

character(len=80) pure function casida_oct_m::theory_name ( type(casida_t), intent(in)  cas)
private

Definition at line 1400 of file casida.F90.

◆ isnt_degenerate()

logical function casida_oct_m::isnt_degenerate ( type(casida_t), intent(in)  cas,
type(states_elec_t), intent(in)  st,
integer, intent(in)  ia,
integer, intent(in)  jb 
)
private

Definition at line 1420 of file casida.F90.

◆ get_global_row()

integer function casida_oct_m::get_global_row ( type(casida_t), intent(inout)  cas,
integer, intent(in)  jb_local 
)
private

Definition at line 1434 of file casida.F90.

◆ get_global_col()

integer function casida_oct_m::get_global_col ( type(casida_t), intent(inout)  cas,
integer, intent(in)  ia_local 
)
private

Definition at line 1448 of file casida.F90.

◆ local_indices()

subroutine casida_oct_m::local_indices ( type(casida_t), intent(in)  cas,
integer, intent(in)  ia,
integer, intent(in)  jb,
logical, intent(out)  on_this_processor,
integer, intent(out)  ia_local,
integer, intent(out)  jb_local 
)
private

Definition at line 1462 of file casida.F90.

◆ doscillator_strengths()

subroutine casida_oct_m::doscillator_strengths ( type(casida_t), intent(inout)  cas,
class(mesh_t), intent(in)  mesh,
type(states_elec_t), intent(in)  st 
)
private

Definition at line 1550 of file casida.F90.

◆ dks_matrix_elements()

real(real64) function, dimension(cas%n_pairs) casida_oct_m::dks_matrix_elements ( type(casida_t), intent(in)  cas,
type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in)  dv 
)
private

Definition at line 1688 of file casida.F90.

◆ dtransition_matrix_element()

real(real64) function casida_oct_m::dtransition_matrix_element ( type(casida_t), intent(in)  cas,
integer, intent(in)  ia,
real(real64), dimension(:), intent(in)  xx 
)
private

calculate transition matrix elements

Casida: \( \vec{d}_k = \sum_{cv} \vec{d}_{cv} x_{cv} \sqrt{\frac{\epsilon_c - \epsilon_v}{\omega_k}} \) others: \( \vec{d}_k = \sum_{cv} \vec{d}_{cv} x_{cv} \)

Parameters
[in]xxthese are KS matrix elements

Definition at line 1732 of file casida.F90.

◆ dtransition_density()

subroutine casida_oct_m::dtransition_density ( type(casida_t), intent(in)  cas,
type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  ia,
real(real64), dimension(:), intent(out)  n0I 
)
private

Definition at line 1776 of file casida.F90.

◆ dget_transition_densities()

subroutine casida_oct_m::dget_transition_densities ( type(casida_t), intent(in)  cas,
type(electrons_t), intent(in)  sys 
)
private

Definition at line 1820 of file casida.F90.

◆ dcasida_get_rho()

subroutine casida_oct_m::dcasida_get_rho ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  ii,
integer, intent(in)  ia,
integer, intent(in)  kk,
real(real64), dimension(:), intent(out)  rho 
)
private

Definition at line 1853 of file casida.F90.

◆ dcasida_calc_lr_hmat1()

subroutine casida_oct_m::dcasida_calc_lr_hmat1 ( type(electrons_t), intent(inout)  sys,
class(perturbation_t), intent(in)  pert,
real(real64), dimension(:,:,:), intent(in)  hvar,
real(real64), dimension(:,:,:), intent(out)  lr_hmat1,
logical, dimension(:,:,:), intent(in)  is_saved,
integer, intent(in)  st_start,
integer, intent(in)  st_end,
integer, intent(in)  ik 
)
private

calculate one-particle matrix elements of perturbation

Definition at line 1891 of file casida.F90.

◆ dcasida_lr_hmat2()

subroutine casida_oct_m::dcasida_lr_hmat2 ( type(casida_t), intent(inout)  cas,
type(states_elec_t), intent(in)  st,
real(real64), dimension(:,:,:), intent(in)  lr_hmat1,
integer, intent(in)  ik 
)
private

calculate two-particle matrix elements of perturbation

Definition at line 1942 of file casida.F90.

◆ dcasida_get_matrix()

subroutine casida_oct_m::dcasida_get_matrix ( type(casida_t), intent(inout)  cas,
type(namespace_t), intent(in)  namespace,
type(hamiltonian_elec_t), intent(in)  hm,
type(states_elec_t), intent(in)  st,
type(v_ks_t), intent(in)  ks,
type(grid_t), intent(in)  gr,
real(real64), dimension(:,:), intent(out)  matrix,
real(real64), dimension(:,:,:), intent(in)  fxc,
real(real64), dimension(:,:,:,:,:), intent(in)  fxc_grad,
real(real64), dimension(:,:,:,:), intent(in)  fxc_grad_spin,
character(len=*), intent(in)  restart_file,
logical, intent(in), optional  is_forces,
real(real64), dimension(:,:), intent(out), optional  matrixB 
)
private
Parameters
[out]matrixbOff-diagonal B coupling matrix for the full TDHF (RPA) problem.

Definition at line 1978 of file casida.F90.

◆ dwrite_k_term()

subroutine casida_oct_m::dwrite_k_term ( type(casida_t), intent(in)  cas,
real(real64), intent(in)  mat_val,
integer, intent(in)  iunit,
integer, intent(in)  ia,
integer, intent(in)  jb 
)
private

write matrix element to casida_restart file

Definition at line 2867 of file casida.F90.

◆ dcasida_forces()

subroutine casida_oct_m::dcasida_forces ( type(casida_t), intent(inout)  cas,
type(electrons_t), intent(inout)  sys,
type(grid_t), intent(in)  gr,
type(states_elec_t), intent(inout)  st 
)
private

Definition at line 2883 of file casida.F90.

◆ dcasida_get_lr_hmat1()

subroutine casida_oct_m::dcasida_get_lr_hmat1 ( type(casida_t), intent(in)  cas,
type(electrons_t), intent(inout)  sys,
integer, intent(in)  iatom,
integer, intent(in)  idir,
real(real64), dimension(:,:), intent(in)  dl_rho,
real(real64), dimension(:,:,:), intent(out)  lr_hmat1 
)
private

Definition at line 3032 of file casida.F90.

◆ dcasida_solve()

subroutine casida_oct_m::dcasida_solve ( type(casida_t), intent(inout)  cas,
type(electrons_t), intent(in)  sys 
)
private

Definition at line 3146 of file casida.F90.

◆ dcasida_write()

subroutine casida_oct_m::dcasida_write ( type(casida_t), intent(inout)  cas,
type(electrons_t), intent(in)  sys 
)
private

Definition at line 3372 of file casida.F90.

◆ dwrite_implied_occupations()

subroutine casida_oct_m::dwrite_implied_occupations ( type(casida_t), intent(in)  cas,
integer, intent(in)  iunit,
integer, intent(in)  ind 
)
private

Definition at line 3533 of file casida.F90.

◆ dwrite_distributed_matrix()

subroutine casida_oct_m::dwrite_distributed_matrix ( type(casida_t), intent(inout)  cas,
real(real64), dimension(:,:), intent(in)  matrix,
character(len=*), intent(in)  filename 
)
private

Definition at line 3572 of file casida.F90.

◆ dallreduce_sum()

real(real64) function casida_oct_m::dallreduce_sum ( type(casida_t), intent(in)  cas,
real(real64), intent(in)  variable 
)
private

Definition at line 3595 of file casida.F90.

◆ zoscillator_strengths()

subroutine casida_oct_m::zoscillator_strengths ( type(casida_t), intent(inout)  cas,
class(mesh_t), intent(in)  mesh,
type(states_elec_t), intent(in)  st 
)
private

Definition at line 3688 of file casida.F90.

◆ zks_matrix_elements()

complex(real64) function, dimension(cas%n_pairs) casida_oct_m::zks_matrix_elements ( type(casida_t), intent(in)  cas,
type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in)  dv 
)
private

Definition at line 3826 of file casida.F90.

◆ ztransition_matrix_element()

complex(real64) function casida_oct_m::ztransition_matrix_element ( type(casida_t), intent(in)  cas,
integer, intent(in)  ia,
complex(real64), dimension(:), intent(in)  xx 
)
private

calculate transition matrix elements

Casida: \( \vec{d}_k = \sum_{cv} \vec{d}_{cv} x_{cv} \sqrt{\frac{\epsilon_c - \epsilon_v}{\omega_k}} \) others: \( \vec{d}_k = \sum_{cv} \vec{d}_{cv} x_{cv} \)

Parameters
[in]xxthese are KS matrix elements

Definition at line 3870 of file casida.F90.

◆ ztransition_density()

subroutine casida_oct_m::ztransition_density ( type(casida_t), intent(in)  cas,
type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  ia,
complex(real64), dimension(:), intent(out)  n0I 
)
private

Definition at line 3914 of file casida.F90.

◆ zget_transition_densities()

subroutine casida_oct_m::zget_transition_densities ( type(casida_t), intent(in)  cas,
type(electrons_t), intent(in)  sys 
)
private

Definition at line 3958 of file casida.F90.

◆ zcasida_get_rho()

subroutine casida_oct_m::zcasida_get_rho ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  ii,
integer, intent(in)  ia,
integer, intent(in)  kk,
complex(real64), dimension(:), intent(out)  rho 
)
private

Definition at line 3991 of file casida.F90.

◆ zcasida_calc_lr_hmat1()

subroutine casida_oct_m::zcasida_calc_lr_hmat1 ( type(electrons_t), intent(inout)  sys,
class(perturbation_t), intent(in)  pert,
real(real64), dimension(:,:,:), intent(in)  hvar,
complex(real64), dimension(:,:,:), intent(out)  lr_hmat1,
logical, dimension(:,:,:), intent(in)  is_saved,
integer, intent(in)  st_start,
integer, intent(in)  st_end,
integer, intent(in)  ik 
)
private

calculate one-particle matrix elements of perturbation

Definition at line 4029 of file casida.F90.

◆ zcasida_lr_hmat2()

subroutine casida_oct_m::zcasida_lr_hmat2 ( type(casida_t), intent(inout)  cas,
type(states_elec_t), intent(in)  st,
complex(real64), dimension(:,:,:), intent(in)  lr_hmat1,
integer, intent(in)  ik 
)
private

calculate two-particle matrix elements of perturbation

Definition at line 4080 of file casida.F90.

◆ zcasida_get_matrix()

subroutine casida_oct_m::zcasida_get_matrix ( type(casida_t), intent(inout)  cas,
type(namespace_t), intent(in)  namespace,
type(hamiltonian_elec_t), intent(in)  hm,
type(states_elec_t), intent(in)  st,
type(v_ks_t), intent(in)  ks,
type(grid_t), intent(in)  gr,
complex(real64), dimension(:,:), intent(out)  matrix,
real(real64), dimension(:,:,:), intent(in)  fxc,
real(real64), dimension(:,:,:,:,:), intent(in)  fxc_grad,
real(real64), dimension(:,:,:,:), intent(in)  fxc_grad_spin,
character(len=*), intent(in)  restart_file,
logical, intent(in), optional  is_forces,
complex(real64), dimension(:,:), intent(out), optional  matrixB 
)
private
Parameters
[out]matrixbOff-diagonal B coupling matrix for the full TDHF (RPA) problem.

Definition at line 4116 of file casida.F90.

◆ zwrite_k_term()

subroutine casida_oct_m::zwrite_k_term ( type(casida_t), intent(in)  cas,
complex(real64), intent(in)  mat_val,
integer, intent(in)  iunit,
integer, intent(in)  ia,
integer, intent(in)  jb 
)
private

write matrix element to casida_restart file

Definition at line 5005 of file casida.F90.

◆ zcasida_forces()

subroutine casida_oct_m::zcasida_forces ( type(casida_t), intent(inout)  cas,
type(electrons_t), intent(inout)  sys,
type(grid_t), intent(in)  gr,
type(states_elec_t), intent(inout)  st 
)
private

Definition at line 5021 of file casida.F90.

◆ zcasida_get_lr_hmat1()

subroutine casida_oct_m::zcasida_get_lr_hmat1 ( type(casida_t), intent(in)  cas,
type(electrons_t), intent(inout)  sys,
integer, intent(in)  iatom,
integer, intent(in)  idir,
real(real64), dimension(:,:), intent(in)  dl_rho,
complex(real64), dimension(:,:,:), intent(out)  lr_hmat1 
)
private

Definition at line 5170 of file casida.F90.

◆ zcasida_solve()

subroutine casida_oct_m::zcasida_solve ( type(casida_t), intent(inout)  cas,
type(electrons_t), intent(in)  sys 
)
private

Definition at line 5284 of file casida.F90.

◆ zcasida_write()

subroutine casida_oct_m::zcasida_write ( type(casida_t), intent(inout)  cas,
type(electrons_t), intent(in)  sys 
)
private

Definition at line 5510 of file casida.F90.

◆ zwrite_implied_occupations()

subroutine casida_oct_m::zwrite_implied_occupations ( type(casida_t), intent(in)  cas,
integer, intent(in)  iunit,
integer, intent(in)  ind 
)
private

Definition at line 5671 of file casida.F90.

◆ zwrite_distributed_matrix()

subroutine casida_oct_m::zwrite_distributed_matrix ( type(casida_t), intent(inout)  cas,
complex(real64), dimension(:,:), intent(in)  matrix,
character(len=*), intent(in)  filename 
)
private

Definition at line 5710 of file casida.F90.

◆ zallreduce_sum()

complex(real64) function casida_oct_m::zallreduce_sum ( type(casida_t), intent(in)  cas,
complex(real64), intent(in)  variable 
)
private

Definition at line 5733 of file casida.F90.

Variable Documentation

◆ casida_eps_diff

integer, parameter casida_oct_m::casida_eps_diff = 1
private

Definition at line 211 of file casida.F90.

◆ casida_petersilka

integer, parameter casida_oct_m::casida_petersilka = 2
private

Definition at line 211 of file casida.F90.

◆ casida_tamm_dancoff

integer, parameter casida_oct_m::casida_tamm_dancoff = 4
private

Definition at line 211 of file casida.F90.

◆ casida_variational

integer, parameter casida_oct_m::casida_variational = 8
private

Definition at line 211 of file casida.F90.

◆ casida_casida

integer, parameter casida_oct_m::casida_casida = 16
private

Definition at line 211 of file casida.F90.

◆ solver_elpa

integer, parameter casida_oct_m::solver_elpa = 1
private

Definition at line 218 of file casida.F90.

◆ solver_scalapack

integer, parameter casida_oct_m::solver_scalapack = 2
private

Definition at line 218 of file casida.F90.