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.

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_init ()
 
subroutine, public casida_run (system, from_scratch)
 
subroutine casida_run_legacy (sys, fromScratch)
 
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, mesh, matrix, xc, restart_file, is_forces)
 
subroutine dwrite_k_term (cas, mat_val, iunit, ia, jb)
 write matrix element to casida_restart file More...
 
subroutine dcasida_forces (cas, sys, mesh, 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, mesh, matrix, xc, restart_file, is_forces)
 
subroutine zwrite_k_term (cas, mat_val, iunit, ia, jb)
 write matrix element to casida_restart file More...
 
subroutine zcasida_forces (cas, sys, mesh, 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_init()

subroutine, public casida_oct_m::casida_run_init

Definition at line 283 of file casida.F90.

◆ casida_run()

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

Definition at line 312 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 330 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 783 of file casida.F90.

◆ casida_type_end()

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

Definition at line 941 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 996 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 1185 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 1206 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 1244 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 1264 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 1278 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 1292 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 1306 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 1406 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 1542 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 1586 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 1624 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 1667 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 1700 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 1737 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 1785 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,
class(mesh_t), intent(in)  mesh,
real(real64), dimension(:,:), intent(out)  matrix,
real(real64), dimension(:,:,:), intent(in)  xc,
character(len=*), intent(in)  restart_file,
logical, intent(in), optional  is_forces 
)
private

calculates the matrix elements <i(p),a(p)|v|j(q),b(q)> and/or <i(p),a(p)|xc|j(q),b(q)>

no need to get rho twice

Definition at line 1821 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 2268 of file casida.F90.

◆ dcasida_forces()

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

Definition at line 2284 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 2425 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 2537 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 2800 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 2961 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 3000 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 3044 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 3137 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 3273 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 3317 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 3355 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 3398 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 3431 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 3468 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 3516 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,
class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:,:), intent(out)  matrix,
real(real64), dimension(:,:,:), intent(in)  xc,
character(len=*), intent(in)  restart_file,
logical, intent(in), optional  is_forces 
)
private

calculates the matrix elements <i(p),a(p)|v|j(q),b(q)> and/or <i(p),a(p)|xc|j(q),b(q)>

no need to get rho twice

Definition at line 3552 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 3999 of file casida.F90.

◆ zcasida_forces()

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

Definition at line 4015 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 4156 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 4268 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 4545 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 4706 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 4745 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 4789 of file casida.F90.

Variable Documentation

◆ casida_eps_diff

integer, parameter casida_oct_m::casida_eps_diff = 1
private

Definition at line 185 of file casida.F90.

◆ casida_petersilka

integer, parameter casida_oct_m::casida_petersilka = 2
private

Definition at line 185 of file casida.F90.

◆ casida_tamm_dancoff

integer, parameter casida_oct_m::casida_tamm_dancoff = 4
private

Definition at line 185 of file casida.F90.

◆ casida_variational

integer, parameter casida_oct_m::casida_variational = 8
private

Definition at line 185 of file casida.F90.

◆ casida_casida

integer, parameter casida_oct_m::casida_casida = 16
private

Definition at line 185 of file casida.F90.

◆ solver_elpa

integer, parameter casida_oct_m::solver_elpa = 1
private

Definition at line 192 of file casida.F90.

◆ solver_scalapack

integer, parameter casida_oct_m::solver_scalapack = 2
private

Definition at line 192 of file casida.F90.