24 USE dbcsr_api,
ONLY: &
25 dbcsr_complete_redistribute, dbcsr_copy, dbcsr_copy_into_existing, dbcsr_create, &
26 dbcsr_desymmetrize, dbcsr_distribution_get, dbcsr_distribution_hold, &
27 dbcsr_distribution_new, dbcsr_distribution_release, dbcsr_distribution_type, &
28 dbcsr_finalize, dbcsr_get_info, dbcsr_multiply, dbcsr_nblkrows_total, dbcsr_p_type, &
29 dbcsr_release, dbcsr_set, dbcsr_type, dbcsr_type_real_8
31 ls_cluster_molecular,&
72 #include "./base/base_uses.f90"
78 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'dm_ls_scf_qs'
97 TYPE(dbcsr_type) :: matrix_ls, matrix_qs
98 TYPE(ls_mstruct_type),
INTENT(IN) :: ls_mstruct
100 CHARACTER(len=*),
PARAMETER :: routinen =
'matrix_ls_create'
102 CHARACTER(len=default_string_length) :: name
103 INTEGER :: handle, iatom, imol, jatom, &
104 ls_data_type, natom, nmol
105 INTEGER,
ALLOCATABLE,
DIMENSION(:),
TARGET :: atom_to_cluster, atom_to_cluster_primus, &
106 clustered_blk_sizes, primus_of_mol
107 INTEGER,
DIMENSION(:),
POINTER :: clustered_col_dist, clustered_row_dist, &
108 ls_blk_sizes, ls_col_dist, ls_row_dist
109 TYPE(dbcsr_distribution_type) :: ls_dist, ls_dist_clustered
111 CALL timeset(routinen, handle)
114 CALL dbcsr_get_info(matrix_qs, col_blk_size=ls_blk_sizes, distribution=ls_dist)
115 CALL dbcsr_distribution_hold(ls_dist)
116 CALL dbcsr_distribution_get(ls_dist, row_dist=ls_row_dist, col_dist=ls_col_dist)
117 ls_data_type = dbcsr_type_real_8
120 IF (ls_mstruct%do_pao)
THEN
121 CALL dbcsr_get_info(ls_mstruct%matrix_A, col_blk_size=ls_blk_sizes)
125 SELECT CASE (ls_mstruct%cluster_type)
130 natom = dbcsr_nblkrows_total(matrix_qs)
131 nmol = maxval(ls_mstruct%atom_to_molecule)
132 ALLOCATE (atom_to_cluster_primus(natom))
133 ALLOCATE (atom_to_cluster(natom))
134 ALLOCATE (primus_of_mol(nmol))
136 atom_to_cluster(iatom) = ls_mstruct%atom_to_molecule(iatom)
140 DO jatom = iatom, 1, -1
141 IF (ls_mstruct%atom_to_molecule(jatom) == atom_to_cluster(iatom))
THEN
142 atom_to_cluster_primus(iatom) = jatom
147 primus_of_mol(atom_to_cluster(iatom)) = atom_to_cluster_primus(iatom)
151 ALLOCATE (clustered_row_dist(nmol))
153 clustered_row_dist(imol) = ls_row_dist(primus_of_mol(imol))
157 ALLOCATE (clustered_col_dist(nmol))
159 clustered_col_dist(imol) = ls_col_dist(primus_of_mol(imol))
162 ALLOCATE (clustered_blk_sizes(nmol))
163 clustered_blk_sizes = 0
165 clustered_blk_sizes(atom_to_cluster(iatom)) = clustered_blk_sizes(atom_to_cluster(iatom)) + &
168 ls_blk_sizes => clustered_blk_sizes
171 CALL dbcsr_distribution_new(ls_dist_clustered, &
173 row_dist=clustered_row_dist, &
174 col_dist=clustered_col_dist, &
176 CALL dbcsr_distribution_release(ls_dist)
177 ls_dist = ls_dist_clustered
180 cpabort(
"Unknown LS cluster type")
184 CALL dbcsr_get_info(matrix_qs, name=name)
185 CALL dbcsr_create(matrix_ls, &
189 data_type=ls_data_type, &
190 row_blk_size=ls_blk_sizes, &
191 col_blk_size=ls_blk_sizes)
192 CALL dbcsr_distribution_release(ls_dist)
193 CALL dbcsr_finalize(matrix_ls)
195 CALL timestop(handle)
213 TYPE(dbcsr_type) :: matrix_ls, matrix_qs
214 TYPE(ls_mstruct_type),
INTENT(IN),
TARGET :: ls_mstruct
215 LOGICAL,
INTENT(IN) :: covariant
217 CHARACTER(len=*),
PARAMETER :: routinen =
'matrix_qs_to_ls'
220 INTEGER,
DIMENSION(:),
POINTER :: pao_blk_sizes
221 TYPE(dbcsr_type) :: matrix_pao, matrix_tmp
222 TYPE(dbcsr_type),
POINTER :: matrix_trafo
224 CALL timeset(routinen, handle)
226 IF (.NOT. ls_mstruct%do_pao)
THEN
227 CALL matrix_cluster(matrix_ls, matrix_qs, ls_mstruct)
230 CALL dbcsr_get_info(ls_mstruct%matrix_A, col_blk_size=pao_blk_sizes)
231 CALL dbcsr_create(matrix_pao, &
233 template=matrix_qs, &
234 row_blk_size=pao_blk_sizes, &
235 col_blk_size=pao_blk_sizes)
237 matrix_trafo => ls_mstruct%matrix_A
238 IF (covariant) matrix_trafo => ls_mstruct%matrix_B
239 CALL dbcsr_create(matrix_tmp, template=matrix_trafo)
241 CALL dbcsr_multiply(
"N",
"N", 1.0_dp, matrix_qs, matrix_trafo, 0.0_dp, matrix_tmp)
242 CALL dbcsr_multiply(
"T",
"N", 1.0_dp, matrix_trafo, matrix_tmp, 0.0_dp, matrix_pao)
243 CALL dbcsr_release(matrix_tmp)
245 CALL matrix_cluster(matrix_ls, matrix_pao, ls_mstruct)
246 CALL dbcsr_release(matrix_pao)
249 CALL timestop(handle)
260 SUBROUTINE matrix_cluster(matrix_out, matrix_in, ls_mstruct)
261 TYPE(dbcsr_type) :: matrix_out, matrix_in
262 TYPE(ls_mstruct_type),
INTENT(IN) :: ls_mstruct
264 CHARACTER(len=*),
PARAMETER :: routinen =
'matrix_cluster'
267 TYPE(dbcsr_type) :: matrix_in_nosym
269 CALL timeset(routinen, handle)
271 SELECT CASE (ls_mstruct%cluster_type)
273 CALL dbcsr_copy(matrix_out, matrix_in)
277 CALL dbcsr_create(matrix_in_nosym, template=matrix_in, matrix_type=
"N")
278 CALL dbcsr_desymmetrize(matrix_in, matrix_in_nosym)
281 CALL dbcsr_complete_redistribute(matrix_in_nosym, matrix_out);
282 CALL dbcsr_release(matrix_in_nosym)
285 cpabort(
"Unknown LS cluster type")
288 CALL timestop(handle)
290 END SUBROUTINE matrix_cluster
306 SUBROUTINE matrix_ls_to_qs(matrix_qs, matrix_ls, ls_mstruct, covariant, keep_sparsity)
307 TYPE(dbcsr_type) :: matrix_qs, matrix_ls
308 TYPE(ls_mstruct_type),
INTENT(IN),
TARGET :: ls_mstruct
310 LOGICAL,
OPTIONAL :: keep_sparsity
312 CHARACTER(len=*),
PARAMETER :: routinen =
'matrix_ls_to_qs'
315 INTEGER,
DIMENSION(:),
POINTER :: pao_blk_sizes
316 LOGICAL :: my_keep_sparsity
317 TYPE(dbcsr_type) :: matrix_declustered, matrix_tmp1, &
319 TYPE(dbcsr_type),
POINTER :: matrix_trafo
321 CALL timeset(routinen, handle)
323 my_keep_sparsity = .true.
324 IF (
PRESENT(keep_sparsity)) &
325 my_keep_sparsity = keep_sparsity
327 IF (.NOT. ls_mstruct%do_pao)
THEN
328 CALL dbcsr_create(matrix_declustered, template=matrix_qs)
330 IF (my_keep_sparsity)
THEN
331 CALL dbcsr_copy_into_existing(matrix_qs, matrix_declustered)
333 CALL dbcsr_copy(matrix_qs, matrix_declustered)
335 CALL dbcsr_release(matrix_declustered)
338 CALL dbcsr_get_info(ls_mstruct%matrix_A, col_blk_size=pao_blk_sizes)
339 CALL dbcsr_create(matrix_declustered, &
340 template=matrix_qs, &
341 row_blk_size=pao_blk_sizes, &
342 col_blk_size=pao_blk_sizes)
346 matrix_trafo => ls_mstruct%matrix_B
347 IF (covariant) matrix_trafo => ls_mstruct%matrix_A
348 CALL dbcsr_create(matrix_tmp1, template=matrix_trafo)
349 CALL dbcsr_create(matrix_tmp2, template=matrix_qs)
350 CALL dbcsr_multiply(
"N",
"N", 1.0_dp, matrix_trafo, matrix_declustered, 0.0_dp, matrix_tmp1)
351 CALL dbcsr_multiply(
"N",
"T", 1.0_dp, matrix_tmp1, matrix_trafo, 0.0_dp, matrix_tmp2)
352 IF (my_keep_sparsity)
THEN
353 CALL dbcsr_copy_into_existing(matrix_qs, matrix_tmp2)
355 CALL dbcsr_copy(matrix_qs, matrix_tmp2)
357 CALL dbcsr_release(matrix_declustered)
358 CALL dbcsr_release(matrix_tmp1)
359 CALL dbcsr_release(matrix_tmp2)
362 CALL timestop(handle)
374 TYPE(dbcsr_type) :: matrix_out, matrix_in
375 TYPE(ls_mstruct_type),
INTENT(IN) :: ls_mstruct
377 CHARACTER(len=*),
PARAMETER :: routinen =
'matrix_decluster'
381 CALL timeset(routinen, handle)
383 SELECT CASE (ls_mstruct%cluster_type)
385 CALL dbcsr_copy(matrix_out, matrix_in)
389 CALL dbcsr_complete_redistribute(matrix_in, matrix_out)
392 cpabort(
"Unknown LS cluster type")
395 CALL timestop(handle)
408 TYPE(qs_environment_type),
POINTER :: qs_env
410 CHARACTER(len=*),
PARAMETER :: routinen =
'ls_scf_init_qs'
412 INTEGER :: handle, ispin, nspin, unit_nr
413 TYPE(cp_logger_type),
POINTER :: logger
414 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks, matrix_s
415 TYPE(dft_control_type),
POINTER :: dft_control
416 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
418 TYPE(qs_ks_env_type),
POINTER :: ks_env
421 CALL timeset(routinen, handle)
425 IF (logger%para_env%is_source())
THEN
432 CALL get_qs_env(qs_env, dft_control=dft_control, &
434 matrix_ks=matrix_ks, &
438 nspin = dft_control%nspins
441 IF (.NOT.
ASSOCIATED(matrix_ks))
THEN
444 ALLOCATE (matrix_ks(ispin)%matrix)
445 CALL dbcsr_create(matrix_ks(ispin)%matrix, template=matrix_s(1)%matrix)
447 CALL dbcsr_set(matrix_ks(ispin)%matrix, 0.0_dp)
452 CALL timestop(handle)
465 TYPE(qs_environment_type),
POINTER :: qs_env
466 REAL(kind=
dp) :: energy
468 CHARACTER(len=*),
PARAMETER :: routinen =
'ls_scf_qs_atomic_guess'
470 INTEGER :: handle, nspin, unit_nr
471 INTEGER,
DIMENSION(2) :: nelectron_spin
472 LOGICAL :: has_unit_metric
473 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
474 TYPE(cp_logger_type),
POINTER :: logger
475 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks, matrix_s, rho_ao
476 TYPE(dft_control_type),
POINTER :: dft_control
477 TYPE(mp_para_env_type),
POINTER :: para_env
478 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
479 TYPE(qs_energy_type),
POINTER ::
qs_energy
480 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
481 TYPE(qs_ks_env_type),
POINTER :: ks_env
482 TYPE(qs_rho_type),
POINTER :: rho
484 CALL timeset(routinen, handle)
485 NULLIFY (rho, rho_ao)
489 IF (logger%para_env%is_source())
THEN
496 CALL get_qs_env(qs_env, dft_control=dft_control, &
498 matrix_ks=matrix_ks, &
501 atomic_kind_set=atomic_kind_set, &
502 qs_kind_set=qs_kind_set, &
503 particle_set=particle_set, &
504 has_unit_metric=has_unit_metric, &
506 nelectron_spin=nelectron_spin, &
511 nspin = dft_control%nspins
514 IF (dft_control%qs_control%dftb .OR. dft_control%qs_control%semi_empirical .OR. &
515 dft_control%qs_control%xtb)
THEN
517 dft_control, particle_set, atomic_kind_set, qs_kind_set, &
518 nspin, nelectron_spin, para_env)
521 nspin, nelectron_spin, unit_nr, para_env)
530 CALL timestop(handle)
546 TYPE(qs_environment_type),
POINTER :: qs_env
547 TYPE(ls_scf_env_type) :: ls_scf_env
548 REAL(kind=
dp) :: energy_new
549 INTEGER,
INTENT(IN) :: iscf
551 CHARACTER(len=*),
PARAMETER :: routinen =
'ls_scf_dm_to_ks'
553 INTEGER :: handle, ispin, nspin, unit_nr
554 TYPE(cp_logger_type),
POINTER :: logger
555 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao
556 TYPE(mp_para_env_type),
POINTER :: para_env
557 TYPE(qs_energy_type),
POINTER :: energy
558 TYPE(qs_rho_type),
POINTER :: rho
560 NULLIFY (energy, rho, rho_ao)
561 CALL timeset(routinen, handle)
564 IF (logger%para_env%is_source())
THEN
570 nspin = ls_scf_env%nspins
571 CALL get_qs_env(qs_env, para_env=para_env, energy=energy, rho=rho)
576 CALL matrix_ls_to_qs(rho_ao(ispin)%matrix, ls_scf_env%matrix_p(ispin), &
577 ls_scf_env%ls_mstruct, covariant=.false.)
582 IF (ls_scf_env%do_rho_mixing)
THEN
584 cpabort(
"Direct P mixing not implemented in linear scaling SCF. ")
586 IF (iscf .GT. max(ls_scf_env%mixing_store%nskip_mixing, 1))
THEN
587 CALL gspace_mixing(qs_env, ls_scf_env%density_mixing_method, &
588 ls_scf_env%mixing_store, rho, para_env, &
590 IF (unit_nr > 0)
THEN
591 WRITE (unit_nr,
'(A57)') &
592 "*********************************************************"
593 WRITE (unit_nr,
'(A13,F5.3,A20,A6,A7,I3)') &
594 " Using ALPHA=", ls_scf_env%mixing_store%alpha, &
595 " to mix rho: method=", ls_scf_env%mixing_store%iter_method,
", iscf=", iscf
596 WRITE (unit_nr,
'(A8,F5.3,A6,F5.3,A8)') &
597 " rho_nw=", ls_scf_env%mixing_store%alpha,
"*rho + ", &
598 1.0_dp - ls_scf_env%mixing_store%alpha,
"*rho_old"
599 WRITE (unit_nr,
'(A57)') &
600 "*********************************************************"
608 just_energy=.false., print_active=.true.)
609 energy_new = energy%total
611 CALL timestop(handle)
625 TYPE(qs_environment_type),
POINTER :: qs_env
626 TYPE(ls_scf_env_type) :: ls_scf_env
627 TYPE(dbcsr_type),
INTENT(IN) :: matrix_p_ls
628 INTEGER,
INTENT(IN) :: unit_nr
629 CHARACTER(LEN=*),
INTENT(IN) :: title
630 INTEGER,
DIMENSION(:),
POINTER :: stride
632 CHARACTER(len=*),
PARAMETER :: routinen =
'write_matrix_to_cube'
635 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks
636 TYPE(dbcsr_type),
TARGET :: matrix_p_qs
637 TYPE(particle_list_type),
POINTER :: particles
638 TYPE(pw_c1d_gs_type) :: wf_g
639 TYPE(pw_env_type),
POINTER :: pw_env
640 TYPE(pw_pool_p_type),
DIMENSION(:),
POINTER :: pw_pools
641 TYPE(pw_pool_type),
POINTER :: auxbas_pw_pool
642 TYPE(pw_r3d_rs_type) :: wf_r
643 TYPE(qs_ks_env_type),
POINTER :: ks_env
644 TYPE(qs_subsys_type),
POINTER :: subsys
646 CALL timeset(routinen, handle)
648 NULLIFY (ks_env, pw_env, auxbas_pw_pool, pw_pools, particles, subsys, matrix_ks)
659 CALL dbcsr_copy(matrix_p_qs, matrix_ks(1)%matrix)
660 CALL dbcsr_set(matrix_p_qs, 0.0_dp)
661 CALL matrix_ls_to_qs(matrix_p_qs, matrix_p_ls, ls_scf_env%ls_mstruct, covariant=.false.)
665 auxbas_pw_pool=auxbas_pw_pool, &
667 CALL auxbas_pw_pool%create_pw(pw=wf_r)
669 CALL auxbas_pw_pool%create_pw(pw=wf_g)
678 particles=particles, stride=stride)
681 CALL auxbas_pw_pool%give_back_pw(wf_r)
682 CALL auxbas_pw_pool%give_back_pw(wf_g)
683 CALL dbcsr_release(matrix_p_qs)
685 CALL timestop(handle)
695 TYPE(qs_environment_type),
POINTER :: qs_env
696 TYPE(ls_scf_env_type) :: ls_scf_env
698 CHARACTER(len=*),
PARAMETER :: routinen =
'rho_mixing_ls_init'
701 TYPE(dft_control_type),
POINTER :: dft_control
702 TYPE(qs_rho_type),
POINTER :: rho
703 TYPE(rho_atom_type),
DIMENSION(:),
POINTER :: rho_atom
705 CALL timeset(routinen, handle)
707 CALL get_qs_env(qs_env, dft_control=dft_control, rho=rho)
709 CALL mixing_allocate(qs_env, ls_scf_env%density_mixing_method, nspins=ls_scf_env%nspins, &
710 mixing_store=ls_scf_env%mixing_store)
712 IF (dft_control%qs_control%gapw)
THEN
713 CALL get_qs_env(qs_env, rho_atom_set=rho_atom)
714 CALL mixing_init(ls_scf_env%density_mixing_method, rho, ls_scf_env%mixing_store, &
715 ls_scf_env%para_env, rho_atom=rho_atom)
716 ELSEIF (dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb)
THEN
718 ELSEIF (dft_control%qs_control%semi_empirical)
THEN
719 cpabort(
'SE Code not possible')
721 CALL mixing_init(ls_scf_env%density_mixing_method, rho, ls_scf_env%mixing_store, &
725 CALL timestop(handle)
Define the atomic kind types and their sub types.
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.
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
A wrapper around pw_to_cube() which accepts particle_list_type.
subroutine, public cp_pw_to_cube(pw, unit_nr, title, particles, stride, zero_tails, silent, mpi_io)
...
Routines for a linear scaling quickstep SCF run based on the density matrix, with a focus on the inte...
subroutine, public matrix_ls_to_qs(matrix_qs, matrix_ls, ls_mstruct, covariant, keep_sparsity)
second link to QS, copy a LS matrix to QS matrix used to isolate QS style matrices from LS style will...
subroutine, public matrix_decluster(matrix_out, matrix_in, ls_mstruct)
Reverses molecular blocking and reduction to single precision if enabled.
subroutine, public ls_scf_dm_to_ks(qs_env, ls_scf_env, energy_new, iscf)
use the density matrix in ls_scf_env to compute the new energy and KS matrix
subroutine, public write_matrix_to_cube(qs_env, ls_scf_env, matrix_p_ls, unit_nr, title, stride)
...
subroutine, public rho_mixing_ls_init(qs_env, ls_scf_env)
Initialize g-space density mixing.
subroutine, public matrix_ls_create(matrix_ls, matrix_qs, ls_mstruct)
create a matrix for use (and as a template) in ls based on a qs template
subroutine, public matrix_qs_to_ls(matrix_ls, matrix_qs, ls_mstruct, covariant)
first link to QS, copy a QS matrix to LS matrix used to isolate QS style matrices from LS style will ...
subroutine, public ls_scf_init_qs(qs_env)
further required initialization of QS. Might be factored-out since this seems common code with the ot...
subroutine, public ls_scf_qs_atomic_guess(qs_env, energy)
get an atomic initial guess
Types needed for a linear scaling quickstep SCF run based on the density matrix.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Interface to the message passing library MPI.
represent a simple array based list of the given type
Define the data structure for the particle information.
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Routine to return block diagonal density matrix. Blocks correspond to the atomic densities.
subroutine, public calculate_atomic_block_dm(pmatrix, matrix_s, atomic_kind_set, qs_kind_set, nspin, nelectron_spin, ounit, para_env)
returns a block diagonal density matrix. Blocks correspond to the atomic densities.
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
module that contains the definitions of the scf types
integer, parameter, public direct_mixing_nr
integer, parameter, public gspace_mixing_nr
Perform a QUICKSTEP wavefunction optimization (single point)
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_nonbond, sab_almo, sab_kp, sab_kp_nosym, 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, ecoul_1c, rho0_s_rs, rho0_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, 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, rhs)
Get the QUICKSTEP environment.
subroutine, public gspace_mixing(qs_env, mixing_method, mixing_store, rho, para_env, iter_count)
Driver for the g-space mixing, calls the proper routine given the requested method.
Routines to somehow generate an initial guess.
subroutine, public calculate_mopac_dm(pmat, matrix_s, has_unit_metric, dft_control, particle_set, atomic_kind_set, qs_kind_set, nspin, nelectron_spin, para_env)
returns a block diagonal density matrix. Blocks correspond to the mopac initial guess.
Define the quickstep kind type and their sub types.
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 set_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, complex_ks, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_RI_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_RI_aux_kp, matrix_ks_im_kp, vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, kpoints, sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, task_list, task_list_soft, subsys, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env)
...
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...
elemental subroutine, public charge_mixing_init(mixing_store)
initialiation needed when charge mixing is used
subroutine, public mixing_init(mixing_method, rho, mixing_store, para_env, rho_atom)
initialiation needed when gspace mixing is used
subroutine, public mixing_allocate(qs_env, mixing_method, p_mix_new, p_delta, nspins, mixing_store)
allocation needed when density mixing is used
Define the neighbor list data types and the corresponding functionality.
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...
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...
types that represent a quickstep subsys
subroutine, public qs_subsys_get(subsys, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell, energy, force, qs_kind_set, cp_subsys, nelectron_total, nelectron_spin)
...