40 USE dbcsr_api,
ONLY: &
41 dbcsr_copy, dbcsr_create, dbcsr_deallocate_matrix, dbcsr_distribution_get, &
42 dbcsr_distribution_type, dbcsr_get_block_p, dbcsr_get_info, dbcsr_iterator_blocks_left, &
43 dbcsr_iterator_next_block, dbcsr_iterator_start, dbcsr_iterator_stop, dbcsr_iterator_type, &
44 dbcsr_p_type, dbcsr_set, dbcsr_type, dbcsr_type_antisymmetric, dbcsr_type_no_symmetry, &
76 neighbor_list_iterator_p_type,&
78 neighbor_list_set_p_type
81 #include "./base/base_uses.f90"
87 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'kpoint_methods'
106 TYPE(kpoint_type),
POINTER :: kpoint
107 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
108 TYPE(cell_type),
POINTER :: cell
110 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kpoint_initialize'
112 INTEGER :: handle, i, ik, iounit, ir, is, natom, &
114 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atype
116 REAL(kind=
dp) :: wsum
117 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: coord, scoord
118 TYPE(csym_type) :: crys_sym
119 TYPE(kpoint_sym_type),
POINTER :: kpsym
121 CALL timeset(routinen, handle)
123 cpassert(
ASSOCIATED(kpoint))
125 SELECT CASE (kpoint%kp_scheme)
130 ALLOCATE (kpoint%xkp(3, 1), kpoint%wkp(1))
131 kpoint%xkp(1:3, 1) = 0.0_dp
132 kpoint%wkp(1) = 1.0_dp
133 ALLOCATE (kpoint%kp_sym(1))
134 NULLIFY (kpoint%kp_sym(1)%kpoint_sym)
136 CASE (
"MONKHORST-PACK",
"MACDONALD")
138 IF (.NOT. kpoint%symmetry)
THEN
141 ALLOCATE (coord(3, natom), scoord(3, natom), atype(natom))
144 coord(1, i) = sin(i*0.12345_dp)
145 coord(2, i) = cos(i*0.23456_dp)
146 coord(3, i) = sin(i*0.34567_dp)
150 natom =
SIZE(particle_set)
151 ALLOCATE (scoord(3, natom), atype(natom))
153 CALL get_atomic_kind(atomic_kind=particle_set(i)%atomic_kind, kind_number=atype(i))
157 IF (kpoint%verbose)
THEN
163 CALL crys_sym_gen(crys_sym, scoord, atype, cell%hmat, delta=kpoint%eps_geo, iounit=iounit)
164 CALL kpoint_gen(crys_sym, kpoint%nkp_grid, symm=kpoint%symmetry, shift=kpoint%kp_shift, &
165 full_grid=kpoint%full_grid)
166 kpoint%nkp = crys_sym%nkpoint
167 ALLOCATE (kpoint%xkp(3, kpoint%nkp), kpoint%wkp(kpoint%nkp))
168 wsum = sum(crys_sym%wkpoint)
169 DO ik = 1, kpoint%nkp
170 kpoint%xkp(1:3, ik) = crys_sym%xkpoint(1:3, ik)
171 kpoint%wkp(ik) = crys_sym%wkpoint(ik)/wsum
179 ALLOCATE (kpoint%kp_sym(kpoint%nkp))
180 DO ik = 1, kpoint%nkp
181 NULLIFY (kpoint%kp_sym(ik)%kpoint_sym)
183 kpsym => kpoint%kp_sym(ik)%kpoint_sym
184 IF (crys_sym%symlib .AND. .NOT. crys_sym%fullgrid .AND. crys_sym%istriz == 1)
THEN
186 kpsym%nwght = nint(crys_sym%wkpoint(ik))
190 kpsym%apply_symmetry = .true.
191 natom =
SIZE(particle_set)
192 ALLOCATE (kpsym%rot(3, 3, ns))
193 ALLOCATE (kpsym%xkp(3, ns))
194 ALLOCATE (kpsym%f0(natom, ns))
196 DO is = 1,
SIZE(crys_sym%kplink, 2)
197 IF (crys_sym%kplink(2, is) == ik)
THEN
199 ir = crys_sym%kpop(is)
200 kpsym%rot(1:3, 1:3, nr) = crys_sym%rotations(1:3, 1:3, ir)
201 kpsym%xkp(1:3, nr) = crys_sym%kpmesh(1:3, is)
210 DEALLOCATE (scoord, atype)
214 ALLOCATE (kpoint%kp_sym(kpoint%nkp))
216 NULLIFY (kpoint%kp_sym(i)%kpoint_sym)
224 SELECT CASE (kpoint%kp_scheme)
228 cpassert(kpoint%nkp == 1)
229 cpassert(sum(abs(kpoint%xkp)) <= 1.e-12_dp)
230 cpassert(kpoint%wkp(1) == 1.0_dp)
231 cpassert(.NOT. kpoint%symmetry)
233 cpassert(.NOT. kpoint%symmetry)
234 cpassert(kpoint%nkp >= 1)
235 CASE (
"MONKHORST-PACK",
"MACDONALD")
236 cpassert(kpoint%nkp >= 1)
238 IF (kpoint%use_real_wfn)
THEN
240 ikloop:
DO ik = 1, kpoint%nkp
242 spez = (kpoint%xkp(i, ik) == 0.0_dp .OR. kpoint%xkp(i, ik) == 0.5_dp)
243 IF (.NOT. spez)
EXIT ikloop
248 CALL cp_warn(__location__, &
249 "A calculation using real wavefunctions is requested. "// &
250 "We could not determine if the symmetry of the system allows real wavefunctions. ")
254 CALL timestop(handle)
267 TYPE(kpoint_type),
INTENT(INOUT) :: kpoint
268 TYPE(mp_para_env_type),
INTENT(IN),
TARGET :: para_env
269 TYPE(cp_blacs_env_type),
INTENT(IN),
TARGET :: blacs_env
270 LOGICAL,
INTENT(IN),
OPTIONAL :: with_aux_fit
272 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kpoint_env_initialize'
274 INTEGER :: handle, igr, ik, ikk, ngr, niogrp, nkp, &
275 nkp_grp, nkp_loc, npe, unit_nr
276 INTEGER,
DIMENSION(2) :: dims, pos
278 TYPE(kpoint_env_p_type),
DIMENSION(:),
POINTER :: kp_aux_env, kp_env
279 TYPE(kpoint_env_type),
POINTER :: kp
280 TYPE(mp_cart_type) :: comm_cart
281 TYPE(mp_para_env_type),
POINTER :: para_env_inter_kp, para_env_kp
283 CALL timeset(routinen, handle)
285 IF (
PRESENT(with_aux_fit))
THEN
286 aux_fit = with_aux_fit
291 kpoint%para_env => para_env
292 CALL kpoint%para_env%retain()
293 kpoint%blacs_env_all => blacs_env
294 CALL kpoint%blacs_env_all%retain()
296 cpassert(.NOT.
ASSOCIATED(kpoint%kp_env))
298 cpassert(.NOT.
ASSOCIATED(kpoint%kp_aux_env))
301 NULLIFY (kp_env, kp_aux_env)
303 npe = para_env%num_pe
306 ALLOCATE (kp_env(nkp))
308 NULLIFY (kp_env(ik)%kpoint_env)
310 kp => kp_env(ik)%kpoint_env
312 kp%wkp = kpoint%wkp(ik)
313 kp%xkp(1:3) = kpoint%xkp(1:3, ik)
316 kpoint%kp_env => kp_env
319 ALLOCATE (kp_aux_env(nkp))
321 NULLIFY (kp_aux_env(ik)%kpoint_env)
323 kp => kp_aux_env(ik)%kpoint_env
325 kp%wkp = kpoint%wkp(ik)
326 kp%xkp(1:3) = kpoint%xkp(1:3, ik)
330 kpoint%kp_aux_env => kp_aux_env
333 ALLOCATE (kpoint%kp_dist(2, 1))
334 kpoint%kp_dist(1, 1) = 1
335 kpoint%kp_dist(2, 1) = nkp
336 kpoint%kp_range(1) = 1
337 kpoint%kp_range(2) = nkp
340 kpoint%para_env_kp => para_env
341 CALL kpoint%para_env_kp%retain()
342 kpoint%para_env_inter_kp => para_env
343 CALL kpoint%para_env_inter_kp%retain()
344 kpoint%iogrp = .true.
345 kpoint%nkp_groups = 1
347 IF (kpoint%parallel_group_size == -1)
THEN
352 IF (mod(npe, igr) .NE. 0) cycle
354 IF (mod(nkp, nkp_grp) .NE. 0) cycle
357 ELSE IF (kpoint%parallel_group_size == 0)
THEN
360 ELSE IF (kpoint%parallel_group_size > 0)
THEN
361 ngr = min(kpoint%parallel_group_size, npe)
369 cpassert(mod(nkp, nkp_grp) == 0)
370 nkp_loc = nkp/nkp_grp
372 IF ((dims(1)*dims(2) /= npe))
THEN
373 cpabort(
"Number of processors is not divisible by the kpoint group size.")
377 CALL comm_cart%create(comm_old=para_env, ndims=2, dims=dims)
378 pos = comm_cart%mepos_cart
379 ALLOCATE (para_env_kp)
380 CALL para_env_kp%from_split(comm_cart, pos(2))
381 ALLOCATE (para_env_inter_kp)
382 CALL para_env_inter_kp%from_split(comm_cart, pos(1))
383 CALL comm_cart%free()
386 IF (para_env%is_source()) niogrp = 1
387 CALL para_env_kp%sum(niogrp)
388 kpoint%iogrp = (niogrp == 1)
391 kpoint%para_env_kp => para_env_kp
392 kpoint%para_env_inter_kp => para_env_inter_kp
395 ALLOCATE (kpoint%kp_dist(2, nkp_grp))
397 kpoint%kp_dist(1:2, igr) =
get_limit(nkp, nkp_grp, igr - 1)
400 kpoint%kp_range(1:2) = kpoint%kp_dist(1:2, para_env_inter_kp%mepos + 1)
402 ALLOCATE (kp_env(nkp_loc))
404 NULLIFY (kp_env(ik)%kpoint_env)
405 ikk = kpoint%kp_range(1) + ik - 1
407 kp => kp_env(ik)%kpoint_env
409 kp%wkp = kpoint%wkp(ikk)
410 kp%xkp(1:3) = kpoint%xkp(1:3, ikk)
411 kp%is_local = (ngr == 1)
413 kpoint%kp_env => kp_env
416 ALLOCATE (kp_aux_env(nkp_loc))
418 NULLIFY (kp_aux_env(ik)%kpoint_env)
419 ikk = kpoint%kp_range(1) + ik - 1
421 kp => kp_aux_env(ik)%kpoint_env
423 kp%wkp = kpoint%wkp(ikk)
424 kp%xkp(1:3) = kpoint%xkp(1:3, ikk)
425 kp%is_local = (ngr == 1)
427 kpoint%kp_aux_env => kp_aux_env
432 IF (unit_nr > 0 .AND. kpoint%verbose)
THEN
434 WRITE (unit_nr, fmt=
"(T2,A,T71,I10)")
"KPOINTS| Number of kpoint groups ", nkp_grp
435 WRITE (unit_nr, fmt=
"(T2,A,T71,I10)")
"KPOINTS| Size of each kpoint group", ngr
436 WRITE (unit_nr, fmt=
"(T2,A,T71,I10)")
"KPOINTS| Number of kpoints per group", nkp_loc
438 kpoint%nkp_groups = nkp_grp
442 CALL timestop(handle)
455 TYPE(kpoint_type),
POINTER :: kpoint
456 TYPE(mo_set_type),
DIMENSION(:),
INTENT(INOUT) :: mos
457 INTEGER,
INTENT(IN),
OPTIONAL :: added_mos
458 LOGICAL,
OPTIONAL :: for_aux_fit
460 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kpoint_initialize_mos'
462 INTEGER :: handle, ic, ik, is, nadd, nao, nc, &
463 nelectron, nkp_loc, nmo, nmorig(2), &
466 REAL(kind=
dp) :: flexible_electron_count, maxocc, n_el_f
467 TYPE(cp_blacs_env_type),
POINTER :: blacs_env
468 TYPE(cp_fm_pool_p_type),
DIMENSION(:),
POINTER :: ao_ao_fm_pools
469 TYPE(cp_fm_struct_type),
POINTER :: matrix_struct
470 TYPE(cp_fm_type),
POINTER :: fmlocal
471 TYPE(kpoint_env_type),
POINTER :: kp
472 TYPE(qs_matrix_pools_type),
POINTER :: mpools
474 CALL timeset(routinen, handle)
476 IF (
PRESENT(for_aux_fit))
THEN
477 aux_fit = for_aux_fit
482 cpassert(
ASSOCIATED(kpoint))
484 IF (.true. .OR.
ASSOCIATED(mos(1)%mo_coeff))
THEN
486 cpassert(
ASSOCIATED(kpoint%kp_aux_env))
489 IF (
PRESENT(added_mos))
THEN
495 IF (kpoint%use_real_wfn)
THEN
501 nkp_loc = kpoint%kp_range(2) - kpoint%kp_range(1) + 1
502 IF (nkp_loc > 0)
THEN
504 cpassert(
SIZE(kpoint%kp_aux_env) == nkp_loc)
506 cpassert(
SIZE(kpoint%kp_env) == nkp_loc)
511 kp => kpoint%kp_aux_env(ik)%kpoint_env
513 kp => kpoint%kp_env(ik)%kpoint_env
515 ALLOCATE (kp%mos(nc, nspin))
517 CALL get_mo_set(mos(is), nao=nao, nmo=nmo, nelectron=nelectron, &
518 n_el_f=n_el_f, maxocc=maxocc, flexible_electron_count=flexible_electron_count)
519 nmo = min(nao, nmo + nadd)
521 CALL allocate_mo_set(kp%mos(ic, is), nao, nmo, nelectron, n_el_f, maxocc, &
522 flexible_electron_count)
532 IF (
ASSOCIATED(kpoint%blacs_env))
THEN
533 blacs_env => kpoint%blacs_env
536 kpoint%blacs_env => blacs_env
542 nmo = min(nao, nmorig(is) + nadd)
550 blacs_env=blacs_env, para_env=kpoint%para_env_kp)
553 kpoint%mpools_aux_fit => mpools
555 kpoint%mpools => mpools
564 CALL mpools_get(mpools, ao_ao_fm_pools=ao_ao_fm_pools)
570 kp => kpoint%kp_aux_env(ik)%kpoint_env
572 kp => kpoint%kp_env(ik)%kpoint_env
575 CALL cp_fm_release(kp%pmat)
576 ALLOCATE (kp%pmat(nc, nspin))
583 CALL cp_fm_release(kp%wmat)
584 ALLOCATE (kp%wmat(nc, nspin))
598 CALL timestop(handle)
607 TYPE(kpoint_type),
POINTER :: kpoint
609 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kpoint_initialize_mo_set'
611 INTEGER :: handle, ic, ik, ikk, ispin
612 TYPE(cp_fm_pool_p_type),
DIMENSION(:),
POINTER :: ao_mo_fm_pools
613 TYPE(cp_fm_type),
POINTER :: mo_coeff
614 TYPE(mo_set_type),
DIMENSION(:, :),
POINTER :: moskp
616 CALL timeset(routinen, handle)
618 DO ik = 1,
SIZE(kpoint%kp_env)
619 CALL mpools_get(kpoint%mpools, ao_mo_fm_pools=ao_mo_fm_pools)
620 moskp => kpoint%kp_env(ik)%kpoint_env%mos
621 ikk = kpoint%kp_range(1) + ik - 1
622 cpassert(
ASSOCIATED(moskp))
623 DO ispin = 1,
SIZE(moskp, 2)
624 DO ic = 1,
SIZE(moskp, 1)
625 CALL get_mo_set(moskp(ic, ispin), mo_coeff=mo_coeff)
626 IF (.NOT.
ASSOCIATED(mo_coeff))
THEN
628 fm_pool=ao_mo_fm_pools(ispin)%pool, name=
"kpoints")
634 CALL timestop(handle)
648 TYPE(kpoint_type),
POINTER :: kpoint
649 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
651 TYPE(mp_para_env_type),
POINTER :: para_env
652 TYPE(dft_control_type),
POINTER :: dft_control
654 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kpoint_init_cell_index'
656 INTEGER :: handle, i1, i2, i3, ic, icount, it, &
658 INTEGER,
DIMENSION(3) :: cell, itm
659 INTEGER,
DIMENSION(:, :),
POINTER :: index_to_cell,
list
660 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index, cti
662 TYPE(neighbor_list_iterator_p_type), &
663 DIMENSION(:),
POINTER :: nl_iterator
665 NULLIFY (cell_to_index, index_to_cell)
667 CALL timeset(routinen, handle)
669 cpassert(
ASSOCIATED(kpoint))
671 ALLOCATE (
list(3, 125))
681 IF (cell(1) ==
list(1, ic) .AND. cell(2) ==
list(2, ic) .AND. &
682 cell(3) ==
list(3, ic))
THEN
689 IF (icount >
SIZE(
list, 2))
THEN
690 CALL reallocate(
list, 1, 3, 1, 2*
SIZE(
list, 2))
692 list(1:3, icount) = cell(1:3)
698 itm(1) = maxval(abs(
list(1, 1:icount)))
699 itm(2) = maxval(abs(
list(2, 1:icount)))
700 itm(3) = maxval(abs(
list(3, 1:icount)))
701 CALL para_env%max(itm)
702 it = maxval(itm(1:3))
703 IF (
ASSOCIATED(kpoint%cell_to_index))
THEN
704 DEALLOCATE (kpoint%cell_to_index)
706 ALLOCATE (kpoint%cell_to_index(-itm(1):itm(1), -itm(2):itm(2), -itm(3):itm(3)))
707 cell_to_index => kpoint%cell_to_index
716 CALL para_env%sum(cti)
718 DO i1 = -itm(1), itm(1)
719 DO i2 = -itm(2), itm(2)
720 DO i3 = -itm(3), itm(3)
721 IF (cti(i1, i2, i3) == 0)
THEN
722 cti(i1, i2, i3) = 1000000
725 cti(i1, i2, i3) = (abs(i1) + abs(i2) + abs(i3))*1000 + abs(i3)*100 + abs(i2)*10 + abs(i1)
726 cti(i1, i2, i3) = cti(i1, i2, i3) + (i1 + i2 + i3)
732 IF (
ASSOCIATED(kpoint%index_to_cell))
THEN
733 DEALLOCATE (kpoint%index_to_cell)
735 ALLOCATE (kpoint%index_to_cell(3, ncount))
736 index_to_cell => kpoint%index_to_cell
739 i1 = cell(1) - 1 - itm(1)
740 i2 = cell(2) - 1 - itm(2)
741 i3 = cell(3) - 1 - itm(3)
742 cti(i1, i2, i3) = 1000000
743 index_to_cell(1, ic) = i1
744 index_to_cell(2, ic) = i2
745 index_to_cell(3, ic) = i3
749 i1 = index_to_cell(1, ic)
750 i2 = index_to_cell(2, ic)
751 i3 = index_to_cell(3, ic)
756 kpoint%sab_nl => sab_nl
759 dft_control%nimages =
SIZE(index_to_cell, 2)
763 CALL timestop(handle)
779 xkp, cell_to_index, sab_nl, is_complex, rs_sign)
781 TYPE(dbcsr_type) :: rmatrix
782 TYPE(dbcsr_type),
OPTIONAL :: cmatrix
783 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rsmat
784 INTEGER,
INTENT(IN) :: ispin
785 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: xkp
786 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
787 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
789 LOGICAL,
INTENT(IN),
OPTIONAL :: is_complex
790 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: rs_sign
792 CHARACTER(LEN=*),
PARAMETER :: routinen =
'rskp_transform'
794 INTEGER :: handle, iatom, ic, icol, irow, jatom, &
796 INTEGER,
DIMENSION(3) :: cell
797 LOGICAL :: do_symmetric, found, my_complex, &
799 REAL(kind=
dp) :: arg, coskl, fsign, fsym, sinkl
800 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: cblock, rblock, rsblock
801 TYPE(neighbor_list_iterator_p_type), &
802 DIMENSION(:),
POINTER :: nl_iterator
804 CALL timeset(routinen, handle)
807 IF (
PRESENT(is_complex)) my_complex = is_complex
810 IF (
PRESENT(rs_sign)) fsign = rs_sign
812 wfn_real_only = .true.
813 IF (
PRESENT(cmatrix)) wfn_real_only = .false.
815 nimg =
SIZE(rsmat, 2)
828 IF (do_symmetric .AND. (iatom > jatom))
THEN
834 ic = cell_to_index(cell(1), cell(2), cell(3))
835 IF (ic < 1 .OR. ic > nimg) cycle
837 arg = real(cell(1),
dp)*xkp(1) + real(cell(2),
dp)*xkp(2) + real(cell(3),
dp)*xkp(3)
839 coskl = fsign*fsym*cos(
twopi*arg)
840 sinkl = fsign*sin(
twopi*arg)
842 coskl = fsign*cos(
twopi*arg)
843 sinkl = fsign*fsym*sin(
twopi*arg)
846 CALL dbcsr_get_block_p(matrix=rsmat(ispin, ic)%matrix, row=irow, col=icol, &
847 block=rsblock, found=found)
848 IF (.NOT. found) cycle
850 IF (wfn_real_only)
THEN
851 CALL dbcsr_get_block_p(matrix=rmatrix, row=irow, col=icol, &
852 block=rblock, found=found)
853 IF (.NOT. found) cycle
854 rblock = rblock + coskl*rsblock
856 CALL dbcsr_get_block_p(matrix=rmatrix, row=irow, col=icol, &
857 block=rblock, found=found)
858 IF (.NOT. found) cycle
859 CALL dbcsr_get_block_p(matrix=cmatrix, row=irow, col=icol, &
860 block=cblock, found=found)
861 IF (.NOT. found) cycle
862 rblock = rblock + coskl*rsblock
863 cblock = cblock + sinkl*rsblock
869 CALL timestop(handle)
880 TYPE(kpoint_type),
POINTER :: kpoint
881 TYPE(smear_type),
POINTER :: smear
883 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kpoint_set_mo_occupation'
885 INTEGER :: handle, ik, ikpgr, ispin, kplocal, nb, &
886 ne_a, ne_b, nelectron, nkp, nmo, nspin
887 INTEGER,
DIMENSION(2) :: kp_range
888 REAL(kind=
dp) :: kts, mu, mus(2), nel
889 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: weig, wocc
890 REAL(kind=
dp),
DIMENSION(:),
POINTER :: eigenvalues, occupation, wkp
891 TYPE(kpoint_env_type),
POINTER :: kp
892 TYPE(mo_set_type),
POINTER :: mo_set
893 TYPE(mp_para_env_type),
POINTER :: para_env_inter_kp
895 CALL timeset(routinen, handle)
899 kp => kpoint%kp_env(1)%kpoint_env
900 nspin =
SIZE(kp%mos, 2)
901 mo_set => kp%mos(1, 1)
902 CALL get_mo_set(mo_set, nmo=nmo, nelectron=nelectron)
905 CALL get_mo_set(kp%mos(1, 2), nmo=nb, nelectron=ne_b)
908 ALLOCATE (weig(nmo, nkp, nspin), wocc(nmo, nkp, nspin))
912 kplocal = kp_range(2) - kp_range(1) + 1
913 DO ikpgr = 1, kplocal
914 ik = kp_range(1) + ikpgr - 1
915 kp => kpoint%kp_env(ikpgr)%kpoint_env
917 mo_set => kp%mos(1, ispin)
918 CALL get_mo_set(mo_set, eigenvalues=eigenvalues)
919 weig(1:nmo, ik, ispin) = eigenvalues(1:nmo)
923 CALL para_env_inter_kp%sum(weig)
926 IF (smear%do_smear)
THEN
928 SELECT CASE (smear%method)
931 nel = real(nelectron, kind=
dp)
932 CALL fermikp(wocc(:, :, 1), mus(1), kts, weig(:, :, 1), nel, wkp, &
933 smear%electronic_temperature, 2.0_dp)
934 ELSE IF (smear%fixed_mag_mom > 0.0_dp)
THEN
935 cpabort(
"kpoints: Smearing with fixed magnetic moments not (yet) supported")
936 nel = real(ne_a, kind=
dp)
937 CALL fermikp(wocc(:, :, 1), mus(1), kts, weig(:, :, 1), nel, wkp, &
938 smear%electronic_temperature, 1.0_dp)
939 nel = real(ne_b, kind=
dp)
940 CALL fermikp(wocc(:, :, 2), mus(2), kts, weig(:, :, 2), nel, wkp, &
941 smear%electronic_temperature, 1.0_dp)
943 nel = real(ne_a, kind=
dp) + real(ne_b, kind=
dp)
944 CALL fermikp2(wocc(:, :, :), mu, kts, weig(:, :, :), nel, wkp, &
945 smear%electronic_temperature)
950 cpabort(
"kpoints: Selected smearing not (yet) supported")
955 nel = real(nelectron, kind=
dp)
956 CALL fermikp(wocc(:, :, 1), mus(1), kts, weig(:, :, 1), nel, wkp, 0.0_dp, 2.0_dp)
958 nel = real(ne_a, kind=
dp)
959 CALL fermikp(wocc(:, :, 1), mus(1), kts, weig(:, :, 1), nel, wkp, 0.0_dp, 1.0_dp)
960 nel = real(ne_b, kind=
dp)
961 CALL fermikp(wocc(:, :, 2), mus(2), kts, weig(:, :, 2), nel, wkp, 0.0_dp, 1.0_dp)
964 DO ikpgr = 1, kplocal
965 ik = kp_range(1) + ikpgr - 1
966 kp => kpoint%kp_env(ikpgr)%kpoint_env
968 mo_set => kp%mos(1, ispin)
969 CALL get_mo_set(mo_set, eigenvalues=eigenvalues, occupation_numbers=occupation)
970 eigenvalues(1:nmo) = weig(1:nmo, ik, ispin)
971 occupation(1:nmo) = wocc(1:nmo, ik, ispin)
973 mo_set%mu = mus(ispin)
977 DEALLOCATE (weig, wocc)
979 CALL timestop(handle)
991 TYPE(kpoint_type),
POINTER :: kpoint
992 LOGICAL,
OPTIONAL :: energy_weighted, for_aux_fit
994 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kpoint_density_matrices'
996 INTEGER :: handle, ikpgr, ispin, kplocal, nao, nmo, &
998 INTEGER,
DIMENSION(2) :: kp_range
999 LOGICAL :: aux_fit, wtype
1000 REAL(kind=
dp),
DIMENSION(:),
POINTER :: eigenvalues, occupation
1001 TYPE(cp_fm_struct_type),
POINTER :: matrix_struct
1002 TYPE(cp_fm_type) :: fwork
1003 TYPE(cp_fm_type),
POINTER :: cpmat, pmat, rpmat
1004 TYPE(kpoint_env_type),
POINTER :: kp
1005 TYPE(mo_set_type),
POINTER :: mo_set
1007 CALL timeset(routinen, handle)
1009 IF (
PRESENT(energy_weighted))
THEN
1010 wtype = energy_weighted
1016 IF (
PRESENT(for_aux_fit))
THEN
1017 aux_fit = for_aux_fit
1023 cpassert(
ASSOCIATED(kpoint%kp_aux_env))
1028 mo_set => kpoint%kp_aux_env(1)%kpoint_env%mos(1, 1)
1030 mo_set => kpoint%kp_env(1)%kpoint_env%mos(1, 1)
1033 CALL cp_fm_get_info(mo_set%mo_coeff, matrix_struct=matrix_struct)
1037 kplocal = kp_range(2) - kp_range(1) + 1
1038 DO ikpgr = 1, kplocal
1040 kp => kpoint%kp_aux_env(ikpgr)%kpoint_env
1042 kp => kpoint%kp_env(ikpgr)%kpoint_env
1044 nspin =
SIZE(kp%mos, 2)
1046 mo_set => kp%mos(1, ispin)
1048 CALL get_mo_set(mo_set, eigenvalues=eigenvalues)
1050 IF (kpoint%use_real_wfn)
THEN
1052 pmat => kp%wmat(1, ispin)
1054 pmat => kp%pmat(1, ispin)
1056 CALL get_mo_set(mo_set, occupation_numbers=occupation)
1057 CALL cp_fm_to_fm(mo_set%mo_coeff, fwork)
1062 CALL parallel_gemm(
"N",
"T", nao, nao, nmo, 1.0_dp, mo_set%mo_coeff, fwork, 0.0_dp, pmat)
1065 rpmat => kp%wmat(1, ispin)
1066 cpmat => kp%wmat(2, ispin)
1068 rpmat => kp%pmat(1, ispin)
1069 cpmat => kp%pmat(2, ispin)
1071 CALL get_mo_set(mo_set, occupation_numbers=occupation)
1072 CALL cp_fm_to_fm(mo_set%mo_coeff, fwork)
1078 CALL parallel_gemm(
"N",
"T", nao, nao, nmo, 1.0_dp, mo_set%mo_coeff, fwork, 0.0_dp, rpmat)
1079 mo_set => kp%mos(2, ispin)
1081 CALL parallel_gemm(
"N",
"T", nao, nao, nmo, 1.0_dp, mo_set%mo_coeff, fwork, 0.0_dp, cpmat)
1083 CALL parallel_gemm(
"N",
"T", nao, nao, nmo, -1.0_dp, fwork, mo_set%mo_coeff, 1.0_dp, cpmat)
1084 CALL cp_fm_to_fm(mo_set%mo_coeff, fwork)
1090 CALL parallel_gemm(
"N",
"T", nao, nao, nmo, 1.0_dp, mo_set%mo_coeff, fwork, 1.0_dp, rpmat)
1095 CALL cp_fm_release(fwork)
1097 CALL timestop(handle)
1115 TYPE(kpoint_type),
POINTER :: kpoint
1116 TYPE(dbcsr_p_type),
DIMENSION(:, :) :: denmat
1117 LOGICAL,
INTENT(IN) :: wtype
1118 TYPE(dbcsr_type),
POINTER :: tempmat
1119 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
1121 TYPE(cp_fm_type),
DIMENSION(:),
INTENT(IN) :: fmwork
1122 LOGICAL,
OPTIONAL :: for_aux_fit
1123 TYPE(cp_fm_type),
DIMENSION(:, :, :),
INTENT(IN), &
1124 OPTIONAL :: pmat_ext
1126 CHARACTER(LEN=*),
PARAMETER :: routinen =
'kpoint_density_transform'
1128 INTEGER :: handle, ic, ik, ikk, indx, is, ispin, &
1129 nc, nimg, nkp, nspin
1130 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
1131 LOGICAL :: aux_fit, do_ext, do_symmetric, my_kpgrp, &
1133 REAL(kind=
dp) :: wkpx
1134 REAL(kind=
dp),
DIMENSION(:),
POINTER :: wkp
1135 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: xkp
1136 TYPE(copy_info_type),
ALLOCATABLE,
DIMENSION(:) :: info
1137 TYPE(cp_fm_type) :: fmdummy
1138 TYPE(dbcsr_type),
POINTER :: cpmat, rpmat, scpmat, srpmat
1139 TYPE(kpoint_env_type),
POINTER :: kp
1140 TYPE(kpoint_sym_type),
POINTER :: kpsym
1141 TYPE(mp_para_env_type),
POINTER :: para_env
1143 CALL timeset(routinen, handle)
1147 IF (
PRESENT(for_aux_fit))
THEN
1148 aux_fit = for_aux_fit
1154 IF (
PRESENT(pmat_ext)) do_ext = .true.
1157 cpassert(
ASSOCIATED(kpoint%kp_aux_env))
1162 CALL dbcsr_create(rpmat, template=tempmat, &
1163 matrix_type=merge(dbcsr_type_symmetric, dbcsr_type_no_symmetry, do_symmetric))
1166 CALL dbcsr_create(cpmat, template=tempmat, &
1167 matrix_type=merge(dbcsr_type_antisymmetric, dbcsr_type_no_symmetry, do_symmetric))
1169 IF (.NOT. kpoint%full_grid)
THEN
1171 CALL dbcsr_create(srpmat, template=rpmat)
1174 CALL dbcsr_create(scpmat, template=cpmat)
1179 cell_to_index=cell_to_index)
1182 kp => kpoint%kp_aux_env(1)%kpoint_env
1184 kp => kpoint%kp_env(1)%kpoint_env
1186 nspin =
SIZE(kp%mos, 2)
1187 nc =
SIZE(kp%mos, 1)
1188 nimg =
SIZE(denmat, 2)
1189 real_only = (nc == 1)
1191 para_env => kpoint%blacs_env_all%para_env
1192 ALLOCATE (info(nspin*nkp*nc))
1198 CALL dbcsr_set(denmat(ispin, ic)%matrix, 0.0_dp)
1202 my_kpgrp = (ik >= kpoint%kp_range(1) .AND. ik <= kpoint%kp_range(2))
1204 ikk = ik - kpoint%kp_range(1) + 1
1206 kp => kpoint%kp_aux_env(ikk)%kpoint_env
1208 kp => kpoint%kp_env(ikk)%kpoint_env
1214 cpassert(
SIZE(fmwork) >= nc)
1256 kpsym => kpoint%kp_sym(ik)%kpoint_sym
1257 cpassert(
ASSOCIATED(kpsym))
1259 IF (kpsym%apply_symmetry)
THEN
1260 wkpx = wkp(ik)/real(kpsym%nwght, kind=
dp)
1261 DO is = 1, kpsym%nwght
1263 CALL symtrans(srpmat, rpmat, kpsym%rot(1:3, 1:3, is), kpsym%f0(:, is), symmetric=.true.)
1265 CALL symtrans(srpmat, rpmat, kpsym%rot(1:3, 1:3, is), kpsym%f0(:, is), symmetric=.true.)
1266 CALL symtrans(scpmat, cpmat, kpsym%rot(1:3, 1:3, is), kpsym%f0(:, is), antisymmetric=.true.)
1268 CALL transform_dmat(denmat, srpmat, scpmat, ispin, real_only, sab_nl, &
1269 cell_to_index, kpsym%xkp(1:3, is), wkpx)
1273 CALL transform_dmat(denmat, rpmat, cpmat, ispin, real_only, sab_nl, &
1274 cell_to_index, xkp(1:3, ik), wkp(ik))
1283 my_kpgrp = (ik >= kpoint%kp_range(1) .AND. ik <= kpoint%kp_range(2))
1285 ikk = ik - kpoint%kp_range(1) + 1
1287 kp => kpoint%kp_aux_env(ikk)%kpoint_env
1289 kp => kpoint%kp_env(ikk)%kpoint_env
1307 CALL dbcsr_deallocate_matrix(rpmat)
1308 CALL dbcsr_deallocate_matrix(cpmat)
1309 IF (.NOT. kpoint%full_grid)
THEN
1310 CALL dbcsr_deallocate_matrix(srpmat)
1311 CALL dbcsr_deallocate_matrix(scpmat)
1314 CALL timestop(handle)
1330 SUBROUTINE transform_dmat(denmat, rpmat, cpmat, ispin, real_only, sab_nl, cell_to_index, xkp, wkp)
1332 TYPE(dbcsr_p_type),
DIMENSION(:, :) :: denmat
1333 TYPE(dbcsr_type),
POINTER :: rpmat, cpmat
1334 INTEGER,
INTENT(IN) :: ispin
1335 LOGICAL,
INTENT(IN) :: real_only
1336 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
1338 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
1339 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: xkp
1340 REAL(kind=
dp),
INTENT(IN) :: wkp
1342 CHARACTER(LEN=*),
PARAMETER :: routinen =
'transform_dmat'
1344 INTEGER :: handle, iatom, icell, icol, irow, jatom, &
1346 INTEGER,
DIMENSION(3) :: cell
1347 LOGICAL :: do_symmetric, found
1348 REAL(kind=
dp) :: arg, coskl, fc, sinkl
1349 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: cblock, dblock, rblock
1350 TYPE(neighbor_list_iterator_p_type), &
1351 DIMENSION(:),
POINTER :: nl_iterator
1353 CALL timeset(routinen, handle)
1355 nimg =
SIZE(denmat, 2)
1371 IF (do_symmetric .AND. iatom > jatom)
THEN
1377 icell = cell_to_index(cell(1), cell(2), cell(3))
1378 IF (icell < 1 .OR. icell > nimg) cycle
1380 arg = real(cell(1),
dp)*xkp(1) + real(cell(2),
dp)*xkp(2) + real(cell(3),
dp)*xkp(3)
1381 coskl = wkp*cos(
twopi*arg)
1382 sinkl = wkp*fc*sin(
twopi*arg)
1384 CALL dbcsr_get_block_p(matrix=denmat(ispin, icell)%matrix, row=irow, col=icol, &
1385 block=dblock, found=found)
1386 IF (.NOT. found) cycle
1389 CALL dbcsr_get_block_p(matrix=rpmat, row=irow, col=icol, block=rblock, found=found)
1390 IF (.NOT. found) cycle
1391 dblock = dblock + coskl*rblock
1393 CALL dbcsr_get_block_p(matrix=rpmat, row=irow, col=icol, block=rblock, found=found)
1394 IF (.NOT. found) cycle
1395 CALL dbcsr_get_block_p(matrix=cpmat, row=irow, col=icol, block=cblock, found=found)
1396 IF (.NOT. found) cycle
1397 dblock = dblock + coskl*rblock
1398 dblock = dblock + sinkl*cblock
1403 CALL timestop(handle)
1405 END SUBROUTINE transform_dmat
1416 SUBROUTINE symtrans(smat, pmat, rot, f0, symmetric, antisymmetric)
1417 TYPE(dbcsr_type),
POINTER :: smat, pmat
1418 REAL(kind=
dp),
DIMENSION(3, 3),
INTENT(IN) :: rot
1419 INTEGER,
DIMENSION(:),
INTENT(IN) :: f0
1420 LOGICAL,
INTENT(IN),
OPTIONAL :: symmetric, antisymmetric
1422 CHARACTER(LEN=*),
PARAMETER :: routinen =
'symtrans'
1424 INTEGER :: handle, iatom, icol, ip, irow, jcol, jp, &
1425 jrow, natom, numnodes
1426 LOGICAL :: asym, dorot, found, perm, sym, trans
1427 REAL(kind=
dp) :: dr, fsign
1428 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: pblock, sblock
1429 TYPE(dbcsr_distribution_type) :: dist
1430 TYPE(dbcsr_iterator_type) :: iter
1432 CALL timeset(routinen, handle)
1436 IF (
PRESENT(symmetric)) sym = symmetric
1438 IF (
PRESENT(antisymmetric)) asym = antisymmetric
1440 cpassert(.NOT. (sym .AND. asym))
1441 cpassert((sym .OR. asym))
1447 IF (f0(iatom) == iatom) cycle
1454 IF (abs(sum(abs(rot)) - 3.0_dp) > 1.e-12_dp) dorot = .true.
1455 dr = abs(rot(1, 1) - 1.0_dp) + abs(rot(2, 2) - 1.0_dp) + abs(rot(3, 3) - 1.0_dp)
1456 IF (abs(dr) > 1.e-12_dp) dorot = .true.
1459 IF (asym) fsign = -1.0_dp
1461 IF (dorot .OR. perm)
THEN
1462 CALL dbcsr_set(smat, 0.0_dp)
1464 CALL dbcsr_get_info(pmat, distribution=dist)
1465 CALL dbcsr_distribution_get(dist, numnodes=numnodes)
1466 IF (numnodes == 1)
THEN
1468 CALL dbcsr_iterator_start(iter, pmat)
1469 DO WHILE (dbcsr_iterator_blocks_left(iter))
1470 CALL dbcsr_iterator_next_block(iter, irow, icol, pblock)
1482 CALL dbcsr_get_block_p(matrix=smat, row=jrow, col=jcol, block=sblock, found=found)
1483 IF (.NOT. found) cycle
1485 sblock = fsign*transpose(pblock)
1490 CALL dbcsr_iterator_stop(iter)
1494 CALL cp_abort(__location__,
"k-points need FULL_GRID currently. "// &
1495 "Reduced grids not yet working correctly")
1500 CALL dbcsr_copy(smat, pmat)
1501 CALL cp_abort(__location__,
"k-points need FULL_GRID currently. "// &
1502 "Reduced grids not yet working correctly")
1506 CALL dbcsr_copy(smat, pmat)
1509 CALL timestop(handle)
1511 END SUBROUTINE symtrans
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.
subroutine, public real_to_scaled(s, r, cell)
Transform real to scaled cell coordinates. s=h_inv*r.
methods related to the blacs parallel environment
subroutine, public cp_blacs_env_create(blacs_env, para_env, blacs_grid_layout, blacs_repeatable, row_major, grid_2d)
allocates and initializes a type that represent a blacs context
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
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 copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
basic linear algebra operations for full matrices
subroutine, public cp_fm_column_scale(matrixa, scaling)
scales column i of matrix a with scaling(i)
pool for for elements that are retained and released
subroutine, public fm_pool_create_fm(pool, element, name)
returns an element, allocating it if none is in the pool
subroutine, public fm_pool_give_back_fm(pool, element)
returns the element to the pool
represent the structure of a full matrix
represent a full matrix distributed on many processors
subroutine, public cp_fm_start_copy_general(source, destination, para_env, info)
Initiates the copy operation: get distribution data, post MPI isend and irecvs.
subroutine, public cp_fm_cleanup_copy_general(info)
Completes the copy operation: wait for comms clean up MPI state.
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_finish_copy_general(destination, info)
Completes the copy operation: wait for comms, unpack, clean up MPI state.
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...
K-points and crystal symmetry routines.
subroutine, public print_crys_symmetry(csym)
...
subroutine, public crys_sym_gen(csym, scoor, types, hmat, delta, iounit)
...
subroutine, public release_csym_type(csym)
Release the CSYM type.
subroutine, public kpoint_gen(csym, nk, symm, shift, full_grid)
...
subroutine, public apply_rotation_coord(f0, csym, ir)
...
subroutine, public print_kp_symmetry(csym)
...
deal with the Fermi distribution, compute it, fix mu, get derivs
subroutine, public fermikp2(f, mu, kTS, e, nel, wk, t)
Bisection search to find mu for a given nel (kpoint case)
subroutine, public fermikp(f, mu, kTS, e, nel, wk, t, maxocc)
Bisection search to find mu for a given nel (kpoint case)
Defines the basic variable types.
integer, parameter, public dp
Routines needed for kpoint calculation.
subroutine, public kpoint_initialize_mo_set(kpoint)
...
subroutine, public rskp_transform(rmatrix, cmatrix, rsmat, ispin, xkp, cell_to_index, sab_nl, is_complex, rs_sign)
Transformation of real space matrices to a kpoint.
subroutine, public kpoint_initialize_mos(kpoint, mos, added_mos, for_aux_fit)
Initialize a set of MOs and density matrix for each kpoint (kpoint group)
subroutine, public kpoint_initialize(kpoint, particle_set, cell)
Generate the kpoints and initialize the kpoint environment.
subroutine, public kpoint_density_transform(kpoint, denmat, wtype, tempmat, sab_nl, fmwork, for_aux_fit, pmat_ext)
generate real space density matrices in DBCSR format
subroutine, public kpoint_init_cell_index(kpoint, sab_nl, para_env, dft_control)
Generates the mapping of cell indices and linear RS index CELL (0,0,0) is always mapped to index 1.
subroutine, public kpoint_density_matrices(kpoint, energy_weighted, for_aux_fit)
Calculate kpoint density matrices (rho(k), owned by kpoint groups)
subroutine, public kpoint_env_initialize(kpoint, para_env, blacs_env, with_aux_fit)
Initialize the kpoint environment.
subroutine, public kpoint_set_mo_occupation(kpoint, smear)
Given the eigenvalues of all kpoints, calculates the occupation numbers.
Types and basic routines needed for a kpoint calculation.
subroutine, public kpoint_sym_create(kp_sym)
Create a single kpoint symmetry environment.
subroutine, public kpoint_env_create(kp_env)
Create a single kpoint environment.
subroutine, public get_kpoint_info(kpoint, kp_scheme, nkp_grid, kp_shift, symmetry, verbose, full_grid, use_real_wfn, eps_geo, parallel_group_size, kp_range, nkp, xkp, wkp, para_env, blacs_env_all, para_env_kp, para_env_inter_kp, blacs_env, kp_env, kp_aux_env, mpools, iogrp, nkp_groups, kp_dist, cell_to_index, index_to_cell, sab_nl, sab_nl_nosym)
Retrieve information from a kpoint environment.
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
Definition of mathematical constants and functions.
real(kind=dp), parameter, public twopi
Utility routines for the memory handling.
Interface to the message passing library MPI.
basic linear algebra operations for full matrixes
Define the data structure for the particle information.
wrapper for the pools of matrixes
subroutine, public mpools_create(mpools)
creates a mpools
subroutine, public mpools_rebuild_fm_pools(mpools, mos, blacs_env, para_env, nmosub)
rebuilds the pools of the (ao x mo, ao x ao , mo x mo) full matrixes
subroutine, public mpools_get(mpools, ao_mo_fm_pools, ao_ao_fm_pools, mo_mo_fm_pools, ao_mosub_fm_pools, mosub_mosub_fm_pools, maxao_maxmo_fm_pool, maxao_maxao_fm_pool, maxmo_maxmo_fm_pool)
returns various attributes of the mpools (notably the pools contained in it)
Definition and initialisation of the mo data type.
subroutine, public set_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, uniform_occupation, kTS, mu, flexible_electron_count)
Set the components of a MO set data structure.
subroutine, public allocate_mo_set(mo_set, nao, nmo, nelectron, n_el_f, maxocc, flexible_electron_count)
Allocates a mo set and partially initializes it (nao,nmo,nelectron, and flexible_electron_count are v...
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.
subroutine, public init_mo_set(mo_set, fm_pool, fm_ref, fm_struct, name)
initializes an allocated mo_set. eigenvalues, mo_coeff, occupation_numbers are valid only after this ...
Define the neighbor list data types and the corresponding functionality.
subroutine, public neighbor_list_iterator_create(iterator_set, nl, search, nthread)
Neighbor list iterator functions.
subroutine, public neighbor_list_iterator_release(iterator_set)
...
subroutine, public get_neighbor_list_set_p(neighbor_list_sets, nlist, symmetric)
Return the components of the first neighbor list set.
integer function, public neighbor_list_iterate(iterator_set, mepos)
...
subroutine, public get_iterator_info(iterator_set, mepos, ikind, jkind, nkind, ilist, nlist, inode, nnode, iatom, jatom, r, cell)
...
parameters that control an scf iteration
All kind of helpful little routines.
pure integer function, dimension(2), public get_limit(m, n, me)
divide m entries into n parts, return size of part me