77#include "./base/base_uses.f90"
83 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'dft_plus_u'
98 SUBROUTINE plus_u(qs_env, matrix_h, matrix_w)
102 POINTER :: matrix_h, matrix_w
104 CHARACTER(LEN=*),
PARAMETER :: routinen =
'plus_u'
106 INTEGER :: handle, output_unit, print_level
107 LOGICAL :: orthonormal_basis, should_output
112 CALL timeset(routinen, handle)
114 cpassert(
ASSOCIATED(qs_env))
116 NULLIFY (input, dft_control)
122 dft_control=dft_control)
130 orthonormal_basis = .false.
134 print_level = logger%iter_info%print_level
137 (.NOT.
PRESENT(matrix_w)))
139 extension=
".plus_u", &
140 ignore_should_output=should_output, &
141 log_filename=.false.)
145 SELECT CASE (dft_control%plus_u_method_id)
147 IF (orthonormal_basis)
THEN
150 CALL mulliken(qs_env, orthonormal_basis, matrix_h, &
151 should_output, output_unit, print_level)
153 CALL lowdin(qs_env, matrix_h, matrix_w, &
154 should_output, output_unit, print_level)
157 CALL mulliken(qs_env, orthonormal_basis, matrix_h, &
158 should_output, output_unit, print_level)
160 CALL mulliken_charges(qs_env, orthonormal_basis, matrix_h, matrix_w, &
161 should_output, output_unit, print_level)
163 cpabort(
"Invalid DFT+U method requested")
167 ignore_should_output=should_output)
169 CALL timestop(handle)
202 SUBROUTINE lowdin(qs_env, matrix_h, matrix_w, should_output, output_unit, &
207 POINTER :: matrix_h, matrix_w
208 LOGICAL,
INTENT(IN) :: should_output
209 INTEGER,
INTENT(IN) :: output_unit, print_level
211 CHARACTER(LEN=*),
PARAMETER :: routinen =
'lowdin'
213 CHARACTER(LEN=10) :: spin_info
214 CHARACTER(LEN=6),
ALLOCATABLE,
DIMENSION(:) :: symbol
215 CHARACTER(LEN=default_string_length) :: atomic_kind_name
216 INTEGER :: atom_a, handle, i, i0, iatom, ikind, iorb, isb, iset, isgf, ishell, ispin, j, &
217 jsb, jset, jsgf, jshell, lu, m, max_scf, n, natom, natom_of_kind, nkind, norb, nsb, &
218 nsbsize, nset, nsgf, nsgf_kind, nspin
219 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: first_sgf_atom
220 INTEGER,
DIMENSION(1) :: iloc
221 INTEGER,
DIMENSION(:),
POINTER :: atom_list, nshell, orbitals
222 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgf, l, last_sgf
223 LOGICAL :: debug, dft_plus_u_atom, &
224 fm_work1_local_alloc, &
225 fm_work2_local_alloc, found, &
227 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: orb_occ
228 REAL(kind=
dp) :: eps_scf, eps_u_ramping, fspin, occ, trq, &
229 trq2, u_minus_j, u_minus_j_target, &
231 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: q_eigval
232 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: q_eigvec, q_matrix, q_work
233 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: q_block, v_block
237 TYPE(
cp_fm_type),
POINTER :: fm_s_half, fm_work1, fm_work2
238 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_p, matrix_s
239 TYPE(
dbcsr_type),
POINTER :: sm_h, sm_p, sm_q, sm_s, sm_v, sm_w
245 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
250 CALL timeset(routinen, handle)
255 NULLIFY (atomic_kind_set)
256 NULLIFY (qs_kind_set)
257 NULLIFY (dft_control)
269 NULLIFY (orb_basis_set)
271 NULLIFY (particle_set)
290 atomic_kind_set=atomic_kind_set, &
291 qs_kind_set=qs_kind_set, &
292 dft_control=dft_control, &
295 particle_set=particle_set, &
302 cpassert(
ASSOCIATED(atomic_kind_set))
303 cpassert(
ASSOCIATED(dft_control))
304 cpassert(
ASSOCIATED(energy))
305 cpassert(
ASSOCIATED(matrix_s))
306 cpassert(
ASSOCIATED(particle_set))
307 cpassert(
ASSOCIATED(rho))
309 sm_s => matrix_s(1)%matrix
312 energy%dft_plus_u = 0.0_dp
314 nspin = dft_control%nspins
328 nkind =
SIZE(atomic_kind_set)
330 ALLOCATE (first_sgf_atom(natom))
331 first_sgf_atom(:) = 0
334 first_sgf=first_sgf_atom)
336 IF (
PRESENT(matrix_h) .OR.
PRESENT(matrix_w))
THEN
337 just_energy = .false.
344 fm_s_half => scf_env%s_half
345 cpassert(
ASSOCIATED(fm_s_half))
350 fm_work1_local_alloc = .false.
351 fm_work2_local_alloc = .false.
353 IF (
ASSOCIATED(scf_env%scf_work1))
THEN
354 IF (
ASSOCIATED(scf_env%scf_work1(1)%matrix_struct))
THEN
355 fm_work1 => scf_env%scf_work1(1)
359 fm_work2 => scf_env%scf_work2
361 IF ((.NOT.
ASSOCIATED(fm_work1)) .OR. &
362 (.NOT.
ASSOCIATED(fm_work2)))
THEN
368 IF (.NOT.
ASSOCIATED(fm_work1))
THEN
371 matrix_struct=fmstruct, &
372 name=
"FULL WORK MATRIX 1")
373 fm_work1_local_alloc = .true.
375 IF (.NOT.
ASSOCIATED(fm_work2))
THEN
378 matrix_struct=fmstruct, &
379 name=
"FULL WORK MATRIX 2")
380 fm_work2_local_alloc = .true.
397 IF (
PRESENT(matrix_h))
THEN
399 sm_h => matrix_h(ispin)%matrix
404 IF (
PRESENT(matrix_w))
THEN
406 sm_w => matrix_w(ispin)%matrix
411 sm_p => matrix_p(ispin)%matrix
425 matrix_a=fm_s_half, &
431 output_unit=output_unit)
433 output_unit=output_unit)
435 output_unit=output_unit)
458 atom_list=atom_list, &
459 name=atomic_kind_name, &
463 dft_plus_u_atom=dft_plus_u_atom, &
464 l_of_dft_plus_u=lu, &
466 basis_set=orb_basis_set, &
467 u_minus_j=u_minus_j, &
468 u_minus_j_target=u_minus_j_target, &
469 u_ramping=u_ramping, &
470 eps_u_ramping=eps_u_ramping, &
478 IF (.NOT.
ASSOCIATED(orb_basis_set)) cycle
479 IF (.NOT. dft_plus_u_atom) cycle
484 IF ((ispin == 1) .AND. (u_ramping > 0.0_dp))
THEN
485 IF (qs_env%scf_env%iter_delta <= eps_u_ramping)
THEN
486 u_minus_j = min(u_minus_j + u_ramping, u_minus_j_target)
487 CALL set_qs_kind(qs_kind_set(ikind), u_minus_j=u_minus_j)
489 IF (should_output .AND. (output_unit > 0))
THEN
490 WRITE (unit=output_unit, fmt=
"(T3,A,3X,A,F0.3,A)") &
491 "Kind name: "//trim(adjustl(atomic_kind_name)), &
492 "U(eff) = ", u_minus_j*
evolt,
" eV"
496 IF (u_minus_j == 0.0_dp) cycle
501 first_sgf=first_sgf, &
511 DO ishell = 1, nshell(iset)
512 IF (l(ishell, iset) == lu) nsb = nsb + 1
519 ALLOCATE (q_matrix(n, n))
520 q_matrix(:, :) = 0.0_dp
525 IF (output_unit > 0)
THEN
526 ALLOCATE (symbol(nsbsize))
531 WRITE (unit=spin_info, fmt=
"(A8,I2)")
" of spin", ispin
535 WRITE (unit=output_unit, fmt=
"(/,T3,A,I0,A,/,/,T5,A,10(2X,A6))") &
536 "DFT+U occupations"//trim(spin_info)//
" for the atoms of atomic kind ", ikind, &
537 ": "//trim(atomic_kind_name), &
538 "Atom Shell ", (adjustr(symbol(i)), i=1, nsbsize),
" Trace"
545 DO iatom = 1, natom_of_kind
547 atom_a = atom_list(iatom)
549 q_matrix(:, :) = 0.0_dp
559 IF (
ASSOCIATED(q_block))
THEN
565 DO ishell = 1, nshell(iset)
566 IF (l(ishell, iset) /= lu) cycle
567 DO isgf = first_sgf(ishell, iset), last_sgf(ishell, iset)
571 DO jshell = 1, nshell(jset)
572 IF (l(jshell, jset) /= lu) cycle
573 DO jsgf = first_sgf(jshell, jset), last_sgf(jshell, jset)
575 IF (isgf == jsgf) q_matrix(i, j) = q_block(isgf, jsgf)
585 IF (
ASSOCIATED(orbitals))
THEN
586 IF ((qs_env%scf_env%iter_delta >= eps_scf) .OR. &
587 ((qs_env%scf_env%outer_scf%iter_count == 0) .AND. &
588 (qs_env%scf_env%iter_count <= max_scf)))
THEN
589 ALLOCATE (orb_occ(nsbsize))
590 ALLOCATE (q_eigval(n))
592 ALLOCATE (q_eigvec(n, n))
593 q_eigvec(:, :) = 0.0_dp
594 norb =
SIZE(orbitals)
595 CALL jacobi(q_matrix, q_eigval, q_eigvec)
596 q_matrix(:, :) = 0.0_dp
599 DO i = (isb - 1)*nsbsize + 1, isb*nsbsize
600 trq = trq + q_eigval(i)
603 occ = trq/real(norb, kind=
dp)
608 iloc = maxloc(q_eigvec(:, isb*nsbsize))
609 jsb = int((iloc(1) - 1)/nsbsize) + 1
611 i0 = (jsb - 1)*nsbsize + 1
613 DO j = i0, jsb*nsbsize
617 IF (.NOT. orb_occ(lu + m + 1))
THEN
619 orb_occ(lu + m + 1) = .true.
623 iorb = i0 + lu + orbitals(i)
624 orb_occ(lu + orbitals(i) + 1) = .true.
626 cpassert(iorb /= -1000)
627 iloc = maxloc(q_eigvec(iorb, :))
628 q_eigval(iloc(1)) = min(occ, trq)
629 q_matrix(:, iloc(1)) = q_eigval(iloc(1))*q_eigvec(:, iloc(1))
630 trq = trq - q_eigval(iloc(1))
633 q_matrix(:, :) = matmul(q_matrix, transpose(q_eigvec))
635 DEALLOCATE (q_eigval)
636 DEALLOCATE (q_eigvec)
644 trq = trq + q_matrix(i, i)
646 trq2 = trq2 + q_matrix(i, j)*q_matrix(j, i)
651 trq2 = fspin*fspin*trq2
655 energy%dft_plus_u = energy%dft_plus_u + 0.5_dp*u_minus_j*(trq - trq2)/fspin
659 IF (.NOT. just_energy)
THEN
666 cpassert(
ASSOCIATED(v_block))
670 DO ishell = 1, nshell(iset)
671 IF (l(ishell, iset) /= lu) cycle
672 DO isgf = first_sgf(ishell, iset), last_sgf(ishell, iset)
676 DO jshell = 1, nshell(jset)
677 IF (l(jshell, jset) /= lu) cycle
678 DO jsgf = first_sgf(jshell, jset), last_sgf(jshell, jset)
680 IF (isgf == jsgf)
THEN
681 v_block(isgf, isgf) = u_minus_j*(0.5_dp - fspin*q_matrix(i, i))
683 cpassert(abs(q_matrix(j, i)) < 1.0e-14_dp)
684 v_block(isgf, jsgf) = -u_minus_j*fspin*q_matrix(j, i)
700 CALL para_env%sum(q_matrix)
701 IF (output_unit > 0)
THEN
702 ALLOCATE (q_work(nsb, nsbsize))
703 q_work(:, :) = 0.0_dp
706 DO i = (isb - 1)*nsbsize + 1, isb*nsbsize
708 q_work(isb, j) = q_matrix(i, i)
712 WRITE (unit=output_unit, fmt=
"(T3,I6,2X,I6,2X,10F8.3)") &
713 atom_a, isb, q_work(isb, :), sum(q_work(isb, :))
715 WRITE (unit=output_unit, fmt=
"(T12,A,2X,10F8.3)") &
716 "Total", (sum(q_work(:, i)), i=1, nsbsize), sum(q_work)
717 WRITE (unit=output_unit, fmt=
"(A)")
""
721 WRITE (unit=output_unit, fmt=
"(T9,70I10)") (i, i=1, n)
723 WRITE (unit=output_unit, fmt=
"(T3,I6,70F10.6)") i, q_matrix(i, :)
726 ALLOCATE (q_eigval(n))
728 ALLOCATE (q_eigvec(n, n))
729 q_eigvec(:, :) = 0.0_dp
730 CALL jacobi(q_matrix, q_eigval, q_eigvec)
731 WRITE (unit=output_unit, fmt=
"(/,T9,70I10)") (i, i=1, n)
732 WRITE (unit=output_unit, fmt=
"(T9,71F10.6)") (q_eigval(i), i=1, n), &
735 WRITE (unit=output_unit, fmt=
"(T3,I6,70F10.6)") i, q_eigvec(i, :)
737 DEALLOCATE (q_eigval)
738 DEALLOCATE (q_eigvec)
743 ALLOCATE (q_work(nsgf_kind, nsgf_kind))
744 q_work(:, :) = 0.0_dp
745 IF (
ASSOCIATED(q_block)) q_work(:, :) = q_block(:, :)
746 CALL para_env%sum(q_work)
747 IF (output_unit > 0)
THEN
748 norb =
SIZE(q_work, 1)
749 WRITE (unit=output_unit, fmt=
"(/,T9,200I10)") (i, i=1, norb)
751 WRITE (unit=output_unit, fmt=
"(T3,I6,200F10.6)") i, q_work(i, :)
753 ALLOCATE (q_eigval(norb))
755 ALLOCATE (q_eigvec(norb, norb))
756 q_eigvec(:, :) = 0.0_dp
757 CALL jacobi(q_work, q_eigval, q_eigvec)
758 WRITE (unit=output_unit, fmt=
"(/,T9,200I10)") (i, i=1, norb)
759 WRITE (unit=output_unit, fmt=
"(T9,201F10.6)") (q_eigval(i), i=1, norb), &
760 sum(q_eigval(1:norb))
762 WRITE (unit=output_unit, fmt=
"(T3,I6,200F10.6)") i, q_eigvec(i, :)
764 DEALLOCATE (q_eigval)
765 DEALLOCATE (q_eigvec)
773 IF (
ALLOCATED(q_matrix))
THEN
774 DEALLOCATE (q_matrix)
780 IF (
ASSOCIATED(sm_h))
THEN
791 IF (
ASSOCIATED(sm_w))
THEN
793 cpwarn(
"This is an experimental version of the forces calculation for the DFT+U method LOWDIN")
794 IF (virial%pv_calculate)
THEN
795 cpabort(
"The stress tensor is not implemented for the DFT+U method LOWDIN")
804 CALL para_env%sum(energy%dft_plus_u)
806 IF (energy%dft_plus_u < 0.0_dp) &
807 CALL cp_warn(__location__, &
808 "DFT+U energy contibution is negative possibly due "// &
809 "to unphysical Lowdin charges!")
814 IF (fm_work1_local_alloc)
THEN
816 DEALLOCATE (fm_work1)
818 IF (fm_work2_local_alloc)
THEN
820 DEALLOCATE (fm_work2)
828 CALL timestop(handle)
830 END SUBROUTINE lowdin
862 SUBROUTINE mulliken(qs_env, orthonormal_basis, matrix_h, should_output, &
863 output_unit, print_level)
866 LOGICAL,
INTENT(IN) :: orthonormal_basis
869 LOGICAL,
INTENT(IN) :: should_output
870 INTEGER,
INTENT(IN) :: output_unit, print_level
872 CHARACTER(LEN=*),
PARAMETER :: routinen =
'mulliken'
874 CHARACTER(LEN=10) :: spin_info
875 CHARACTER(LEN=6),
ALLOCATABLE,
DIMENSION(:) :: symbol
876 CHARACTER(LEN=default_string_length) :: atomic_kind_name
877 INTEGER :: atom_a, handle, i, i0, iatom, ikind, iorb, isb, iset, isgf, ishell, ispin, j, &
878 jsb, jset, jsgf, jshell, lu, m, max_scf, n, natom, natom_of_kind, nkind, norb, nsb, &
879 nsbsize, nset, nsgf_kind, nspin
880 INTEGER,
DIMENSION(1) :: iloc
881 INTEGER,
DIMENSION(:),
POINTER :: atom_list, nshell, orbitals
882 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgf, l, last_sgf
883 LOGICAL :: debug, dft_plus_u_atom, found, &
884 just_energy, occupation_enforced, smear
885 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: is_plus_u_kind, orb_occ
886 REAL(kind=
dp) :: eps_scf, eps_u_ramping, fspin, occ, trq, &
887 trq2, u_minus_j, u_minus_j_target, &
889 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: q_eigval
890 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: q_eigvec, q_matrix, q_work
891 REAL(kind=
dp),
DIMENSION(:),
POINTER :: nelec
892 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: h_block, p_block, q_block, s_block, &
896 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_p, matrix_s
897 TYPE(
dbcsr_type),
POINTER :: sm_h, sm_p, sm_q, sm_s, sm_v
903 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
906 CALL timeset(routinen, handle)
911 NULLIFY (atomic_kind_set)
912 NULLIFY (qs_kind_set)
913 NULLIFY (dft_control)
923 NULLIFY (orb_basis_set)
925 NULLIFY (particle_set)
941 occupation_enforced = .false.
944 atomic_kind_set=atomic_kind_set, &
945 qs_kind_set=qs_kind_set, &
946 dft_control=dft_control, &
948 particle_set=particle_set, &
952 cpassert(
ASSOCIATED(atomic_kind_set))
953 cpassert(
ASSOCIATED(dft_control))
954 cpassert(
ASSOCIATED(energy))
955 cpassert(
ASSOCIATED(particle_set))
956 cpassert(
ASSOCIATED(rho))
958 IF (orthonormal_basis)
THEN
964 cpassert(
ASSOCIATED(matrix_s))
965 sm_s => matrix_s(1)%matrix
972 energy%dft_plus_u = 0.0_dp
974 nspin = dft_control%nspins
988 nkind =
SIZE(atomic_kind_set)
990 ALLOCATE (is_plus_u_kind(nkind))
991 is_plus_u_kind(:) = .false.
993 IF (
PRESENT(matrix_h))
THEN
994 just_energy = .false.
1003 IF (
PRESENT(matrix_h))
THEN
1005 sm_h => matrix_h(ispin)%matrix
1012 sm_p => matrix_p(ispin)%matrix
1014 IF (.NOT.
ASSOCIATED(sm_q))
THEN
1020 IF (.NOT.
ASSOCIATED(sm_v))
THEN
1034 IF (.NOT.
ASSOCIATED(p_block)) cycle
1041 cpassert(
ASSOCIATED(q_block))
1043 IF (orthonormal_basis)
THEN
1045 DO isgf = 1,
SIZE(q_block, 1)
1046 q_block(isgf, isgf) = p_block(isgf, isgf)
1054 cpassert(
ASSOCIATED(s_block))
1056 DO jsgf = 1,
SIZE(p_block, 2)
1057 DO isgf = 1,
SIZE(p_block, 1)
1058 q_block(isgf, jsgf) = p_block(isgf, jsgf)*s_block(isgf, jsgf)
1079 atom_list=atom_list, &
1080 name=atomic_kind_name, &
1081 natom=natom_of_kind)
1084 dft_plus_u_atom=dft_plus_u_atom, &
1085 l_of_dft_plus_u=lu, &
1087 basis_set=orb_basis_set, &
1088 u_minus_j=u_minus_j, &
1089 u_minus_j_target=u_minus_j_target, &
1090 u_ramping=u_ramping, &
1091 eps_u_ramping=eps_u_ramping, &
1093 orbitals=orbitals, &
1100 IF (.NOT.
ASSOCIATED(orb_basis_set)) cycle
1101 IF (.NOT. dft_plus_u_atom) cycle
1106 IF ((ispin == 1) .AND. (u_ramping > 0.0_dp))
THEN
1107 IF (qs_env%scf_env%iter_delta <= eps_u_ramping)
THEN
1108 u_minus_j = min(u_minus_j + u_ramping, u_minus_j_target)
1109 CALL set_qs_kind(qs_kind_set(ikind), u_minus_j=u_minus_j)
1111 IF (should_output .AND. (output_unit > 0))
THEN
1112 WRITE (unit=output_unit, fmt=
"(T3,A,3X,A,F0.3,A)") &
1113 "Kind name: "//trim(adjustl(atomic_kind_name)), &
1114 "U(eff) = ", u_minus_j*
evolt,
" eV"
1118 IF (u_minus_j == 0.0_dp) cycle
1120 is_plus_u_kind(ikind) = .true.
1125 first_sgf=first_sgf, &
1127 last_sgf=last_sgf, &
1135 DO ishell = 1, nshell(iset)
1136 IF (l(ishell, iset) == lu) nsb = nsb + 1
1140 nsbsize = (2*lu + 1)
1143 ALLOCATE (q_matrix(n, n))
1144 q_matrix(:, :) = 0.0_dp
1149 IF (output_unit > 0)
THEN
1150 ALLOCATE (symbol(nsbsize))
1155 WRITE (unit=spin_info, fmt=
"(A8,I2)")
" of spin", ispin
1159 WRITE (unit=output_unit, fmt=
"(/,T3,A,I0,A,/,/,T5,A,10(2X,A6))") &
1160 "DFT+U occupations"//trim(spin_info)//
" for the atoms of atomic kind ", ikind, &
1161 ": "//trim(atomic_kind_name), &
1162 "Atom Shell ", (adjustr(symbol(i)), i=1, nsbsize),
" Trace"
1169 DO iatom = 1, natom_of_kind
1171 atom_a = atom_list(iatom)
1173 q_matrix(:, :) = 0.0_dp
1185 IF (
ASSOCIATED(q_block))
THEN
1189 DO ishell = 1, nshell(iset)
1190 IF (l(ishell, iset) /= lu) cycle
1191 DO isgf = first_sgf(ishell, iset), last_sgf(ishell, iset)
1195 DO jshell = 1, nshell(jset)
1196 IF (l(jshell, jset) /= lu) cycle
1197 DO jsgf = first_sgf(jshell, jset), last_sgf(jshell, jset)
1199 q_matrix(i, j) = q_block(isgf, jsgf)
1209 IF (
ASSOCIATED(orbitals))
THEN
1210 IF ((qs_env%scf_env%iter_delta >= eps_scf) .OR. &
1211 ((qs_env%scf_env%outer_scf%iter_count == 0) .AND. &
1212 (qs_env%scf_env%iter_count <= max_scf)))
THEN
1213 ALLOCATE (orb_occ(nsbsize))
1214 ALLOCATE (q_eigval(n))
1215 q_eigval(:) = 0.0_dp
1216 ALLOCATE (q_eigvec(n, n))
1217 q_eigvec(:, :) = 0.0_dp
1218 norb =
SIZE(orbitals)
1219 CALL jacobi(q_matrix, q_eigval, q_eigvec)
1220 q_matrix(:, :) = 0.0_dp
1221 IF (nelec(ispin) >= 0.5_dp)
THEN
1222 trq = nelec(ispin)/sum(q_eigval(1:n))
1223 q_eigval(1:n) = trq*q_eigval(1:n)
1227 DO i = (isb - 1)*nsbsize + 1, isb*nsbsize
1228 trq = trq + q_eigval(i)
1231 occ = trq/real(norb, kind=
dp)
1235 orb_occ(:) = .false.
1236 iloc = maxloc(q_eigvec(:, isb*nsbsize))
1237 jsb = int((iloc(1) - 1)/nsbsize) + 1
1239 i0 = (jsb - 1)*nsbsize + 1
1241 DO j = i0, jsb*nsbsize
1245 IF (.NOT. orb_occ(lu + m + 1))
THEN
1247 orb_occ(lu + m + 1) = .true.
1251 iorb = i0 + lu + orbitals(i)
1252 orb_occ(lu + orbitals(i) + 1) = .true.
1254 cpassert(iorb /= -1000)
1255 iloc = maxloc(q_eigvec(iorb, :))
1256 q_eigval(iloc(1)) = min(occ, trq)
1257 q_matrix(:, iloc(1)) = q_eigval(iloc(1))*q_eigvec(:, iloc(1))
1258 trq = trq - q_eigval(iloc(1))
1261 q_matrix(:, :) = matmul(q_matrix, transpose(q_eigvec))
1262 DEALLOCATE (orb_occ)
1263 DEALLOCATE (q_eigval)
1264 DEALLOCATE (q_eigvec)
1265 occupation_enforced = .true.
1273 trq = trq + q_matrix(i, i)
1275 trq2 = trq2 + q_matrix(i, j)*q_matrix(j, i)
1280 trq2 = fspin*fspin*trq2
1284 energy%dft_plus_u = energy%dft_plus_u + 0.5_dp*u_minus_j*(trq - trq2)/fspin
1288 IF (.NOT. just_energy)
THEN
1295 cpassert(
ASSOCIATED(v_block))
1299 DO ishell = 1, nshell(iset)
1300 IF (l(ishell, iset) /= lu) cycle
1301 DO isgf = first_sgf(ishell, iset), last_sgf(ishell, iset)
1305 DO jshell = 1, nshell(jset)
1306 IF (l(jshell, jset) /= lu) cycle
1307 DO jsgf = first_sgf(jshell, jset), last_sgf(jshell, jset)
1309 IF (isgf == jsgf)
THEN
1310 v_block(isgf, isgf) = u_minus_j*(0.5_dp - fspin*q_matrix(i, i))
1312 v_block(isgf, jsgf) = -u_minus_j*fspin*q_matrix(j, i)
1328 CALL para_env%sum(q_matrix)
1329 IF (output_unit > 0)
THEN
1330 ALLOCATE (q_work(nsb, nsbsize))
1331 q_work(:, :) = 0.0_dp
1334 DO i = (isb - 1)*nsbsize + 1, isb*nsbsize
1336 q_work(isb, j) = q_matrix(i, i)
1340 WRITE (unit=output_unit, fmt=
"(T3,I6,2X,I6,2X,10F8.3)") &
1341 atom_a, isb, q_work(isb, :), sum(q_work(isb, :))
1343 WRITE (unit=output_unit, fmt=
"(T12,A,2X,10F8.3)") &
1344 "Total", (sum(q_work(:, i)), i=1, nsbsize), sum(q_work)
1345 WRITE (unit=output_unit, fmt=
"(A)")
""
1349 WRITE (unit=output_unit, fmt=
"(T9,70I10)") (i, i=1, n)
1351 WRITE (unit=output_unit, fmt=
"(T3,I6,70F10.6)") i, q_matrix(i, :)
1354 ALLOCATE (q_eigval(n))
1355 q_eigval(:) = 0.0_dp
1356 ALLOCATE (q_eigvec(n, n))
1357 q_eigvec(:, :) = 0.0_dp
1358 CALL jacobi(q_matrix, q_eigval, q_eigvec)
1359 WRITE (unit=output_unit, fmt=
"(/,T9,70I10)") (i, i=1, n)
1360 WRITE (unit=output_unit, fmt=
"(T9,71F10.6)") (q_eigval(i), i=1, n), &
1363 WRITE (unit=output_unit, fmt=
"(T3,I6,70F10.6)") i, q_eigvec(i, :)
1365 DEALLOCATE (q_eigval)
1366 DEALLOCATE (q_eigvec)
1371 ALLOCATE (q_work(nsgf_kind, nsgf_kind))
1372 q_work(:, :) = 0.0_dp
1373 IF (
ASSOCIATED(q_block)) q_work(:, :) = q_block(:, :)
1374 CALL para_env%sum(q_work)
1375 IF (output_unit > 0)
THEN
1376 norb =
SIZE(q_work, 1)
1377 WRITE (unit=output_unit, fmt=
"(/,T9,200I10)") (i, i=1, norb)
1379 WRITE (unit=output_unit, fmt=
"(T3,I6,200F10.6)") i, q_work(i, :)
1381 ALLOCATE (q_eigval(norb))
1382 q_eigval(:) = 0.0_dp
1383 ALLOCATE (q_eigvec(norb, norb))
1384 q_eigvec(:, :) = 0.0_dp
1385 CALL jacobi(q_work, q_eigval, q_eigvec)
1386 WRITE (unit=output_unit, fmt=
"(/,T9,200I10)") (i, i=1, norb)
1387 WRITE (unit=output_unit, fmt=
"(T9,201F10.6)") (q_eigval(i), i=1, norb), &
1388 sum(q_eigval(1:norb))
1390 WRITE (unit=output_unit, fmt=
"(T3,I6,200F10.6)") i, q_eigvec(i, :)
1392 DEALLOCATE (q_eigval)
1393 DEALLOCATE (q_eigvec)
1401 IF (
ALLOCATED(q_matrix))
THEN
1402 DEALLOCATE (q_matrix)
1409 IF (
ASSOCIATED(sm_h))
THEN
1413 IF (.NOT. is_plus_u_kind(ikind)) cycle
1415 kind_a => atomic_kind_set(ikind)
1418 atom_list=atom_list, &
1419 natom=natom_of_kind)
1421 DO iatom = 1, natom_of_kind
1423 atom_a = atom_list(iatom)
1431 IF (.NOT.
ASSOCIATED(h_block)) cycle
1438 cpassert(
ASSOCIATED(v_block))
1440 IF (orthonormal_basis)
THEN
1441 DO isgf = 1,
SIZE(h_block, 1)
1442 h_block(isgf, isgf) = h_block(isgf, isgf) + v_block(isgf, isgf)
1450 cpassert(
ASSOCIATED(s_block))
1451 DO jsgf = 1,
SIZE(h_block, 2)
1452 DO isgf = 1,
SIZE(h_block, 1)
1453 h_block(isgf, jsgf) = h_block(isgf, jsgf) + v_block(isgf, jsgf)*s_block(isgf, jsgf)
1468 CALL para_env%sum(energy%dft_plus_u)
1470 IF (energy%dft_plus_u < 0.0_dp)
THEN
1471 IF (.NOT. occupation_enforced)
THEN
1472 CALL cp_warn(__location__, &
1473 "DFT+U energy contibution is negative possibly due "// &
1474 "to unphysical Mulliken charges!")
1481 CALL timestop(handle)
1521 SUBROUTINE mulliken_charges(qs_env, orthonormal_basis, matrix_h, matrix_w, &
1522 should_output, output_unit, print_level)
1525 LOGICAL,
INTENT(IN) :: orthonormal_basis
1527 POINTER :: matrix_h, matrix_w
1528 LOGICAL,
INTENT(IN) :: should_output
1529 INTEGER,
INTENT(IN) :: output_unit, print_level
1531 CHARACTER(LEN=*),
PARAMETER :: routinen =
'mulliken_charges'
1533 CHARACTER(LEN=10) :: spin_info
1534 CHARACTER(LEN=6),
ALLOCATABLE,
DIMENSION(:) :: symbol
1535 CHARACTER(LEN=default_string_length) :: atomic_kind_name
1536 INTEGER :: atom_a, handle, i, iatom, ikind, isb, iset, isgf, ishell, ispin, jatom, jsgf, lu, &
1537 m, natom, natom_of_kind, nkind, nsb, nset, nsgf, nspin, sgf
1538 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: first_sgf_atom
1539 INTEGER,
DIMENSION(:),
POINTER :: atom_list, nshell
1540 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgf, l, last_sgf
1541 LOGICAL :: dft_plus_u_atom, found, just_energy
1542 REAL(kind=
dp) :: eps_u_ramping, fspin, q, u_minus_j, &
1543 u_minus_j_target, u_ramping, v
1544 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: dedq, trps
1545 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: q_ii
1546 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: h_block, p_block, s_block, w_block
1549 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_p, matrix_s
1550 TYPE(
dbcsr_type),
POINTER :: sm_h, sm_p, sm_s, sm_w
1556 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1559 CALL timeset(routinen, handle)
1562 NULLIFY (atomic_kind_set)
1563 NULLIFY (qs_kind_set)
1564 NULLIFY (dft_control)
1573 NULLIFY (orb_basis_set)
1575 NULLIFY (particle_set)
1585 atomic_kind_set=atomic_kind_set, &
1586 qs_kind_set=qs_kind_set, &
1587 dft_control=dft_control, &
1589 particle_set=particle_set, &
1593 cpassert(
ASSOCIATED(atomic_kind_set))
1594 cpassert(
ASSOCIATED(dft_control))
1595 cpassert(
ASSOCIATED(energy))
1596 cpassert(
ASSOCIATED(particle_set))
1597 cpassert(
ASSOCIATED(rho))
1599 IF (orthonormal_basis)
THEN
1605 cpassert(
ASSOCIATED(matrix_s))
1606 sm_s => matrix_s(1)%matrix
1613 energy%dft_plus_u = 0.0_dp
1615 nspin = dft_control%nspins
1617 IF (nspin == 2)
THEN
1629 nkind =
SIZE(atomic_kind_set)
1631 ALLOCATE (first_sgf_atom(natom))
1632 first_sgf_atom(:) = 0
1635 first_sgf=first_sgf_atom)
1637 ALLOCATE (trps(nsgf))
1640 IF (
PRESENT(matrix_h) .OR.
PRESENT(matrix_w))
THEN
1641 ALLOCATE (dedq(nsgf))
1642 just_energy = .false.
1644 just_energy = .true.
1651 IF (
PRESENT(matrix_h))
THEN
1653 sm_h => matrix_h(ispin)%matrix
1659 IF (
PRESENT(matrix_w))
THEN
1661 sm_w => matrix_w(ispin)%matrix
1667 sm_p => matrix_p(ispin)%matrix
1679 IF (orthonormal_basis)
THEN
1681 IF (iatom /= jatom) cycle
1683 IF (
ASSOCIATED(p_block))
THEN
1684 sgf = first_sgf_atom(iatom)
1685 DO isgf = 1,
SIZE(p_block, 1)
1686 trps(sgf) = trps(sgf) + p_block(isgf, isgf)
1698 cpassert(
ASSOCIATED(s_block))
1700 sgf = first_sgf_atom(jatom)
1701 DO jsgf = 1,
SIZE(p_block, 2)
1702 DO isgf = 1,
SIZE(p_block, 1)
1703 trps(sgf) = trps(sgf) + p_block(isgf, jsgf)*s_block(isgf, jsgf)
1708 IF (iatom /= jatom)
THEN
1709 sgf = first_sgf_atom(iatom)
1710 DO isgf = 1,
SIZE(p_block, 1)
1711 DO jsgf = 1,
SIZE(p_block, 2)
1712 trps(sgf) = trps(sgf) + p_block(isgf, jsgf)*s_block(isgf, jsgf)
1724 CALL para_env%sum(trps)
1741 atom_list=atom_list, &
1742 name=atomic_kind_name, &
1743 natom=natom_of_kind)
1746 dft_plus_u_atom=dft_plus_u_atom, &
1747 l_of_dft_plus_u=lu, &
1748 basis_set=orb_basis_set, &
1749 u_minus_j=u_minus_j, &
1750 u_minus_j_target=u_minus_j_target, &
1751 u_ramping=u_ramping, &
1752 eps_u_ramping=eps_u_ramping)
1756 IF (.NOT.
ASSOCIATED(orb_basis_set)) cycle
1757 IF (.NOT. dft_plus_u_atom) cycle
1762 IF ((ispin == 1) .AND. (u_ramping > 0.0_dp))
THEN
1763 IF (qs_env%scf_env%iter_delta <= eps_u_ramping)
THEN
1764 u_minus_j = min(u_minus_j + u_ramping, u_minus_j_target)
1765 CALL set_qs_kind(qs_kind_set(ikind), u_minus_j=u_minus_j)
1767 IF (should_output .AND. (output_unit > 0))
THEN
1768 WRITE (unit=output_unit, fmt=
"(T3,A,3X,A,F0.3,A)") &
1769 "Kind name: "//trim(adjustl(atomic_kind_name)), &
1770 "U(eff) = ", u_minus_j*
evolt,
" eV"
1774 IF (u_minus_j == 0.0_dp) cycle
1779 first_sgf=first_sgf, &
1781 last_sgf=last_sgf, &
1789 DO ishell = 1, nshell(iset)
1790 IF (l(ishell, iset) == lu) nsb = nsb + 1
1794 ALLOCATE (q_ii(nsb, 2*lu + 1))
1799 IF (output_unit > 0)
THEN
1800 ALLOCATE (symbol(2*lu + 1))
1805 WRITE (unit=spin_info, fmt=
"(A8,I2)")
" of spin", ispin
1809 WRITE (unit=output_unit, fmt=
"(/,T3,A,I0,A,/,/,T5,A,10(2X,A6))") &
1810 "DFT+U occupations"//trim(spin_info)//
" for the atoms of atomic kind ", ikind, &
1811 ": "//trim(atomic_kind_name), &
1812 "Atom Shell ", (adjustr(symbol(i)), i=1, 2*lu + 1),
" Trace"
1819 DO iatom = 1, natom_of_kind
1821 atom_a = atom_list(iatom)
1835 IF (
ASSOCIATED(p_block))
THEN
1837 sgf = first_sgf_atom(atom_a)
1841 DO ishell = 1, nshell(iset)
1842 IF (l(ishell, iset) == lu)
THEN
1845 DO isgf = first_sgf(ishell, iset), last_sgf(ishell, iset)
1849 energy%dft_plus_u = energy%dft_plus_u + &
1850 0.5_dp*u_minus_j*(q - q**2)/fspin
1851 IF (.NOT. just_energy)
THEN
1852 dedq(sgf) = dedq(sgf) + u_minus_j*(0.5_dp - q)
1857 sgf = sgf + last_sgf(ishell, iset) - first_sgf(ishell, iset) + 1
1867 CALL para_env%sum(q_ii)
1868 IF (output_unit > 0)
THEN
1870 WRITE (unit=output_unit, fmt=
"(T3,I6,2X,I6,2X,10F8.3)") &
1871 atom_a, isb, q_ii(isb, :), sum(q_ii(isb, :))
1873 WRITE (unit=output_unit, fmt=
"(T12,A,2X,10F8.3)") &
1874 "Total", (sum(q_ii(:, i)), i=1, 2*lu + 1), sum(q_ii)
1875 WRITE (unit=output_unit, fmt=
"(A)")
""
1881 IF (
ALLOCATED(q_ii))
THEN
1887 IF (.NOT. just_energy)
THEN
1888 CALL para_env%sum(dedq)
1893 IF (
ASSOCIATED(sm_h))
THEN
1901 IF (orthonormal_basis)
THEN
1903 IF (iatom /= jatom) cycle
1905 IF (
ASSOCIATED(h_block))
THEN
1906 sgf = first_sgf_atom(iatom)
1907 DO isgf = 1,
SIZE(h_block, 1)
1908 h_block(isgf, isgf) = h_block(isgf, isgf) + dedq(sgf)
1922 cpassert(
ASSOCIATED(s_block))
1926 sgf = first_sgf_atom(iatom)
1928 DO isgf = 1,
SIZE(h_block, 1)
1929 IF (dedq(sgf) /= 0.0_dp)
THEN
1930 v = 0.5_dp*dedq(sgf)
1931 DO jsgf = 1,
SIZE(h_block, 2)
1932 h_block(isgf, jsgf) = h_block(isgf, jsgf) + v*s_block(isgf, jsgf)
1938 sgf = first_sgf_atom(jatom)
1940 DO jsgf = 1,
SIZE(h_block, 2)
1941 IF (dedq(sgf) /= 0.0_dp)
THEN
1942 v = 0.5_dp*dedq(sgf)
1943 DO isgf = 1,
SIZE(h_block, 1)
1944 h_block(isgf, jsgf) = h_block(isgf, jsgf) + v*s_block(isgf, jsgf)
1962 IF (
ASSOCIATED(sm_w) .AND. (.NOT. orthonormal_basis))
THEN
1972 IF (iatom == jatom) cycle
1981 cpassert(
ASSOCIATED(w_block))
1985 sgf = first_sgf_atom(iatom)
1987 DO isgf = 1,
SIZE(w_block, 1)
1988 IF (dedq(sgf) /= 0.0_dp)
THEN
1989 v = -0.5_dp*dedq(sgf)
1990 DO jsgf = 1,
SIZE(w_block, 2)
1991 w_block(isgf, jsgf) = w_block(isgf, jsgf) + v*p_block(isgf, jsgf)
1997 sgf = first_sgf_atom(jatom)
1999 DO jsgf = 1,
SIZE(w_block, 2)
2000 IF (dedq(sgf) /= 0.0_dp)
THEN
2001 v = -0.5_dp*dedq(sgf)
2002 DO isgf = 1,
SIZE(w_block, 1)
2003 w_block(isgf, jsgf) = w_block(isgf, jsgf) + v*p_block(isgf, jsgf)
2019 CALL para_env%sum(energy%dft_plus_u)
2021 IF (energy%dft_plus_u < 0.0_dp) &
2022 CALL cp_warn(__location__, &
2023 "DFT+U energy contibution is negative possibly due "// &
2024 "to unphysical Mulliken charges!")
2028 IF (
ALLOCATED(first_sgf_atom))
THEN
2029 DEALLOCATE (first_sgf_atom)
2032 IF (
ALLOCATED(trps))
THEN
2036 IF (
ALLOCATED(dedq))
THEN
2040 CALL timestop(handle)
2042 END SUBROUTINE mulliken_charges
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
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)
...
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public dudarev1997
integer, save, public dudarev1998
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_deallocate_matrix(matrix)
...
subroutine, public dbcsr_iterator_next_block(iterator, row, column, block, block_number_argument_has_been_removed, row_size, col_size, row_offset, col_offset)
...
logical function, public dbcsr_iterator_blocks_left(iterator)
...
subroutine, public dbcsr_iterator_stop(iterator)
...
subroutine, public dbcsr_get_block_p(matrix, row, col, block, found, row_size, col_size)
...
subroutine, public dbcsr_iterator_start(iterator, matrix, shared, dynamic, dynamic_byrows)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_get_block_diag(matrix, diag)
Copies the diagonal blocks of matrix into diag.
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_sm_fm_multiply(matrix, fm_in, fm_out, ncol, alpha, beta)
multiply a dbcsr with a fm matrix
subroutine, public cp_dbcsr_plus_fm_fm_t(sparse_matrix, matrix_v, matrix_g, ncol, alpha, keep_sparsity, symmetry_mode)
performs the multiplication sparse_matrix+dense_mat*dens_mat^T if matrix_g is not explicitly given,...
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
subroutine, public write_fm_with_basis_info(blacs_matrix, before, after, qs_env, para_env, first_row, last_row, first_col, last_col, output_unit, omit_headers)
Print a spherical matrix of blacs type.
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)
...
basic linear algebra operations for full matrices
subroutine, public cp_fm_transpose(matrix, matrixt)
transposes a matrix matrixt = matrix ^ T
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
various routines to log and control the output. The idea is that decisions about where to log should ...
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)
...
integer, parameter, public low_print_level
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...
Add the DFT+U contribution to the Hamiltonian matrix.
subroutine, public plus_u(qs_env, matrix_h, matrix_w)
Add the DFT+U contribution to the Hamiltonian matrix. Wrapper routine for all "+U" methods.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Collection of simple mathematical functions and subroutines.
subroutine, public jacobi(a, d, v)
Jacobi matrix diagonalization. The eigenvalues are returned in vector d and the eigenvectors are retu...
Interface to the message passing library MPI.
compute mulliken charges we (currently) define them as c_i = 1/2 [ (PS)_{ii} + (SP)_{ii} ]
character(len=6) function, public sgf_symbol(n, l, m)
Build a spherical orbital symbol (orbital labels for printing).
basic linear algebra operations for full matrixes
Define methods related to particle_type.
subroutine, public get_particle_set(particle_set, qs_kind_set, first_sgf, last_sgf, nsgf, nmao, basis)
Get the components of a particle set.
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
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, 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, 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, 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, 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, ecoul_1c, rho0_s_rs, rho0_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)
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, 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, 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, init_u_ramping_each_scf, reltmat, ghost, 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, basis_type, total_zeff_corr, npgf_seg)
Get attributes of an atomic kind set.
subroutine, public set_qs_kind(qs_kind, paw_atom, ghost, floating, hard_radius, hard0_radius, covalent_radius, vdw_radius, lmax_rho0, zeff, no_optimize, dispersion, u_minus_j, reltmat, dftb_parameter, xtb_parameter, elec_conf, pao_basis_size)
Set the components of an atomic kind data set.
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
returns info about the density described by this object. If some representation is not available an e...
module that contains the definitions of the scf types
Provides all information about an atomic kind.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
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.
keeps the density in various representations, keeping track of which ones are valid.