32 dbcsr_type_antisymmetric, dbcsr_type_symmetric
79#include "./base/base_uses.f90"
106 vel_reprs, com_nl, loc_print_section)
109 TYPE(
cp_fm_type),
DIMENSION(:),
INTENT(IN) :: mo_local
110 INTEGER,
INTENT(IN) :: max_moment
111 LOGICAL,
INTENT(IN) :: magnetic, vel_reprs, com_nl
114 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_localized_moments'
116 CHARACTER(LEN=8),
ALLOCATABLE,
DIMENSION(:) :: rlab
117 CHARACTER(LEN=default_string_length) :: mol_name
118 INTEGER :: akind, first_atom, handle, i, iatom, idir, imo_im, imo_re, imol, iounit, iproc, &
119 ispin, ix, iy, iz, l, last_atom, nao, natom, nm, nmols, nmom, ns, nspins, order, &
121 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: states
122 INTEGER,
DIMENSION(2) :: nstates
123 LOGICAL :: do_rtp, floating, ghost
124 REAL(
dp) :: charge, dd, im_part, re_part, zwfc
125 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: mmom, nlcom_rrv, nlcom_rrv_vrr, &
126 nlcom_rv, nlcom_rvr, nlcom_rxrv, &
128 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: rmom
129 REAL(
dp),
DIMENSION(3) :: rcc, ria
130 REAL(
dp),
DIMENSION(:),
POINTER :: ref_point
137 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: magmom, matrix_s, moments, momentum
138 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: moments_der
148 CALL timeset(routinen, handle)
151 IF (max_moment > 1 .OR. magnetic .OR. vel_reprs .OR. com_nl)
THEN
157 NULLIFY (cell, dft_control, matrix_s, molecule_set, qs_kind_set, sab_orb)
160 dft_control=dft_control, &
162 molecule_set=molecule_set, &
163 qs_kind_set=qs_kind_set, &
165 particle_set => qs_loc_env%particle_set
166 para_env => qs_loc_env%para_env
168 nspins = dft_control%nspins
169 zwfc = 3.0_dp - real(nspins, kind=
dp)
171 do_rtp = qs_env%run_rtp .OR. (
SIZE(mo_local) == 2*nspins)
175 nm = (6 + 11*nmom + 6*nmom**2 + nmom**3)/6 - 1
176 nmols =
SIZE(molecule_set)
179 extension=
".LocMom", middle_name=
"LOCALIZED_MOMENTS")
181 ALLOCATE (rmom(nm + 1, 3), rlab(nm + 1))
182 IF (magnetic)
ALLOCATE (mmom(3))
184 IF (com_nl .AND. (nmom >= 2))
THEN
187 rmom_vel_size = max(nm, 9)
189 ALLOCATE (rmom_vel(rmom_vel_size))
193 molecule_kind => molecule_set(imol)%molecule_kind
194 first_atom = molecule_set(imol)%first_atom
195 last_atom = molecule_set(imol)%last_atom
199 ref_point=ref_point, ifirst=first_atom, &
208 ALLOCATE (moments(i)%matrix)
209 IF (vel_reprs .AND. (nmom >= 2))
THEN
210 CALL dbcsr_create(moments(i)%matrix, template=matrix_s(1)%matrix, &
211 matrix_type=dbcsr_type_symmetric)
214 CALL dbcsr_copy(moments(i)%matrix, matrix_s(1)%matrix,
"Moments")
216 CALL dbcsr_set(moments(i)%matrix, 0.0_dp)
218 IF (vel_reprs .AND. (nmom >= 2))
THEN
219 NULLIFY (moments_der)
224 CALL dbcsr_create(moments_der(i, idir)%matrix, template=matrix_s(1)%matrix, &
225 matrix_type=dbcsr_type_antisymmetric)
227 CALL dbcsr_set(moments_der(i, idir)%matrix, 0.0_dp)
241 CALL dbcsr_create(magmom(i)%matrix, template=matrix_s(1)%matrix, &
242 matrix_type=dbcsr_type_antisymmetric)
255 CALL dbcsr_create(momentum(i)%matrix, template=matrix_s(1)%matrix, &
256 matrix_type=dbcsr_type_antisymmetric)
258 CALL dbcsr_set(momentum(i)%matrix, 0.0_dp)
266 template_fmstruct=mo_local(1)%matrix_struct)
270 IF (
ASSOCIATED(molecule_set(imol)%lmi))
THEN
271 nstates(1) = molecule_set(imol)%lmi(ispin)%nstates
275 nstates(2) = para_env%mepos
276 CALL para_env%maxloc(nstates)
277 IF (nstates(1) == 0) cycle
280 ALLOCATE (states(ns))
281 IF (iproc == para_env%mepos)
THEN
282 states(:) = molecule_set(imol)%lmi(ispin)%states(:)
286 CALL para_env%bcast(states, iproc)
297 template_fmstruct=mo_local(imo_re)%matrix_struct)
299 template_fmstruct=mo_local(imo_re)%matrix_struct)
313 CALL cp_fm_to_fm(mo_local(imo_re), vr_fm, 1, states(i), i)
315 CALL cp_fm_to_fm(mo_local(imo_im), vi_fm, 1, states(i), i)
327 CALL trace_op_in_mo(moments(i)%matrix, or_fm, v_cfm, ov_cfm, vov_cfm, &
328 o_struct, ns, nao, re_part, im_part)
329 rmom(i + 1, 1) = rmom(i + 1, 1) + zwfc*re_part
331 rmom(1, 1) = rmom(1, 1) + zwfc*real(ns, kind=
dp)
335 CALL trace_op_in_mo(magmom(i)%matrix, or_fm, v_cfm, ov_cfm, vov_cfm, &
336 o_struct, ns, nao, re_part, im_part)
337 mmom(i) = mmom(i) - zwfc*im_part
346 CALL trace_op_in_mo(momentum(i)%matrix, or_fm, v_cfm, ov_cfm, vov_cfm, &
347 o_struct, ns, nao, re_part, im_part)
348 rmom_vel(i) = rmom_vel(i) - zwfc*im_part
351 ALLOCATE (qupole_der(9))
355 CALL trace_op_in_mo(moments_der(i, idir)%matrix, or_fm, v_cfm, ov_cfm, &
356 vov_cfm, o_struct, ns, nao, re_part, im_part)
357 qupole_der((i - 1)*3 + idir) = &
358 qupole_der((i - 1)*3 + idir) + zwfc*(re_part - im_part)
361 rmom_vel(4) = -2.0_dp*qupole_der(1) - rmom(1, 1)
362 rmom_vel(5) = -qupole_der(2) - qupole_der(4)
363 rmom_vel(6) = -qupole_der(3) - qupole_der(7)
364 rmom_vel(7) = -2.0_dp*qupole_der(5) - rmom(1, 1)
365 rmom_vel(8) = -qupole_der(6) - qupole_der(8)
366 rmom_vel(9) = -2.0_dp*qupole_der(9) - rmom(1, 1)
367 DEALLOCATE (qupole_der)
381 CALL para_env%sum(rmom(:, 1))
382 IF (magnetic)
CALL para_env%sum(mmom)
383 IF (vel_reprs)
CALL para_env%sum(rmom_vel)
385 DO iatom = first_atom, first_atom + natom - 1
386 ria =
pbc(particle_set(iatom)%r - rcc, cell) + rcc
388 atomic_kind => particle_set(iatom)%atomic_kind
390 CALL get_qs_kind(qs_kind_set(akind), ghost=ghost, floating=floating, &
392 IF (ghost .OR. floating) cycle
393 rmom(1, 2) = rmom(1, 2) - charge
399 IF (ix > 0) dd = dd*ria(1)**ix
400 IF (iy > 0) dd = dd*ria(2)**iy
401 IF (iz > 0) dd = dd*ria(3)**iz
402 rmom(l + 1, 2) = rmom(l + 1, 2) - charge*dd
406 rmom(:, :) = -rmom(:, :)
407 rmom(:, 3) = rmom(:, 1) + rmom(:, 2)
410 IF ((nmom >= 1) .AND. vel_reprs)
THEN
411 ALLOCATE (nlcom_rv(3))
414 IF ((nmom >= 2) .AND. vel_reprs)
THEN
415 ALLOCATE (nlcom_rrv(6), nlcom_rvr(6), nlcom_rrv_vrr(6))
416 nlcom_rrv(:) = 0.0_dp
417 nlcom_rvr(:) = 0.0_dp
418 nlcom_rrv_vrr(:) = 0.0_dp
421 ALLOCATE (nlcom_rxrv(3))
422 nlcom_rxrv(:) = 0.0_dp
425 nlcom_rvr, nlcom_rrv_vrr, rcc)
429 WRITE (unit=iounit, fmt=
'(/,T3,A,I6,2X,A)') &
430 "# Molecule:", imol, trim(mol_name)
431 IF (magnetic .AND. vel_reprs)
THEN
432 CALL print_moments(iounit, nmom, rmom, rlab, rcc, cell, periodic=.false., &
433 mmom=mmom, rmom_vel=rmom_vel)
434 ELSE IF (magnetic)
THEN
435 CALL print_moments(iounit, nmom, rmom, rlab, rcc, cell, periodic=.false., &
437 ELSE IF (vel_reprs)
THEN
438 CALL print_moments(iounit, nmom, rmom, rlab, rcc, cell, periodic=.false., &
441 CALL print_moments(iounit, nmom, rmom, rlab, rcc, cell, periodic=.false.)
445 IF (magnetic) mmom(:) = nlcom_rxrv(:)
446 IF (vel_reprs .AND. (nmom >= 1)) rmom_vel(1:3) = nlcom_rv
447 IF (vel_reprs .AND. (nmom >= 2))
THEN
448 rmom_vel(4:9) = nlcom_rrv
449 rmom_vel(10:15) = nlcom_rvr
450 rmom_vel(16:21) = nlcom_rrv_vrr
452 IF (magnetic .AND. vel_reprs)
THEN
454 ELSE IF (magnetic)
THEN
456 ELSE IF (vel_reprs)
THEN
463 IF ((nmom >= 1) .AND. vel_reprs)
DEALLOCATE (nlcom_rv)
464 IF ((nmom >= 2) .AND. vel_reprs)
DEALLOCATE (nlcom_rrv, nlcom_rvr, nlcom_rrv_vrr)
465 IF (magnetic)
DEALLOCATE (nlcom_rxrv)
473 DEALLOCATE (rmom, rlab)
474 IF (magnetic)
DEALLOCATE (mmom)
475 IF (vel_reprs)
DEALLOCATE (rmom_vel)
479 CALL timestop(handle)
496 SUBROUTINE trace_op_in_mo(op_dbcsr, or_fm, v_cfm, ov_cfm, vov_cfm, o_struct, ns, nao, &
501 TYPE(
cp_cfm_type),
INTENT(INOUT) :: ov_cfm, vov_cfm
503 INTEGER,
INTENT(IN) :: ns, nao
504 REAL(
dp),
INTENT(OUT) :: re_sum, im_sum
513 CALL cp_cfm_gemm(
"N",
"N", nao, ns, nao, (1._dp, 0._dp), o_cfm, v_cfm, &
514 (0._dp, 0._dp), ov_cfm)
515 CALL cp_cfm_gemm(
"C",
"N", ns, ns, nao, (1._dp, 0._dp), v_cfm, ov_cfm, &
516 (0._dp, 0._dp), vov_cfm)
521 re_sum = re_sum + real(di, kind=
dp)
522 im_sum = im_sum + aimag(di)
526 END SUBROUTINE trace_op_in_mo
539 INTEGER,
INTENT(IN) :: unit_nr, max_moment
540 LOGICAL,
INTENT(IN) :: magnetic, vel_reprs, com_nl
542 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_kg_moments'
544 CHARACTER(LEN=8),
ALLOCATABLE,
DIMENSION(:) :: rlab
545 CHARACTER(LEN=default_string_length) :: mol_name
546 INTEGER :: akind, first_atom, handle, i, iatom, &
547 idir, imol, ispin, ix, iy, iz, jatom, &
548 l, last_atom, natom, nm, nmol, nmom, &
549 nspins, rmom_vel_size
550 INTEGER,
DIMENSION(:),
POINTER :: atom_to_molecule
551 LOGICAL :: do_rtp, floating, found, ghost
552 REAL(
dp) :: charge, dd, factor
553 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: mmom, nlcom_rrv, nlcom_rrv_vrr, &
554 nlcom_rv, nlcom_rvr, nlcom_rxrv, &
556 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: rmom
557 REAL(
dp),
DIMENSION(3) :: rcc, ria
558 REAL(
dp),
DIMENSION(:),
POINTER :: ref_point
559 REAL(
dp),
DIMENSION(:, :),
POINTER :: oblock, pblock, sblock
563 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: magmom, matrix_s, moments, momentum, &
565 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: moments_der
577 CALL timeset(routinen, handle)
580 IF (max_moment > 1 .OR. magnetic .OR. vel_reprs .OR. com_nl)
THEN
584 NULLIFY (cell, dft_control, kg_env, matrix_s, para_env, particle_set, &
585 qs_kind_set, rho, sab_orb)
588 dft_control=dft_control, &
592 particle_set=particle_set, &
593 qs_kind_set=qs_kind_set, &
597 cpassert(
ASSOCIATED(kg_env))
598 molecule_set => kg_env%molecule_set
599 atom_to_molecule => kg_env%atom_to_molecule
601 nspins = dft_control%nspins
602 do_rtp = qs_env%run_rtp
605 nm = (6 + 11*nmom + 6*nmom**2 + nmom**3)/6 - 1
606 nmol =
SIZE(molecule_set)
608 NULLIFY (rho_ao, rho_ao_im)
610 IF (do_rtp)
CALL qs_rho_get(rho, rho_ao_im=rho_ao_im)
612 ALLOCATE (rmom(nm + 1, 3), rlab(nm + 1))
613 IF (magnetic)
ALLOCATE (mmom(3))
615 IF (com_nl .AND. (nmom >= 2))
THEN
618 rmom_vel_size = max(nm, 9)
620 ALLOCATE (rmom_vel(rmom_vel_size))
624 molecule_kind => molecule_set(imol)%molecule_kind
625 first_atom = molecule_set(imol)%first_atom
626 last_atom = molecule_set(imol)%last_atom
630 ref_point=ref_point, ifirst=first_atom, ilast=last_atom)
638 ALLOCATE (moments(i)%matrix)
639 IF (vel_reprs .AND. (nmom >= 2))
THEN
640 CALL dbcsr_create(moments(i)%matrix, template=matrix_s(1)%matrix, &
641 matrix_type=dbcsr_type_symmetric)
644 CALL dbcsr_copy(moments(i)%matrix, matrix_s(1)%matrix,
"Moments")
646 CALL dbcsr_set(moments(i)%matrix, 0.0_dp)
648 IF (vel_reprs .AND. (nmom >= 2))
THEN
649 NULLIFY (moments_der)
654 CALL dbcsr_create(moments_der(i, idir)%matrix, template=matrix_s(1)%matrix, &
655 matrix_type=dbcsr_type_antisymmetric)
657 CALL dbcsr_set(moments_der(i, idir)%matrix, 0.0_dp)
671 CALL dbcsr_create(magmom(i)%matrix, template=matrix_s(1)%matrix, &
672 matrix_type=dbcsr_type_antisymmetric)
685 CALL dbcsr_create(momentum(i)%matrix, template=matrix_s(1)%matrix, &
686 matrix_type=dbcsr_type_antisymmetric)
688 CALL dbcsr_set(momentum(i)%matrix, 0.0_dp)
694 IF (vel_reprs .AND. (nmom >= 2))
THEN
695 ALLOCATE (qupole_der(9))
703 IF (
SIZE(pblock) == 0) cycle
704 IF (atom_to_molecule(iatom) /= imol) cycle
705 IF (atom_to_molecule(jatom) /= imol) cycle
706 factor = merge(2.0_dp, 1.0_dp, iatom /= jatom)
708 IF (found) rmom(1, 1) = rmom(1, 1) + factor*sum(pblock*sblock)
711 IF (found) rmom(i + 1, 1) = rmom(i + 1, 1) + factor*sum(pblock*oblock)
716 IF (do_rtp .AND. (magnetic .OR. vel_reprs))
THEN
720 IF (
SIZE(pblock) == 0) cycle
721 IF (atom_to_molecule(iatom) /= imol) cycle
722 IF (atom_to_molecule(jatom) /= imol) cycle
723 factor = merge(2.0_dp, 1.0_dp, iatom /= jatom)
727 IF (found) mmom(i) = mmom(i) + factor*sum(pblock*oblock)
733 IF (found) rmom_vel(i) = rmom_vel(i) + factor*sum(pblock*oblock)
739 iatom, jatom, oblock, found)
741 qupole_der((i - 1)*3 + idir) = &
742 qupole_der((i - 1)*3 + idir) - factor*sum(pblock*oblock)
752 IF (vel_reprs .AND. (nmom >= 2))
THEN
753 rmom_vel(4) = -2.0_dp*qupole_der(1) - rmom(1, 1)
754 rmom_vel(5) = -qupole_der(2) - qupole_der(4)
755 rmom_vel(6) = -qupole_der(3) - qupole_der(7)
756 rmom_vel(7) = -2.0_dp*qupole_der(5) - rmom(1, 1)
757 rmom_vel(8) = -qupole_der(6) - qupole_der(8)
758 rmom_vel(9) = -2.0_dp*qupole_der(9) - rmom(1, 1)
759 DEALLOCATE (qupole_der)
762 CALL para_env%sum(rmom(:, 1))
763 IF (magnetic)
CALL para_env%sum(mmom)
764 IF (vel_reprs)
CALL para_env%sum(rmom_vel)
766 DO iatom = first_atom, first_atom + natom - 1
767 ria =
pbc(particle_set(iatom)%r - rcc, cell) + rcc
769 atomic_kind => particle_set(iatom)%atomic_kind
771 CALL get_qs_kind(qs_kind_set(akind), ghost=ghost, floating=floating, &
773 IF (ghost .OR. floating) cycle
774 rmom(1, 2) = rmom(1, 2) - charge
780 IF (ix > 0) dd = dd*ria(1)**ix
781 IF (iy > 0) dd = dd*ria(2)**iy
782 IF (iz > 0) dd = dd*ria(3)**iz
783 rmom(l + 1, 2) = rmom(l + 1, 2) - charge*dd
787 rmom(:, :) = -rmom(:, :)
788 rmom(:, 3) = rmom(:, 1) + rmom(:, 2)
791 IF ((nmom >= 1) .AND. vel_reprs)
THEN
792 ALLOCATE (nlcom_rv(3))
795 IF ((nmom >= 2) .AND. vel_reprs)
THEN
796 ALLOCATE (nlcom_rrv(6), nlcom_rvr(6), nlcom_rrv_vrr(6))
797 nlcom_rrv(:) = 0.0_dp
798 nlcom_rvr(:) = 0.0_dp
799 nlcom_rrv_vrr(:) = 0.0_dp
802 ALLOCATE (nlcom_rxrv(3))
803 nlcom_rxrv(:) = 0.0_dp
806 nlcom_rvr, nlcom_rrv_vrr, rcc)
809 IF (unit_nr > 0)
THEN
810 WRITE (unit=unit_nr, fmt=
'(/,T3,A,I6,2X,A)') &
811 "# Molecule:", imol, trim(mol_name)
812 IF (magnetic .AND. vel_reprs)
THEN
813 CALL print_moments(unit_nr, nmom, rmom, rlab, rcc, cell, periodic=.false., &
814 mmom=mmom, rmom_vel=rmom_vel)
815 ELSE IF (magnetic)
THEN
816 CALL print_moments(unit_nr, nmom, rmom, rlab, rcc, cell, periodic=.false., &
818 ELSE IF (vel_reprs)
THEN
819 CALL print_moments(unit_nr, nmom, rmom, rlab, rcc, cell, periodic=.false., &
822 CALL print_moments(unit_nr, nmom, rmom, rlab, rcc, cell, periodic=.false.)
826 IF (magnetic) mmom(:) = nlcom_rxrv(:)
827 IF (vel_reprs .AND. (nmom >= 1)) rmom_vel(1:3) = nlcom_rv
828 IF (vel_reprs .AND. (nmom >= 2))
THEN
829 rmom_vel(4:9) = nlcom_rrv
830 rmom_vel(10:15) = nlcom_rvr
831 rmom_vel(16:21) = nlcom_rrv_vrr
833 IF (magnetic .AND. vel_reprs)
THEN
835 ELSE IF (magnetic)
THEN
837 ELSE IF (vel_reprs)
THEN
844 IF ((nmom >= 1) .AND. vel_reprs)
DEALLOCATE (nlcom_rv)
845 IF ((nmom >= 2) .AND. vel_reprs)
DEALLOCATE (nlcom_rrv, nlcom_rvr, nlcom_rrv_vrr)
846 IF (magnetic)
DEALLOCATE (nlcom_rxrv)
854 DEALLOCATE (rmom, rlab)
855 IF (magnetic)
DEALLOCATE (mmom)
856 IF (vel_reprs)
DEALLOCATE (rmom_vel)
858 CALL timestop(handle)
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.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public schreder2024_1
integer, save, public schreder2021
Handles all functions related to the CELL.
Basic linear algebra operations for complex full matrices.
subroutine, public cp_cfm_gemm(transa, transb, m, n, k, alpha, matrix_a, matrix_b, beta, matrix_c, a_first_col, a_first_row, b_first_col, b_first_row, c_first_col, c_first_row)
Performs one of the matrix-matrix operations: matrix_c = alpha * op1( matrix_a ) * op2( matrix_b ) + ...
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_get_element(matrix, irow_global, icol_global, alpha)
Get the matrix element by its global index.
subroutine, public cp_cfm_release(matrix)
Releases a full matrix.
subroutine, public cp_fm_to_cfm(msourcer, msourcei, mtarget)
Construct a complex full matrix by taking its real and imaginary parts from two separate real-value f...
subroutine, public cp_cfm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
Creates a new full matrix with the given structure.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_get_readonly_block_p(matrix, row, col, block, found, row_size, col_size)
Like dbcsr_get_block_p() but with matrix being INTENT(IN). When invoking this routine,...
logical function, public dbcsr_iterator_blocks_left(iterator)
...
subroutine, public dbcsr_iterator_stop(iterator)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_init_p(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, transposed)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_iterator_readonly_start(iterator, matrix, shared, dynamic, dynamic_byrows)
Like dbcsr_iterator_start() but with matrix being INTENT(IN). When invoking this routine,...
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_dbcsr_to_fm(matrix, fm)
Copy a DBCSR matrix to a BLACS matrix.
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 ...
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,...
Types needed for a Kim-Gordon-like partitioning into molecular subunits.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Routines for the calculation of moments from Wannier functions.
subroutine, public calculate_kg_moments(qs_env, unit_nr, max_moment, magnetic, vel_reprs, com_nl)
Calculates multipole moments per molecule from the Kim-Gordon AO density matrix.
subroutine, public calculate_localized_moments(qs_env, qs_loc_env, mo_local, max_moment, magnetic, vel_reprs, com_nl, loc_print_section)
Calculates localized multipole moments per molecule in the Wannier MO basis.
Interface to the message passing library MPI.
Define the molecule kind structure types and the corresponding functionality.
subroutine, public get_molecule_kind(molecule_kind, atom_list, bond_list, bend_list, ub_list, impr_list, opbend_list, colv_list, fixd_list, g3x3_list, g4x6_list, vsite_list, torsion_list, shell_list, name, mass, charge, kind_number, natom, nbend, nbond, nub, nimpr, nopbend, nconstraint, nconstraint_fixd, nfixd, ncolv, ng3x3, ng4x6, nvsite, nfixd_restraint, ng3x3_restraint, ng4x6_restraint, nvsite_restraint, nrestraints, nmolecule, nsgf, nshell, ntorsion, molecule_list, nelectron, nelectron_alpha, nelectron_beta, bond_kind_set, bend_kind_set, ub_kind_set, impr_kind_set, opbend_kind_set, torsion_kind_set, molname_generated)
Get informations about a molecule kind.
Define the data structure for the molecule information.
Calculates the moment integrals <a|r^m|b>
subroutine, public get_reference_point(rpoint, drpoint, qs_env, fist_env, reference, ref_point, ifirst, ilast)
...
Provides Cartesian and spherical orbital pointers and indices.
integer, save, public current_maxl
integer, dimension(:, :), allocatable, public indco
Define the data structure for the particle information.
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.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, 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, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
New version of the module for the localization of the molecular orbitals This should be able to use d...
Calculates the moment integrals <a|r^m|b> and <a|r x d/dr|b>
subroutine, public build_local_magmom_matrix(qs_env, magmom, nmoments, ref_point, ref_points, basis_type)
...
subroutine, public print_moments_nl(unit_number, nmom, rlab, mmom, rmom_vel)
...
subroutine, public set_label(label, ix, iy, iz)
...
subroutine, public build_local_moment_matrix(qs_env, moments, nmoments, ref_point, ref_points, basis_type)
...
subroutine, public print_moments(unit_number, nmom, rmom, rlab, rcc, cell, periodic, mmom, rmom_vel)
...
subroutine, public build_local_moments_der_matrix(qs_env, moments_der, nmoments_der, nmoments, ref_point, moments)
Calculate right-hand sided derivatives of multipole moments, e. g. < a | xy d/dz | b > Optionally sto...
subroutine, public calculate_commutator_nl_terms(qs_env, nlcom_rv, nlcom_rxrv, nlcom_rrv, nlcom_rvr, nlcom_rrv_vrr, ref_point)
Calculate the expectation value of operators related to non-local potential: [r, Vnl],...
Define the neighbor list data types and the corresponding functionality.
subroutine, public build_lin_mom_matrix(qs_env, matrix)
Calculation of the linear momentum matrix <mu|∂|nu> over Cartesian Gaussian functions.
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...
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
Represent a complex full matrix.
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...
Contains all the info needed for KG runs...
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.
contains all the info needed by quickstep to calculate the spread of a selected set of orbitals and i...
keeps the density in various representations, keeping track of which ones are valid.