88#include "./base/base_uses.f90"
94 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_mo_io'
118 TYPE(
mo_set_type),
DIMENSION(:),
INTENT(IN) :: mo_array
121 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
125 CHARACTER(LEN=*),
PARAMETER :: routinen =
'write_mo_set_to_restart'
126 CHARACTER(LEN=30),
DIMENSION(2),
PARAMETER :: &
127 keys = [
"SCF%PRINT%RESTART_HISTORY",
"SCF%PRINT%RESTART "]
129 INTEGER :: handle, ikey, ires, ispin
132 CALL timeset(routinen, handle)
141 IF (mo_array(1)%use_mo_coeff_b)
THEN
144 DO ispin = 1,
SIZE(mo_array)
145 cpassert(
ASSOCIATED(mo_array(ispin)%mo_coeff_b))
147 mo_array(ispin)%mo_coeff)
151 DO ikey = 1,
SIZE(keys)
153 dft_section, keys(ikey)),
cp_p_file))
THEN
155 extension=
".wfn", file_status=
"REPLACE", file_action=
"WRITE", &
156 do_backup=.true., file_form=
"UNFORMATTED")
157 IF (
PRESENT(matrix_ks))
THEN
158 CALL write_mo_set_low(mo_array, particle_set=particle_set, qs_kind_set=qs_kind_set, &
159 ires=ires, matrix_ks=matrix_ks)
161 CALL write_mo_set_low(mo_array, particle_set=particle_set, qs_kind_set=qs_kind_set, &
169 CALL timestop(handle)
183 TYPE(
mo_set_type),
DIMENSION(:),
INTENT(IN) :: mo_array
185 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: tmpl_matrix
187 CHARACTER(LEN=*),
PARAMETER :: routinen =
'write_dm_binary_restart'
189 CHARACTER(LEN=default_path_length) :: file_name, project_name
190 INTEGER :: handle, ispin, unit_nr
191 LOGICAL :: do_dm_restart
192 REAL(kind=
dp) :: cs_pos
196 CALL timeset(routinen, handle)
198 IF (logger%para_env%is_source())
THEN
204 project_name = logger%iter_info%project_name
206 NULLIFY (matrix_p_tmp)
208 IF (do_dm_restart)
THEN
209 ALLOCATE (matrix_p_tmp)
210 DO ispin = 1,
SIZE(mo_array)
211 CALL dbcsr_create(matrix_p_tmp, template=tmpl_matrix(ispin)%matrix, name=
"DM RESTART")
213 IF (.NOT.
ASSOCIATED(mo_array(ispin)%mo_coeff_b)) cpabort(
"mo_coeff_b NOT ASSOCIATED")
217 use_dbcsr=.true., retain_sparsity=.false.)
219 WRITE (file_name,
'(A,I0,A)') trim(project_name)//
"_SCF_DM_SPIN_", ispin,
"_RESTART.dm"
221 IF (unit_nr > 0)
THEN
222 WRITE (unit_nr,
'(T2,A,E20.8)')
"Writing restart DM "//trim(file_name)//
" with checksum: ", cs_pos
228 DEALLOCATE (matrix_p_tmp)
231 CALL timestop(handle)
245 TYPE(
mo_set_type),
DIMENSION(:),
INTENT(IN) :: mo_array
246 TYPE(
cp_fm_type),
DIMENSION(:),
INTENT(IN) :: rt_mos
249 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
251 CHARACTER(LEN=*),
PARAMETER :: routinen =
'write_rt_mos_to_restart'
252 CHARACTER(LEN=43),
DIMENSION(2),
PARAMETER :: keys = [ &
253 "REAL_TIME_PROPAGATION%PRINT%RESTART_HISTORY", &
254 "REAL_TIME_PROPAGATION%PRINT%RESTART "]
256 INTEGER :: handle, ikey, ires
259 CALL timeset(routinen, handle)
267 DO ikey = 1,
SIZE(keys)
270 dft_section, keys(ikey)),
cp_p_file))
THEN
272 extension=
".rtpwfn", file_status=
"REPLACE", file_action=
"WRITE", &
273 do_backup=.true., file_form=
"UNFORMATTED")
274 CALL write_mo_set_low(mo_array, qs_kind_set=qs_kind_set, particle_set=particle_set, &
275 ires=ires, rt_mos=rt_mos)
281 CALL timestop(handle)
296 TYPE(
mo_set_type),
DIMENSION(:),
INTENT(IN) :: mo_array
297 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
305 CHARACTER(LEN=*),
PARAMETER :: routinen =
'write_mo_set_low'
307 INTEGER :: handle, iatom, ikind, imat, iset, &
308 ishell, ispin, lmax, lshell, &
309 max_block, nao, natom, nmo, nset, &
310 nset_max, nshell_max, nspin
311 INTEGER,
DIMENSION(:),
POINTER :: nset_info, nshell
312 INTEGER,
DIMENSION(:, :),
POINTER :: l, nshell_info
313 INTEGER,
DIMENSION(:, :, :),
POINTER :: nso_info
314 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mo_eigenvalues, mo_occupation_numbers
319 CALL timeset(routinen, handle)
322 NULLIFY (mo_eigenvalues)
323 NULLIFY (mo_occupation_numbers)
325 nspin =
SIZE(mo_array)
326 nao = mo_array(1)%nao
330 natom =
SIZE(particle_set, 1)
335 NULLIFY (orb_basis_set, dftb_parameter)
336 CALL get_atomic_kind(particle_set(iatom)%atomic_kind, kind_number=ikind)
338 basis_set=orb_basis_set, &
339 dftb_parameter=dftb_parameter)
340 IF (
ASSOCIATED(orb_basis_set))
THEN
345 nset_max = max(nset_max, nset)
347 nshell_max = max(nshell_max, nshell(iset))
349 ELSE IF (
ASSOCIATED(dftb_parameter))
THEN
351 nset_max = max(nset_max, 1)
352 nshell_max = max(nshell_max, lmax + 1)
359 ALLOCATE (nso_info(nshell_max, nset_max, natom))
360 nso_info(:, :, :) = 0
362 ALLOCATE (nshell_info(nset_max, natom))
363 nshell_info(:, :) = 0
365 ALLOCATE (nset_info(natom))
369 NULLIFY (orb_basis_set, dftb_parameter)
370 CALL get_atomic_kind(particle_set(iatom)%atomic_kind, kind_number=ikind)
372 basis_set=orb_basis_set, dftb_parameter=dftb_parameter)
373 IF (
ASSOCIATED(orb_basis_set))
THEN
378 nset_info(iatom) = nset
380 nshell_info(iset, iatom) = nshell(iset)
381 DO ishell = 1, nshell(iset)
382 lshell = l(ishell, iset)
383 nso_info(ishell, iset, iatom) =
nso(lshell)
386 ELSE IF (
ASSOCIATED(dftb_parameter))
THEN
389 nshell_info(1, iatom) = lmax + 1
390 DO ishell = 1, lmax + 1
392 nso_info(ishell, 1, iatom) =
nso(lshell)
400 WRITE (ires) natom, nspin, nao, nset_max, nshell_max
401 WRITE (ires) nset_info
402 WRITE (ires) nshell_info
403 WRITE (ires) nso_info
405 DEALLOCATE (nset_info)
407 DEALLOCATE (nshell_info)
409 DEALLOCATE (nso_info)
415 mo_coeff => mo_array(ispin)%mo_coeff
416 nmo = mo_array(ispin)%nmo
418 mo_eigenvalues => mo_array(ispin)%eigenvalues
419 mo_occupation_numbers => mo_array(ispin)%occupation_numbers
420 IF (
PRESENT(matrix_ks))
THEN
423 ks_matrix=matrix_ks(ispin)%matrix, &
424 evals_arg=mo_eigenvalues)
428 mo_array(ispin)%homo, &
429 mo_array(ispin)%lfomo, &
430 mo_array(ispin)%nelectron
431 WRITE (ires) mo_eigenvalues(1:nmo), mo_occupation_numbers(1:nmo)
434 IF (
PRESENT(rt_mos))
THEN
435 DO imat = 2*ispin - 1, 2*ispin
443 CALL timestop(handle)
458 CHARACTER(LEN=default_path_length),
INTENT(OUT) :: filename
459 LOGICAL,
INTENT(OUT) :: exist
462 LOGICAL,
INTENT(IN),
OPTIONAL :: kp, xas, rtp
465 LOGICAL :: my_kp, my_rtp, my_xas
471 IF (
PRESENT(kp)) my_kp = kp
472 IF (
PRESENT(xas)) my_xas = xas
473 IF (
PRESENT(rtp)) my_rtp = rtp
477 IF (n_rep_val > 0)
THEN
484 extension=
"", my_local=.false.)
485 ELSE IF (my_rtp)
THEN
489 extension=
".rtpwfn", my_local=.false.)
494 extension=
".kp", my_local=.false.)
499 extension=
".wfn", my_local=.false.)
502 IF (.NOT. my_xas)
THEN
503 INQUIRE (file=filename, exist=exist)
522 para_env, id_nr, multiplicity, dft_section, natom_mismatch, &
525 TYPE(
mo_set_type),
DIMENSION(:),
INTENT(INOUT) :: mo_array
526 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
529 INTEGER,
INTENT(IN) :: id_nr, multiplicity
531 LOGICAL,
INTENT(OUT),
OPTIONAL :: natom_mismatch
532 LOGICAL,
INTENT(IN),
OPTIONAL :: cdft
533 INTEGER,
INTENT(IN),
OPTIONAL :: out_unit
535 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_mo_set_from_restart'
537 CHARACTER(LEN=default_path_length) :: file_name
538 INTEGER :: handle, ispin, my_out_unit, natom, &
540 LOGICAL :: exist, my_cdft
543 CALL timeset(routinen, handle)
546 IF (
PRESENT(cdft)) my_cdft = cdft
548 IF (
PRESENT(out_unit)) my_out_unit = out_unit
550 nspin =
SIZE(mo_array)
553 IF (para_env%is_source())
THEN
555 natom =
SIZE(particle_set, 1)
559 file_name = trim(file_name)//
".bak-"//adjustl(
cp_to_string(id_nr))
563 file_action=
"READ", &
564 file_form=
"UNFORMATTED", &
566 unit_number=restart_unit)
571 particle_set=particle_set, natom=natom, &
572 rst_unit=restart_unit, multiplicity=multiplicity, natom_mismatch=natom_mismatch)
574 IF (
PRESENT(natom_mismatch))
THEN
576 CALL para_env%bcast(natom_mismatch)
577 IF (natom_mismatch)
THEN
578 IF (para_env%is_source())
CALL close_file(unit_number=restart_unit)
579 CALL timestop(handle)
585 IF (para_env%is_source())
THEN
586 IF (my_out_unit > 0)
THEN
587 WRITE (unit=my_out_unit, fmt=
"(T2,A)") &
588 "WFN_RESTART| Restart file "//trim(file_name)//
" read"
594 IF (.NOT. my_cdft)
THEN
597 dft_section, 4, 0, final_mos=.false.)
601 CALL timestop(handle)
618 TYPE(
mo_set_type),
DIMENSION(:),
INTENT(INOUT) :: mo_array
619 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: rt_mos
620 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
623 INTEGER,
INTENT(IN) :: id_nr, multiplicity
626 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_rt_mos_from_restart'
628 CHARACTER(LEN=default_path_length) :: file_name
629 INTEGER :: handle, ispin, natom, nspin, &
630 restart_unit, unit_nr
634 CALL timeset(routinen, handle)
637 nspin =
SIZE(mo_array)
640 IF (para_env%is_source())
THEN
642 natom =
SIZE(particle_set, 1)
646 file_name = trim(file_name)//
".bak-"//adjustl(
cp_to_string(id_nr))
650 IF (unit_nr > 0)
THEN
651 WRITE (unit_nr,
'(T2,A)')
"Read RTP restart from the file: "//trim(file_name)
655 file_action=
"READ", &
656 file_form=
"UNFORMATTED", &
658 unit_number=restart_unit)
663 particle_set=particle_set, qs_kind_set=qs_kind_set, natom=natom, &
664 rst_unit=restart_unit, multiplicity=multiplicity)
667 IF (para_env%is_source())
CALL close_file(unit_number=restart_unit)
671 dft_section, 4, 0, final_mos=.false.)
674 CALL timestop(handle)
694 multiplicity, rt_mos, natom_mismatch)
696 TYPE(
mo_set_type),
DIMENSION(:),
INTENT(INOUT) :: mos
698 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
700 INTEGER,
INTENT(IN) :: natom, rst_unit
701 INTEGER,
INTENT(in),
OPTIONAL :: multiplicity
702 TYPE(
cp_fm_type),
DIMENSION(:),
OPTIONAL,
POINTER :: rt_mos
703 LOGICAL,
INTENT(OUT),
OPTIONAL :: natom_mismatch
705 INTEGER :: homo, homo_read, i, iatom, ikind, imat, irow, iset, iset_read, ishell, &
706 ishell_read, iso, ispin, lfomo_read, lmax, lshell, my_mult, nao, nao_read, natom_read, &
707 nelectron, nelectron_read, nmo, nmo_read, nnshell, nset, nset_max, nshell_max, nspin, &
708 nspin_read, offset_read
709 INTEGER,
DIMENSION(:),
POINTER :: nset_info, nshell
710 INTEGER,
DIMENSION(:, :),
POINTER :: l, nshell_info
711 INTEGER,
DIMENSION(:, :, :),
POINTER :: nso_info, offset_info
712 LOGICAL :: minbas, natom_match, use_this
713 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eig_read, occ_read
714 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: vecbuffer, vecbuffer_read
724 IF (
PRESENT(multiplicity)) my_mult = multiplicity
726 IF (para_env%is_source())
THEN
727 READ (rst_unit) natom_read, nspin_read, nao_read, nset_max, nshell_max
728 IF (
PRESENT(rt_mos))
THEN
729 IF (nspin_read /= nspin)
THEN
730 cpabort(
"To change nspin is not possible. ")
734 IF (nspin_read /= nspin)
THEN
736 "READ RESTART : WARNING : nspin is not equal "
739 IF (nspin_read > nspin)
THEN
740 cpabort(
"Reducing nspin is not possible. ")
744 natom_match = (natom_read == natom)
746 IF (natom_match)
THEN
749 ALLOCATE (nso_info(nshell_max, nset_max, natom_read))
750 ALLOCATE (nshell_info(nset_max, natom_read))
751 ALLOCATE (nset_info(natom_read))
752 ALLOCATE (offset_info(nshell_max, nset_max, natom_read))
754 IF (nao_read /= nao)
THEN
756 " READ RESTART : WARNING : DIFFERENT # AOs ", nao, nao_read
757 IF (
PRESENT(rt_mos))
THEN
758 cpabort(
"To change basis is not possible. ")
762 READ (rst_unit) nset_info
763 READ (rst_unit) nshell_info
764 READ (rst_unit) nso_info
768 DO iset = 1, nset_info(iatom)
769 DO ishell = 1, nshell_info(iset, iatom)
770 offset_info(ishell, iset, iatom) = i
771 i = i + nso_info(ishell, iset, iatom)
776 ALLOCATE (vecbuffer_read(1, nao_read))
782 CALL para_env%bcast(natom_match)
783 IF (
PRESENT(natom_mismatch)) natom_mismatch = .NOT. natom_match
785 IF (.NOT. natom_match)
THEN
786 IF (
PRESENT(natom_mismatch))
THEN
788 " READ RESTART : WARNING : DIFFERENT natom, returning ", natom, natom_read
791 cpabort(
"Incorrect number of atoms in restart file. ")
795 CALL para_env%bcast(nspin_read)
797 ALLOCATE (vecbuffer(1, nao))
802 homo = mos(ispin)%homo
803 mos(ispin)%eigenvalues(:) = 0.0_dp
804 mos(ispin)%occupation_numbers(:) = 0.0_dp
807 IF (para_env%is_source() .AND. (nmo > 0))
THEN
808 READ (rst_unit) nmo_read, homo_read, lfomo_read, nelectron_read
809 ALLOCATE (eig_read(nmo_read), occ_read(nmo_read))
813 nmo = min(nmo, nmo_read)
814 IF (nmo_read < nmo)
THEN
815 CALL cp_warn(__location__, &
816 "The number of MOs on the restart unit is smaller than the number of "// &
817 "the allocated MOs. The MO set will be padded with zeros!")
819 IF (nmo_read > nmo)
THEN
820 CALL cp_warn(__location__, &
821 "The number of MOs on the restart unit is greater than the number of "// &
822 "the allocated MOs. The read MO set will be truncated!")
825 READ (rst_unit) eig_read(1:nmo_read), occ_read(1:nmo_read)
826 mos(ispin)%eigenvalues(1:nmo) = eig_read(1:nmo)
827 mos(ispin)%occupation_numbers(1:nmo) = occ_read(1:nmo)
828 DEALLOCATE (eig_read, occ_read)
830 mos(ispin)%homo = homo_read
831 mos(ispin)%lfomo = lfomo_read
832 IF (min(homo_read, homo) > nmo)
THEN
833 IF (nelectron_read == mos(ispin)%nelectron)
THEN
834 CALL cp_warn(__location__, &
835 "The number of occupied MOs on the restart unit is larger than "// &
836 "the allocated MOs. The read MO set will be truncated and the occupation numbers recalculated!")
841 cpabort(
"Number of occupied MOs on restart unit larger than allocated MOs. ")
846 CALL para_env%bcast(nmo)
847 CALL para_env%bcast(mos(ispin)%homo)
848 CALL para_env%bcast(mos(ispin)%lfomo)
849 CALL para_env%bcast(mos(ispin)%nelectron)
850 CALL para_env%bcast(mos(ispin)%eigenvalues)
851 CALL para_env%bcast(mos(ispin)%occupation_numbers)
853 IF (
PRESENT(rt_mos))
THEN
854 DO imat = 2*ispin - 1, 2*ispin
856 IF (para_env%is_source())
THEN
857 READ (rst_unit) vecbuffer
859 vecbuffer(1, :) = 0.0_dp
861 CALL para_env%bcast(vecbuffer)
863 vecbuffer, 1, i, nao, 1, transpose=.true.)
868 IF (para_env%is_source())
THEN
869 READ (rst_unit) vecbuffer_read
874 NULLIFY (orb_basis_set, dftb_parameter, l, nshell)
875 CALL get_atomic_kind(particle_set(iatom)%atomic_kind, kind_number=ikind)
877 basis_set=orb_basis_set, dftb_parameter=dftb_parameter)
878 IF (
ASSOCIATED(orb_basis_set))
THEN
884 ELSE IF (
ASSOCIATED(dftb_parameter))
THEN
901 nnshell = nshell(iset)
903 DO ishell = 1, nnshell
907 lshell = l(ishell, iset)
909 IF (iset_read > nset_info(iatom)) use_this = .false.
911 IF (
nso(lshell) == nso_info(ishell_read, iset_read, iatom))
THEN
912 offset_read = offset_info(ishell_read, iset_read, iatom)
913 ishell_read = ishell_read + 1
914 IF (ishell_read > nshell_info(iset, iatom))
THEN
916 iset_read = iset_read + 1
922 DO iso = 1,
nso(lshell)
924 IF (offset_read - 1 + iso < 1 .OR. offset_read - 1 + iso > nao_read)
THEN
925 vecbuffer(1, irow) = 0.0_dp
927 vecbuffer(1, irow) = vecbuffer_read(1, offset_read - 1 + iso)
930 vecbuffer(1, irow) = 0.0_dp
941 vecbuffer(1, :) = 0.0_dp
945 CALL para_env%bcast(vecbuffer)
947 vecbuffer, 1, i, nao, 1, transpose=.true.)
951 IF (para_env%is_source())
THEN
954 DO i = nmo + 1, nmo_read
955 READ (rst_unit) vecbuffer_read
960 IF (.NOT.
PRESENT(rt_mos))
THEN
961 IF (ispin == 1 .AND. nspin_read < nspin)
THEN
963 mos(ispin + 1)%homo = mos(ispin)%homo
964 mos(ispin + 1)%lfomo = mos(ispin)%lfomo
965 nelectron = mos(ispin)%nelectron
966 IF (my_mult /= 1)
THEN
967 CALL cp_abort(__location__, &
968 "Restarting an LSD calculation from an LDA wfn only works for multiplicity=1 (singlets).")
970 IF (mos(ispin + 1)%nelectron < 0)
THEN
971 cpabort(
"LSD: too few electrons for this multiplisity. ")
973 mos(ispin + 1)%eigenvalues = mos(ispin)%eigenvalues
974 mos(ispin)%occupation_numbers = mos(ispin)%occupation_numbers/2.0_dp
975 mos(ispin + 1)%occupation_numbers = mos(ispin)%occupation_numbers
976 CALL cp_fm_to_fm(mos(ispin)%mo_coeff, mos(ispin + 1)%mo_coeff)
982 DEALLOCATE (vecbuffer)
984 IF (para_env%is_source())
THEN
985 DEALLOCATE (vecbuffer_read)
986 DEALLOCATE (offset_info)
987 DEALLOCATE (nso_info)
988 DEALLOCATE (nshell_info)
989 DEALLOCATE (nset_info)
1022 dft_section, before, kpoint, final_mos, spin, &
1023 solver_method, rtp, cpart, sim_step, umo_set, qs_env, &
1027 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1030 INTEGER,
INTENT(IN) :: before, kpoint
1031 LOGICAL,
INTENT(IN),
OPTIONAL :: final_mos
1032 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: spin
1033 CHARACTER(LEN=2),
INTENT(IN),
OPTIONAL :: solver_method
1034 LOGICAL,
INTENT(IN),
OPTIONAL :: rtp
1035 INTEGER,
INTENT(IN),
OPTIONAL :: cpart, sim_step
1036 TYPE(
mo_set_type),
INTENT(IN),
OPTIONAL :: umo_set
1040 CHARACTER(LEN=12) :: symbol
1041 CHARACTER(LEN=12),
DIMENSION(:),
POINTER :: bcgf_symbol
1042 CHARACTER(LEN=14) :: fmtstr5
1043 CHARACTER(LEN=15) :: energy_str, orbital_str, step_string
1044 CHARACTER(LEN=2) :: element_symbol, my_solver_method
1045 CHARACTER(LEN=2*default_string_length) :: name
1046 CHARACTER(LEN=21) :: vector_str
1047 CHARACTER(LEN=22) :: fmtstr4
1048 CHARACTER(LEN=24) :: fmtstr2
1049 CHARACTER(LEN=25) :: fmtstr1
1050 CHARACTER(LEN=29) :: fmtstr6
1051 CHARACTER(LEN=4) :: reim
1052 CHARACTER(LEN=40) :: fmtstr3
1053 CHARACTER(LEN=6),
DIMENSION(:),
POINTER :: bsgf_symbol
1054 INTEGER :: after, first_mo, from, homo, iatom, icgf, ico, icol, ikind, imo, irow, iset, &
1055 isgf, ishell, iso, iw, jcol, last_mo, left, lmax, lshell, nao, natom, ncgf, ncol, nkind, &
1056 nmo, nmo_local, nset, nsgf, numo, right, scf_step, to, width
1057 INTEGER,
DIMENSION(:),
POINTER :: mo_index_range, nshell
1058 INTEGER,
DIMENSION(:, :),
POINTER :: l
1059 LOGICAL :: ionode, my_final, my_rtp, omit_headers, print_cartesian, print_cartesian_overlap, &
1060 print_eigvals, print_eigvecs, print_occup, should_output
1061 REAL(kind=
dp) :: chemical_potential, gap, maxocc
1062 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: mo_eigenvalues, mo_occupation_numbers
1063 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: cmatrix, smatrix
1064 REAL(kind=
dp),
DIMENSION(:),
POINTER :: eigenvalues, occupation_numbers
1065 TYPE(
cp_fm_type),
POINTER :: mo_coeff, umo_coeff
1077 NULLIFY (bcgf_symbol)
1078 NULLIFY (bsgf_symbol)
1080 NULLIFY (mo_index_range)
1085 ionode = logger%para_env%is_source()
1092 CALL section_vals_val_get(dft_section,
"PRINT%MO%CARTESIAN_OVERLAP", l_val=print_cartesian_overlap)
1093 after = min(max(after, 1), 16)
1096 IF (
PRESENT(final_mos))
THEN
1097 my_final = final_mos
1104 IF (
PRESENT(rtp))
THEN
1109 .OR. (sim_step == 1)
1115 IF ((.NOT. should_output) .OR. (.NOT. (print_eigvals .OR. print_eigvecs .OR. print_occup)))
RETURN
1118 cpassert(
PRESENT(sim_step))
1119 cpassert(
PRESENT(cpart))
1121 IF (cpart == 0)
THEN
1126 print_eigvals = .false.
1128 scf_step = max(0, logger%iter_info%iteration(logger%iter_info%n_rlevel) - 1)
1131 IF (.NOT. my_final)
THEN
1132 IF (.NOT. my_rtp)
THEN
1133 step_string =
" AFTER SCF STEP"
1135 step_string =
" AFTER RTP STEP"
1139 IF (
PRESENT(solver_method))
THEN
1140 my_solver_method = solver_method
1143 my_solver_method =
"TD"
1147 IF (
PRESENT(para_env_inter_kp))
THEN
1148 cpassert(
ASSOCIATED(para_env_inter_kp))
1149 cpassert(.NOT.
PRESENT(umo_set))
1153 chemical_potential = 0.0_dp
1154 NULLIFY (eigenvalues, occupation_numbers, mo_coeff)
1155 IF (
PRESENT(mo_set))
THEN
1156 CALL get_mo_set(mo_set=mo_set, eigenvalues=eigenvalues, &
1157 occupation_numbers=occupation_numbers, mo_coeff=mo_coeff, &
1158 homo=homo, maxocc=maxocc, mu=chemical_potential, nmo=nmo_local)
1161 CALL para_env_inter_kp%max(nmo)
1162 CALL para_env_inter_kp%sum(homo)
1163 CALL para_env_inter_kp%sum(maxocc)
1164 CALL para_env_inter_kp%sum(chemical_potential)
1165 ALLOCATE (mo_eigenvalues(nmo), mo_occupation_numbers(nmo))
1166 mo_eigenvalues = 0.0_dp
1167 mo_occupation_numbers = 0.0_dp
1168 IF (nmo_local > 0 .AND.
PRESENT(mo_set))
THEN
1169 mo_eigenvalues(1:nmo_local) = eigenvalues(1:nmo_local)
1170 mo_occupation_numbers(1:nmo_local) = occupation_numbers(1:nmo_local)
1172 CALL para_env_inter_kp%sum(mo_eigenvalues)
1173 CALL para_env_inter_kp%sum(mo_occupation_numbers)
1174 IF (print_eigvecs)
THEN
1176 ALLOCATE (smatrix(nao, nmo))
1178 IF (nmo_local > 0 .AND.
PRESENT(mo_set))
THEN
1181 CALL para_env_inter_kp%sum(smatrix)
1185 cpassert(
PRESENT(mo_set))
1187 mo_coeff=mo_coeff, &
1188 eigenvalues=eigenvalues, &
1189 occupation_numbers=occupation_numbers, &
1194 mu=chemical_potential)
1195 IF (
PRESENT(umo_set))
THEN
1197 mo_coeff=umo_coeff, &
1203 ALLOCATE (mo_eigenvalues(nmo), mo_occupation_numbers(nmo))
1204 mo_eigenvalues(1:nmo - numo) = eigenvalues(1:nmo - numo)
1205 mo_occupation_numbers = 0.0_dp
1206 mo_occupation_numbers(1:nmo - numo) = occupation_numbers(1:nmo - numo)
1208 CALL get_mo_set(mo_set=umo_set, eigenvalues=eigenvalues)
1209 mo_eigenvalues(nmo - numo + 1:nmo) = eigenvalues(1:numo)
1213 IF (print_eigvecs)
THEN
1214 IF (.NOT.
ALLOCATED(smatrix))
THEN
1215 ALLOCATE (smatrix(nao, nmo))
1221 IF (.NOT. ionode)
THEN
1222 DEALLOCATE (smatrix)
1226 IF (
PRESENT(qs_env))
THEN
1227 IF (
ASSOCIATED(qs_env) .AND. my_final .AND. print_cartesian_overlap)
THEN
1228 NULLIFY (qs_kind_set)
1229 CALL get_qs_env(qs_env=qs_env, qs_kind_set=qs_kind_set)
1230 nkind =
SIZE(qs_kind_set)
1233 qs_env%input,
"DFT%PRINT%AO_MATRICES/OVERLAP"),
cp_p_file))
THEN
1234 ALLOCATE (orb_basis_set_list(nkind))
1236 qs_kind => qs_kind_set(ikind)
1237 NULLIFY (orb_basis_set_list(ikind)%gto_basis_set)
1239 CALL get_qs_kind(qs_kind=qs_kind, basis_set=orbbasis, basis_type=
"ORB")
1240 IF (
ASSOCIATED(orbbasis)) orb_basis_set_list(ikind)%gto_basis_set => orbbasis
1246 CALL get_qs_env(qs_env, ks_env=ks_env, para_env=para_env)
1248 orb_basis_set_list, orb_basis_set_list, sro_list, .true.)
1253 CALL section_vals_val_get(qs_env%input,
"DFT%PRINT%AO_MATRICES%OMIT_HEADERS", l_val=omit_headers)
1255 after = min(max(after, 1), 16)
1256 IF (
ASSOCIATED(sro))
THEN
1258 output_unit=iw, omit_headers=omit_headers, &
1259 cartesian_basis=.true.)
1262 "DFT%PRINT%AO_MATRICES/OVERLAP")
1264 DEALLOCATE (orb_basis_set_list)
1270 ignore_should_output=should_output, &
1275 natom =
SIZE(particle_set)
1280 fmtstr1 =
"(T2,A,21X, ( X,I5, X))"
1281 fmtstr2 =
"(T2,A,21X, (1X,F . ))"
1282 fmtstr3 =
"(T2,A,I5,1X,I5,1X,A,1X,A6, (1X,F . ))"
1284 width = before + after + 3
1285 ncol = int(56/width)
1287 right = max((after - 2), 1)
1288 left = width - right - 5
1290 WRITE (unit=fmtstr1(11:12), fmt=
"(I2)") ncol
1291 WRITE (unit=fmtstr1(14:15), fmt=
"(I2)") left
1292 WRITE (unit=fmtstr1(21:22), fmt=
"(I2)") right
1294 WRITE (unit=fmtstr2(11:12), fmt=
"(I2)") ncol
1295 WRITE (unit=fmtstr2(18:19), fmt=
"(I2)") width - 1
1296 WRITE (unit=fmtstr2(21:22), fmt=
"(I2)") after
1298 WRITE (unit=fmtstr3(27:28), fmt=
"(I2)") ncol
1299 WRITE (unit=fmtstr3(34:35), fmt=
"(I2)") width - 1
1300 WRITE (unit=fmtstr3(37:38), fmt=
"(I2)") after
1302 IF (my_final .OR. (my_solver_method ==
"TD"))
THEN
1303 energy_str =
"EIGENVALUES"
1304 vector_str =
"EIGENVECTORS"
1306 energy_str =
"ENERGIES"
1307 vector_str =
"COEFFICIENTS"
1311 energy_str =
"ZEROS"
1312 vector_str = trim(reim)//
" RTP COEFFICIENTS"
1315 IF (print_eigvecs)
THEN
1317 IF (print_cartesian)
THEN
1319 orbital_str =
"CARTESIAN"
1321 ALLOCATE (cmatrix(ncgf, ncgf))
1328 NULLIFY (orb_basis_set, dftb_parameter)
1329 CALL get_atomic_kind(particle_set(iatom)%atomic_kind, kind_number=ikind)
1331 basis_set=orb_basis_set, &
1332 dftb_parameter=dftb_parameter)
1333 IF (
ASSOCIATED(orb_basis_set))
THEN
1339 DO ishell = 1, nshell(iset)
1340 lshell = l(ishell, iset)
1341 CALL dgemm(
"T",
"N",
nco(lshell), nmo,
nso(lshell), 1.0_dp, &
1343 smatrix(isgf, 1), nsgf, 0.0_dp, &
1344 cmatrix(icgf, 1), ncgf)
1345 icgf = icgf +
nco(lshell)
1346 isgf = isgf +
nso(lshell)
1349 ELSE IF (
ASSOCIATED(dftb_parameter))
THEN
1351 DO ishell = 1, lmax + 1
1353 CALL dgemm(
"T",
"N",
nco(lshell), nsgf,
nso(lshell), 1.0_dp, &
1355 smatrix(isgf, 1), nsgf, 0.0_dp, &
1356 cmatrix(icgf, 1), ncgf)
1357 icgf = icgf +
nco(lshell)
1358 isgf = isgf +
nso(lshell)
1368 orbital_str =
"SPHERICAL"
1372 name = trim(energy_str)//
", OCCUPATION NUMBERS, AND "// &
1373 trim(orbital_str)//
" "//trim(vector_str)
1375 IF (.NOT. my_final)
THEN
1376 WRITE (unit=name, fmt=
"(A,1X,I0)") trim(name)//step_string, scf_step
1379 ELSE IF (print_occup .OR. print_eigvals)
THEN
1380 name = trim(energy_str)//
" AND OCCUPATION NUMBERS"
1382 IF (.NOT. my_final)
THEN
1383 WRITE (unit=name, fmt=
"(A,1X,I0)") trim(name)//step_string, scf_step
1388 IF (
PRESENT(spin) .AND. (kpoint > 0))
THEN
1389 WRITE (unit=iw, fmt=
"(/,T2,A,I0)") &
1390 "MO| "//trim(spin)//
" "//trim(name)//
" FOR K POINT ", kpoint
1391 ELSE IF (
PRESENT(spin))
THEN
1392 WRITE (unit=iw, fmt=
"(/,T2,A)") &
1393 "MO| "//trim(spin)//
" "//trim(name)
1394 ELSE IF (kpoint > 0)
THEN
1395 WRITE (unit=iw, fmt=
"(/,T2,A,I0)") &
1396 "MO| "//trim(name)//
" FOR K POINT ", kpoint
1398 WRITE (unit=iw, fmt=
"(/,T2,A)") &
1403 IF (all(mo_index_range > 0))
THEN
1404 IF (mo_index_range(2) > nmo)
THEN
1405 CALL cp_warn(__location__, &
1406 "The last orbital index is larger than the number of orbitals.")
1408 IF (mo_index_range(1) > mo_index_range(2))
THEN
1409 CALL cp_warn(__location__, &
1410 "The first orbital index is larger than the last orbital index.")
1412 first_mo = min(max(1, mo_index_range(1)), nmo)
1413 last_mo = min(max(first_mo, mo_index_range(2)), nmo)
1414 ELSE IF (mo_index_range(2) < 0)
THEN
1415 IF (mo_index_range(1) > nmo)
THEN
1416 CALL cp_warn(__location__, &
1417 "The first orbital index is larger than the number of orbitals.")
1419 first_mo = min(max(1, mo_index_range(1)), nmo)
1426 IF (print_eigvecs)
THEN
1430 DO icol = first_mo, last_mo, ncol
1433 to = min((from + ncol - 1), last_mo)
1435 WRITE (unit=iw, fmt=
"(T2,A)")
"MO|"
1436 WRITE (unit=iw, fmt=fmtstr1) &
1437 "MO|", (jcol, jcol=from, to)
1438 WRITE (unit=iw, fmt=fmtstr2) &
1439 "MO|", (mo_eigenvalues(jcol), jcol=from, to)
1440 WRITE (unit=iw, fmt=
"(T2,A)")
"MO|"
1441 WRITE (unit=iw, fmt=fmtstr2) &
1442 "MO|", (mo_occupation_numbers(jcol), jcol=from, to)
1443 WRITE (unit=iw, fmt=
"(T2,A)")
"MO|"
1449 IF (iatom /= 1)
WRITE (unit=iw, fmt=
"(T2,A)")
"MO|"
1451 NULLIFY (orb_basis_set, dftb_parameter)
1453 element_symbol=element_symbol, kind_number=ikind)
1455 basis_set=orb_basis_set, &
1456 dftb_parameter=dftb_parameter)
1458 IF (print_cartesian)
THEN
1460 IF (
ASSOCIATED(orb_basis_set))
THEN
1469 DO ishell = 1, nshell(iset)
1470 lshell = l(ishell, iset)
1471 DO ico = 1,
nco(lshell)
1472 WRITE (unit=iw, fmt=fmtstr3) &
1473 "MO|", irow, iatom, adjustr(element_symbol), bcgf_symbol(icgf), &
1474 (cmatrix(irow, jcol), jcol=from, to)
1480 ELSE IF (
ASSOCIATED(dftb_parameter))
THEN
1483 DO ishell = 1, lmax + 1
1485 DO ico = 1,
nco(lshell)
1488 WRITE (unit=iw, fmt=fmtstr3) &
1489 "MO|", irow, iatom, adjustr(element_symbol), symbol, &
1490 (cmatrix(irow, jcol), jcol=from, to)
1502 IF (
ASSOCIATED(orb_basis_set))
THEN
1510 DO ishell = 1, nshell(iset)
1511 lshell = l(ishell, iset)
1512 DO iso = 1,
nso(lshell)
1513 WRITE (unit=iw, fmt=fmtstr3) &
1514 "MO|", irow, iatom, adjustr(element_symbol), bsgf_symbol(isgf), &
1515 (smatrix(irow, jcol), jcol=from, to)
1521 ELSE IF (
ASSOCIATED(dftb_parameter))
THEN
1524 DO ishell = 1, lmax + 1
1526 DO iso = 1,
nso(lshell)
1527 symbol =
sgf_symbol(1, lshell, -lshell + iso - 1)
1529 WRITE (unit=iw, fmt=fmtstr3) &
1530 "MO|", irow, iatom, adjustr(element_symbol), symbol, &
1531 (smatrix(irow, jcol), jcol=from, to)
1547 WRITE (unit=iw, fmt=
"(T2,A)")
"MO|"
1551 IF (print_cartesian)
THEN
1552 DEALLOCATE (cmatrix)
1554 DEALLOCATE (smatrix)
1556 ELSE IF (print_occup .OR. print_eigvals)
THEN
1558 WRITE (unit=iw, fmt=
"(T2,A)")
"MO|"
1559 fmtstr4 =
"(T2,A,I7,3(1X,F22. ))"
1560 WRITE (unit=fmtstr4(19:20), fmt=
"(I2)") after
1561 IF (my_final .OR. (my_solver_method ==
"TD"))
THEN
1562 WRITE (unit=iw, fmt=
"(A)") &
1563 " MO| Index Eigenvalue [a.u.] Eigenvalue [eV] Occupation"
1565 WRITE (unit=iw, fmt=
"(A)") &
1566 " MO| Index Energy [a.u.] Energy [eV] Occupation"
1568 DO imo = first_mo, last_mo
1569 WRITE (unit=iw, fmt=fmtstr4) &
1570 "MO|", imo, mo_eigenvalues(imo), &
1571 mo_eigenvalues(imo)*
evolt, &
1572 mo_occupation_numbers(imo)
1574 fmtstr5 =
"(A,T59,F22. )"
1575 WRITE (unit=fmtstr5(12:13), fmt=
"(I2)") after
1576 WRITE (unit=iw, fmt=fmtstr5) &
1581 IF (.NOT. my_rtp)
THEN
1582 fmtstr6 =
"(A,T18,F17. ,A,T41,F17. ,A)"
1583 WRITE (unit=fmtstr6(12:13), fmt=
"(I2)") after
1584 WRITE (unit=fmtstr6(25:26), fmt=
"(I2)") after
1585 WRITE (unit=iw, fmt=fmtstr6) &
1586 " MO| E(Fermi):", chemical_potential,
" a.u.", chemical_potential*
evolt,
" eV"
1588 IF ((homo > 0) .AND. .NOT. my_rtp)
THEN
1589 IF ((mo_occupation_numbers(homo) == maxocc) .AND. (last_mo > homo))
THEN
1590 gap = mo_eigenvalues(homo + 1) - &
1591 mo_eigenvalues(homo)
1592 WRITE (unit=iw, fmt=fmtstr6) &
1593 " MO| Band gap:", gap,
" a.u.", gap*
evolt,
" eV"
1596 WRITE (unit=iw, fmt=
"(A)")
""
1600 IF (
ALLOCATED(mo_eigenvalues))
DEALLOCATE (mo_eigenvalues)
1601 IF (
ALLOCATED(mo_occupation_numbers))
DEALLOCATE (mo_occupation_numbers)
1604 ignore_should_output=should_output)
static void dgemm(const char transa, const char transb, const int m, const int n, const int k, const double alpha, const double *a, const int lda, const double *b, const int ldb, const double beta, double *c, const int ldc)
Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b.
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum, ccon)
...
subroutine, public dbcsr_binary_write(matrix, filepath)
...
subroutine, public dbcsr_release(matrix)
...
real(kind=dp) function, public dbcsr_checksum(matrix, pos)
Calculates the checksum of a DBCSR matrix.
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm, plan)
Copy a DBCSR matrix to a BLACS matrix.
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
subroutine, public cp_dbcsr_write_sparse_matrix(sparse_matrix, before, after, qs_env, para_env, first_row, last_row, first_col, last_col, scale, output_unit, omit_headers, cartesian_basis)
...
Utility routines to open and close files. Tracking of preconnections.
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
represent a full matrix distributed on many processors
subroutine, public cp_fm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env)
returns all kind of information about the full matrix
subroutine, public cp_fm_write_unformatted(fm, unit)
...
subroutine, public cp_fm_set_submatrix(fm, new_values, start_row, start_col, n_rows, n_cols, alpha, beta, transpose)
sets a submatrix of a full matrix fm(start_row:start_row+n_rows,start_col:start_col+n_cols) = alpha*o...
subroutine, public cp_fm_set_all(matrix, alpha, beta)
set all elements of a matrix to the same value, and optionally the diagonal to a different one
subroutine, public cp_fm_get_submatrix(fm, target_m, start_row, start_col, n_rows, n_cols, transpose)
gets a submatrix of a full matrix op(target_m)(1:n_rows,1:n_cols) =fm(start_row:start_row+n_rows,...
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
character(len=default_path_length) function, public cp_print_key_generate_filename(logger, print_key, middle_name, extension, my_local)
Utility function that returns a unit number to write the print key. Might open a file with a unique f...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
sums arrays of real/complex numbers with much reduced round-off as compared to a naive implementation...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Interface to the message passing library MPI.
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public nco
integer, dimension(:, :), allocatable, public indco
integer, dimension(:), allocatable, public nso
character(len=12) function, public cgf_symbol(n, lxyz)
Build a Cartesian orbital symbol (orbital labels for printing).
character(len=6) function, public sgf_symbol(n, l, m)
Build a spherical orbital symbol (orbital labels for printing).
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
collects routines that calculate density matrices
Definition of the DFTB parameter types.
Working with the DFTB parameter types.
subroutine, public get_dftb_atom_param(dftb_parameter, name, typ, defined, z, zeff, natorb, lmax, skself, occupation, eta, energy, cutoff, xi, di, rcdisp, dudq)
...
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_vhxc, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, hund_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, proj_shell_charge, lr_atom, do_mtlr, u_j_loop, ao_coef, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
subroutine, public get_qs_kind_set(qs_kind_set, all_potential_present, tnadd_potential_present, gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, basis_rcut, do_mtlr_present, basis_type, total_zeff_corr, npgf_seg, cneo_potential_present, nkind_q, natom_q)
Get attributes of an atomic kind set.
Definition and initialisation of the mo data type.
subroutine, public wfn_restart_file_name(filename, exist, section, logger, kp, xas, rtp)
...
subroutine, public read_mo_set_from_restart(mo_array, qs_kind_set, particle_set, para_env, id_nr, multiplicity, dft_section, natom_mismatch, cdft, out_unit)
...
subroutine, public read_rt_mos_from_restart(mo_array, rt_mos, qs_kind_set, particle_set, para_env, id_nr, multiplicity, dft_section)
...
subroutine, public write_dm_binary_restart(mo_array, dft_section, tmpl_matrix)
calculates density matrix from mo set and writes the density matrix into a binary restart file
subroutine, public write_mo_set_low(mo_array, qs_kind_set, particle_set, ires, rt_mos, matrix_ks)
...
subroutine, public read_mos_restart_low(mos, para_env, qs_kind_set, particle_set, natom, rst_unit, multiplicity, rt_mos, natom_mismatch)
Reading the mos from apreviously defined restart file.
subroutine, public write_mo_set_to_output_unit(mo_set, qs_kind_set, particle_set, dft_section, before, kpoint, final_mos, spin, solver_method, rtp, cpart, sim_step, umo_set, qs_env, para_env_inter_kp)
Write MO information to output file (eigenvalues, occupation numbers, coefficients).
subroutine, public write_mo_set_to_restart(mo_array, particle_set, dft_section, qs_kind_set, matrix_ks)
...
subroutine, public write_rt_mos_to_restart(mo_array, rt_mos, particle_set, dft_section, qs_kind_set)
...
collects routines that perform operations directly related to MOs
Set occupation of molecular orbitals.
Definition and initialisation of the mo data type.
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kts, mu, flexible_electron_count)
Get the components of a MO set data structure.
Define the neighbor list data types and the corresponding functionality.
subroutine, public release_neighbor_list_sets(nlists)
releases an array of neighbor_list_sets
Generate the atomic neighbor lists.
subroutine, public setup_neighbor_list(ab_list, basis_set_a, basis_set_b, qs_env, mic, symmetric, molecular, operator_type)
Build a neighborlist.
Calculation of overlap matrix, its derivatives and forces.
subroutine, public build_overlap_matrix_simple(ks_env, matrix_s, basis_set_list_a, basis_set_list_b, sab_nl, lcart)
Calculation of the overlap matrix over Cartesian Gaussian functions.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...