48 use,
intrinsic :: iso_fortran_env
95 integer,
parameter :: &
96 CASIDA_EPS_DIFF = 1, &
102 integer,
parameter :: &
112 logical :: states_are_real
113 integer,
allocatable :: n_occ(:)
114 integer,
allocatable :: n_unocc(:)
118 integer :: el_per_state
119 character(len=80) :: trandens
120 character(len=80) :: print_exst
121 real(real64) :: weight_thresh
123 logical :: calc_forces
124 logical :: calc_forces_kernel
125 logical :: calc_forces_scf
127 type(restart_t) :: restart_load
128 type(restart_t) :: restart_dump
130 logical,
allocatable :: is_included(:,:,:)
132 type(states_pair_t),
allocatable :: pair(:)
133 integer,
allocatable :: index(:,:,:)
134 integer,
allocatable :: ind(:)
136 real(real64),
allocatable :: dmat(:,:)
137 real(real64),
allocatable :: dmat_save(:,:)
138 complex(real64),
allocatable :: zmat(:,:)
139 complex(real64),
allocatable :: zmat_save(:,:)
140 real(real64),
allocatable :: w(:)
141 real(real64),
allocatable :: dtm(:, :)
142 complex(real64),
allocatable :: ztm(:, :)
143 real(real64),
allocatable :: f(:)
144 real(real64),
allocatable :: s(:)
146 real(real64),
allocatable :: rho(:,:)
147 real(real64),
allocatable :: fxc(:,:,:)
148 real(real64) :: kernel_lrc_alpha
150 real(real64),
allocatable :: fxc_grad(:,:,:,:,:)
151 real(real64),
allocatable :: fxc_grad_spin(:,:,:,:)
153 real(real64),
allocatable :: dmat2(:,:)
154 complex(real64),
allocatable :: zmat2(:,:)
155 real(real64),
allocatable :: dlr_hmat2(:,:)
156 complex(real64),
allocatable :: zlr_hmat2(:,:)
157 real(real64),
allocatable :: forces(:,:,:)
158 real(real64),
allocatable :: dw2(:)
159 real(real64),
allocatable :: zw2(:)
163 real(real64),
allocatable :: qvector(:)
164 real(real64),
allocatable :: qf(:)
165 real(real64),
allocatable :: qf_avg(:)
168 logical :: parallel_in_eh_pairs
169 logical :: parallel_in_domains
170 logical :: distributed_matrix
171 logical :: write_matrix
172 integer :: parallel_solver
173 type(mpi_grp_t) :: mpi_grp
174 logical :: fromScratch
175 logical :: has_photons
177 type(photon_mode_t),
pointer :: photon_modes => null()
179 integer :: n, nb_rows, nb_cols, block_size
180 type(blacs_proc_grid_t) :: proc_grid
181 integer :: desc(BLACS_DLEN)
182 type(MPI_Datatype) :: darray
190 real(real64),
allocatable :: dpot(:)
191 complex(real64),
allocatable :: zpot(:)
197 class(*),
intent(inout) :: system
198 logical,
intent(in) :: from_scratch
204 message(1) =
"CalculationMode = casida not implemented for multi-system calculations"
216 logical,
intent(in) :: fromscratch
220 integer :: idir, theorylevel, iatom, ierr, default_int
221 character(len=100) :: restart_filename
222 logical :: is_frac_occ
228 if (sys%hm%pcm%run_pcm)
then
232 if (sys%space%is_periodic())
then
233 message(1) =
"Casida oscillator strengths will be incorrect in periodic systems."
254 message(1) =
'Info: Starting Casida linear-response calculation.'
260 call gs_restart%end()
262 message(1) =
"Previous gs calculation is required."
266 cas%el_per_state = sys%st%smear%el_per_state
269 cas%space_dim = sys%space%dim
270 safe_allocate(cas%n_occ(1:sys%st%nik))
271 safe_allocate(cas%n_unocc(1:sys%st%nik))
273 call states_elec_count_pairs(sys%st, sys%namespace, cas%n_pairs, cas%n_occ, cas%n_unocc, cas%is_included, is_frac_occ)
274 if (is_frac_occ)
then
279 select case (sys%st%d%ispin)
281 write(
message(1),
'(a,i4,a)')
"Info: Found", cas%n_occ(1),
" occupied states."
282 write(
message(2),
'(a,i4,a)')
"Info: Found", cas%n_unocc(1),
" unoccupied states."
285 write(
message(1),
'(a,i4,a)')
"Info: Found", cas%n_occ(1),
" occupied states with spin up."
286 write(
message(2),
'(a,i4,a)')
"Info: Found", cas%n_unocc(1),
" unoccupied states with spin up."
287 write(
message(3),
'(a,i4,a)')
"Info: Found", cas%n_occ(2),
" occupied states with spin down."
288 write(
message(4),
'(a,i4,a)')
"Info: Found", cas%n_unocc(2),
" unoccupied states with spin down."
294 message(1) =
'Info: Setting up Hamiltonian.'
296 call v_ks_h_setup(sys%namespace, sys%space, sys%gr, sys%ions, sys%ext_partners, sys%st, sys%ks, &
297 sys%hm, calc_eigenval=.false.)
338 message(1) =
"Variational and full Casida theory levels do not apply to complex wavefunctions."
345 call parse_variable(sys%namespace,
'EnablePhotons', .false., cas%has_photons)
347 if (cas%has_photons)
then
349 cas%photon_modes => sys%photons%modes
351 write(
message(1),
'(a,i7,a)')
'INFO: Solving Casida equation with ', &
352 cas%photon_modes%nmodes,
' photon modes.'
353 write(
message(2),
'(a)')
'as described in ACS Photonics 2019, 6, 11, 2757-2778.'
355 cas%pt_nmodes = cas%photon_modes%nmodes
370 call parse_variable(sys%namespace,
'CasidaTransitionDensities',
"0", cas%trandens)
372 if (cas%trandens /=
"0")
then
374 sys%outp%how, sys%outp%output_interval)
387 safe_allocate(cas%qvector(1:cas%space_dim))
388 if (
parse_block(sys%namespace,
'CasidaMomentumTransfer', blk) == 0)
then
389 do idir = 1, cas%space_dim
394 message(1) =
"Info: Calculating IXS/EELS transition rates."
410 call parse_variable(sys%namespace,
'CasidaQuadratureOrder', 5, cas%avg_order)
426 call parse_variable(sys%namespace,
'CasidaCalcTriplet', .false., cas%triplet)
428 cas%triplet = .false.
431 if (cas%triplet)
then
432 message(1) =
"Info: Using triplet kernel. Oscillator strengths will be for spin magnetic-dipole field."
445 call parse_variable(sys%namespace,
'CasidaHermitianConjugate', .false., cas%herm_conj)
460 call parse_variable(sys%namespace,
'CasidaDistributedMatrix', .false., cas%distributed_matrix)
461#ifndef HAVE_SCALAPACK
462 if (cas%distributed_matrix)
then
463 message(1) =
"ScaLAPACK layout requested, but code not compiled with ScaLAPACK"
477 call parse_variable(sys%namespace,
'CasidaWriteDistributedMatrix', .false., cas%write_matrix)
478 if (.not. cas%distributed_matrix .and. cas%write_matrix)
then
479 message(1) =
"CasidaWriteDistributedMatrix con only be used with CasidaDistributedMatrix"
497 default_int = solver_elpa
501 call parse_variable(sys%namespace,
'CasidaParallelEigensolver', default_int, cas%parallel_solver)
506 if (cas%distributed_matrix .and. cas%parallel_solver == solver_elpa)
then
507 message(1) =
"ELPA solver requested, but code not compiled with ELPA"
522 call parse_variable(sys%namespace,
'CasidaPrintExcitations',
"all", cas%print_exst)
523 if (cas%distributed_matrix)
then
525 cas%print_exst =
"none"
526 message(1) =
"Using ScaLAPACK layout, thus disabling output of excited states."
527 message(2) =
"This options creates too many files for large Casida matrices."
543 if (cas%weight_thresh >
m_one)
then
544 message(1) =
'Casida coefficients have values between 0 and 1'
545 message(2) =
'Threshold values reset to default value'
547 cas%weight_thresh = -
m_one
557 call parse_variable(sys%namespace,
'CasidaCalcForces', .false., cas%calc_forces)
558 if (cas%calc_forces)
then
568 call parse_variable(sys%namespace,
'CasidaCalcForcesKernel', .
true., cas%calc_forces_kernel)
578 call parse_variable(sys%namespace,
'CasidaCalcForcesSCF', .false., cas%calc_forces_scf)
580 if (cas%distributed_matrix)
then
581 message(1) =
"Info: Forces calculation not compatible with ScaLAPACK layout."
582 message(2) =
"Using normal layout."
584 cas%distributed_matrix = .false.
591 cas%fromScratch = fromscratch
593 if (cas%fromScratch)
then
594 if (cas%triplet)
then
595 call cas%restart_dump%rm(
'kernel_triplet')
597 call cas%restart_dump%rm(
'kernel')
600 if (cas%calc_forces)
then
601 do iatom = 1, sys%ions%natoms
602 do idir = 1, cas%space_dim
603 write(restart_filename,
'(a,i6.6,a,i1)')
'lr_kernel_', iatom,
'_', idir
604 if (cas%triplet) restart_filename = trim(restart_filename)//
'_triplet'
605 call cas%restart_dump%rm(restart_filename)
607 write(restart_filename,
'(a,i6.6,a,i1)')
'lr_hmat1_', iatom,
'_', idir
608 call cas%restart_dump%rm(restart_filename)
615 if (
bitand(theorylevel, casida_eps_diff) /= 0)
then
616 message(1) =
"Info: Approximating resonance energies through KS eigenvalue differences"
618 cas%type = casida_eps_diff
622 if (sys%st%d%ispin /=
spinors)
then
626 message(1) =
"Info: Calculating matrix elements in the Tamm-Dancoff approximation"
634 message(1) =
"Info: Calculating matrix elements with the CV(2)-DFT theory"
641 message(1) =
"Info: Calculating matrix elements with the full Casida method"
650 message(1) =
"Info: Calculating resonance energies via the Petersilka approximation"
667 type(
casida_t),
intent(inout) :: cas
670 integer :: ist, ast, jpair, ik, ierr
672 integer :: np, np_rows, np_cols, ii, info
677 cas%kernel_lrc_alpha = sys%ks%xc%kernel_lrc_alpha
679 if (cas%distributed_matrix .and. .not. cas%states_are_real)
then
683 write(
message(1),
'(a,i9)')
"Number of occupied-unoccupied pairs: ", cas%n_pairs
686 if (cas%n_pairs < 1)
then
687 message(1) =
"No Casida pairs -- maybe there are no unoccupied states?"
691 if (
mpi_world%is_root())
write(*,
"(1x)")
695 if (cas%parallel_in_eh_pairs)
then
702 if (cas%distributed_matrix .and. .not. cas%parallel_in_eh_pairs)
then
703 message(1) =
"ScaLAPACK layout requested, but 'Other' parallelization strategy not available."
704 message(2) =
"Please set ParOther to use the ScaLAPACK layout."
705 message(3) =
"Continuing without ScaLAPACK layout."
707 cas%distributed_matrix = .false.
711 cas%n = cas%n_pairs + cas%pt_nmodes
714 if (cas%distributed_matrix)
then
718 np = cas%mpi_grp%size
722 if (mod(np, ii) == 0)
then
728 np_rows = np / np_cols
732 cas%block_size = min(64, cas%n / np_rows)
734 cas%block_size = max(5, cas%block_size)
735 write(
message(1),
'(A,I5,A,I5,A,I5,A)')
'Parallel layout: using block size of ',&
736 cas%block_size,
' and a processor grid with ', np_rows,
'x', np_cols, &
737 ' processors (rows x cols)'
743 cas%nb_rows = numroc(cas%n, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
744 cas%nb_cols = numroc(cas%n, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
747 call descinit(cas%desc(1), cas%n, cas%n, cas%block_size, cas%block_size, 0, 0, &
748 cas%proc_grid%context, cas%nb_rows, info)
758 safe_allocate(cas%pair(1:cas%n))
759 if (cas%states_are_real)
then
760 safe_allocate( cas%dmat(1:cas%nb_rows, 1:cas%nb_cols))
761 safe_allocate( cas%dtm(1:cas%n, 1:cas%space_dim))
764 safe_allocate( cas%zmat(1:cas%nb_rows, 1:cas%nb_cols))
765 safe_allocate( cas%ztm(1:cas%n, 1:cas%space_dim))
767 safe_allocate( cas%f(1:cas%n))
768 safe_allocate( cas%s(1:cas%n_pairs))
769 safe_allocate( cas%w(1:cas%n))
770 safe_allocate( cas%index(1:maxval(cas%n_occ), cas%nst - maxval(cas%n_unocc) + 1:cas%nst, 1:cas%nik))
771 safe_allocate( cas%ind(1:cas%n))
773 if (cas%calc_forces)
then
774 if (cas%states_are_real)
then
775 safe_allocate(cas%dmat_save(1:cas%n_pairs, 1:cas%n_pairs))
777 safe_allocate(cas%zmat_save(1:cas%n_pairs, 1:cas%n_pairs))
779 safe_allocate(cas%forces(1:cas%space_dim, 1:sys%ions%natoms, 1:cas%n_pairs))
783 safe_allocate( cas%qf (1:cas%n_pairs))
784 safe_allocate( cas%qf_avg(1:cas%n_pairs))
792 do ast = cas%n_occ(ik) + 1, cas%nst
793 do ist = 1, cas%n_occ(ik)
794 if (cas%is_included(ist, ast, ik))
then
795 cas%index(ist, ast, ik) = jpair
796 cas%pair(jpair)%i = ist
797 cas%pair(jpair)%a = ast
798 cas%pair(jpair)%kk = ik
805 if (cas%has_photons)
then
807 do ik = 1, cas%pt_nmodes
808 cas%pair(cas%n_pairs + ik)%i = 1
809 cas%pair(cas%n_pairs + ik)%a = -ik
810 cas%pair(cas%n_pairs + ik)%kk = -ik
814 safe_deallocate_a(cas%is_included)
825 type(
casida_t),
intent(inout) :: cas
829 assert(
allocated(cas%pair))
830 safe_deallocate_a(cas%pair)
831 safe_deallocate_a(cas%index)
832 if (cas%states_are_real)
then
833 safe_deallocate_a(cas%dmat)
834 safe_deallocate_a(cas%dtm)
836 safe_deallocate_a(cas%zmat)
837 safe_deallocate_a(cas%ztm)
839 safe_deallocate_a(cas%s)
840 safe_deallocate_a(cas%f)
841 safe_deallocate_a(cas%w)
842 safe_deallocate_a(cas%ind)
845 safe_deallocate_a(cas%qf)
846 safe_deallocate_a(cas%qf_avg)
849 safe_deallocate_a(cas%n_occ)
850 safe_deallocate_a(cas%n_unocc)
852 if (cas%calc_forces)
then
853 if (cas%states_are_real)
then
854 safe_deallocate_a(cas%dmat_save)
856 safe_deallocate_a(cas%zmat_save)
858 safe_deallocate_a(cas%forces)
861 call cas%restart_dump%end()
862 call cas%restart_load%end()
864 if (cas%distributed_matrix)
then
870 safe_deallocate_a(cas%qvector)
881 type(
casida_t),
intent(inout) :: cas
884 type(
grid_t),
pointer :: gr
886 real(real64),
allocatable :: rho_spin(:, :)
887 real(real64),
allocatable :: fxc_spin(:,:,:)
888 character(len=100) :: restart_filename
893 assert(cas%type >= casida_eps_diff .and. cas%type <=
casida_casida)
900 if (cas%states_are_real)
then
915 if (cas%type /= casida_eps_diff .or. cas%calc_forces)
then
917 safe_allocate(cas%rho(1:gr%np_part, 1:st%d%nspin))
918 safe_allocate(cas%fxc(1:gr%np, 1:st%d%nspin, 1:st%d%nspin))
919 cas%gga =
in_family(sys%ks%xc%family, [xc_family_gga])
921 safe_allocate(cas%fxc_grad(1:gr%np, 1:gr%der%dim, 1:gr%der%dim, 1:st%d%nspin, 1:st%d%nspin))
923 safe_allocate(cas%fxc_grad_spin(1:gr%np, 1:gr%der%dim, 1:st%d%nspin, 1:st%d%nspin))
925 safe_allocate(cas%fxc_grad_spin(0, 0, 0, 0))
928 safe_allocate(cas%fxc_grad(0, 0, 0, 0, 0))
929 safe_allocate(cas%fxc_grad_spin(0, 0, 0, 0))
933 if (cas%triplet)
then
934 safe_allocate(rho_spin(1:gr%np_part, 1:2))
935 safe_allocate(fxc_spin(1:gr%np, 1:2, 1:2))
937 rho_spin(:, 1) =
m_half * cas%rho(:, 1)
938 rho_spin(:, 2) =
m_half * cas%rho(:, 1)
941 cas%fxc(:, 1, 1) =
m_half * (fxc_spin(:, 1, 1) - fxc_spin(:, 1, 2))
943 safe_deallocate_a(rho_spin)
944 safe_deallocate_a(fxc_spin)
947 call xc_get_fxc(sys%ks%xc, gr, sys%namespace, cas%rho, st%d%ispin, cas%fxc, cas%fxc_grad, &
950 call xc_get_fxc(sys%ks%xc, gr, sys%namespace, cas%rho, st%d%ispin, cas%fxc)
960 restart_filename =
'kernel'
961 if (cas%triplet) restart_filename = trim(restart_filename)//
'_triplet'
963 select case (cas%type)
964 case (casida_eps_diff)
967 if (cas%states_are_real)
then
968 call dcasida_get_matrix(cas, sys%namespace, sys%hm, st, sys%ks, gr, cas%dmat, cas%fxc, &
969 cas%fxc_grad, cas%fxc_grad_spin, restart_filename)
972 call zcasida_get_matrix(cas, sys%namespace, sys%hm, st, sys%ks, gr, cas%zmat, cas%fxc, &
973 cas%fxc_grad, cas%fxc_grad_spin, restart_filename)
979 if (cas%mpi_grp%is_root() .or. cas%distributed_matrix)
then
980 if (cas%states_are_real)
then
987 if (cas%calc_forces)
then
988 if (cas%states_are_real)
then
995 if (cas%states_are_real)
then
1002 if (cas%type /= casida_eps_diff .or. cas%calc_forces)
then
1003 safe_deallocate_a(cas%fxc)
1004 safe_deallocate_a(cas%fxc_grad)
1005 safe_deallocate_a(cas%fxc_grad_spin)
1006 safe_deallocate_a(cas%rho)
1017 real(real64),
allocatable :: w(:)
1024 do ia = 1, cas%n_pairs
1025 cas%w(ia) = st%eigenval(cas%pair(ia)%a, cas%pair(ia)%kk) - &
1026 st%eigenval(cas%pair(ia)%i, cas%pair(ia)%kk)
1028 message(1) =
"There is a negative unocc-occ KS eigenvalue difference for"
1029 write(
message(2),
'("states ",I5," and ",I5," of k-point ",I5,".")') cas%pair(ia)%i, cas%pair(ia)%a, cas%pair(ia)%kk
1030 message(3) =
"This indicates an inconsistency between gs, unocc, and/or casida calculations."
1036 safe_allocate(w(1:cas%n_pairs))
1038 call sort(w, cas%ind)
1039 safe_deallocate_a(w)
1041 if (
mpi_world%is_root())
write(*,
"(1x)")
1049 type(
v_ks_t),
intent(in) :: ks
1051 type(
grid_t),
intent(in) :: gr
1052 type(
casida_t),
intent(inout) :: cas
1054 real(real64),
allocatable :: rho(:, :)
1055 real(real64),
allocatable :: fxc_sic(:,:,:)
1061 message(1) =
"Casida calculation with ADSIC not implemented for spin-polarized calculations."
1064 if (cas%triplet)
then
1065 message(1) =
"Casida calculation with ADSIC not implemented for triplet excitations."
1069 message(1) =
"Casida calculation with ADSIC not implemented with GGAs."
1073 safe_allocate(fxc_sic(1:gr%np, 1:st%d%nspin, 1:st%d%nspin))
1074 safe_allocate(rho(1:gr%np, 1:st%d%nspin))
1075 rho = cas%rho/st%qtot
1077 call xc_get_fxc(ks%xc, gr, namespace, rho, 1, fxc_sic)
1079 cas%fxc = cas%fxc - fxc_sic/st%qtot
1081 safe_deallocate_a(rho)
1082 safe_deallocate_a(fxc_sic)
1090 real(real64) function casida_matrix_factor(cas, sys)
1094 push_sub(casida_matrix_factor)
1096 casida_matrix_factor =
m_one
1099 casida_matrix_factor =
m_two * casida_matrix_factor
1103 casida_matrix_factor =
m_two * casida_matrix_factor
1106 pop_sub(casida_matrix_factor)
1113 type(namespace_t),
intent(in) :: namespace
1115 integer :: iunit, ia
1117 if (.not. mpi_world%is_root())
return
1121 call io_mkdir(casida_dir, namespace)
1122 iunit = io_open(casida_dir//
'q'//trim(
theory_name(cas)), namespace, action=
'write')
1123 write(iunit,
'(a1,a14,1x,a24,1x,a24,1x,a10,3es15.8,a2)')
'#',
'E' ,
'|<f|exp(iq.r)|i>|^2', &
1124 '<|<f|exp(iq.r)|i>|^2>',
'; q = (',cas%qvector(1:cas%space_dim),
')'
1125 write(iunit,
'(a1,a14,1x,a24,1x,a24,1x,10x,a15)')
'#', trim(units_abbrev(units_out%energy)), &
1130 if (cas%avg_order == 0)
then
1131 do ia = 1, cas%n_pairs
1132 write(iunit,
'(es15.8,es15.8)') units_from_atomic(units_out%energy, cas%w(cas%ind(ia))), cas%qf(cas%ind(ia))
1135 do ia = 1, cas%n_pairs
1136 write(iunit,
'(3es15.8)') units_from_atomic(units_out%energy, cas%w(cas%ind(ia))), &
1137 cas%qf (cas%ind(ia)), &
1138 cas%qf_avg(cas%ind(ia))
1142 call io_close(iunit)
1149 character(len=80) pure function theory_name(cas)
1152 select case (cas%type)
1171 type(states_elec_t),
intent(in) :: st
1172 integer,
intent(in) :: ia
1173 integer,
intent(in) :: jb
1177 isnt_degenerate = (abs((st%eigenval(cas%pair(ia)%a, cas%pair(ia)%kk) - st%eigenval(cas%pair(ia)%i, cas%pair(ia)%kk)) &
1178 - (st%eigenval(cas%pair(jb)%a, cas%pair(jb)%kk) - st%eigenval(cas%pair(jb)%i, cas%pair(jb)%kk))) > 1e-8_real64)
1185 type(
casida_t),
intent(inout) :: cas
1186 integer,
intent(in) :: jb_local
1188 if (.not. cas%distributed_matrix)
then
1191#ifdef HAVE_SCALAPACK
1192 jb = indxl2g(jb_local, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
1199 type(
casida_t),
intent(inout) :: cas
1200 integer,
intent(in) :: ia_local
1202 if (.not. cas%distributed_matrix)
then
1205#ifdef HAVE_SCALAPACK
1206 ia = indxl2g(ia_local, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
1211 subroutine local_indices(cas, ia, jb, on_this_processor, ia_local, jb_local)
1214 integer,
intent(in) :: ia, jb
1215 logical,
intent(out) :: on_this_processor
1216 integer,
intent(out) :: ia_local, jb_local
1217#ifdef HAVE_SCALAPACK
1218 integer :: ia_proc, jb_proc
1221 if (.not. cas%distributed_matrix)
then
1222 on_this_processor = .
true.
1226#ifdef HAVE_SCALAPACK
1227 ia_proc = indxg2p(ia, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
1228 jb_proc = indxg2p(jb, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
1229 if (cas%proc_grid%mycol == ia_proc .and. cas%proc_grid%myrow == jb_proc)
then
1231 ia_local = indxg2l(ia, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
1232 jb_local = indxg2l(jb, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
1234 on_this_processor = .false.
1244#include "casida_inc.F90"
1246#include "complex.F90"
1247#include "casida_inc.F90"
subroutine fxc_add_adsic(namespace, ks, st, gr, 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_other
something else like e-h pairs
integer, parameter, public p_strategy_domains
parallelization in domains
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
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 dcasida_forces(cas, sys, gr, st)
subroutine dcasida_get_matrix(cas, namespace, hm, st, ks, gr, matrix, fxc, fxc_grad, fxc_grad_spin, restart_file, is_forces)
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....
subroutine zcasida_get_matrix(cas, namespace, hm, st, ks, gr, matrix, fxc, fxc_grad, fxc_grad_spin, restart_file, is_forces)
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 casida_run_legacy(sys, fromScratch)
integer, parameter casida_tamm_dancoff
subroutine zcasida_forces(cas, sys, gr, st)
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.
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
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
This module implements the underlying real-space grid.
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)
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
integer, parameter, public restart_gs
integer, parameter, public restart_type_dump
integer, parameter, public restart_type_load
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.
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)
logical pure function, public family_is_mgga_with_exc(xcs)
Is the xc function part of the mGGA family with an energy functional.
subroutine, public xc_get_fxc(xcs, gr, namespace, rho, ispin, fxc, fxc_grad, fxc_grad_spin)
Returns the exchange-correlation kernel.
pure logical function, public in_family(family, xc_families)
integer, parameter, public sic_adsic
Averaged density SIC.
This class contains all parameters, needed for Casida calculations.
Class describing the electron system.
Description of the grid, containing information on derivatives, stencil, and symmetries.
Container class for lists of system_oct_m::system_t.
The states_elec_t class contains all electronic wave functions.