46 use,
intrinsic :: iso_fortran_env
93 integer,
parameter :: &
94 CASIDA_EPS_DIFF = 1, &
100 integer,
parameter :: &
110 logical :: states_are_real
111 integer,
allocatable :: n_occ(:)
112 integer,
allocatable :: n_unocc(:)
116 integer :: el_per_state
117 character(len=80) :: trandens
118 character(len=80) :: print_exst
119 real(real64) :: weight_thresh
121 logical :: calc_forces
122 logical :: calc_forces_kernel
123 logical :: calc_forces_scf
125 type(restart_t) :: restart_load
126 type(restart_t) :: restart_dump
128 logical,
allocatable :: is_included(:,:,:)
130 type(states_pair_t),
allocatable :: pair(:)
131 integer,
allocatable :: index(:,:,:)
132 integer,
allocatable :: ind(:)
134 real(real64),
allocatable :: dmat(:,:)
135 real(real64),
allocatable :: dmat_save(:,:)
136 complex(real64),
allocatable :: zmat(:,:)
137 complex(real64),
allocatable :: zmat_save(:,:)
138 real(real64),
allocatable :: w(:)
139 real(real64),
allocatable :: dtm(:, :)
140 complex(real64),
allocatable :: ztm(:, :)
141 real(real64),
allocatable :: f(:)
142 real(real64),
allocatable :: s(:)
144 real(real64),
allocatable :: rho(:,:)
145 real(real64),
allocatable :: fxc(:,:,:)
146 real(real64) :: kernel_lrc_alpha
148 real(real64),
allocatable :: dmat2(:,:)
149 complex(real64),
allocatable :: zmat2(:,:)
150 real(real64),
allocatable :: dlr_hmat2(:,:)
151 complex(real64),
allocatable :: zlr_hmat2(:,:)
152 real(real64),
allocatable :: forces(:,:,:)
153 real(real64),
allocatable :: dw2(:)
154 real(real64),
allocatable :: zw2(:)
158 real(real64),
allocatable :: qvector(:)
159 real(real64),
allocatable :: qf(:)
160 real(real64),
allocatable :: qf_avg(:)
163 logical :: parallel_in_eh_pairs
164 logical :: parallel_in_domains
165 logical :: distributed_matrix
166 logical :: write_matrix
167 integer :: parallel_solver
168 type(mpi_grp_t) :: mpi_grp
169 logical :: fromScratch
170 logical :: has_photons
172 type(photon_mode_t),
pointer :: photon_modes => null()
174 integer :: n, nb_rows, nb_cols, block_size
175 type(blacs_proc_grid_t) :: proc_grid
176 integer :: desc(BLACS_DLEN)
177 type(MPI_Datatype) :: darray
185 real(real64),
allocatable :: dpot(:)
186 complex(real64),
allocatable :: zpot(:)
221 class(*),
intent(inout) :: system
222 logical,
intent(in) :: from_scratch
228 message(1) =
"CalculationMode = casida not implemented for multi-system calculations"
240 logical,
intent(in) :: fromscratch
244 integer :: idir, theorylevel, iatom, ierr, default_int
245 character(len=100) :: restart_filename
246 logical :: is_frac_occ
252 if (sys%hm%pcm%run_pcm)
then
256 if (sys%space%is_periodic())
then
257 message(1) =
"Casida oscillator strengths will be incorrect in periodic systems."
265 if (family_is_mgga_with_exc(sys%hm%xc))
then
278 message(1) =
'Info: Starting Casida linear-response calculation.'
286 message(1) =
"Previous gs calculation is required."
290 cas%el_per_state = sys%st%smear%el_per_state
293 cas%space_dim = sys%space%dim
294 safe_allocate(cas%n_occ(1:sys%st%nik))
295 safe_allocate(cas%n_unocc(1:sys%st%nik))
297 call states_elec_count_pairs(sys%st, sys%namespace, cas%n_pairs, cas%n_occ, cas%n_unocc, cas%is_included, is_frac_occ)
298 if (is_frac_occ)
then
303 select case (sys%st%d%ispin)
305 write(
message(1),
'(a,i4,a)')
"Info: Found", cas%n_occ(1),
" occupied states."
306 write(
message(2),
'(a,i4,a)')
"Info: Found", cas%n_unocc(1),
" unoccupied states."
309 write(
message(1),
'(a,i4,a)')
"Info: Found", cas%n_occ(1),
" occupied states with spin up."
310 write(
message(2),
'(a,i4,a)')
"Info: Found", cas%n_unocc(1),
" unoccupied states with spin up."
311 write(
message(3),
'(a,i4,a)')
"Info: Found", cas%n_occ(2),
" occupied states with spin down."
312 write(
message(4),
'(a,i4,a)')
"Info: Found", cas%n_unocc(2),
" unoccupied states with spin down."
318 message(1) =
'Info: Setting up Hamiltonian.'
320 call v_ks_h_setup(sys%namespace, sys%space, sys%gr, sys%ions, sys%ext_partners, sys%st, sys%ks, &
321 sys%hm, calc_eigenval=.false.)
362 message(1) =
"Variational and full Casida theory levels do not apply to complex wavefunctions."
369 call parse_variable(sys%namespace,
'EnablePhotons', .false., cas%has_photons)
371 if (cas%has_photons)
then
373 cas%photon_modes => sys%photons%modes
375 write(
message(1),
'(a,i7,a)')
'INFO: Solving Casida equation with ', &
376 cas%photon_modes%nmodes,
' photon modes.'
377 write(
message(2),
'(a)')
'as described in ACS Photonics 2019, 6, 11, 2757-2778.'
379 cas%pt_nmodes = cas%photon_modes%nmodes
394 call parse_variable(sys%namespace,
'CasidaTransitionDensities',
"0", cas%trandens)
396 if (cas%trandens /=
"0")
then
398 sys%outp%how, sys%outp%output_interval)
411 safe_allocate(cas%qvector(1:cas%space_dim))
412 if (
parse_block(sys%namespace,
'CasidaMomentumTransfer', blk) == 0)
then
413 do idir = 1, cas%space_dim
419 message(1) =
"Info: Calculating IXS/EELS transition rates."
435 call parse_variable(sys%namespace,
'CasidaQuadratureOrder', 5, cas%avg_order)
451 call parse_variable(sys%namespace,
'CasidaCalcTriplet', .false., cas%triplet)
453 cas%triplet = .false.
456 if (cas%triplet)
then
457 message(1) =
"Info: Using triplet kernel. Oscillator strengths will be for spin magnetic-dipole field."
470 call parse_variable(sys%namespace,
'CasidaHermitianConjugate', .false., cas%herm_conj)
485 call parse_variable(sys%namespace,
'CasidaDistributedMatrix', .false., cas%distributed_matrix)
486#ifndef HAVE_SCALAPACK
487 if (cas%distributed_matrix)
then
488 message(1) =
"ScaLAPACK layout requested, but code not compiled with ScaLAPACK"
502 call parse_variable(sys%namespace,
'CasidaWriteDistributedMatrix', .false., cas%write_matrix)
503 if (.not. cas%distributed_matrix .and. cas%write_matrix)
then
504 message(1) =
"CasidaWriteDistributedMatrix con only be used with CasidaDistributedMatrix"
522 default_int = solver_elpa
526 call parse_variable(sys%namespace,
'CasidaParallelEigensolver', default_int, cas%parallel_solver)
531 if (cas%distributed_matrix .and. cas%parallel_solver == solver_elpa)
then
532 message(1) =
"ELPA solver requested, but code not compiled with ELPA"
547 call parse_variable(sys%namespace,
'CasidaPrintExcitations',
"all", cas%print_exst)
548 if (cas%distributed_matrix)
then
550 cas%print_exst =
"none"
551 message(1) =
"Using ScaLAPACK layout, thus disabling output of excited states."
552 message(2) =
"This options creates too many files for large Casida matrices."
568 if (cas%weight_thresh >
m_one)
then
569 message(1) =
'Casida coefficients have values between 0 and 1'
570 message(2) =
'Threshold values reset to default value'
572 cas%weight_thresh = -
m_one
582 call parse_variable(sys%namespace,
'CasidaCalcForces', .false., cas%calc_forces)
583 if (cas%calc_forces)
then
593 call parse_variable(sys%namespace,
'CasidaCalcForcesKernel', .
true., cas%calc_forces_kernel)
603 call parse_variable(sys%namespace,
'CasidaCalcForcesSCF', .false., cas%calc_forces_scf)
605 if (cas%distributed_matrix)
then
606 message(1) =
"Info: Forces calculation not compatible with ScaLAPACK layout."
607 message(2) =
"Using normal layout."
609 cas%distributed_matrix = .false.
616 cas%fromScratch = fromscratch
618 if (cas%fromScratch)
then
619 if (cas%triplet)
then
620 call restart_rm(cas%restart_dump,
'kernel_triplet')
625 if (cas%calc_forces)
then
626 do iatom = 1, sys%ions%natoms
627 do idir = 1, cas%space_dim
628 write(restart_filename,
'(a,i6.6,a,i1)')
'lr_kernel_', iatom,
'_', idir
629 if (cas%triplet) restart_filename = trim(restart_filename)//
'_triplet'
630 call restart_rm(cas%restart_dump, restart_filename)
632 write(restart_filename,
'(a,i6.6,a,i1)')
'lr_hmat1_', iatom,
'_', idir
633 call restart_rm(cas%restart_dump, restart_filename)
640 if (
bitand(theorylevel, casida_eps_diff) /= 0)
then
641 message(1) =
"Info: Approximating resonance energies through KS eigenvalue differences"
643 cas%type = casida_eps_diff
647 if (sys%st%d%ispin /=
spinors)
then
651 message(1) =
"Info: Calculating matrix elements in the Tamm-Dancoff approximation"
659 message(1) =
"Info: Calculating matrix elements with the CV(2)-DFT theory"
666 message(1) =
"Info: Calculating matrix elements with the full Casida method"
675 message(1) =
"Info: Calculating resonance energies via the Petersilka approximation"
692 type(
casida_t),
intent(inout) :: cas
695 integer :: ist, ast, jpair, ik, ierr
697 integer :: np, np_rows, np_cols, ii, info
702 cas%kernel_lrc_alpha = sys%ks%xc%kernel_lrc_alpha
704 if (cas%distributed_matrix .and. .not. cas%states_are_real)
then
708 write(
message(1),
'(a,i9)')
"Number of occupied-unoccupied pairs: ", cas%n_pairs
711 if (cas%n_pairs < 1)
then
712 message(1) =
"No Casida pairs -- maybe there are no unoccupied states?"
720 if (cas%parallel_in_eh_pairs)
then
727 if (cas%distributed_matrix .and. .not. cas%parallel_in_eh_pairs)
then
728 message(1) =
"ScaLAPACK layout requested, but 'Other' parallelization strategy not available."
729 message(2) =
"Please set ParOther to use the ScaLAPACK layout."
730 message(3) =
"Continuing without ScaLAPACK layout."
732 cas%distributed_matrix = .false.
736 cas%n = cas%n_pairs + cas%pt_nmodes
739 if (cas%distributed_matrix)
then
743 np = cas%mpi_grp%size
747 if (mod(np, ii) == 0)
then
753 np_rows = np / np_cols
757 cas%block_size = min(64, cas%n / np_rows)
759 cas%block_size = max(5, cas%block_size)
760 write(
message(1),
'(A,I5,A,I5,A,I5,A)')
'Parallel layout: using block size of ',&
761 cas%block_size,
' and a processor grid with ', np_rows,
'x', np_cols, &
762 ' processors (rows x cols)'
768 cas%nb_rows = numroc(cas%n, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
769 cas%nb_cols = numroc(cas%n, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
772 call descinit(cas%desc(1), cas%n, cas%n, cas%block_size, cas%block_size, 0, 0, &
773 cas%proc_grid%context, cas%nb_rows, info)
783 safe_allocate(cas%pair(1:cas%n))
784 if (cas%states_are_real)
then
785 safe_allocate( cas%dmat(1:cas%nb_rows, 1:cas%nb_cols))
786 safe_allocate( cas%dtm(1:cas%n, 1:cas%space_dim))
789 safe_allocate( cas%zmat(1:cas%nb_rows, 1:cas%nb_cols))
790 safe_allocate( cas%ztm(1:cas%n, 1:cas%space_dim))
792 safe_allocate( cas%f(1:cas%n))
793 safe_allocate( cas%s(1:cas%n_pairs))
794 safe_allocate( cas%w(1:cas%n))
795 safe_allocate( cas%index(1:maxval(cas%n_occ), cas%nst - maxval(cas%n_unocc) + 1:cas%nst, 1:cas%nik))
796 safe_allocate( cas%ind(1:cas%n))
798 if (cas%calc_forces)
then
799 if (cas%states_are_real)
then
800 safe_allocate(cas%dmat_save(1:cas%n_pairs, 1:cas%n_pairs))
802 safe_allocate(cas%zmat_save(1:cas%n_pairs, 1:cas%n_pairs))
804 safe_allocate(cas%forces(1:cas%space_dim, 1:sys%ions%natoms, 1:cas%n_pairs))
808 safe_allocate( cas%qf (1:cas%n_pairs))
809 safe_allocate( cas%qf_avg(1:cas%n_pairs))
817 do ast = cas%n_occ(ik) + 1, cas%nst
818 do ist = 1, cas%n_occ(ik)
819 if (cas%is_included(ist, ast, ik))
then
820 cas%index(ist, ast, ik) = jpair
821 cas%pair(jpair)%i = ist
822 cas%pair(jpair)%a = ast
823 cas%pair(jpair)%kk = ik
830 if (cas%has_photons)
then
832 do ik = 1, cas%pt_nmodes
833 cas%pair(cas%n_pairs + ik)%i = 1
834 cas%pair(cas%n_pairs + ik)%a = -ik
835 cas%pair(cas%n_pairs + ik)%kk = -ik
839 safe_deallocate_a(cas%is_included)
850 type(
casida_t),
intent(inout) :: cas
854 assert(
allocated(cas%pair))
855 safe_deallocate_a(cas%pair)
856 safe_deallocate_a(cas%index)
857 if (cas%states_are_real)
then
858 safe_deallocate_a(cas%dmat)
859 safe_deallocate_a(cas%dtm)
861 safe_deallocate_a(cas%zmat)
862 safe_deallocate_a(cas%ztm)
864 safe_deallocate_a(cas%s)
865 safe_deallocate_a(cas%f)
866 safe_deallocate_a(cas%w)
867 safe_deallocate_a(cas%ind)
870 safe_deallocate_a(cas%qf)
871 safe_deallocate_a(cas%qf_avg)
874 safe_deallocate_a(cas%n_occ)
875 safe_deallocate_a(cas%n_unocc)
877 if (cas%calc_forces)
then
878 if (cas%states_are_real)
then
879 safe_deallocate_a(cas%dmat_save)
881 safe_deallocate_a(cas%zmat_save)
883 safe_deallocate_a(cas%forces)
889 if (cas%distributed_matrix)
then
895 safe_deallocate_a(cas%qvector)
906 type(
casida_t),
intent(inout) :: cas
909 class(
mesh_t),
pointer :: mesh
911 real(real64),
allocatable :: rho_spin(:, :)
912 real(real64),
allocatable :: fxc_spin(:,:,:)
913 character(len=100) :: restart_filename
918 assert(cas%type >= casida_eps_diff .and. cas%type <=
casida_casida)
925 if (cas%states_are_real)
then
940 if (cas%type /= casida_eps_diff .or. cas%calc_forces)
then
942 safe_allocate(cas%rho(1:mesh%np, 1:st%d%nspin))
943 safe_allocate(cas%fxc(1:mesh%np, 1:st%d%nspin, 1:st%d%nspin))
947 if (cas%triplet)
then
948 safe_allocate(rho_spin(1:mesh%np, 1:2))
949 safe_allocate(fxc_spin(1:mesh%np, 1:2, 1:2))
952 rho_spin(:, 1) =
m_half * cas%rho(:, 1)
953 rho_spin(:, 2) =
m_half * cas%rho(:, 1)
955 call xc_get_fxc(sys%ks%xc, mesh, sys%namespace, rho_spin,
spin_polarized, fxc_spin)
956 cas%fxc(:, 1, 1) =
m_half * (fxc_spin(:, 1, 1) - fxc_spin(:, 1, 2))
958 safe_deallocate_a(rho_spin)
959 safe_deallocate_a(fxc_spin)
961 call xc_get_fxc(sys%ks%xc, mesh, sys%namespace, cas%rho, st%d%ispin, cas%fxc)
970 restart_filename =
'kernel'
971 if (cas%triplet) restart_filename = trim(restart_filename)//
'_triplet'
973 select case (cas%type)
974 case (casida_eps_diff)
977 if (cas%states_are_real)
then
978 call dcasida_get_matrix(cas, sys%namespace, sys%hm, st, sys%ks, mesh, cas%dmat, cas%fxc, restart_filename)
981 call zcasida_get_matrix(cas, sys%namespace, sys%hm, st, sys%ks, mesh, cas%zmat, cas%fxc, restart_filename)
988 if (cas%states_are_real)
then
995 if (cas%calc_forces)
then
996 if (cas%states_are_real)
then
1003 if (cas%states_are_real)
then
1010 if (cas%type /= casida_eps_diff .or. cas%calc_forces)
then
1011 safe_deallocate_a(cas%fxc)
1012 safe_deallocate_a(cas%rho)
1023 real(real64),
allocatable :: w(:)
1030 do ia = 1, cas%n_pairs
1031 cas%w(ia) = st%eigenval(cas%pair(ia)%a, cas%pair(ia)%kk) - &
1032 st%eigenval(cas%pair(ia)%i, cas%pair(ia)%kk)
1034 message(1) =
"There is a negative unocc-occ KS eigenvalue difference for"
1035 write(
message(2),
'("states ",I5," and ",I5," of k-point ",I5,".")') cas%pair(ia)%i, cas%pair(ia)%a, cas%pair(ia)%kk
1036 message(3) =
"This indicates an inconsistency between gs, unocc, and/or casida calculations."
1042 safe_allocate(w(1:cas%n_pairs))
1044 call sort(w, cas%ind)
1045 safe_deallocate_a(w)
1055 type(
v_ks_t),
intent(in) :: ks
1057 type(
mesh_t),
intent(in) :: mesh
1058 type(
casida_t),
intent(inout) :: cas
1060 real(real64),
allocatable :: rho(:, :)
1061 real(real64),
allocatable :: fxc_sic(:,:,:)
1067 message(1) =
"Casida calculation with ADSIC not implemented for spin-polarized calculations."
1070 if (cas%triplet)
then
1071 message(1) =
"Casida calculation with ADSIC not implemented for triplet excitations."
1075 safe_allocate(fxc_sic(1:mesh%np, 1:st%d%nspin, 1:st%d%nspin))
1076 safe_allocate(rho(1:mesh%np, 1:st%d%nspin))
1078 rho = cas%rho/st%qtot
1080 call xc_get_fxc(ks%xc, mesh, namespace, rho, 1, fxc_sic)
1082 cas%fxc = cas%fxc - fxc_sic/st%qtot
1084 safe_deallocate_a(rho)
1085 safe_deallocate_a(fxc_sic)
1093 real(real64) function casida_matrix_factor(cas, sys)
1097 push_sub(casida_matrix_factor)
1099 casida_matrix_factor =
m_one
1102 casida_matrix_factor =
m_two * casida_matrix_factor
1106 casida_matrix_factor =
m_two * casida_matrix_factor
1109 pop_sub(casida_matrix_factor)
1116 type(namespace_t),
intent(in) :: namespace
1118 integer :: iunit, ia
1120 if (.not. mpi_grp_is_root(mpi_world))
return
1124 call io_mkdir(casida_dir, namespace)
1125 iunit = io_open(casida_dir//
'q'//trim(
theory_name(cas)), namespace, action=
'write')
1126 write(iunit,
'(a1,a14,1x,a24,1x,a24,1x,a10,3es15.8,a2)')
'#',
'E' ,
'|<f|exp(iq.r)|i>|^2', &
1127 '<|<f|exp(iq.r)|i>|^2>',
'; q = (',cas%qvector(1:cas%space_dim),
')'
1128 write(iunit,
'(a1,a14,1x,a24,1x,a24,1x,10x,a15)')
'#', trim(units_abbrev(units_out%energy)), &
1133 if (cas%avg_order == 0)
then
1134 do ia = 1, cas%n_pairs
1135 write(iunit,
'(es15.8,es15.8)') units_from_atomic(units_out%energy, cas%w(cas%ind(ia))), cas%qf(cas%ind(ia))
1138 do ia = 1, cas%n_pairs
1139 write(iunit,
'(3es15.8)') units_from_atomic(units_out%energy, cas%w(cas%ind(ia))), &
1140 cas%qf (cas%ind(ia)), &
1141 cas%qf_avg(cas%ind(ia))
1145 call io_close(iunit)
1152 character(len=80) pure function theory_name(cas)
1155 select case (cas%type)
1174 type(states_elec_t),
intent(in) :: st
1175 integer,
intent(in) :: ia
1176 integer,
intent(in) :: jb
1180 isnt_degenerate = (abs((st%eigenval(cas%pair(ia)%a, cas%pair(ia)%kk) - st%eigenval(cas%pair(ia)%i, cas%pair(ia)%kk)) &
1181 - (st%eigenval(cas%pair(jb)%a, cas%pair(jb)%kk) - st%eigenval(cas%pair(jb)%i, cas%pair(jb)%kk))) > 1e-8_real64)
1188 type(
casida_t),
intent(inout) :: cas
1189 integer,
intent(in) :: jb_local
1191 if (.not. cas%distributed_matrix)
then
1194#ifdef HAVE_SCALAPACK
1195 jb = indxl2g(jb_local, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
1202 type(
casida_t),
intent(inout) :: cas
1203 integer,
intent(in) :: ia_local
1205 if (.not. cas%distributed_matrix)
then
1208#ifdef HAVE_SCALAPACK
1209 ia = indxl2g(ia_local, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
1214 subroutine local_indices(cas, ia, jb, on_this_processor, ia_local, jb_local)
1217 integer,
intent(in) :: ia, jb
1218 logical,
intent(out) :: on_this_processor
1219 integer,
intent(out) :: ia_local, jb_local
1220#ifdef HAVE_SCALAPACK
1221 integer :: ia_proc, jb_proc
1224 if (.not. cas%distributed_matrix)
then
1225 on_this_processor = .
true.
1229#ifdef HAVE_SCALAPACK
1230 ia_proc = indxg2p(ia, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
1231 jb_proc = indxg2p(jb, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
1232 if (cas%proc_grid%mycol == ia_proc .and. cas%proc_grid%myrow == jb_proc)
then
1233 on_this_processor = .
true.
1234 ia_local = indxg2l(ia, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
1235 jb_local = indxg2l(jb, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
1237 on_this_processor = .false.
1247#include "casida_inc.F90"
1249#include "complex.F90"
1250#include "casida_inc.F90"
subroutine fxc_add_adsic(namespace, ks, st, mesh, cas)
subroutine solve_eps_diff
This is the common interface to a sorting routine. It performs the shell algorithm,...
double floor(double __x) __attribute__((__nothrow__
This module implements batches of mesh functions.
This module provides the BLACS processor grid.
subroutine, public blacs_proc_grid_init(this, mpi_grp, procdim)
Initializes a blacs context from an MPI communicator with topological information.
subroutine, public blacs_proc_grid_end(this)
This module handles the calculation mode.
integer, parameter, public p_strategy_kpoints
parallelization in k-points
integer, parameter, public p_strategy_other
something else like e-h pairs
integer, parameter, public p_strategy_domains
parallelization in domains
type(calc_mode_par_t), public calc_mode_par
Singleton instance of parallel calculation mode.
This module implements the Casida equations for excited states.
integer function get_global_col(cas, ia_local)
integer, parameter solver_scalapack
subroutine zoscillator_strengths(cas, mesh, st)
integer, parameter casida_petersilka
subroutine, public casida_run_init()
integer, parameter casida_casida
subroutine casida_type_init(cas, sys)
allocates stuff, and constructs the arrays pair_i and pair_j
integer function get_global_row(cas, jb_local)
integer, parameter casida_eps_diff
character(len=80) pure function theory_name(cas)
subroutine zcasida_forces(cas, sys, mesh, st)
subroutine dcasida_forces(cas, sys, mesh, st)
subroutine local_indices(cas, ia, jb, on_this_processor, ia_local, jb_local)
subroutine zcasida_solve(cas, sys)
subroutine casida_work(sys, cas)
this subroutine calculates electronic excitation energies using the matrix formulation of M....
integer, parameter casida_variational
subroutine qcasida_write(cas, namespace)
subroutine zcasida_write(cas, sys)
logical function isnt_degenerate(cas, st, ia, jb)
subroutine, public casida_run(system, from_scratch)
subroutine doscillator_strengths(cas, mesh, st)
subroutine dcasida_write(cas, sys)
real(real64) function casida_matrix_factor(cas, sys)
subroutine zcasida_get_matrix(cas, namespace, hm, st, ks, mesh, matrix, xc, restart_file, is_forces)
subroutine casida_run_legacy(sys, fromScratch)
subroutine dcasida_get_matrix(cas, namespace, hm, st, ks, mesh, matrix, xc, restart_file, is_forces)
integer, parameter casida_tamm_dancoff
subroutine casida_type_end(cas)
subroutine dcasida_solve(cas, sys)
This module implements a calculator for the density and defines related functions.
subroutine, public states_elec_total_density(st, mesh, total_rho)
This routine calculates the total electronic density.
integer, parameter, public unpolarized
Parameters...
integer, parameter, public spinors
integer, parameter, public spin_polarized
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_epsilon
real(real64), parameter, public m_half
real(real64), parameter, public m_one
subroutine, public io_function_read_what_how_when(namespace, space, what, how, output_interval, what_tag_in, how_tag_in, output_interval_tag_in, ignore_error)
integer pure function, public kpoints_number(this)
A module to handle KS potential, without the external potential.
integer, parameter, public hartree_fock
integer, parameter, public generalized_kohn_sham_dft
integer, parameter, public dft_u_none
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
subroutine, public messages_not_implemented(feature, namespace)
subroutine, public messages_warning(no_lines, all_nodes, namespace)
subroutine, public messages_obsolete_variable(namespace, name, rep)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_input_error(namespace, var, details, row, column)
subroutine, public messages_experimental(name, namespace)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
logical function mpi_grp_is_root(grp)
Is the current MPI process of grpcomm, root.
type(mpi_comm), parameter, public mpi_comm_undefined
used to indicate a communicator has not been initialized
type(mpi_grp_t), public mpi_world
subroutine mpi_grp_init(grp, comm)
Initialize MPI group instance.
This module handles the communicators for the various parallelization strategies.
logical pure function, public multicomm_strategy_is_parallel(mc, level)
This module implements the basic mulsisystem class, a container system for other systems.
integer function, public parse_block(namespace, name, blk, check_varinfo_)
subroutine, public photon_mode_set_n_electrons(this, qtot)
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
integer, parameter, public restart_casida
subroutine, public restart_rm(restart, name)
Remove directory or file "name" that is located inside the current restart directory.
integer, parameter, public restart_gs
subroutine, public restart_init(restart, namespace, data_type, type, mc, ierr, mesh, dir, exact)
Initializes a restart object.
integer, parameter, public restart_type_dump
integer, parameter, public restart_type_load
subroutine, public restart_end(restart)
This module contains interfaces for ScaLAPACK routines Interfaces are from http:
This module is intended to contain "only mathematical" functions and procedures.
pure logical function, public states_are_complex(st)
pure logical function, public states_are_real(st)
This module handles spin dimensions of the states and the k-point distribution.
subroutine, public states_elec_count_pairs(st, namespace, n_pairs, n_occ, n_unocc, is_included, is_frac_occ)
number of occupied-unoccupied pairs for Casida
This module handles reading and writing restart information for the states_elec_t.
subroutine, public states_elec_look_and_load(restart, namespace, space, st, mesh, kpoints, is_complex, packed)
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
This module defines the unit system, used for input and output.
type(unit_system_t), public units_inp
the units systems for reading and writing
type(unit_t), public unit_one
some special units required for particular quantities
This module is intended to contain simple general-purpose utility functions and procedures.
subroutine, public v_ks_h_setup(namespace, space, gr, ions, ext_partners, st, ks, hm, calc_eigenval, calc_current)
integer, parameter, public sic_adsic
Averaged density SIC.
This class contains all parameters, needed for Casida calculations.
Class describing the electron system.
Describes mesh distribution to nodes.
Container class for lists of system_oct_m::system_t.
The states_elec_t class contains all electronic wave functions.