31 dbcsr_type_antisymmetric,&
84#include "./base/base_uses.f90"
91 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_linres_issc_utils'
107 CHARACTER(LEN=*),
PARAMETER :: routinen =
'issc_response'
109 INTEGER :: handle, idir, ijdir, ispin, jdir, nao, &
110 nmo, nspins, output_unit
111 LOGICAL :: do_dso, do_fc, do_pso, do_sd, should_stop
114 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: h1_psi0, psi0_order, psi1
115 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: fc_psi0, psi1_fc
116 TYPE(
cp_fm_type),
DIMENSION(:, :),
POINTER :: dso_psi0, efg_psi0, psi1_dso, psi1_efg, &
127 CALL timeset(routinen, handle)
129 NULLIFY (dft_control, linres_control, lr_section, issc_section)
130 NULLIFY (logger, mpools, mo_coeff, para_env)
131 NULLIFY (tmp_fm_struct, psi1_fc, psi1_efg, psi1_pso, pso_psi0, fc_psi0, efg_psi0)
136 "PROPERTIES%LINRES%SPINSPIN")
139 extension=
".linresLog")
140 IF (output_unit > 0)
THEN
141 WRITE (unit=output_unit, fmt=
"(T10,A,/)") &
142 "*** Self consistent optimization of the response wavefunctions ***"
146 dft_control=dft_control, &
148 linres_control=linres_control, &
152 nspins = dft_control%nspins
170 ALLOCATE (psi0_order(nspins))
171 ALLOCATE (psi1(nspins), h1_psi0(nspins))
173 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff)
174 psi0_order(ispin) = mo_coeff
176 NULLIFY (tmp_fm_struct)
179 context=mo_coeff%matrix_struct%context)
185 should_stop = .false.
196 IF (output_unit > 0)
THEN
197 WRITE (output_unit,
"(T10,A)")
"Response to the perturbation operator efg_"//achar(idir + 119)//achar(jdir + 119)
209 CALL cp_fm_to_fm(efg_psi0(ispin, ijdir), h1_psi0(ispin))
213 linres_control%lr_triplet = .false.
214 linres_control%do_kernel = .false.
215 linres_control%converged = .false.
216 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, output_unit, should_stop)
221 CALL cp_fm_to_fm(psi1(ispin), psi1_efg(ispin, ijdir))
239 IF (output_unit > 0)
THEN
240 WRITE (output_unit,
"(T10,A)")
"Write the resulting psi1 in restart file... not implemented yet"
254 IF (output_unit > 0)
THEN
255 WRITE (output_unit,
"(T10,A)")
"Response to the perturbation operator pso_"//achar(idir + 119)
267 CALL cp_fm_to_fm(pso_psi0(ispin, idir), h1_psi0(ispin))
271 linres_control%lr_triplet = .false.
272 linres_control%do_kernel = .false.
273 linres_control%converged = .false.
274 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, output_unit, should_stop)
279 CALL cp_fm_to_fm(psi1(ispin), psi1_pso(ispin, idir))
297 IF (output_unit > 0)
THEN
298 WRITE (output_unit,
"(T10,A)")
"Write the resulting psi1 in restart file... not implemented yet"
310 IF (output_unit > 0)
THEN
311 WRITE (output_unit,
"(T10,A)")
"Response to the perturbation operator fc"
327 linres_control%lr_triplet = .true.
328 linres_control%do_kernel = .true.
329 linres_control%converged = .false.
330 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, output_unit, should_stop)
353 IF (output_unit > 0)
THEN
354 WRITE (output_unit,
"(T10,A)")
"Write the resulting psi1 in restart file... not implemented yet"
368 IF (output_unit > 0)
THEN
369 WRITE (output_unit,
"(T10,A)")
"Response to the perturbation operator r_"//achar(idir + 119)
381 CALL cp_fm_to_fm(dso_psi0(ispin, idir), h1_psi0(ispin))
385 linres_control%lr_triplet = .false.
386 linres_control%do_kernel = .true.
387 linres_control%converged = .false.
388 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, output_unit, should_stop)
393 CALL cp_fm_to_fm(psi1(ispin), psi1_dso(ispin, idir))
411 IF (output_unit > 0)
THEN
412 WRITE (output_unit,
"(T10,A)")
"Write the resulting psi1 in restart file... not implemented yet"
423 IF (output_unit > 0)
THEN
424 WRITE (output_unit,
'(T2,A,E23.16)')
'ISSC| response: CheckSum =', chk
431 DEALLOCATE (psi0_order)
434 &
"PRINT%PROGRAM_RUN_INFO")
436 CALL timestop(handle)
450 INTEGER,
INTENT(IN) :: iatom
452 CHARACTER(LEN=*),
PARAMETER :: routinen =
'issc_issc'
454 INTEGER :: handle, ispin, ixyz, jatom, jxyz, natom, &
456 LOGICAL :: do_dso, do_fc, do_pso, do_sd, gapw
457 REAL(
dp) :: buf, facdso, facfc, facpso, facsd, g, &
458 issc_dso, issc_fc, issc_pso, issc_sd, &
460 REAL(
dp),
DIMENSION(3) :: r_i, r_j
461 REAL(
dp),
DIMENSION(:, :, :, :, :),
POINTER :: issc
463 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: fc_psi0, psi1_fc
464 TYPE(
cp_fm_type),
DIMENSION(:, :),
POINTER :: psi1_dso, psi1_efg, psi1_pso
466 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_dso, matrix_efg, matrix_fc, &
473 CALL timeset(routinen, handle)
475 NULLIFY (cell, dft_control, particle_set, issc, psi1_fc, psi1_efg, psi1_pso)
476 NULLIFY (matrix_efg, matrix_fc, matrix_pso, mos, mo_coeff, fc_psi0)
480 dft_control=dft_control, &
481 particle_set=particle_set, &
484 gapw = dft_control%qs_control%gapw
485 natom =
SIZE(particle_set, 1)
486 nspins = dft_control%nspins
489 matrix_efg=matrix_efg, &
490 matrix_pso=matrix_pso, &
491 matrix_fc=matrix_fc, &
492 matrix_dso=matrix_dso, &
513 &
"PROPERTIES%LINRES%SPINSPIN")
517 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, maxocc=maxocc)
521 r_i = particle_set(iatom)%r
522 r_j = particle_set(jatom)%r
523 r_j =
pbc(r_i, r_j, cell) + r_i
532 IF (do_fc .AND. iatom .NE. jatom)
THEN
535 CALL dbcsr_set(matrix_fc(1)%matrix, 0.0_dp)
538 fc_psi0(ispin), ncol=nmo,&
542 WRITE (*, *)
' jatom', jatom,
'tr(P*fc)=', buf
544 CALL cp_fm_trace(fc_psi0(ispin), psi1_fc(ispin), buf)
545 issc_fc = 2.0_dp*2.0_dp*maxocc*facfc*buf
546 issc(1, 1, iatom, jatom, 1) = issc(1, 1, iatom, jatom, 1) + issc_fc
547 issc(2, 2, iatom, jatom, 1) = issc(2, 2, iatom, jatom, 1) + issc_fc
548 issc(3, 3, iatom, jatom, 1) = issc(3, 3, iatom, jatom, 1) + issc_fc
553 IF (do_sd .AND. iatom .NE. jatom)
THEN
556 CALL dbcsr_set(matrix_efg(1)%matrix, 0.0_dp)
557 CALL dbcsr_set(matrix_efg(2)%matrix, 0.0_dp)
558 CALL dbcsr_set(matrix_efg(3)%matrix, 0.0_dp)
559 CALL dbcsr_set(matrix_efg(4)%matrix, 0.0_dp)
560 CALL dbcsr_set(matrix_efg(5)%matrix, 0.0_dp)
561 CALL dbcsr_set(matrix_efg(6)%matrix, 0.0_dp)
565 fc_psi0(ispin), ncol=nmo,&
566 & alpha=1.0_dp, beta=0.0_dp)
568 WRITE (*, *)
' jatom', jatom, ixyz,
'tr(P*efg)=', buf
570 CALL cp_fm_trace(fc_psi0(ispin), psi1_efg(ispin, jxyz), buf)
571 issc_sd = 2.0_dp*maxocc*facsd*buf
580 IF (do_pso .AND. iatom .NE. jatom)
THEN
583 CALL dbcsr_set(matrix_pso(1)%matrix, 0.0_dp)
584 CALL dbcsr_set(matrix_pso(2)%matrix, 0.0_dp)
585 CALL dbcsr_set(matrix_pso(3)%matrix, 0.0_dp)
589 fc_psi0(ispin), ncol=nmo,&
590 & alpha=1.0_dp, beta=0.0_dp)
592 CALL cp_fm_trace(fc_psi0(ispin), psi1_pso(ispin, jxyz), buf)
593 issc_pso = -2.0_dp*maxocc*facpso*buf
594 issc(ixyz, jxyz, iatom, jatom, 3) = issc(ixyz, jxyz, iatom, jatom, 3) + issc_pso
602 IF (do_dso .AND. iatom .EQ. natom .AND. jatom .EQ. natom)
THEN
626 fc_psi0(ispin), ncol=nmo,&
627 & alpha=1.0_dp, beta=0.0_dp)
629 CALL cp_fm_trace(psi1_dso(ispin, jxyz), fc_psi0(ispin), buf)
631 issc_dso = 2.0_dp*maxocc*buf
632 issc(ixyz, jxyz, iatom, jatom, 4) = issc(ixyz, jxyz, iatom, jatom, 4) + issc_dso
643 CALL timestop(handle)
656 CHARACTER(LEN=2) :: element_symbol_i, element_symbol_j
657 CHARACTER(LEN=default_string_length) :: name_i, name_j, title
658 INTEGER :: iatom, jatom, natom, output_unit, &
660 LOGICAL :: do_dso, do_fc, do_pso, do_sd, gapw
661 REAL(
dp) :: eig(3), issc_iso_dso, issc_iso_fc, &
662 issc_iso_pso, issc_iso_sd, &
663 issc_iso_tot, issc_tmp(3, 3)
664 REAL(
dp),
DIMENSION(:, :, :, :, :),
POINTER :: issc
665 REAL(
dp),
EXTERNAL :: ddot
672 NULLIFY (logger, particle_set, atom_kind_i, atom_kind_j, dft_control)
678 "PROPERTIES%LINRES%SPINSPIN")
688 dft_control=dft_control, &
689 particle_set=particle_set)
691 natom =
SIZE(particle_set, 1)
692 gapw = dft_control%qs_control%gapw
695 IF (output_unit > 0)
THEN
696 WRITE (output_unit,
'(T2,A,E14.6)')
'ISSC| CheckSum K =', &
697 sqrt(ddot(
SIZE(issc), issc, 1, issc, 1))
704 extension=
".data", middle_name=
"K", log_filename=.false.)
706 IF (unit_atoms > 0)
THEN
707 WRITE (unit_atoms, *)
708 WRITE (unit_atoms, *)
709 WRITE (title,
'(A)')
"Indirect spin-spin coupling matrix"
710 WRITE (unit_atoms,
'(T2,A)') title
712 atom_kind_i => particle_set(iatom)%atomic_kind
713 CALL get_atomic_kind(atom_kind_i, name=name_i, element_symbol=element_symbol_i)
715 atom_kind_j => particle_set(jatom)%atomic_kind
716 CALL get_atomic_kind(atom_kind_j, name=name_j, element_symbol=element_symbol_j)
718 IF (iatom .EQ. jatom .AND. .NOT. do_dso) cycle
722 issc_tmp(:, :) = issc(:, :, iatom, jatom, 1)
723 issc_tmp(:, :) = 0.5_dp*(issc_tmp(:, :) + transpose(issc_tmp(:, :)))
725 issc_iso_fc = (eig(1) + eig(2) + eig(3))/3.0_dp
728 issc_tmp(:, :) = issc(:, :, iatom, jatom, 2)
729 issc_tmp(:, :) = 0.5_dp*(issc_tmp(:, :) + transpose(issc_tmp(:, :)))
731 issc_iso_sd = (eig(1) + eig(2) + eig(3))/3.0_dp
734 issc_tmp(:, :) = issc(:, :, iatom, jatom, 3)
735 issc_tmp(:, :) = 0.5_dp*(issc_tmp(:, :) + transpose(issc_tmp(:, :)))
737 issc_iso_pso = (eig(1) + eig(2) + eig(3))/3.0_dp
740 issc_tmp(:, :) = issc(:, :, iatom, jatom, 4)
741 issc_tmp(:, :) = 0.5_dp*(issc_tmp(:, :) + transpose(issc_tmp(:, :)))
743 issc_iso_dso = (eig(1) + eig(2) + eig(3))/3.0_dp
746 issc_iso_tot = issc_iso_fc + issc_iso_sd + issc_iso_dso + issc_iso_pso
749 WRITE (unit_atoms, *)
750 WRITE (unit_atoms,
'(T2,2(A,I5,A,2X,A2))')
'Indirect spin-spin coupling between ', &
751 iatom, trim(name_i), element_symbol_i,
' and ', &
752 jatom, trim(name_j), element_symbol_j
754 IF (do_fc)
WRITE (unit_atoms,
'(T1,A,f12.4,A)')
' Isotropic FC contribution = ', issc_iso_fc,
' Hz'
755 IF (do_sd)
WRITE (unit_atoms,
'(T1,A,f12.4,A)')
' Isotropic SD contribution = ', issc_iso_sd,
' Hz'
756 IF (do_pso)
WRITE (unit_atoms,
'(T1,A,f12.4,A)')
' Isotropic PSO contribution = ', issc_iso_pso,
' Hz'
758 IF (do_dso)
WRITE (unit_atoms,
'(T1,A,f12.4,A)')
' !!! POLARIZABILITY (for the moment) = ', issc_iso_dso,
' Hz'
759 IF (.NOT. do_dso)
WRITE (unit_atoms,
'(T1,A,f12.4,A)')
' Isotropic coupling = ', issc_iso_tot,
' Hz'
780 CHARACTER(LEN=*),
PARAMETER :: routinen =
'issc_env_init'
782 INTEGER :: handle, iatom, idir, ini, ir, ispin, &
783 istat, m, n, n_rep, nao, natom, &
785 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: first_sgf, last_sgf
786 INTEGER,
DIMENSION(:),
POINTER ::
list, row_blk_sizes
798 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
803 CALL timeset(routinen, handle)
805 NULLIFY (linres_control)
806 NULLIFY (logger, issc_section)
807 NULLIFY (tmp_fm_struct)
808 NULLIFY (particle_set, qs_kind_set)
815 extension=
".linresLog")
819 IF (output_unit > 0)
THEN
820 WRITE (output_unit,
"(/,T20,A,/)")
"*** Start indirect spin-spin coupling Calculation ***"
821 WRITE (output_unit,
"(T10,A,/)")
"Inizialization of the ISSC environment"
825 &
"PROPERTIES%LINRES%SPINSPIN")
830 dft_control=dft_control, &
831 linres_control=linres_control, &
834 particle_set=particle_set, &
835 qs_kind_set=qs_kind_set, &
836 dbcsr_dist=dbcsr_dist)
839 gapw = dft_control%qs_control%gapw
840 nspins = dft_control%nspins
841 natom =
SIZE(particle_set, 1)
844 IF (.NOT. linres_control%localized_psi0) &
845 CALL cp_warn(__location__,
'To get indirect spin-spin coupling parameters within '// &
846 'PBC you need to localize zero order orbitals')
864 NULLIFY (issc_env%issc_on_atom_list)
869 IF (
ASSOCIATED(
list))
THEN
871 DO ini = 1,
SIZE(
list)
872 issc_env%issc_on_atom_list(ini + n) =
list(ini)
878 IF (.NOT.
ASSOCIATED(issc_env%issc_on_atom_list))
THEN
879 ALLOCATE (issc_env%issc_on_atom_list(natom), stat=istat)
880 cpassert(istat .EQ. 0)
882 issc_env%issc_on_atom_list(iatom) = iatom
885 issc_env%issc_natms =
SIZE(issc_env%issc_on_atom_list)
889 ALLOCATE (issc_env%issc(3, 3, issc_env%issc_natms, issc_env%issc_natms, 4), &
890 issc_env%issc_loc(3, 3, issc_env%issc_natms, issc_env%issc_natms, 4), &
893 issc_env%issc(:, :, :, :, :) = 0.0_dp
894 issc_env%issc_loc(:, :, :, :, :) = 0.0_dp
897 ALLOCATE (issc_env%efg_psi0(nspins, 6), issc_env%pso_psi0(nspins, 3), issc_env%fc_psi0(nspins), &
898 issc_env%psi1_efg(nspins, 6), issc_env%psi1_pso(nspins, 3), issc_env%psi1_fc(nspins), &
899 issc_env%dso_psi0(nspins, 3), issc_env%psi1_dso(nspins, 3), &
904 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff)
907 NULLIFY (tmp_fm_struct)
910 context=mo_coeff%matrix_struct%context)
912 CALL cp_fm_create(issc_env%psi1_efg(ispin, idir), tmp_fm_struct)
913 CALL cp_fm_create(issc_env%efg_psi0(ispin, idir), tmp_fm_struct)
916 CALL cp_fm_create(issc_env%psi1_pso(ispin, idir), tmp_fm_struct)
917 CALL cp_fm_create(issc_env%pso_psi0(ispin, idir), tmp_fm_struct)
918 CALL cp_fm_create(issc_env%psi1_dso(ispin, idir), tmp_fm_struct)
919 CALL cp_fm_create(issc_env%dso_psi0(ispin, idir), tmp_fm_struct)
921 CALL cp_fm_create(issc_env%psi1_fc(ispin), tmp_fm_struct)
922 CALL cp_fm_create(issc_env%fc_psi0(ispin), tmp_fm_struct)
927 ALLOCATE (first_sgf(natom))
928 ALLOCATE (last_sgf(natom))
930 first_sgf=first_sgf, &
932 ALLOCATE (row_blk_sizes(natom))
933 CALL dbcsr_convert_offsets_to_sizes(first_sgf, row_blk_sizes, last_sgf)
934 DEALLOCATE (first_sgf)
935 DEALLOCATE (last_sgf)
940 ALLOCATE (issc_env%matrix_efg(1)%matrix)
941 CALL dbcsr_create(matrix=issc_env%matrix_efg(1)%matrix, &
942 name=
"efg (3xx-rr)/3", &
943 dist=dbcsr_dist, matrix_type=dbcsr_type_symmetric, &
944 row_blk_size=row_blk_sizes, col_blk_size=row_blk_sizes, &
948 ALLOCATE (issc_env%matrix_efg(2)%matrix, &
949 issc_env%matrix_efg(3)%matrix, issc_env%matrix_efg(4)%matrix, &
950 issc_env%matrix_efg(5)%matrix, issc_env%matrix_efg(6)%matrix)
951 CALL dbcsr_copy(issc_env%matrix_efg(2)%matrix, issc_env%matrix_efg(1)%matrix, &
953 CALL dbcsr_copy(issc_env%matrix_efg(3)%matrix, issc_env%matrix_efg(1)%matrix, &
955 CALL dbcsr_copy(issc_env%matrix_efg(4)%matrix, issc_env%matrix_efg(1)%matrix, &
957 CALL dbcsr_copy(issc_env%matrix_efg(5)%matrix, issc_env%matrix_efg(1)%matrix, &
959 CALL dbcsr_copy(issc_env%matrix_efg(6)%matrix, issc_env%matrix_efg(1)%matrix, &
962 CALL dbcsr_set(issc_env%matrix_efg(1)%matrix, 0.0_dp)
963 CALL dbcsr_set(issc_env%matrix_efg(2)%matrix, 0.0_dp)
964 CALL dbcsr_set(issc_env%matrix_efg(3)%matrix, 0.0_dp)
965 CALL dbcsr_set(issc_env%matrix_efg(4)%matrix, 0.0_dp)
966 CALL dbcsr_set(issc_env%matrix_efg(5)%matrix, 0.0_dp)
967 CALL dbcsr_set(issc_env%matrix_efg(6)%matrix, 0.0_dp)
971 ALLOCATE (issc_env%matrix_pso(1)%matrix)
972 CALL dbcsr_create(matrix=issc_env%matrix_pso(1)%matrix, &
974 dist=dbcsr_dist, matrix_type=dbcsr_type_antisymmetric, &
975 row_blk_size=row_blk_sizes, col_blk_size=row_blk_sizes, &
979 ALLOCATE (issc_env%matrix_pso(2)%matrix, issc_env%matrix_pso(3)%matrix)
980 CALL dbcsr_copy(issc_env%matrix_pso(2)%matrix, issc_env%matrix_pso(1)%matrix, &
982 CALL dbcsr_copy(issc_env%matrix_pso(3)%matrix, issc_env%matrix_pso(1)%matrix, &
984 CALL dbcsr_set(issc_env%matrix_pso(1)%matrix, 0.0_dp)
985 CALL dbcsr_set(issc_env%matrix_pso(2)%matrix, 0.0_dp)
986 CALL dbcsr_set(issc_env%matrix_pso(3)%matrix, 0.0_dp)
990 ALLOCATE (issc_env%matrix_dso(1)%matrix, issc_env%matrix_dso(2)%matrix, issc_env%matrix_dso(3)%matrix)
991 CALL dbcsr_copy(issc_env%matrix_dso(1)%matrix, issc_env%matrix_efg(1)%matrix, &
993 CALL dbcsr_copy(issc_env%matrix_dso(2)%matrix, issc_env%matrix_efg(1)%matrix, &
995 CALL dbcsr_copy(issc_env%matrix_dso(3)%matrix, issc_env%matrix_efg(1)%matrix, &
997 CALL dbcsr_set(issc_env%matrix_dso(1)%matrix, 0.0_dp)
998 CALL dbcsr_set(issc_env%matrix_dso(2)%matrix, 0.0_dp)
999 CALL dbcsr_set(issc_env%matrix_dso(3)%matrix, 0.0_dp)
1003 ALLOCATE (issc_env%matrix_fc(1)%matrix)
1004 CALL dbcsr_copy(issc_env%matrix_fc(1)%matrix, issc_env%matrix_efg(1)%matrix, &
1006 CALL dbcsr_set(issc_env%matrix_fc(1)%matrix, 0.0_dp)
1008 DEALLOCATE (row_blk_sizes)
1011 IF (output_unit > 0)
THEN
1012 WRITE (output_unit,
"(T2,A,T60,I4,A)")&
1013 &
"ISSC| spin-spin coupling computed for ", issc_env%issc_natms,
' atoms'
1017 &
"PRINT%PROGRAM_RUN_INFO")
1019 CALL timestop(handle)
1032 IF (
ASSOCIATED(issc_env%issc_on_atom_list))
THEN
1033 DEALLOCATE (issc_env%issc_on_atom_list)
1035 IF (
ASSOCIATED(issc_env%issc))
THEN
1036 DEALLOCATE (issc_env%issc)
1038 IF (
ASSOCIATED(issc_env%issc_loc))
THEN
1039 DEALLOCATE (issc_env%issc_loc)
1067 IF (
ASSOCIATED(issc_env%matrix_efg))
THEN
1072 IF (
ASSOCIATED(issc_env%matrix_pso))
THEN
1077 IF (
ASSOCIATED(issc_env%matrix_dso))
THEN
1082 IF (
ASSOCIATED(issc_env%matrix_fc))
THEN
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.
Handles all functions related to the CELL.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_set(matrix, alpha)
...
Routines that link DBCSR and CP2K concepts together.
subroutine, public cp_dbcsr_alloc_block_from_nbl(matrix, sab_orb, desymmetrize)
allocate the blocks of a dbcsr based on the neighbor list
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
basic linear algebra operations for full matrices
real(kind=dp) function, public cp_fm_frobenius_norm(matrix_a)
computes the Frobenius norm of matrix_a
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_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_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_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 ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
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)
...
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...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
Collection of simple mathematical functions and subroutines.
subroutine, public diamat_all(a, eigval, dac)
Diagonalize the symmetric n by n matrix a using the LAPACK library. Only the upper triangle of matrix...
Utility routines for the memory handling.
Interface to the message passing library MPI.
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 a_fine
real(kind=dp), parameter, public hertz
real(kind=dp), parameter, public p_mass
real(kind=dp), parameter, public e_mass
Distribution of the electric field gradient integral matrix.
subroutine, public build_efg_matrix(qs_env, matrix_efg, rc)
Calculation of the electric field gradient matrix over Cartesian Gaussian functions.
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.
Chemical shift calculation by dfpt Initialization of the issc_env, creation of the special neighbor l...
subroutine, public issc_issc(issc_env, qs_env, iatom)
...
subroutine, public issc_response(issc_env, p_env, qs_env)
Initialize the issc environment.
subroutine, public issc_env_cleanup(issc_env)
Deallocate the issc environment.
subroutine, public issc_env_init(issc_env, qs_env)
Initialize the issc environment.
subroutine, public issc_print(issc_env, qs_env)
...
localize wavefunctions linear response scf
subroutine, public linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, iounit, should_stop)
scf loop to optimize the first order wavefunctions (psi1) given a perturbation as an operator applied...
Type definitiona for linear response calculations.
subroutine, public get_issc_env(issc_env, issc_on_atom_list, issc_gapw_radius, issc_loc, do_fc, do_sd, do_pso, do_dso, issc, interpolate_issc, psi1_efg, psi1_pso, psi1_dso, psi1_fc, efg_psi0, pso_psi0, dso_psi0, fc_psi0, matrix_efg, matrix_pso, matrix_dso, matrix_fc)
...
wrapper for the pools of matrixes
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.
basis types for the calculation of the perturbation of density theory.
Distribution of the spin orbit integral matrix.
subroutine, public build_pso_matrix(qs_env, matrix_so, rc)
Calculation of the paramagnetic spin orbit matrix over Cartesian Gaussian functions.
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
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.
General settings for linear response calculations.
container for the pools of matrixes used by qs
Represent a qs system that is perturbed. Can calculate the linear operator and the rhs of the system ...