48 use,
intrinsic :: iso_fortran_env
97 integer,
parameter :: &
98 CASIDA_EPS_DIFF = 1, &
104 integer,
parameter :: &
114 logical :: states_are_real
115 integer,
allocatable :: n_occ(:)
116 integer,
allocatable :: n_unocc(:)
120 integer :: el_per_state
121 character(len=80) :: trandens
122 character(len=80) :: print_exst
123 real(real64) :: weight_thresh
125 logical :: calc_forces
126 logical :: calc_forces_kernel
127 logical :: calc_forces_scf
129 type(restart_t) :: restart_load
130 type(restart_t) :: restart_dump
132 logical,
allocatable :: is_included(:,:,:)
134 type(states_pair_t),
allocatable :: pair(:)
135 integer,
allocatable :: index(:,:,:)
136 integer,
allocatable :: ind(:)
138 real(real64),
allocatable :: dmat(:,:)
139 real(real64),
allocatable :: dmat_save(:,:)
140 complex(real64),
allocatable :: zmat(:,:)
141 complex(real64),
allocatable :: zmat_save(:,:)
142 real(real64),
allocatable :: w(:)
143 real(real64),
allocatable :: dtm(:, :)
144 complex(real64),
allocatable :: ztm(:, :)
145 real(real64),
allocatable :: f(:)
146 real(real64),
allocatable :: s(:)
148 real(real64),
allocatable :: rho(:,:)
149 real(real64),
allocatable :: fxc(:,:,:)
150 real(real64) :: kernel_lrc_alpha
152 real(real64),
allocatable :: fxc_grad(:,:,:,:,:)
153 real(real64),
allocatable :: fxc_grad_spin(:,:,:,:)
155 real(real64),
allocatable :: dmat2(:,:)
156 complex(real64),
allocatable :: zmat2(:,:)
157 real(real64),
allocatable :: dlr_hmat2(:,:)
158 complex(real64),
allocatable :: zlr_hmat2(:,:)
159 real(real64),
allocatable :: forces(:,:,:)
160 real(real64),
allocatable :: dw2(:)
161 real(real64),
allocatable :: zw2(:)
165 real(real64),
allocatable :: qvector(:)
166 real(real64),
allocatable :: qf(:)
167 real(real64),
allocatable :: qf_avg(:)
170 logical :: parallel_in_eh_pairs
171 logical :: parallel_in_domains
172 logical :: distributed_matrix
173 logical :: write_matrix
174 integer :: parallel_solver
175 type(mpi_grp_t) :: mpi_grp
176 logical :: fromScratch
177 logical :: has_photons
179 type(photon_mode_t),
pointer :: photon_modes => null()
181 integer :: n, nb_rows, nb_cols, block_size
182 type(blacs_proc_grid_t) :: proc_grid
183 integer :: desc(BLACS_DLEN)
184 type(MPI_Datatype) :: darray
192 real(real64),
allocatable :: dpot(:)
193 complex(real64),
allocatable :: zpot(:)
228 class(*),
intent(inout) :: system
229 logical,
intent(in) :: from_scratch
235 message(1) =
"CalculationMode = casida not implemented for multi-system calculations"
247 logical,
intent(in) :: fromscratch
251 integer :: idir, theorylevel, iatom, ierr, default_int
252 character(len=100) :: restart_filename
253 logical :: is_frac_occ
259 if (sys%hm%pcm%run_pcm)
then
263 if (sys%space%is_periodic())
then
264 message(1) =
"Casida oscillator strengths will be incorrect in periodic systems."
285 message(1) =
'Info: Starting Casida linear-response calculation.'
293 message(1) =
"Previous gs calculation is required."
297 cas%el_per_state = sys%st%smear%el_per_state
300 cas%space_dim = sys%space%dim
301 safe_allocate(cas%n_occ(1:sys%st%nik))
302 safe_allocate(cas%n_unocc(1:sys%st%nik))
304 call states_elec_count_pairs(sys%st, sys%namespace, cas%n_pairs, cas%n_occ, cas%n_unocc, cas%is_included, is_frac_occ)
305 if (is_frac_occ)
then
310 select case (sys%st%d%ispin)
312 write(
message(1),
'(a,i4,a)')
"Info: Found", cas%n_occ(1),
" occupied states."
313 write(
message(2),
'(a,i4,a)')
"Info: Found", cas%n_unocc(1),
" unoccupied states."
316 write(
message(1),
'(a,i4,a)')
"Info: Found", cas%n_occ(1),
" occupied states with spin up."
317 write(
message(2),
'(a,i4,a)')
"Info: Found", cas%n_unocc(1),
" unoccupied states with spin up."
318 write(
message(3),
'(a,i4,a)')
"Info: Found", cas%n_occ(2),
" occupied states with spin down."
319 write(
message(4),
'(a,i4,a)')
"Info: Found", cas%n_unocc(2),
" unoccupied states with spin down."
325 message(1) =
'Info: Setting up Hamiltonian.'
327 call v_ks_h_setup(sys%namespace, sys%space, sys%gr, sys%ions, sys%ext_partners, sys%st, sys%ks, &
328 sys%hm, calc_eigenval=.false.)
369 message(1) =
"Variational and full Casida theory levels do not apply to complex wavefunctions."
376 call parse_variable(sys%namespace,
'EnablePhotons', .false., cas%has_photons)
378 if (cas%has_photons)
then
380 cas%photon_modes => sys%photons%modes
382 write(
message(1),
'(a,i7,a)')
'INFO: Solving Casida equation with ', &
383 cas%photon_modes%nmodes,
' photon modes.'
384 write(
message(2),
'(a)')
'as described in ACS Photonics 2019, 6, 11, 2757-2778.'
386 cas%pt_nmodes = cas%photon_modes%nmodes
401 call parse_variable(sys%namespace,
'CasidaTransitionDensities',
"0", cas%trandens)
403 if (cas%trandens /=
"0")
then
405 sys%outp%how, sys%outp%output_interval)
418 safe_allocate(cas%qvector(1:cas%space_dim))
419 if (
parse_block(sys%namespace,
'CasidaMomentumTransfer', blk) == 0)
then
420 do idir = 1, cas%space_dim
426 message(1) =
"Info: Calculating IXS/EELS transition rates."
442 call parse_variable(sys%namespace,
'CasidaQuadratureOrder', 5, cas%avg_order)
458 call parse_variable(sys%namespace,
'CasidaCalcTriplet', .false., cas%triplet)
460 cas%triplet = .false.
463 if (cas%triplet)
then
464 message(1) =
"Info: Using triplet kernel. Oscillator strengths will be for spin magnetic-dipole field."
477 call parse_variable(sys%namespace,
'CasidaHermitianConjugate', .false., cas%herm_conj)
492 call parse_variable(sys%namespace,
'CasidaDistributedMatrix', .false., cas%distributed_matrix)
493#ifndef HAVE_SCALAPACK
494 if (cas%distributed_matrix)
then
495 message(1) =
"ScaLAPACK layout requested, but code not compiled with ScaLAPACK"
509 call parse_variable(sys%namespace,
'CasidaWriteDistributedMatrix', .false., cas%write_matrix)
510 if (.not. cas%distributed_matrix .and. cas%write_matrix)
then
511 message(1) =
"CasidaWriteDistributedMatrix con only be used with CasidaDistributedMatrix"
529 default_int = solver_elpa
533 call parse_variable(sys%namespace,
'CasidaParallelEigensolver', default_int, cas%parallel_solver)
538 if (cas%distributed_matrix .and. cas%parallel_solver == solver_elpa)
then
539 message(1) =
"ELPA solver requested, but code not compiled with ELPA"
554 call parse_variable(sys%namespace,
'CasidaPrintExcitations',
"all", cas%print_exst)
555 if (cas%distributed_matrix)
then
557 cas%print_exst =
"none"
558 message(1) =
"Using ScaLAPACK layout, thus disabling output of excited states."
559 message(2) =
"This options creates too many files for large Casida matrices."
575 if (cas%weight_thresh >
m_one)
then
576 message(1) =
'Casida coefficients have values between 0 and 1'
577 message(2) =
'Threshold values reset to default value'
579 cas%weight_thresh = -
m_one
589 call parse_variable(sys%namespace,
'CasidaCalcForces', .false., cas%calc_forces)
590 if (cas%calc_forces)
then
600 call parse_variable(sys%namespace,
'CasidaCalcForcesKernel', .
true., cas%calc_forces_kernel)
610 call parse_variable(sys%namespace,
'CasidaCalcForcesSCF', .false., cas%calc_forces_scf)
612 if (cas%distributed_matrix)
then
613 message(1) =
"Info: Forces calculation not compatible with ScaLAPACK layout."
614 message(2) =
"Using normal layout."
616 cas%distributed_matrix = .false.
623 cas%fromScratch = fromscratch
625 if (cas%fromScratch)
then
626 if (cas%triplet)
then
627 call restart_rm(cas%restart_dump,
'kernel_triplet')
632 if (cas%calc_forces)
then
633 do iatom = 1, sys%ions%natoms
634 do idir = 1, cas%space_dim
635 write(restart_filename,
'(a,i6.6,a,i1)')
'lr_kernel_', iatom,
'_', idir
636 if (cas%triplet) restart_filename = trim(restart_filename)//
'_triplet'
637 call restart_rm(cas%restart_dump, restart_filename)
639 write(restart_filename,
'(a,i6.6,a,i1)')
'lr_hmat1_', iatom,
'_', idir
640 call restart_rm(cas%restart_dump, restart_filename)
647 if (
bitand(theorylevel, casida_eps_diff) /= 0)
then
648 message(1) =
"Info: Approximating resonance energies through KS eigenvalue differences"
650 cas%type = casida_eps_diff
654 if (sys%st%d%ispin /=
spinors)
then
658 message(1) =
"Info: Calculating matrix elements in the Tamm-Dancoff approximation"
666 message(1) =
"Info: Calculating matrix elements with the CV(2)-DFT theory"
673 message(1) =
"Info: Calculating matrix elements with the full Casida method"
682 message(1) =
"Info: Calculating resonance energies via the Petersilka approximation"
699 type(
casida_t),
intent(inout) :: cas
702 integer :: ist, ast, jpair, ik, ierr
704 integer :: np, np_rows, np_cols, ii, info
709 cas%kernel_lrc_alpha = sys%ks%xc%kernel_lrc_alpha
711 if (cas%distributed_matrix .and. .not. cas%states_are_real)
then
715 write(
message(1),
'(a,i9)')
"Number of occupied-unoccupied pairs: ", cas%n_pairs
718 if (cas%n_pairs < 1)
then
719 message(1) =
"No Casida pairs -- maybe there are no unoccupied states?"
727 if (cas%parallel_in_eh_pairs)
then
734 if (cas%distributed_matrix .and. .not. cas%parallel_in_eh_pairs)
then
735 message(1) =
"ScaLAPACK layout requested, but 'Other' parallelization strategy not available."
736 message(2) =
"Please set ParOther to use the ScaLAPACK layout."
737 message(3) =
"Continuing without ScaLAPACK layout."
739 cas%distributed_matrix = .false.
743 cas%n = cas%n_pairs + cas%pt_nmodes
746 if (cas%distributed_matrix)
then
750 np = cas%mpi_grp%size
754 if (mod(np, ii) == 0)
then
760 np_rows = np / np_cols
764 cas%block_size = min(64, cas%n / np_rows)
766 cas%block_size = max(5, cas%block_size)
767 write(
message(1),
'(A,I5,A,I5,A,I5,A)')
'Parallel layout: using block size of ',&
768 cas%block_size,
' and a processor grid with ', np_rows,
'x', np_cols, &
769 ' processors (rows x cols)'
775 cas%nb_rows = numroc(cas%n, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
776 cas%nb_cols = numroc(cas%n, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
779 call descinit(cas%desc(1), cas%n, cas%n, cas%block_size, cas%block_size, 0, 0, &
780 cas%proc_grid%context, cas%nb_rows, info)
790 safe_allocate(cas%pair(1:cas%n))
791 if (cas%states_are_real)
then
792 safe_allocate( cas%dmat(1:cas%nb_rows, 1:cas%nb_cols))
793 safe_allocate( cas%dtm(1:cas%n, 1:cas%space_dim))
796 safe_allocate( cas%zmat(1:cas%nb_rows, 1:cas%nb_cols))
797 safe_allocate( cas%ztm(1:cas%n, 1:cas%space_dim))
799 safe_allocate( cas%f(1:cas%n))
800 safe_allocate( cas%s(1:cas%n_pairs))
801 safe_allocate( cas%w(1:cas%n))
802 safe_allocate( cas%index(1:maxval(cas%n_occ), cas%nst - maxval(cas%n_unocc) + 1:cas%nst, 1:cas%nik))
803 safe_allocate( cas%ind(1:cas%n))
805 if (cas%calc_forces)
then
806 if (cas%states_are_real)
then
807 safe_allocate(cas%dmat_save(1:cas%n_pairs, 1:cas%n_pairs))
809 safe_allocate(cas%zmat_save(1:cas%n_pairs, 1:cas%n_pairs))
811 safe_allocate(cas%forces(1:cas%space_dim, 1:sys%ions%natoms, 1:cas%n_pairs))
815 safe_allocate( cas%qf (1:cas%n_pairs))
816 safe_allocate( cas%qf_avg(1:cas%n_pairs))
824 do ast = cas%n_occ(ik) + 1, cas%nst
825 do ist = 1, cas%n_occ(ik)
826 if (cas%is_included(ist, ast, ik))
then
827 cas%index(ist, ast, ik) = jpair
828 cas%pair(jpair)%i = ist
829 cas%pair(jpair)%a = ast
830 cas%pair(jpair)%kk = ik
837 if (cas%has_photons)
then
839 do ik = 1, cas%pt_nmodes
840 cas%pair(cas%n_pairs + ik)%i = 1
841 cas%pair(cas%n_pairs + ik)%a = -ik
842 cas%pair(cas%n_pairs + ik)%kk = -ik
846 safe_deallocate_a(cas%is_included)
857 type(
casida_t),
intent(inout) :: cas
861 assert(
allocated(cas%pair))
862 safe_deallocate_a(cas%pair)
863 safe_deallocate_a(cas%index)
864 if (cas%states_are_real)
then
865 safe_deallocate_a(cas%dmat)
866 safe_deallocate_a(cas%dtm)
868 safe_deallocate_a(cas%zmat)
869 safe_deallocate_a(cas%ztm)
871 safe_deallocate_a(cas%s)
872 safe_deallocate_a(cas%f)
873 safe_deallocate_a(cas%w)
874 safe_deallocate_a(cas%ind)
877 safe_deallocate_a(cas%qf)
878 safe_deallocate_a(cas%qf_avg)
881 safe_deallocate_a(cas%n_occ)
882 safe_deallocate_a(cas%n_unocc)
884 if (cas%calc_forces)
then
885 if (cas%states_are_real)
then
886 safe_deallocate_a(cas%dmat_save)
888 safe_deallocate_a(cas%zmat_save)
890 safe_deallocate_a(cas%forces)
896 if (cas%distributed_matrix)
then
902 safe_deallocate_a(cas%qvector)
913 type(
casida_t),
intent(inout) :: cas
916 type(
grid_t),
pointer :: gr
918 real(real64),
allocatable :: rho_spin(:, :)
919 real(real64),
allocatable :: fxc_spin(:,:,:)
920 character(len=100) :: restart_filename
925 assert(cas%type >= casida_eps_diff .and. cas%type <=
casida_casida)
932 if (cas%states_are_real)
then
947 if (cas%type /= casida_eps_diff .or. cas%calc_forces)
then
949 safe_allocate(cas%rho(1:gr%np_part, 1:st%d%nspin))
950 safe_allocate(cas%fxc(1:gr%np, 1:st%d%nspin, 1:st%d%nspin))
951 cas%gga =
in_family(sys%ks%xc%family, [xc_family_gga])
953 safe_allocate(cas%fxc_grad(1:gr%np, 1:gr%der%dim, 1:gr%der%dim, 1:st%d%nspin, 1:st%d%nspin))
955 safe_allocate(cas%fxc_grad_spin(1:gr%np, 1:gr%der%dim, 1:st%d%nspin, 1:st%d%nspin))
957 safe_allocate(cas%fxc_grad_spin(0, 0, 0, 0))
960 safe_allocate(cas%fxc_grad(0, 0, 0, 0, 0))
961 safe_allocate(cas%fxc_grad_spin(0, 0, 0, 0))
965 if (cas%triplet)
then
966 safe_allocate(rho_spin(1:gr%np_part, 1:2))
967 safe_allocate(fxc_spin(1:gr%np, 1:2, 1:2))
969 rho_spin(:, 1) =
m_half * cas%rho(:, 1)
970 rho_spin(:, 2) =
m_half * cas%rho(:, 1)
973 cas%fxc(:, 1, 1) =
m_half * (fxc_spin(:, 1, 1) - fxc_spin(:, 1, 2))
975 safe_deallocate_a(rho_spin)
976 safe_deallocate_a(fxc_spin)
979 call xc_get_fxc(sys%ks%xc, gr, sys%namespace, cas%rho, st%d%ispin, cas%fxc, cas%fxc_grad, &
982 call xc_get_fxc(sys%ks%xc, gr, sys%namespace, cas%rho, st%d%ispin, cas%fxc)
992 restart_filename =
'kernel'
993 if (cas%triplet) restart_filename = trim(restart_filename)//
'_triplet'
995 select case (cas%type)
996 case (casida_eps_diff)
999 if (cas%states_are_real)
then
1000 call dcasida_get_matrix(cas, sys%namespace, sys%hm, st, sys%ks, gr, cas%dmat, cas%fxc, &
1001 cas%fxc_grad, cas%fxc_grad_spin, restart_filename)
1005 cas%fxc_grad, cas%fxc_grad_spin, restart_filename)
1012 if (cas%states_are_real)
then
1019 if (cas%calc_forces)
then
1020 if (cas%states_are_real)
then
1027 if (cas%states_are_real)
then
1034 if (cas%type /= casida_eps_diff .or. cas%calc_forces)
then
1035 safe_deallocate_a(cas%fxc)
1036 safe_deallocate_a(cas%fxc_grad)
1037 safe_deallocate_a(cas%fxc_grad_spin)
1038 safe_deallocate_a(cas%rho)
1049 real(real64),
allocatable :: w(:)
1056 do ia = 1, cas%n_pairs
1057 cas%w(ia) = st%eigenval(cas%pair(ia)%a, cas%pair(ia)%kk) - &
1058 st%eigenval(cas%pair(ia)%i, cas%pair(ia)%kk)
1060 message(1) =
"There is a negative unocc-occ KS eigenvalue difference for"
1061 write(
message(2),
'("states ",I5," and ",I5," of k-point ",I5,".")') cas%pair(ia)%i, cas%pair(ia)%a, cas%pair(ia)%kk
1062 message(3) =
"This indicates an inconsistency between gs, unocc, and/or casida calculations."
1068 safe_allocate(w(1:cas%n_pairs))
1070 call sort(w, cas%ind)
1071 safe_deallocate_a(w)
1081 type(
v_ks_t),
intent(in) :: ks
1083 type(
grid_t),
intent(in) :: gr
1084 type(
casida_t),
intent(inout) :: cas
1086 real(real64),
allocatable :: rho(:, :)
1087 real(real64),
allocatable :: fxc_sic(:,:,:)
1093 message(1) =
"Casida calculation with ADSIC not implemented for spin-polarized calculations."
1096 if (cas%triplet)
then
1097 message(1) =
"Casida calculation with ADSIC not implemented for triplet excitations."
1101 message(1) =
"Casida calculation with ADSIC not implemented with GGAs."
1105 safe_allocate(fxc_sic(1:gr%np, 1:st%d%nspin, 1:st%d%nspin))
1106 safe_allocate(rho(1:gr%np, 1:st%d%nspin))
1107 rho = cas%rho/st%qtot
1109 call xc_get_fxc(ks%xc, gr, namespace, rho, 1, fxc_sic)
1111 cas%fxc = cas%fxc - fxc_sic/st%qtot
1113 safe_deallocate_a(rho)
1114 safe_deallocate_a(fxc_sic)
1122 real(real64) function casida_matrix_factor(cas, sys)
1126 push_sub(casida_matrix_factor)
1128 casida_matrix_factor =
m_one
1131 casida_matrix_factor =
m_two * casida_matrix_factor
1135 casida_matrix_factor =
m_two * casida_matrix_factor
1138 pop_sub(casida_matrix_factor)
1145 type(namespace_t),
intent(in) :: namespace
1147 integer :: iunit, ia
1149 if (.not. mpi_grp_is_root(mpi_world))
return
1153 call io_mkdir(casida_dir, namespace)
1154 iunit = io_open(casida_dir//
'q'//trim(
theory_name(cas)), namespace, action=
'write')
1155 write(iunit,
'(a1,a14,1x,a24,1x,a24,1x,a10,3es15.8,a2)')
'#',
'E' ,
'|<f|exp(iq.r)|i>|^2', &
1156 '<|<f|exp(iq.r)|i>|^2>',
'; q = (',cas%qvector(1:cas%space_dim),
')'
1157 write(iunit,
'(a1,a14,1x,a24,1x,a24,1x,10x,a15)')
'#', trim(units_abbrev(units_out%energy)), &
1162 if (cas%avg_order == 0)
then
1163 do ia = 1, cas%n_pairs
1164 write(iunit,
'(es15.8,es15.8)') units_from_atomic(units_out%energy, cas%w(cas%ind(ia))), cas%qf(cas%ind(ia))
1167 do ia = 1, cas%n_pairs
1168 write(iunit,
'(3es15.8)') units_from_atomic(units_out%energy, cas%w(cas%ind(ia))), &
1169 cas%qf (cas%ind(ia)), &
1170 cas%qf_avg(cas%ind(ia))
1174 call io_close(iunit)
1181 character(len=80) pure function theory_name(cas)
1184 select case (cas%type)
1203 type(states_elec_t),
intent(in) :: st
1204 integer,
intent(in) :: ia
1205 integer,
intent(in) :: jb
1209 isnt_degenerate = (abs((st%eigenval(cas%pair(ia)%a, cas%pair(ia)%kk) - st%eigenval(cas%pair(ia)%i, cas%pair(ia)%kk)) &
1210 - (st%eigenval(cas%pair(jb)%a, cas%pair(jb)%kk) - st%eigenval(cas%pair(jb)%i, cas%pair(jb)%kk))) > 1e-8_real64)
1217 type(
casida_t),
intent(inout) :: cas
1218 integer,
intent(in) :: jb_local
1220 if (.not. cas%distributed_matrix)
then
1223#ifdef HAVE_SCALAPACK
1224 jb = indxl2g(jb_local, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
1231 type(
casida_t),
intent(inout) :: cas
1232 integer,
intent(in) :: ia_local
1234 if (.not. cas%distributed_matrix)
then
1237#ifdef HAVE_SCALAPACK
1238 ia = indxl2g(ia_local, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
1243 subroutine local_indices(cas, ia, jb, on_this_processor, ia_local, jb_local)
1246 integer,
intent(in) :: ia, jb
1247 logical,
intent(out) :: on_this_processor
1248 integer,
intent(out) :: ia_local, jb_local
1249#ifdef HAVE_SCALAPACK
1250 integer :: ia_proc, jb_proc
1253 if (.not. cas%distributed_matrix)
then
1254 on_this_processor = .
true.
1258#ifdef HAVE_SCALAPACK
1259 ia_proc = indxg2p(ia, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
1260 jb_proc = indxg2p(jb, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
1261 if (cas%proc_grid%mycol == ia_proc .and. cas%proc_grid%myrow == jb_proc)
then
1262 on_this_processor = .
true.
1263 ia_local = indxg2l(ia, cas%block_size, cas%proc_grid%mycol, 0, cas%proc_grid%npcol)
1264 jb_local = indxg2l(jb, cas%block_size, cas%proc_grid%myrow, 0, cas%proc_grid%nprow)
1266 on_this_processor = .false.
1276#include "casida_inc.F90"
1278#include "complex.F90"
1279#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_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 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)
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)
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.