101#include "./base/base_uses.f90"
105 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_p_env_methods'
106 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .false.
129 orthogonal_orbitals, linres_control)
134 POINTER :: p1_option, p1_admm_option
135 LOGICAL,
INTENT(in),
OPTIONAL :: orthogonal_orbitals
138 CHARACTER(len=*),
PARAMETER :: routinen =
'p_env_create'
140 INTEGER :: handle, n_ao, n_mo, n_spins, natom, spin
147 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_s, matrix_s_aux_fit
151 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
153 CALL timeset(routinen, handle)
154 NULLIFY (ao_mo_fm_pools, mo_mo_fm_pools, matrix_s, dft_control, para_env, blacs_env)
157 dft_control=dft_control, &
161 n_spins = dft_control%nspins
163 p_env%new_preconditioner = .true.
165 ALLOCATE (p_env%rho1)
167 ALLOCATE (p_env%rho1_xc)
170 ALLOCATE (p_env%kpp1_env)
173 IF (
PRESENT(p1_option))
THEN
174 p_env%p1 => p1_option
178 ALLOCATE (p_env%p1(spin)%matrix)
179 CALL dbcsr_copy(p_env%p1(spin)%matrix, matrix_s(1)%matrix, &
181 CALL dbcsr_set(p_env%p1(spin)%matrix, 0.0_dp)
185 IF (dft_control%do_admm)
THEN
186 CALL get_admm_env(qs_env%admm_env, matrix_s_aux_fit=matrix_s_aux_fit)
188 ALLOCATE (p_env%rho1_admm)
192 IF (
PRESENT(p1_admm_option))
THEN
193 p_env%p1_admm => p1_admm_option
197 ALLOCATE (p_env%p1_admm(spin)%matrix)
198 CALL dbcsr_copy(p_env%p1_admm(spin)%matrix, matrix_s_aux_fit(1)%matrix, &
199 name=
"p_env%p1_admm-"//trim(adjustl(
cp_to_string(spin))))
200 CALL dbcsr_set(p_env%p1_admm(spin)%matrix, 0.0_dp)
204 IF (admm_env%do_gapw)
THEN
205 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set)
206 admm_gapw_env => admm_env%admm_gapw_env
209 admm_gapw_env%admm_kind_set, dft_control, para_env)
213 CALL mpools_get(qs_env%mpools, ao_mo_fm_pools=ao_mo_fm_pools, &
214 mo_mo_fm_pools=mo_mo_fm_pools)
219 CALL get_mo_set(qs_env%mos(spin), mo_coeff=qs_env_c)
221 ncol_global=n_mo, nrow_global=n_ao)
222 p_env%n_mo(spin) = n_mo
223 p_env%n_ao(spin) = n_ao
226 p_env%orthogonal_orbitals = .false.
227 IF (
PRESENT(orthogonal_orbitals))
THEN
228 p_env%orthogonal_orbitals = orthogonal_orbitals
236 name=
"p_env%m_epsilon")
239 IF (.NOT. p_env%orthogonal_orbitals)
THEN
241 name=
"p_env%Smo_inv")
244 IF (.NOT. p_env%orthogonal_orbitals)
THEN
246 elements=p_env%psi0d, &
253 IF (dft_control%qs_control%gapw)
THEN
255 atomic_kind_set=atomic_kind_set, &
258 qs_kind_set=qs_kind_set)
262 qs_kind_set, dft_control, para_env)
264 CALL init_rho0(p_env%local_rho_set, qs_env, dft_control%qs_control%gapw_control, &
269 ELSE IF (dft_control%qs_control%gapw_xc)
THEN
271 atomic_kind_set=atomic_kind_set, &
272 qs_kind_set=qs_kind_set)
275 qs_kind_set, dft_control, para_env)
281 IF (
PRESENT(linres_control))
THEN
285 IF (.NOT.
ASSOCIATED(p_env%preconditioner))
THEN
287 ALLOCATE (p_env%preconditioner(n_spins))
290 para_env=para_env, blacs_env=blacs_env)
294 name=
"p_env%PS_psi0")
300 CALL timestop(handle)
318 CHARACTER(len=*),
PARAMETER :: routinen =
'p_env_check_i_alloc'
320 CHARACTER(len=25) :: name
321 INTEGER :: handle, ispin, nspins
326 CALL timeset(routinen, handle)
328 NULLIFY (dft_control, matrix_s)
330 CALL get_qs_env(qs_env, dft_control=dft_control)
331 gapw_xc = dft_control%qs_control%gapw_xc
332 IF (.NOT.
ASSOCIATED(p_env%kpp1))
THEN
334 nspins = dft_control%nspins
340 ALLOCATE (p_env%kpp1(ispin)%matrix)
341 CALL dbcsr_copy(p_env%kpp1(ispin)%matrix, matrix_s(1)%matrix, &
343 CALL dbcsr_set(p_env%kpp1(ispin)%matrix, 0.0_dp)
353 IF (dft_control%do_admm .AND. .NOT.
ASSOCIATED(p_env%kpp1_admm))
THEN
354 CALL get_admm_env(qs_env%admm_env, matrix_s_aux_fit=matrix_s)
355 nspins = dft_control%nspins
358 name =
"p_env%kpp1_admm-"
361 ALLOCATE (p_env%kpp1_admm(ispin)%matrix)
362 CALL dbcsr_copy(p_env%kpp1_admm(ispin)%matrix, matrix_s(1)%matrix, &
364 CALL dbcsr_set(p_env%kpp1_admm(ispin)%matrix, 0.0_dp)
373 IF (.NOT.
ASSOCIATED(p_env%rho1))
THEN
379 IF (dft_control%do_admm)
THEN
387 CALL timestop(handle)
399 CHARACTER(LEN=*),
PARAMETER :: routinen =
'p_env_update_rho'
401 CHARACTER(LEN=default_string_length) :: basis_type
402 INTEGER :: handle, ispin
408 POINTER :: sab_aux_fit
414 CALL timeset(routinen, handle)
416 CALL get_qs_env(qs_env, dft_control=dft_control)
421 DO ispin = 1,
SIZE(rho1_ao)
422 CALL dbcsr_copy(rho1_ao(ispin)%matrix, p_env%p1(ispin)%matrix)
426 rho_xc_external=p_env%rho1_xc, &
427 local_rho_set=p_env%local_rho_set, &
430 IF (dft_control%do_admm)
THEN
432 NULLIFY (ks_env, rho1_ao, rho_g_aux, rho_r_aux, task_list)
434 CALL get_qs_env(qs_env, ks_env=ks_env, admm_env=admm_env)
435 basis_type =
"AUX_FIT"
436 CALL get_admm_env(qs_env%admm_env, task_list_aux_fit=task_list)
437 IF (admm_env%do_gapw)
THEN
438 basis_type =
"AUX_FIT_SOFT"
439 task_list => admm_env%admm_gapw_env%task_list
445 DO ispin = 1,
SIZE(rho1_ao)
446 CALL dbcsr_copy(rho1_ao(ispin)%matrix, p_env%p1_admm(ispin)%matrix)
448 matrix_p=rho1_ao(ispin)%matrix, &
449 rho=rho_r_aux(ispin), &
450 rho_gspace=rho_g_aux(ispin), &
451 soft_valid=.false., &
452 basis_type=basis_type, &
453 task_list_external=task_list)
455 IF (admm_env%do_gapw)
THEN
459 rho_atom_set=p_env%local_rho_set_admm%rho_atom_set, &
460 qs_kind_set=admm_env%admm_gapw_env%admm_kind_set, &
461 oce=admm_env%admm_gapw_env%oce, sab=sab_aux_fit, para_env=para_env)
466 CALL timestop(handle)
484 CHARACTER(len=*),
PARAMETER :: routinen =
'p_env_psi0_changed'
486 INTEGER :: handle, iounit, lfomo, n_spins, nmo, spin
487 LOGICAL :: was_present
488 REAL(kind=
dp) :: maxocc
490 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: psi0
493 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks, matrix_s, rho_ao
502 CALL timeset(routinen, handle)
504 NULLIFY (ao_mo_fm_pools, mos, psi0, matrix_s, mos, para_env, ks_env, rho, &
505 logger, input, lr_section, energy, matrix_ks, dft_control, rho_ao)
512 matrix_ks=matrix_ks, &
517 dft_control=dft_control)
521 n_spins = dft_control%nspins
523 ao_mo_fm_pools=ao_mo_fm_pools)
524 ALLOCATE (psi0(n_spins))
533 IF (p_env%orthogonal_orbitals)
THEN
534 IF (
ASSOCIATED(p_env%psi0d))
THEN
545 p_env%S_psi0(spin), &
546 ncol=p_env%n_mo(spin), alpha=1.0_dp)
547 CALL parallel_gemm(transa=
'T', transb=
'N', n=p_env%n_mo(spin), &
548 m=p_env%n_mo(spin), k=p_env%n_ao(spin), alpha=1.0_dp, &
549 matrix_a=psi0(spin), &
550 matrix_b=p_env%S_psi0(spin), &
551 beta=0.0_dp, matrix_c=p_env%m_epsilon(spin))
559 triangular_matrix=p_env%m_epsilon(spin), &
560 matrix_b=p_env%Smo_inv(spin), side=
'R', &
561 invert_tr=.true., n_rows=p_env%n_mo(spin), &
562 n_cols=p_env%n_mo(spin))
564 triangular_matrix=p_env%m_epsilon(spin), &
565 matrix_b=p_env%Smo_inv(spin), side=
'R', &
566 transpose_tr=.true., &
567 invert_tr=.true., n_rows=p_env%n_mo(spin), &
568 n_cols=p_env%n_mo(spin))
575 triangular_matrix=p_env%m_epsilon(spin), &
576 matrix_b=p_env%psi0d(spin), side=
'R', &
577 invert_tr=.true., n_rows=p_env%n_ao(spin), &
578 n_cols=p_env%n_mo(spin))
580 triangular_matrix=p_env%m_epsilon(spin), &
581 matrix_b=p_env%psi0d(spin), side=
'R', &
582 transpose_tr=.true., &
583 invert_tr=.true., n_rows=p_env%n_ao(spin), &
584 n_cols=p_env%n_mo(spin))
588 nmo=nmo, maxocc=maxocc)
589 IF (lfomo > nmo)
THEN
590 CALL dbcsr_set(rho_ao(spin)%matrix, 0.0_dp)
592 matrix_v=psi0(spin), &
593 matrix_g=p_env%psi0d(spin), &
594 ncol=p_env%n_mo(spin))
595 CALL dbcsr_scale(rho_ao(spin)%matrix, alpha_scalar=maxocc)
597 cpabort(
"symmetrized onesided smearing to do")
612 extension=
".linresLog")
615 IF (was_present)
THEN
616 WRITE (unit=iounit, fmt=
"(/,(T3,A,T55,F25.14))") &
617 "Total energy ground state: ", energy%total
621 "PRINT%PROGRAM_RUN_INFO")
631 p_env%S_psi0(spin), p_env%n_mo(spin))
634 p_env%n_mo(spin), p_env%n_mo(spin), p_env%n_ao(spin), &
635 -1.0_dp, p_env%S_psi0(spin), p_env%psi0d(spin), &
636 0.0_dp, p_env%m_epsilon(spin))
649 p_env%S_psi0(spin), &
654 IF (p_env%orthogonal_orbitals)
THEN
663 CALL timestop(handle)
682 TYPE(
cp_fm_type),
DIMENSION(:),
INTENT(inout) :: v
683 INTEGER,
DIMENSION(:),
INTENT(in),
OPTIONAL :: n_cols
685 CHARACTER(len=*),
PARAMETER :: routinen =
'p_preortho'
687 INTEGER :: cols, handle, max_cols, maxnmo, n_spins, &
688 nmo2, spin, v_cols, v_rows
694 CALL timeset(routinen, handle)
696 NULLIFY (maxmo_maxmo_fm_pool, maxmo_maxmo_fmstruct, tmp_fmstruct, &
699 CALL get_qs_env(qs_env, dft_control=dft_control)
700 CALL mpools_get(qs_env%mpools, maxmo_maxmo_fm_pool=maxmo_maxmo_fm_pool)
701 n_spins = dft_control%nspins
703 CALL cp_fm_struct_get(maxmo_maxmo_fmstruct, nrow_global=nmo2, ncol_global=maxnmo)
704 cpassert(
SIZE(v) >= n_spins)
706 IF (
PRESENT(n_cols))
THEN
707 max_cols = maxval(n_cols(1:n_spins))
712 max_cols = max(max_cols, v_cols)
715 IF (max_cols <= nmo2)
THEN
719 ncol_global=maxnmo, template_fmstruct=maxmo_maxmo_fmstruct)
720 CALL cp_fm_create(tmp_matrix, matrix_struct=tmp_fmstruct)
727 nrow_global=v_rows, ncol_global=v_cols)
728 cpassert(v_rows >= p_env%n_ao(spin))
730 IF (
PRESENT(n_cols))
THEN
731 cpassert(n_cols(spin) <= cols)
734 cpassert(cols <= max_cols)
737 CALL parallel_gemm(transa=
'T', transb=
'N', m=cols, n=p_env%n_mo(spin), &
738 k=p_env%n_ao(spin), alpha=1.0_dp, matrix_a=v(spin), &
739 matrix_b=p_env%S_psi0(spin), beta=0.0_dp, &
742 CALL parallel_gemm(transa=
'N', transb=
'T', m=p_env%n_ao(spin), n=cols, &
743 k=p_env%n_mo(spin), alpha=-1.0_dp, &
744 matrix_a=p_env%psi0d(spin), matrix_b=tmp_matrix, &
745 beta=1.0_dp, matrix_c=v(spin))
749 IF (max_cols <= nmo2)
THEN
755 CALL timestop(handle)
774 TYPE(
cp_fm_type),
DIMENSION(:),
INTENT(inout) :: v
775 INTEGER,
DIMENSION(:),
INTENT(in),
OPTIONAL :: n_cols
777 CHARACTER(len=*),
PARAMETER :: routinen =
'p_postortho'
779 INTEGER :: cols, handle, max_cols, maxnmo, n_spins, &
780 nmo2, spin, v_cols, v_rows
786 CALL timeset(routinen, handle)
788 NULLIFY (maxmo_maxmo_fm_pool, maxmo_maxmo_fmstruct, tmp_fmstruct, &
791 CALL get_qs_env(qs_env, dft_control=dft_control)
792 CALL mpools_get(qs_env%mpools, maxmo_maxmo_fm_pool=maxmo_maxmo_fm_pool)
793 n_spins = dft_control%nspins
795 CALL cp_fm_struct_get(maxmo_maxmo_fmstruct, nrow_global=nmo2, ncol_global=maxnmo)
796 cpassert(
SIZE(v) >= n_spins)
798 IF (
PRESENT(n_cols))
THEN
799 max_cols = maxval(n_cols(1:n_spins))
804 max_cols = max(max_cols, v_cols)
807 IF (max_cols <= nmo2)
THEN
811 ncol_global=maxnmo, template_fmstruct=maxmo_maxmo_fmstruct)
812 CALL cp_fm_create(tmp_matrix, matrix_struct=tmp_fmstruct)
819 nrow_global=v_rows, ncol_global=v_cols)
820 cpassert(v_rows >= p_env%n_ao(spin))
822 IF (
PRESENT(n_cols))
THEN
823 cpassert(n_cols(spin) <= cols)
826 cpassert(cols <= max_cols)
829 CALL parallel_gemm(transa=
'T', transb=
'N', m=cols, n=p_env%n_mo(spin), &
830 k=p_env%n_ao(spin), alpha=1.0_dp, matrix_a=v(spin), &
831 matrix_b=p_env%psi0d(spin), beta=0.0_dp, &
834 CALL parallel_gemm(transa=
'N', transb=
'T', m=p_env%n_ao(spin), n=cols, &
835 k=p_env%n_mo(spin), alpha=-1.0_dp, &
836 matrix_a=p_env%S_psi0(spin), matrix_b=tmp_matrix, &
837 beta=1.0_dp, matrix_c=v(spin))
841 IF (max_cols <= nmo2)
THEN
847 CALL timestop(handle)
860 CHARACTER(len=*),
PARAMETER :: routinen =
'p_env_finish_kpp1'
862 INTEGER :: handle, ispin, nao, nao_aux
867 CALL timeset(routinen, handle)
869 CALL get_qs_env(qs_env, dft_control=dft_control, admm_env=admm_env)
871 IF (dft_control%do_admm)
THEN
872 CALL dbcsr_copy(work_hmat, p_env%kpp1(1)%matrix)
874 CALL cp_fm_get_info(admm_env%A, nrow_global=nao_aux, ncol_global=nao)
875 DO ispin = 1,
SIZE(p_env%kpp1)
877 ncol=nao, alpha=1.0_dp, beta=0.0_dp)
878 CALL parallel_gemm(
'T',
'N', nao, nao, nao_aux, 1.0_dp, admm_env%A, &
879 admm_env%work_aux_orb, 0.0_dp, admm_env%work_orb_orb)
881 CALL copy_fm_to_dbcsr(admm_env%work_orb_orb, work_hmat, keep_sparsity=.true.)
882 CALL dbcsr_add(p_env%kpp1(ispin)%matrix, work_hmat, 1.0_dp, 1.0_dp)
888 CALL timestop(handle)
Contains ADMM methods which require molecular orbitals.
subroutine, public admm_aux_response_density(qs_env, dm, dm_admm)
Calculate ADMM auxiliary response density.
Types and set/get functions for auxiliary density matrix methods.
subroutine, public get_admm_env(admm_env, mo_derivs_aux_fit, mos_aux_fit, sab_aux_fit, sab_aux_fit_asymm, sab_aux_fit_vs_orb, matrix_s_aux_fit, matrix_s_aux_fit_kp, matrix_s_aux_fit_vs_orb, matrix_s_aux_fit_vs_orb_kp, task_list_aux_fit, matrix_ks_aux_fit, matrix_ks_aux_fit_kp, matrix_ks_aux_fit_im, matrix_ks_aux_fit_dft, matrix_ks_aux_fit_hfx, matrix_ks_aux_fit_dft_kp, matrix_ks_aux_fit_hfx_kp, rho_aux_fit, rho_aux_fit_buffer, admm_dm)
Get routine for the ADMM env.
Define the atomic kind types and their sub types.
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_scale(matrix, alpha_scalar)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
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,...
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_triangular_multiply(triangular_matrix, matrix_b, side, transpose_tr, invert_tr, uplo_tr, unit_diag_tr, n_rows, n_cols, alpha)
multiplies in place by a triangular matrix: matrix_b = alpha op(triangular_matrix) matrix_b or (if si...
various cholesky decomposition related routines
subroutine, public cp_fm_cholesky_decompose(matrix, n, info_out)
used to replace a symmetric positive def. matrix M with its cholesky decomposition U: M = U^T * U,...
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
type(cp_fm_struct_type) function, pointer, public fm_pool_get_el_struct(pool)
returns the structure of the elements in this pool
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_get(fmstruct, para_env, context, descriptor, ncol_block, nrow_block, nrow_global, ncol_global, first_p_pos, row_indices, col_indices, nrow_local, ncol_local, nrow_locals, ncol_locals, local_leading_dimension)
returns the values of various attributes of the 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,...
subroutine, public init_coulomb_local(hartree_local, natom)
...
subroutine, public hartree_local_create(hartree_local)
...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Interface to the message passing library MPI.
basic linear algebra operations for full matrixes
subroutine, public init_preconditioner(preconditioner_env, para_env, blacs_env)
...
container for various plainwaves related things
Calculate the plane wave density by collocating the primitive Gaussian functions (pgf).
subroutine, public calculate_rho_elec(matrix_p, matrix_p_kp, rho, rho_gspace, total_rho, ks_env, soft_valid, compute_tau, compute_grad, basis_type, der_type, idir, task_list_external, pw_env_external)
computes the density corresponding to a given density matrix on the grid
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.
module that builds the second order perturbation kernel kpp1 = delta_rho|_P delta_rho|_P E drho(P1) d...
subroutine, public kpp1_create(kpp1_env)
allocates and initializes a kpp1_env
subroutine, public kpp1_did_change(kpp1_env)
function to advise of changes either in the grids
routines that build the Kohn-Sham matrix (i.e calculate the coulomb and xc parts
subroutine, public qs_ks_update_qs_env(qs_env, calculate_forces, just_energy, print_active)
updates the Kohn Sham matrix of the given qs_env (facility method)
subroutine, public qs_ks_did_change(ks_env, s_mstruct_changed, rho_changed, potential_changed, full_reset)
tells that some of the things relevant to the ks calculation did change. has to be called when change...
Type definitiona for linear response calculations.
subroutine, public local_rho_set_create(local_rho_set)
...
wrapper for the pools of 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 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.
Utility functions for the perturbation calculations.
subroutine, public p_postortho(p_env, qs_env, v, n_cols)
does a postorthogonalization on the given matrix vector: v = (I-SP) v
subroutine, public p_env_psi0_changed(p_env, qs_env)
To be called after the value of psi0 has changed. Recalculates the quantities S_psi0 and m_epsilon.
subroutine, public p_env_finish_kpp1(qs_env, p_env)
...
subroutine, public p_env_create(p_env, qs_env, p1_option, p1_admm_option, orthogonal_orbitals, linres_control)
allocates and initializes the perturbation environment (no setup)
subroutine, public p_env_update_rho(p_env, qs_env)
...
subroutine, public p_preortho(p_env, qs_env, v, n_cols)
does a preorthogonalization of the given matrix: v = (I-PS)v
subroutine, public p_env_check_i_alloc(p_env, qs_env)
checks that the intenal storage is allocated, and allocs it if needed
basis types for the calculation of the perturbation of density theory.
subroutine, public rho0_s_grid_create(pw_env, rho0_mpole)
...
subroutine, public init_rho0(local_rho_set, qs_env, gapw_control, zcore)
...
subroutine, public allocate_rho_atom_internals(rho_atom_set, atomic_kind_set, qs_kind_set, dft_control, para_env)
...
subroutine, public calculate_rho_atom_coeff(qs_env, rho_ao, rho_atom_set, qs_kind_set, oce, sab, para_env)
...
methods of the rho structure (defined in qs_rho_types)
subroutine, public qs_rho_update_rho(rho_struct, qs_env, rho_xc_external, local_rho_set, task_list_external, task_list_external_soft, pw_env_external, para_env_external)
updates rho_r and rho_g to the rhorho_ao. if use_kinetic_energy_density also computes tau_r and tau_g...
subroutine, public qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_external)
rebuilds rho (if necessary allocating and initializing it)
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...
subroutine, public qs_rho_create(rho)
Allocates a new instance of rho.
Utilities for string manipulations.
subroutine, public compress(string, full)
Eliminate multiple space characters in a string. If full is .TRUE., then all spaces are eliminated.
A subtype of the admm_env that contains the extra data needed for an ADMM GAPW calculation.
stores some data used in wavefunction fitting
Provides all information about an atomic kind.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
to create arrays of pools
represent a pool of elements with the same structure
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
contained for different pw related things
Provides all information about a quickstep kind.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
General settings for linear response calculations.
Represent a qs system that is perturbed. Can calculate the linear operator and the rhs of the system ...
keeps the density in various representations, keeping track of which ones are valid.