67#include "./base/base_uses.f90"
75 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'ec_external'
93 LOGICAL,
INTENT(IN) :: calculate_forces
95 CHARACTER(len=*),
PARAMETER :: routinen =
'ec_ext_energy'
97 INTEGER :: handle, ispin, nocc, nspins, unit_nr
100 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: cpmos, mo_occ, mo_ref
107 CALL timeset(routinen, handle)
109 CALL get_qs_env(qs_env, dft_control=dft_control)
110 nspins = dft_control%nspins
113 IF (logger%para_env%is_source())
THEN
119 ec_env%etotal = 0.0_dp
122 ec_env%ehartree = 0.0_dp
125 ALLOCATE (cpmos(nspins), mo_ref(nspins), mo_occ(nspins))
129 IF (ec_env%debug_external)
THEN
132 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, homo=nocc)
135 template_fmstruct=mo_coeff%matrix_struct)
145 ec_env%mo_occ => mo_ref
146 CALL ec_ext_debug(qs_env, ec_env, calculate_forces, unit_nr)
148 IF (calculate_forces)
THEN
150 IF (nspins == 1) focc = 4.0_dp
152 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, homo=nocc)
154 cpmos(ispin), nocc, &
155 alpha=focc, beta=0.0_dp)
158 ec_env%cpmos => cpmos
161 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, homo=nocc)
164 template_fmstruct=mo_coeff%matrix_struct)
175 CALL ec_ext_interface(qs_env, ec_env%exresp_fn, mo_occ, mo_ref, cpmos, calculate_forces, unit_nr)
176 ec_env%mo_occ => mo_ref
177 ec_env%cpmos => cpmos
180 IF (calculate_forces)
THEN
184 CALL align_vectors(ec_env%cpmos(ispin), ec_env%mo_occ(ispin), mo_occ(ispin), &
185 matrix_s(1)%matrix, unit_nr)
188 CALL ec_ext_setup(qs_env, ec_env, .true., unit_nr)
190 CALL matrix_r_forces(qs_env, ec_env%cpmos, ec_env%mo_occ, &
191 ec_env%matrix_w(1, 1)%matrix, unit_nr)
193 CALL ec_ext_setup(qs_env, ec_env, .false., unit_nr)
198 CALL timestop(handle)
214 SUBROUTINE ec_ext_interface(qs_env, trexio_fn, mo_occ, mo_ref, cpmos, calculate_forces, unit_nr)
216 CHARACTER(LEN=*) :: trexio_fn
217 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: mo_occ, mo_ref, cpmos
218 LOGICAL,
INTENT(IN) :: calculate_forces
219 INTEGER,
INTENT(IN) :: unit_nr
221 CHARACTER(LEN=*),
PARAMETER :: routinen =
'ec_ext_interface'
223 INTEGER :: handle, ispin, nao, nmos, nocc(2), nspins
224 REAL(kind=
dp) :: focc
226 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: energy_derivative
228 TYPE(
mo_set_type),
DIMENSION(:),
POINTER :: mos_trexio
231 CALL timeset(routinen, handle)
233 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, para_env=para_env)
235 nspins = dft_control%nspins
238 CALL cp_fm_get_info(mo_occ(ispin), nrow_global=nao, ncol_global=nocc(ispin))
241 IF (unit_nr > 0)
THEN
242 WRITE (unit_nr,
'(T2,A)')
" Read EXTERNAL Response from file: "//trim(trexio_fn)
244 ALLOCATE (mos_trexio(nspins))
245 IF (calculate_forces)
THEN
246 NULLIFY (energy_derivative)
249 CALL read_trexio(qs_env, trexio_filename=trexio_fn, &
250 mo_set_trexio=mos_trexio, &
251 energy_derivative=energy_derivative)
254 IF (nspins == 1) focc = 4.0_dp
256 CALL get_mo_set(mo_set=mos_trexio(ispin), mo_coeff=mo_coeff, homo=nmos)
258 cpmos(ispin), ncol=nmos, alpha=focc, beta=0.0_dp)
263 CALL read_trexio(qs_env, trexio_filename=trexio_fn, &
264 mo_set_trexio=mos_trexio)
268 CALL get_mo_set(mo_set=mos_trexio(ispin), mo_coeff=mo_coeff, homo=nmos)
272 DEALLOCATE (mos_trexio)
274 CALL timestop(handle)
276 END SUBROUTINE ec_ext_interface
287 SUBROUTINE ec_ext_debug(qs_env, ec_env, calculate_forces, unit_nr)
290 LOGICAL,
INTENT(IN) :: calculate_forces
291 INTEGER,
INTENT(IN) :: unit_nr
293 CHARACTER(LEN=*),
PARAMETER :: routinen =
'ec_ext_debug'
295 CHARACTER(LEN=default_string_length) :: headline
296 INTEGER :: handle, ispin, nocc, nspins
298 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_h, matrix_p, matrix_s
305 CALL timeset(routinen, handle)
308 dft_control=dft_control, &
311 matrix_s_kp=matrix_s, &
312 matrix_h_kp=matrix_h)
314 nspins = dft_control%nspins
317 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, homo=nocc)
318 CALL cp_fm_to_fm(mo_coeff, ec_env%mo_occ(ispin), nocc)
324 headline =
"CORE HAMILTONIAN MATRIX"
325 ALLOCATE (ec_env%matrix_h(1, 1)%matrix)
326 CALL dbcsr_create(ec_env%matrix_h(1, 1)%matrix, name=trim(headline), &
327 template=matrix_h(1, 1)%matrix, matrix_type=dbcsr_type_symmetric)
329 CALL dbcsr_copy(ec_env%matrix_h(1, 1)%matrix, matrix_h(1, 1)%matrix)
336 IF (calculate_forces)
THEN
338 CALL ec_debug_force(qs_env, matrix_p, unit_nr)
341 CALL timestop(handle)
343 END SUBROUTINE ec_ext_debug
351 SUBROUTINE ec_debug_force(qs_env, matrix_p, unit_nr)
353 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_p
354 INTEGER,
INTENT(IN) :: unit_nr
356 CHARACTER(LEN=*),
PARAMETER :: routinen =
'ec_debug_force'
358 INTEGER :: handle, iounit, nder, nimages
359 LOGICAL :: calculate_forces, debug_forces, &
360 debug_stress, use_virial
361 REAL(kind=
dp) :: fconv
362 REAL(kind=
dp),
DIMENSION(3, 3) :: stdeb, sttot
371 CALL timeset(routinen, handle)
373 debug_forces = .true.
374 debug_stress = .true.
377 calculate_forces = .true.
382 dft_control=dft_control, &
385 nimages = dft_control%nimages
386 IF (nimages /= 1)
THEN
387 cpabort(
"K-points not implemented")
391 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
393 fconv = 1.0e-9_dp*
pascal/cell%deth
394 IF (debug_stress .AND. use_virial)
THEN
395 sttot = virial%pv_virial
401 ALLOCATE (scrm(1, 1)%matrix)
402 CALL dbcsr_create(scrm(1, 1)%matrix, template=matrix_p(1, 1)%matrix)
403 CALL get_qs_env(qs_env=qs_env, sab_orb=sab_orb)
408 calculate_forces=calculate_forces, &
409 debug_forces=debug_forces, debug_stress=debug_stress)
412 CALL core_matrices(qs_env, scrm, matrix_p, calculate_forces, nder, &
413 debug_forces=debug_forces, debug_stress=debug_stress)
415 IF (debug_stress .AND. use_virial)
THEN
416 stdeb = fconv*(virial%pv_virial - sttot)
417 CALL para_env%sum(stdeb)
418 IF (iounit > 0)
WRITE (unit=iounit, fmt=
"(T2,A,T41,2(1X,ES19.11))") &
420 IF (iounit > 0)
WRITE (unit=iounit, fmt=
"(T2,A,T41,2(1X,ES19.11))")
' '
426 CALL timestop(handle)
428 END SUBROUTINE ec_debug_force
439 SUBROUTINE ec_ext_setup(qs_env, ec_env, calc_forces, unit_nr)
442 LOGICAL,
INTENT(IN) :: calc_forces
443 INTEGER,
INTENT(IN) :: unit_nr
445 CHARACTER(LEN=*),
PARAMETER :: routinen =
'ec_ext_setup'
447 CHARACTER(LEN=default_string_length) :: headline
448 INTEGER :: handle, ispin, nao, nocc, nspins
449 REAL(kind=
dp) :: a_max, c_max
452 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_h, matrix_ks, matrix_p, matrix_s
458 CALL timeset(routinen, handle)
461 dft_control=dft_control, &
464 matrix_s_kp=matrix_s, &
465 matrix_ks_kp=matrix_ks, &
466 matrix_h_kp=matrix_h)
468 nspins = dft_control%nspins
473 headline =
"HAMILTONIAN MATRIX"
475 ALLOCATE (ec_env%matrix_ks(ispin, 1)%matrix)
476 CALL dbcsr_create(ec_env%matrix_ks(ispin, 1)%matrix, name=trim(headline), &
477 template=matrix_ks(ispin, 1)%matrix, matrix_type=dbcsr_type_symmetric)
479 CALL dbcsr_copy(ec_env%matrix_ks(ispin, 1)%matrix, matrix_ks(ispin, 1)%matrix)
485 headline =
"OVERLAP MATRIX"
486 ALLOCATE (ec_env%matrix_s(1, 1)%matrix)
487 CALL dbcsr_create(ec_env%matrix_s(1, 1)%matrix, name=trim(headline), &
488 template=matrix_s(1, 1)%matrix, matrix_type=dbcsr_type_symmetric)
490 CALL dbcsr_copy(ec_env%matrix_s(1, 1)%matrix, matrix_s(1, 1)%matrix)
497 headline =
"DENSITY MATRIX"
499 ALLOCATE (ec_env%matrix_p(ispin, 1)%matrix)
500 CALL dbcsr_create(ec_env%matrix_p(ispin, 1)%matrix, name=trim(headline), &
501 template=matrix_p(ispin, 1)%matrix, matrix_type=dbcsr_type_symmetric)
503 CALL dbcsr_copy(ec_env%matrix_p(ispin, 1)%matrix, matrix_p(ispin, 1)%matrix)
506 IF (calc_forces)
THEN
511 headline =
"ENERGY WEIGHTED DENSITY MATRIX"
513 ALLOCATE (ec_env%matrix_w(ispin, 1)%matrix)
514 CALL dbcsr_create(ec_env%matrix_w(ispin, 1)%matrix, name=trim(headline), &
515 template=matrix_p(ispin, 1)%matrix, matrix_type=dbcsr_type_symmetric)
517 CALL dbcsr_set(ec_env%matrix_w(ispin, 1)%matrix, 0.0_dp)
523 headline =
"Hz MATRIX"
525 ALLOCATE (ec_env%matrix_hz(ispin)%matrix)
526 CALL dbcsr_create(ec_env%matrix_hz(ispin)%matrix, name=trim(headline), &
527 template=matrix_s(1, 1)%matrix, matrix_type=dbcsr_type_symmetric)
529 CALL dbcsr_set(ec_env%matrix_hz(ispin)%matrix, 0.0_dp)
534 mat_struct => ec_env%mo_occ(ispin)%matrix_struct
538 ksmo, nocc, alpha=1.0_dp, beta=0.0_dp)
541 smo, nocc, alpha=1.0_dp, beta=0.0_dp)
543 template_fmstruct=mat_struct)
545 CALL parallel_gemm(
'T',
'N', nocc, nocc, nao, 1.0_dp, ec_env%mo_occ(ispin), ksmo, 0.0_dp, emat)
546 CALL parallel_gemm(
'N',
'N', nao, nocc, nocc, -1.0_dp, smo, emat, 1.0_dp, ksmo)
553 IF (unit_nr > 0)
THEN
554 WRITE (unit_nr,
"(T3,A,T50,I2,T61,F20.12)")
"External:: Max value of MO coeficients", ispin, c_max
555 WRITE (unit_nr,
"(T3,A,T50,I2,T61,F20.12)")
"External:: Max value of MO gradients", ispin, a_max
560 CALL timestop(handle)
562 END SUBROUTINE ec_ext_setup
572 SUBROUTINE align_vectors(cpmos, mo_ref, mo_occ, matrix_s, unit_nr)
573 TYPE(
cp_fm_type),
INTENT(IN) :: cpmos, mo_ref, mo_occ
575 INTEGER,
INTENT(IN) :: unit_nr
577 CHARACTER(LEN=*),
PARAMETER :: routinen =
'align_vectors'
579 INTEGER :: handle, i, nao, nocc, scg
580 REAL(kind=
dp) :: a_max
581 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) ::
diag
585 CALL timeset(routinen, handle)
587 mat_struct => cpmos%matrix_struct
592 template_fmstruct=mat_struct)
594 CALL parallel_gemm(
'T',
'N', nocc, nocc, nao, 1.0_dp, mo_ref, smo, 0.0_dp, emat)
595 CALL parallel_gemm(
'N',
'N', nao, nocc, nocc, 1.0_dp, cpmos, emat, 0.0_dp, smo)
599 ALLOCATE (
diag(nocc))
601 a_max = nocc - sum(
diag)
604 IF (abs(
diag(i) + 1.0_dp) < 0.001) scg = scg + 1
606 IF (unit_nr > 0)
THEN
607 WRITE (unit_nr,
"(T3,A,T61,F20.8)")
"External:: Orbital rotation index", a_max
608 WRITE (unit_nr,
"(T3,A,T71,I10)")
"External:: Number of orbital phase changes", scg
616 CALL timestop(handle)
618 END SUBROUTINE align_vectors
626 SUBROUTINE matrix_w_forces(qs_env, matrix_w, unit_nr)
628 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_w
629 INTEGER,
INTENT(IN) :: unit_nr
631 CHARACTER(LEN=*),
PARAMETER :: routinen =
'matrix_w_forces'
633 INTEGER :: handle, iounit, nder, nimages
634 LOGICAL :: debug_forces, debug_stress, use_virial
635 REAL(kind=
dp) :: fconv
636 REAL(kind=
dp),
DIMENSION(3) :: fodeb
637 REAL(kind=
dp),
DIMENSION(3, 3) :: stdeb, sttot
648 CALL timeset(routinen, handle)
650 debug_forces = .true.
651 debug_stress = .true.
658 dft_control=dft_control, &
664 nimages = dft_control%nimages
665 IF (nimages /= 1)
THEN
666 cpabort(
"K-points not implemented")
670 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
672 fconv = 1.0e-9_dp*
pascal/cell%deth
673 IF (debug_stress .AND. use_virial)
THEN
674 sttot = virial%pv_virial
680 ALLOCATE (scrm(1, 1)%matrix)
681 CALL dbcsr_create(scrm(1, 1)%matrix, template=matrix_w(1, 1)%matrix)
685 IF (
SIZE(matrix_w, 1) == 2)
THEN
686 CALL dbcsr_add(matrix_w(1, 1)%matrix, matrix_w(2, 1)%matrix, &
687 alpha_scalar=1.0_dp, beta_scalar=1.0_dp)
691 IF (debug_forces) fodeb(1:3) = force(1)%overlap(1:3, 1)
692 IF (debug_stress .AND. use_virial) stdeb = virial%pv_overlap
694 matrix_name=
"OVERLAP MATRIX", &
695 basis_type_a=
"ORB", &
696 basis_type_b=
"ORB", &
697 sab_nl=sab_orb, calculate_forces=.true., &
700 IF (debug_forces)
THEN
701 fodeb(1:3) = force(1)%overlap(1:3, 1) - fodeb(1:3)
702 CALL para_env%sum(fodeb)
703 IF (iounit > 0)
WRITE (iounit,
"(T3,A,T33,3F16.8)")
"DEBUG:: Wout*dS ", fodeb
705 IF (debug_stress .AND. use_virial)
THEN
706 stdeb = fconv*(virial%pv_overlap - stdeb)
707 CALL para_env%sum(stdeb)
708 IF (iounit > 0)
WRITE (unit=iounit, fmt=
"(T2,A,T41,2(1X,ES19.11))") &
711 IF (
SIZE(matrix_w, 1) == 2)
THEN
712 CALL dbcsr_add(matrix_w(1, 1)%matrix, matrix_w(2, 1)%matrix, &
713 alpha_scalar=1.0_dp, beta_scalar=-1.0_dp)
719 CALL timestop(handle)
721 END SUBROUTINE matrix_w_forces
731 SUBROUTINE matrix_r_forces(qs_env, cpmos, mo_occ, matrix_r, unit_nr)
733 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: cpmos, mo_occ
735 INTEGER,
INTENT(IN) :: unit_nr
737 CHARACTER(LEN=*),
PARAMETER :: routinen =
'matrix_r_forces'
739 INTEGER :: handle, iounit, ispin, nao, nocc, nspins
740 LOGICAL :: debug_forces, debug_stress, use_virial
741 REAL(kind=
dp) :: fconv, focc
742 REAL(kind=
dp),
DIMENSION(3) :: fodeb
743 REAL(kind=
dp),
DIMENSION(3, 3) :: stdeb
756 CALL timeset(routinen, handle)
758 debug_forces = .true.
759 debug_stress = .true.
762 nspins =
SIZE(mo_occ)
764 IF (nspins == 1) focc = 2.0_dp
769 CALL cp_fm_get_info(cpmos(ispin), matrix_struct=fm_struct, nrow_global=nao, ncol_global=nocc)
771 CALL cp_fm_struct_create(mat_struct, nrow_global=nocc, ncol_global=nocc, template_fmstruct=fm_struct)
773 CALL parallel_gemm(
"T",
"N", nocc, nocc, nao, 1.0_dp, mo_occ(ispin), cpmos(ispin), 0.0_dp, chcmat)
774 CALL parallel_gemm(
"N",
"N", nao, nocc, nocc, 1.0_dp, mo_occ(ispin), chcmat, 0.0_dp, rcvec)
783 dft_control=dft_control, &
790 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
791 fconv = 1.0e-9_dp*
pascal/cell%deth
793 IF (debug_forces) fodeb(1:3) = force(1)%overlap(1:3, 1)
794 IF (debug_stress .AND. use_virial) stdeb = virial%pv_overlap
797 matrix_name=
"OVERLAP MATRIX", &
798 basis_type_a=
"ORB", basis_type_b=
"ORB", &
799 sab_nl=sab_orb, calculate_forces=.true., &
801 IF (debug_forces)
THEN
802 fodeb(1:3) = force(1)%overlap(1:3, 1) - fodeb(1:3)
803 CALL para_env%sum(fodeb)
804 IF (iounit > 0)
WRITE (iounit,
"(T3,A,T33,3F16.8)")
"DEBUG:: Wz*dS ", fodeb
806 IF (debug_stress .AND. use_virial)
THEN
807 stdeb = fconv*(virial%pv_overlap - stdeb)
808 CALL para_env%sum(stdeb)
809 IF (iounit > 0)
WRITE (unit=iounit, fmt=
"(T2,A,T41,2(1X,ES19.11))") &
814 CALL timestop(handle)
816 END SUBROUTINE matrix_r_forces
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)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
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
subroutine, public cp_dbcsr_plus_fm_fm_t(sparse_matrix, matrix_v, matrix_g, ncol, alpha, keep_sparsity, symmetry_mode)
performs the multiplication sparse_matrix+dense_mat*dens_mat^T if matrix_g is not explicitly given,...
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_diag(matrix, diag)
returns the diagonal elements of a fm
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp, set_zero)
creates a new full matrix with the given structure
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_maxabsval(matrix, a_max, ir_max, ic_max)
find the maximum absolute value of the matrix element maxval(abs(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
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
Types needed for a for a Energy Correction.
Routines for an external energy correction on top of a Kohn-Sham calculation.
subroutine, public ec_ext_energy(qs_env, ec_env, calculate_forces)
External energy method.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Collection of simple mathematical functions and subroutines.
subroutine, public diag(n, a, d, v)
Diagonalize matrix a. The eigenvalues are returned in vector d and the eigenvectors are returned in m...
Interface to the message passing library MPI.
basic linear algebra operations for full matrixes
Definition of physical constants:
real(kind=dp), parameter, public pascal
Calculation of the energies concerning the core charge distribution.
Calculation of the core Hamiltonian integral matrix <a|H|b> over Cartesian Gaussian-type functions.
subroutine, public kinetic_energy_matrix(qs_env, matrixkp_t, matrix_t, matrix_p, matrix_name, calculate_forces, nderivative, sab_orb, eps_filter, basis_type, debug_forces, debug_stress)
Calculate kinetic energy matrix and possible relativistic correction.
subroutine, public core_matrices(qs_env, matrix_h, matrix_p, calculate_forces, nder, ec_env, dcdr_env, ec_env_matrices, basis_type, debug_forces, debug_stress, atcore)
...
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, 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, 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.
Definition and initialisation of the mo data type.
subroutine, public deallocate_mo_set(mo_set)
Deallocate a wavefunction data structure.
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.
Calculation of overlap matrix, its derivatives and forces.
subroutine, public build_overlap_matrix(ks_env, matrix_s, matrixkp_s, matrix_name, nderivative, basis_type_a, basis_type_b, sab_nl, calculate_forces, matrix_p, matrixkp_p)
Calculation of the overlap matrix 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...
The module to read/write TREX IO files for interfacing CP2K with other programs.
subroutine, public read_trexio(qs_env, trexio_filename, mo_set_trexio, energy_derivative)
Read a trexio file.
pure real(kind=dp) function, public one_third_sum_diag(a)
...
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...
Contains information on the energy correction functional for KG.
stores all the informations relevant to an mpi environment
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
keeps the density in various representations, keeping track of which ones are valid.