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)
206 CALL cp_fm_to_fm(efg_psi0(ispin, ijdir), h1_psi0(ispin))
210 linres_control%lr_triplet = .false.
211 linres_control%do_kernel = .false.
212 linres_control%converged = .false.
213 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, output_unit, should_stop)
218 CALL cp_fm_to_fm(psi1(ispin), psi1_efg(ispin, ijdir))
224 IF (output_unit > 0)
THEN
225 WRITE (output_unit,
"(T10,A)")
"Write the resulting psi1 in restart file... not implemented yet"
239 IF (output_unit > 0)
THEN
240 WRITE (output_unit,
"(T10,A)")
"Response to the perturbation operator pso_"//achar(idir + 119)
252 CALL cp_fm_to_fm(pso_psi0(ispin, idir), h1_psi0(ispin))
256 linres_control%lr_triplet = .false.
257 linres_control%do_kernel = .false.
258 linres_control%converged = .false.
259 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, output_unit, should_stop)
264 CALL cp_fm_to_fm(psi1(ispin), psi1_pso(ispin, idir))
270 IF (output_unit > 0)
THEN
271 WRITE (output_unit,
"(T10,A)")
"Write the resulting psi1 in restart file... not implemented yet"
283 IF (output_unit > 0)
THEN
284 WRITE (output_unit,
"(T10,A)")
"Response to the perturbation operator fc"
297 linres_control%lr_triplet = .true.
298 linres_control%do_kernel = .true.
299 linres_control%converged = .false.
300 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, output_unit, should_stop)
311 IF (output_unit > 0)
THEN
312 WRITE (output_unit,
"(T10,A)")
"Write the resulting psi1 in restart file... not implemented yet"
326 IF (output_unit > 0)
THEN
327 WRITE (output_unit,
"(T10,A)")
"Response to the perturbation operator r_"//achar(idir + 119)
339 CALL cp_fm_to_fm(dso_psi0(ispin, idir), h1_psi0(ispin))
343 linres_control%lr_triplet = .false.
344 linres_control%do_kernel = .true.
345 linres_control%converged = .false.
346 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, output_unit, should_stop)
351 CALL cp_fm_to_fm(psi1(ispin), psi1_dso(ispin, idir))
355 IF (output_unit > 0)
THEN
356 WRITE (output_unit,
"(T10,A)")
"Write the resulting psi1 in restart file... not implemented yet"
367 IF (output_unit > 0)
THEN
368 WRITE (output_unit,
'(T2,A,E23.16)')
'ISSC| response: CheckSum =', chk
375 DEALLOCATE (psi0_order)
378 &
"PRINT%PROGRAM_RUN_INFO")
380 CALL timestop(handle)
394 INTEGER,
INTENT(IN) :: iatom
396 CHARACTER(LEN=*),
PARAMETER :: routinen =
'issc_issc'
398 INTEGER :: handle, ispin, ixyz, jatom, jxyz, natom, &
400 LOGICAL :: do_dso, do_fc, do_pso, do_sd, gapw
401 REAL(
dp) :: buf, facdso, facfc, facpso, facsd, g, &
402 issc_dso, issc_fc, issc_pso, issc_sd, &
404 REAL(
dp),
DIMENSION(3) :: r_i, r_j
405 REAL(
dp),
DIMENSION(:, :, :, :, :),
POINTER :: issc
407 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: fc_psi0, psi1_fc
408 TYPE(
cp_fm_type),
DIMENSION(:, :),
POINTER :: psi1_dso, psi1_efg, psi1_pso
410 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_dso, matrix_efg, matrix_fc, &
417 CALL timeset(routinen, handle)
419 NULLIFY (cell, dft_control, particle_set, issc, psi1_fc, psi1_efg, psi1_pso)
420 NULLIFY (matrix_efg, matrix_fc, matrix_pso, mos, mo_coeff, fc_psi0)
424 dft_control=dft_control, &
425 particle_set=particle_set, &
428 gapw = dft_control%qs_control%gapw
429 natom =
SIZE(particle_set, 1)
430 nspins = dft_control%nspins
433 matrix_efg=matrix_efg, &
434 matrix_pso=matrix_pso, &
435 matrix_fc=matrix_fc, &
436 matrix_dso=matrix_dso, &
457 &
"PROPERTIES%LINRES%SPINSPIN")
461 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, maxocc=maxocc)
465 r_i = particle_set(iatom)%r
466 r_j = particle_set(jatom)%r
467 r_j =
pbc(r_i, r_j, cell) + r_i
476 IF (do_fc .AND. iatom /= jatom)
THEN
479 CALL dbcsr_set(matrix_fc(1)%matrix, 0.0_dp)
482 fc_psi0(ispin), ncol=nmo,&
486 WRITE (*, *)
' jatom', jatom,
'tr(P*fc)=', buf
488 CALL cp_fm_trace(fc_psi0(ispin), psi1_fc(ispin), buf)
489 issc_fc = 2.0_dp*2.0_dp*maxocc*facfc*buf
490 issc(1, 1, iatom, jatom, 1) = issc(1, 1, iatom, jatom, 1) + issc_fc
491 issc(2, 2, iatom, jatom, 1) = issc(2, 2, iatom, jatom, 1) + issc_fc
492 issc(3, 3, iatom, jatom, 1) = issc(3, 3, iatom, jatom, 1) + issc_fc
497 IF (do_sd .AND. iatom /= jatom)
THEN
500 CALL dbcsr_set(matrix_efg(1)%matrix, 0.0_dp)
501 CALL dbcsr_set(matrix_efg(2)%matrix, 0.0_dp)
502 CALL dbcsr_set(matrix_efg(3)%matrix, 0.0_dp)
503 CALL dbcsr_set(matrix_efg(4)%matrix, 0.0_dp)
504 CALL dbcsr_set(matrix_efg(5)%matrix, 0.0_dp)
505 CALL dbcsr_set(matrix_efg(6)%matrix, 0.0_dp)
509 fc_psi0(ispin), ncol=nmo,&
510 & alpha=1.0_dp, beta=0.0_dp)
512 WRITE (*, *)
' jatom', jatom, ixyz,
'tr(P*efg)=', buf
514 CALL cp_fm_trace(fc_psi0(ispin), psi1_efg(ispin, jxyz), buf)
515 issc_sd = 2.0_dp*maxocc*facsd*buf
524 IF (do_pso .AND. iatom /= jatom)
THEN
527 CALL dbcsr_set(matrix_pso(1)%matrix, 0.0_dp)
528 CALL dbcsr_set(matrix_pso(2)%matrix, 0.0_dp)
529 CALL dbcsr_set(matrix_pso(3)%matrix, 0.0_dp)
533 fc_psi0(ispin), ncol=nmo,&
534 & alpha=1.0_dp, beta=0.0_dp)
536 CALL cp_fm_trace(fc_psi0(ispin), psi1_pso(ispin, jxyz), buf)
537 issc_pso = -2.0_dp*maxocc*facpso*buf
538 issc(ixyz, jxyz, iatom, jatom, 3) = issc(ixyz, jxyz, iatom, jatom, 3) + issc_pso
546 IF (do_dso .AND. iatom == natom .AND. jatom == natom)
THEN
549 fc_psi0(ispin), ncol=nmo,&
550 & alpha=1.0_dp, beta=0.0_dp)
552 CALL cp_fm_trace(psi1_dso(ispin, jxyz), fc_psi0(ispin), buf)
554 issc_dso = 2.0_dp*maxocc*buf
555 issc(ixyz, jxyz, iatom, jatom, 4) = issc(ixyz, jxyz, iatom, jatom, 4) + issc_dso
566 CALL timestop(handle)
579 CHARACTER(LEN=2) :: element_symbol_i, element_symbol_j
580 CHARACTER(LEN=default_string_length) :: name_i, name_j, title
581 INTEGER :: iatom, jatom, natom, output_unit, &
583 LOGICAL :: do_dso, do_fc, do_pso, do_sd, gapw
584 REAL(
dp) :: eig(3), issc_iso_dso, issc_iso_fc, &
585 issc_iso_pso, issc_iso_sd, &
586 issc_iso_tot, issc_tmp(3, 3)
587 REAL(
dp),
DIMENSION(:, :, :, :, :),
POINTER :: issc
588 REAL(
dp),
EXTERNAL :: ddot
595 NULLIFY (logger, particle_set, atom_kind_i, atom_kind_j, dft_control)
601 "PROPERTIES%LINRES%SPINSPIN")
611 dft_control=dft_control, &
612 particle_set=particle_set)
614 natom =
SIZE(particle_set, 1)
615 gapw = dft_control%qs_control%gapw
618 IF (output_unit > 0)
THEN
619 WRITE (output_unit,
'(T2,A,E14.6)')
'ISSC| CheckSum K =', &
620 sqrt(ddot(
SIZE(issc), issc, 1, issc, 1))
627 extension=
".data", middle_name=
"K", log_filename=.false.)
629 IF (unit_atoms > 0)
THEN
630 WRITE (unit_atoms, *)
631 WRITE (unit_atoms, *)
632 WRITE (title,
'(A)')
"Indirect spin-spin coupling matrix"
633 WRITE (unit_atoms,
'(T2,A)') title
635 atom_kind_i => particle_set(iatom)%atomic_kind
636 CALL get_atomic_kind(atom_kind_i, name=name_i, element_symbol=element_symbol_i)
638 atom_kind_j => particle_set(jatom)%atomic_kind
639 CALL get_atomic_kind(atom_kind_j, name=name_j, element_symbol=element_symbol_j)
641 IF (iatom == jatom .AND. .NOT. do_dso) cycle
645 issc_tmp(:, :) = issc(:, :, iatom, jatom, 1)
646 issc_tmp(:, :) = 0.5_dp*(issc_tmp(:, :) + transpose(issc_tmp(:, :)))
648 issc_iso_fc = (eig(1) + eig(2) + eig(3))/3.0_dp
651 issc_tmp(:, :) = issc(:, :, iatom, jatom, 2)
652 issc_tmp(:, :) = 0.5_dp*(issc_tmp(:, :) + transpose(issc_tmp(:, :)))
654 issc_iso_sd = (eig(1) + eig(2) + eig(3))/3.0_dp
657 issc_tmp(:, :) = issc(:, :, iatom, jatom, 3)
658 issc_tmp(:, :) = 0.5_dp*(issc_tmp(:, :) + transpose(issc_tmp(:, :)))
660 issc_iso_pso = (eig(1) + eig(2) + eig(3))/3.0_dp
663 issc_tmp(:, :) = issc(:, :, iatom, jatom, 4)
664 issc_tmp(:, :) = 0.5_dp*(issc_tmp(:, :) + transpose(issc_tmp(:, :)))
666 issc_iso_dso = (eig(1) + eig(2) + eig(3))/3.0_dp
669 issc_iso_tot = issc_iso_fc + issc_iso_sd + issc_iso_dso + issc_iso_pso
672 WRITE (unit_atoms, *)
673 WRITE (unit_atoms,
'(T2,2(A,I5,A,2X,A2))')
'Indirect spin-spin coupling between ', &
674 iatom, trim(name_i), element_symbol_i,
' and ', &
675 jatom, trim(name_j), element_symbol_j
677 IF (do_fc)
WRITE (unit_atoms,
'(T1,A,f12.4,A)')
' Isotropic FC contribution = ', issc_iso_fc,
' Hz'
678 IF (do_sd)
WRITE (unit_atoms,
'(T1,A,f12.4,A)')
' Isotropic SD contribution = ', issc_iso_sd,
' Hz'
679 IF (do_pso)
WRITE (unit_atoms,
'(T1,A,f12.4,A)')
' Isotropic PSO contribution = ', issc_iso_pso,
' Hz'
681 IF (do_dso)
WRITE (unit_atoms,
'(T1,A,f12.4,A)')
' !!! POLARIZABILITY (for the moment) = ', issc_iso_dso,
' Hz'
682 IF (.NOT. do_dso)
WRITE (unit_atoms,
'(T1,A,f12.4,A)')
' Isotropic coupling = ', issc_iso_tot,
' Hz'
703 CHARACTER(LEN=*),
PARAMETER :: routinen =
'issc_env_init'
705 INTEGER :: handle, iatom, idir, ini, ir, ispin, m, &
706 n, n_rep, nao, natom, nspins, &
708 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: first_sgf, last_sgf
709 INTEGER,
DIMENSION(:),
POINTER ::
list, row_blk_sizes
721 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
726 CALL timeset(routinen, handle)
728 NULLIFY (linres_control)
729 NULLIFY (logger, issc_section)
730 NULLIFY (tmp_fm_struct)
731 NULLIFY (particle_set, qs_kind_set)
738 extension=
".linresLog")
742 IF (output_unit > 0)
THEN
743 WRITE (output_unit,
"(/,T20,A,/)")
"*** Start indirect spin-spin coupling Calculation ***"
744 WRITE (output_unit,
"(T10,A,/)")
"Inizialization of the ISSC environment"
748 &
"PROPERTIES%LINRES%SPINSPIN")
753 dft_control=dft_control, &
754 linres_control=linres_control, &
757 particle_set=particle_set, &
758 qs_kind_set=qs_kind_set, &
759 dbcsr_dist=dbcsr_dist)
762 gapw = dft_control%qs_control%gapw
763 nspins = dft_control%nspins
764 natom =
SIZE(particle_set, 1)
767 IF (.NOT. linres_control%localized_psi0)
THEN
768 CALL cp_warn(__location__,
'To get indirect spin-spin coupling parameters within '// &
769 'PBC you need to localize zero order orbitals')
788 NULLIFY (issc_env%issc_on_atom_list)
793 IF (
ASSOCIATED(
list))
THEN
795 DO ini = 1,
SIZE(
list)
796 issc_env%issc_on_atom_list(ini + n) =
list(ini)
802 IF (.NOT.
ASSOCIATED(issc_env%issc_on_atom_list))
THEN
803 ALLOCATE (issc_env%issc_on_atom_list(natom))
805 issc_env%issc_on_atom_list(iatom) = iatom
808 issc_env%issc_natms =
SIZE(issc_env%issc_on_atom_list)
812 ALLOCATE (issc_env%issc(3, 3, issc_env%issc_natms, issc_env%issc_natms, 4), &
813 issc_env%issc_loc(3, 3, issc_env%issc_natms, issc_env%issc_natms, 4))
814 issc_env%issc(:, :, :, :, :) = 0.0_dp
815 issc_env%issc_loc(:, :, :, :, :) = 0.0_dp
818 ALLOCATE (issc_env%efg_psi0(nspins, 6), issc_env%pso_psi0(nspins, 3), issc_env%fc_psi0(nspins), &
819 issc_env%psi1_efg(nspins, 6), issc_env%psi1_pso(nspins, 3), issc_env%psi1_fc(nspins), &
820 issc_env%dso_psi0(nspins, 3), issc_env%psi1_dso(nspins, 3))
822 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff)
825 NULLIFY (tmp_fm_struct)
828 context=mo_coeff%matrix_struct%context)
830 CALL cp_fm_create(issc_env%psi1_efg(ispin, idir), tmp_fm_struct)
831 CALL cp_fm_create(issc_env%efg_psi0(ispin, idir), tmp_fm_struct)
834 CALL cp_fm_create(issc_env%psi1_pso(ispin, idir), tmp_fm_struct)
835 CALL cp_fm_create(issc_env%pso_psi0(ispin, idir), tmp_fm_struct)
836 CALL cp_fm_create(issc_env%psi1_dso(ispin, idir), tmp_fm_struct)
837 CALL cp_fm_create(issc_env%dso_psi0(ispin, idir), tmp_fm_struct)
839 CALL cp_fm_create(issc_env%psi1_fc(ispin), tmp_fm_struct)
840 CALL cp_fm_create(issc_env%fc_psi0(ispin), tmp_fm_struct)
845 ALLOCATE (first_sgf(natom))
846 ALLOCATE (last_sgf(natom))
848 first_sgf=first_sgf, &
850 ALLOCATE (row_blk_sizes(natom))
851 CALL dbcsr_convert_offsets_to_sizes(first_sgf, row_blk_sizes, last_sgf)
852 DEALLOCATE (first_sgf)
853 DEALLOCATE (last_sgf)
858 ALLOCATE (issc_env%matrix_efg(1)%matrix)
859 CALL dbcsr_create(matrix=issc_env%matrix_efg(1)%matrix, &
860 name=
"efg (3xx-rr)/3", &
861 dist=dbcsr_dist, matrix_type=dbcsr_type_symmetric, &
862 row_blk_size=row_blk_sizes, col_blk_size=row_blk_sizes, &
866 ALLOCATE (issc_env%matrix_efg(2)%matrix, &
867 issc_env%matrix_efg(3)%matrix, issc_env%matrix_efg(4)%matrix, &
868 issc_env%matrix_efg(5)%matrix, issc_env%matrix_efg(6)%matrix)
869 CALL dbcsr_copy(issc_env%matrix_efg(2)%matrix, issc_env%matrix_efg(1)%matrix, &
871 CALL dbcsr_copy(issc_env%matrix_efg(3)%matrix, issc_env%matrix_efg(1)%matrix, &
873 CALL dbcsr_copy(issc_env%matrix_efg(4)%matrix, issc_env%matrix_efg(1)%matrix, &
875 CALL dbcsr_copy(issc_env%matrix_efg(5)%matrix, issc_env%matrix_efg(1)%matrix, &
877 CALL dbcsr_copy(issc_env%matrix_efg(6)%matrix, issc_env%matrix_efg(1)%matrix, &
880 CALL dbcsr_set(issc_env%matrix_efg(1)%matrix, 0.0_dp)
881 CALL dbcsr_set(issc_env%matrix_efg(2)%matrix, 0.0_dp)
882 CALL dbcsr_set(issc_env%matrix_efg(3)%matrix, 0.0_dp)
883 CALL dbcsr_set(issc_env%matrix_efg(4)%matrix, 0.0_dp)
884 CALL dbcsr_set(issc_env%matrix_efg(5)%matrix, 0.0_dp)
885 CALL dbcsr_set(issc_env%matrix_efg(6)%matrix, 0.0_dp)
889 ALLOCATE (issc_env%matrix_pso(1)%matrix)
890 CALL dbcsr_create(matrix=issc_env%matrix_pso(1)%matrix, &
892 dist=dbcsr_dist, matrix_type=dbcsr_type_antisymmetric, &
893 row_blk_size=row_blk_sizes, col_blk_size=row_blk_sizes, &
897 ALLOCATE (issc_env%matrix_pso(2)%matrix, issc_env%matrix_pso(3)%matrix)
898 CALL dbcsr_copy(issc_env%matrix_pso(2)%matrix, issc_env%matrix_pso(1)%matrix, &
900 CALL dbcsr_copy(issc_env%matrix_pso(3)%matrix, issc_env%matrix_pso(1)%matrix, &
902 CALL dbcsr_set(issc_env%matrix_pso(1)%matrix, 0.0_dp)
903 CALL dbcsr_set(issc_env%matrix_pso(2)%matrix, 0.0_dp)
904 CALL dbcsr_set(issc_env%matrix_pso(3)%matrix, 0.0_dp)
908 ALLOCATE (issc_env%matrix_dso(1)%matrix, issc_env%matrix_dso(2)%matrix, issc_env%matrix_dso(3)%matrix)
909 CALL dbcsr_copy(issc_env%matrix_dso(1)%matrix, issc_env%matrix_efg(1)%matrix, &
911 CALL dbcsr_copy(issc_env%matrix_dso(2)%matrix, issc_env%matrix_efg(1)%matrix, &
913 CALL dbcsr_copy(issc_env%matrix_dso(3)%matrix, issc_env%matrix_efg(1)%matrix, &
915 CALL dbcsr_set(issc_env%matrix_dso(1)%matrix, 0.0_dp)
916 CALL dbcsr_set(issc_env%matrix_dso(2)%matrix, 0.0_dp)
917 CALL dbcsr_set(issc_env%matrix_dso(3)%matrix, 0.0_dp)
921 ALLOCATE (issc_env%matrix_fc(1)%matrix)
922 CALL dbcsr_copy(issc_env%matrix_fc(1)%matrix, issc_env%matrix_efg(1)%matrix, &
924 CALL dbcsr_set(issc_env%matrix_fc(1)%matrix, 0.0_dp)
926 DEALLOCATE (row_blk_sizes)
929 IF (output_unit > 0)
THEN
930 WRITE (output_unit,
"(T2,A,T60,I4,A)")&
931 &
"ISSC| spin-spin coupling computed for ", issc_env%issc_natms,
' atoms'
935 &
"PRINT%PROGRAM_RUN_INFO")
937 CALL timestop(handle)
950 IF (
ASSOCIATED(issc_env%issc_on_atom_list))
THEN
951 DEALLOCATE (issc_env%issc_on_atom_list)
953 IF (
ASSOCIATED(issc_env%issc))
THEN
954 DEALLOCATE (issc_env%issc)
956 IF (
ASSOCIATED(issc_env%issc_loc))
THEN
957 DEALLOCATE (issc_env%issc_loc)
985 IF (
ASSOCIATED(issc_env%matrix_efg))
THEN
990 IF (
ASSOCIATED(issc_env%matrix_pso))
THEN
995 IF (
ASSOCIATED(issc_env%matrix_dso))
THEN
1000 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, nrow, ncol, set_zero)
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, ncgf)
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, 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, 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.
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, silent)
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 ...