(git:b279b6b)
minbas_methods.F
Go to the documentation of this file.
1 !--------------------------------------------------------------------------------------------------!
2 ! CP2K: A general program to perform molecular dynamics simulations !
3 ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4 ! !
5 ! SPDX-License-Identifier: GPL-2.0-or-later !
6 !--------------------------------------------------------------------------------------------------!
7 
8 ! **************************************************************************************************
9 !> \brief Calculate localized minimal basis
10 !> \par History
11 !> 12.2016 created [JGH]
12 !> \author JGH
13 ! **************************************************************************************************
15  USE cp_blacs_env, ONLY: cp_blacs_env_type
16  USE cp_control_types, ONLY: dft_control_type
22  USE cp_fm_diag, ONLY: choose_eigv_solver,&
26  cp_fm_struct_type
27  USE cp_fm_types, ONLY: cp_fm_create,&
29  cp_fm_release,&
31  cp_fm_type
32  USE dbcsr_api, ONLY: &
33  dbcsr_create, dbcsr_distribution_type, dbcsr_filter, dbcsr_iterator_blocks_left, &
34  dbcsr_iterator_next_block, dbcsr_iterator_start, dbcsr_iterator_stop, dbcsr_iterator_type, &
35  dbcsr_multiply, dbcsr_p_type, dbcsr_release, dbcsr_reserve_diag_blocks, dbcsr_type, &
36  dbcsr_type_no_symmetry
37  USE kinds, ONLY: dp
38  USE lapack, ONLY: lapack_ssyev
39  USE mao_basis, ONLY: mao_generate_basis
40  USE message_passing, ONLY: mp_para_env_type
41  USE parallel_gemm_api, ONLY: parallel_gemm
43  USE particle_types, ONLY: particle_type
44  USE qs_environment_types, ONLY: get_qs_env,&
45  qs_environment_type
46  USE qs_kind_types, ONLY: qs_kind_type
47  USE qs_ks_types, ONLY: get_ks_env,&
48  qs_ks_env_type
49  USE qs_mo_types, ONLY: get_mo_set,&
50  mo_set_type
51 #include "./base/base_uses.f90"
52 
53  IMPLICIT NONE
54  PRIVATE
55 
56  CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'minbas_methods'
57 
58  PUBLIC :: minbas_calculation
59 
60 ! **************************************************************************************************
61 
62 CONTAINS
63 
64 ! **************************************************************************************************
65 !> \brief ...
66 !> \param qs_env ...
67 !> \param mos ...
68 !> \param quambo ...
69 !> \param mao ...
70 !> \param iounit ...
71 !> \param full_ortho ...
72 !> \param eps_filter ...
73 ! **************************************************************************************************
74  SUBROUTINE minbas_calculation(qs_env, mos, quambo, mao, iounit, full_ortho, eps_filter)
75  TYPE(qs_environment_type), POINTER :: qs_env
76  TYPE(mo_set_type), DIMENSION(:), INTENT(IN) :: mos
77  TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: quambo
78  TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
79  POINTER :: mao
80  INTEGER, INTENT(IN), OPTIONAL :: iounit
81  LOGICAL, INTENT(IN), OPTIONAL :: full_ortho
82  REAL(kind=dp), INTENT(IN), OPTIONAL :: eps_filter
83 
84  CHARACTER(len=*), PARAMETER :: routinen = 'minbas_calculation'
85 
86  INTEGER :: handle, homo, i, iab, ispin, nao, natom, &
87  ndep, nmao, nmo, nmx, np, np1, nspin, &
88  nvirt, unit_nr
89  INTEGER, DIMENSION(:), POINTER :: col_blk_sizes, row_blk_sizes
90  LOGICAL :: do_minbas, my_full_ortho
91  REAL(kind=dp) :: my_eps_filter
92  REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: dval, dvalo, dvalv, eigval
93  TYPE(cp_blacs_env_type), POINTER :: blacs_env
94  TYPE(cp_fm_struct_type), POINTER :: fm_struct_a, fm_struct_b, fm_struct_c, &
95  fm_struct_d, fm_struct_e
96  TYPE(cp_fm_type) :: fm1, fm2, fm3, fm4, fm5, fm6, fma, fmb, &
97  fmwork
98  TYPE(cp_fm_type), POINTER :: fm_mos
99  TYPE(dbcsr_distribution_type), POINTER :: dbcsr_dist
100  TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: mao_coef
101  TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_s
102  TYPE(dbcsr_type) :: smao, sortho
103  TYPE(dbcsr_type), POINTER :: smat
104  TYPE(dft_control_type), POINTER :: dft_control
105  TYPE(mp_para_env_type), POINTER :: para_env
106  TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
107  TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
108  TYPE(qs_ks_env_type), POINTER :: ks_env
109 
110  CALL timeset(routinen, handle)
111 
112  IF (PRESENT(iounit)) THEN
113  unit_nr = iounit
114  ELSE
115  unit_nr = -1
116  END IF
117 
118  IF (PRESENT(full_ortho)) THEN
119  my_full_ortho = full_ortho
120  ELSE
121  my_full_ortho = .false.
122  END IF
123 
124  IF (PRESENT(eps_filter)) THEN
125  my_eps_filter = eps_filter
126  ELSE
127  my_eps_filter = 1.0e-10_dp
128  END IF
129 
130  CALL get_qs_env(qs_env, dft_control=dft_control)
131  nspin = dft_control%nspins
132 
133  CALL get_qs_env(qs_env=qs_env, ks_env=ks_env)
134  CALL get_qs_env(qs_env=qs_env, qs_kind_set=qs_kind_set, natom=natom)
135  CALL get_ks_env(ks_env=ks_env, particle_set=particle_set, dbcsr_dist=dbcsr_dist)
136  ALLOCATE (row_blk_sizes(natom), col_blk_sizes(natom))
137  CALL get_particle_set(particle_set, qs_kind_set, nsgf=row_blk_sizes)
138  CALL get_particle_set(particle_set, qs_kind_set, nmao=col_blk_sizes)
139  nmao = sum(col_blk_sizes)
140  ! check if MAOs have been specified
141  DO iab = 1, natom
142  IF (col_blk_sizes(iab) < 0) &
143  cpabort("Number of MAOs has to be specified in KIND section for all elements")
144  END DO
145  CALL get_mo_set(mo_set=mos(1), nao=nao, nmo=nmo)
146 
147  IF (unit_nr > 0) THEN
148  WRITE (unit_nr, '(T2,A,T71,I10)') 'Total Number of Atomic Basis Set Functions :', nao
149  WRITE (unit_nr, '(T2,A,T71,I10)') 'Total Number of Minimal Basis Set Functions :', nmao
150  IF (nspin == 1) THEN
151  WRITE (unit_nr, '(T2,A,T71,I10)') 'Total Number of Molecular Orbitals available :', nmo
152  ELSE
153  DO ispin = 1, nspin
154  CALL get_mo_set(mo_set=mos(ispin), nmo=nmx)
155  WRITE (unit_nr, '(T2,A,i2,T71,I10)') &
156  'Total Number of Molecular Orbitals available for Spin ', ispin, nmx
157  END DO
158  END IF
159  END IF
160  cpassert(nmao <= nao)
161  DO ispin = 1, nspin
162  CALL get_mo_set(mo_set=mos(ispin), nmo=nmx)
163  IF (nmx /= nmo) EXIT
164  END DO
165  do_minbas = .true.
166  IF (nmao > nmo) THEN
167  IF (unit_nr > 0) THEN
168  WRITE (unit_nr, '(T2,A)') 'Localized Minimal Basis Analysis not possible'
169  END IF
170  do_minbas = .false.
171  ELSEIF (nmo /= nmx) THEN
172  IF (unit_nr > 0) THEN
173  WRITE (unit_nr, '(T2,A)') 'Different Number of Alpha and Beta MOs'
174  WRITE (unit_nr, '(T2,A)') 'Localized Minimal Basis Analysis not possible'
175  END IF
176  do_minbas = .false.
177  ELSE
178  IF (nao > nmo) THEN
179  IF (unit_nr > 0) THEN
180  WRITE (unit_nr, '(T2,A)') 'WARNING: Only a subset of MOs is available: Analysis depends on MOs'
181  END IF
182  END IF
183  END IF
184 
185  IF (do_minbas) THEN
186  ! initialize QUAMBOs
187  NULLIFY (quambo)
188  CALL dbcsr_allocate_matrix_set(quambo, nspin)
189  DO ispin = 1, nspin
190  ! coeficients
191  ALLOCATE (quambo(ispin)%matrix)
192  CALL dbcsr_create(matrix=quambo(ispin)%matrix, &
193  name="QUAMBO", dist=dbcsr_dist, matrix_type=dbcsr_type_no_symmetry, &
194  row_blk_size=row_blk_sizes, col_blk_size=col_blk_sizes, nze=0)
195  END DO
196 
197  ! initialize MAOs
198  ! optimize MAOs (mao_coef is allocated in the routine)
199  CALL mao_generate_basis(qs_env, mao_coef)
200 
201  ! sortho (nmao x nmao)
202  CALL dbcsr_create(sortho, name="SORTHO", dist=dbcsr_dist, matrix_type=dbcsr_type_no_symmetry, &
203  row_blk_size=col_blk_sizes, col_blk_size=col_blk_sizes, nze=0)
204  CALL dbcsr_reserve_diag_blocks(matrix=sortho)
205 
206  DEALLOCATE (row_blk_sizes, col_blk_sizes)
207 
208  ! temporary FM matrices
209  CALL get_qs_env(qs_env=qs_env, para_env=para_env, blacs_env=blacs_env)
210  NULLIFY (fm_struct_a, fm_struct_b)
211  CALL cp_fm_struct_create(fm_struct_a, nrow_global=nao, ncol_global=nmao, &
212  para_env=para_env, context=blacs_env)
213  CALL cp_fm_struct_create(fm_struct_b, nrow_global=nmo, ncol_global=nmao, &
214  para_env=para_env, context=blacs_env)
215  CALL cp_fm_create(fm1, fm_struct_a)
216  CALL cp_fm_create(fm2, fm_struct_b)
217  CALL cp_fm_create(fma, fm_struct_b)
218  CALL cp_fm_create(fmb, fm_struct_b)
219 
220  CALL get_qs_env(qs_env, matrix_s_kp=matrix_s)
221  smat => matrix_s(1, 1)%matrix
222  DO ispin = 1, nspin
223 
224  ! SMAO = Overlap*MAOs
225  CALL dbcsr_create(smao, name="S*MAO", template=mao_coef(1)%matrix)
226  CALL dbcsr_multiply("N", "N", 1.0_dp, smat, mao_coef(ispin)%matrix, 0.0_dp, smao)
227  ! a(nj)* = C(vn)(T) * SMAO(vj)
228  CALL copy_dbcsr_to_fm(smao, fm1)
229  CALL get_mo_set(mos(ispin), mo_coeff=fm_mos)
230  CALL parallel_gemm("T", "N", nmo, nmao, nao, 1.0_dp, fm_mos, fm1, 0.0_dp, fm2)
231  CALL dbcsr_release(smao)
232  CALL get_mo_set(mo_set=mos(ispin), homo=homo)
233  IF (unit_nr > 0) THEN
234  WRITE (unit_nr, '(T2,A,T51,A,i2,T71,I10)') 'MOs in Occupied Valence Set', 'Spin ', ispin, homo
235  END IF
236  nvirt = nmo - homo
237  NULLIFY (fm_struct_c)
238  CALL cp_fm_struct_create(fm_struct_c, nrow_global=nvirt, ncol_global=nvirt, &
239  para_env=para_env, context=blacs_env)
240  CALL cp_fm_create(fm3, fm_struct_c)
241  CALL cp_fm_create(fm4, fm_struct_c)
242  ! B(vw) = a(vj)* * a(wj)*
243  CALL parallel_gemm("N", "T", nvirt, nvirt, nmao, 1.0_dp, fm2, fm2, 0.0_dp, fm3, &
244  a_first_row=homo + 1, b_first_row=homo + 1)
245  ALLOCATE (eigval(nvirt))
246  CALL choose_eigv_solver(fm3, fm4, eigval)
247  ! SVD(B) -> select p largest eigenvalues and vectors
248  np = nmao - homo
249  np1 = nvirt - np + 1
250  IF (unit_nr > 0) THEN
251  WRITE (unit_nr, '(T2,A,T51,A,i2,T71,I10)') 'MOs in Virtual Valence Set', 'Spin ', ispin, np
252  END IF
253  ! R(vw) = SUM_p T(vp)*T(wp)
254  CALL parallel_gemm("N", "T", nvirt, nvirt, np, 1.0_dp, fm4, fm4, 0.0_dp, fm3, &
255  a_first_col=np1, b_first_col=np1)
256  !
257  ALLOCATE (dval(nmao), dvalo(nmao), dvalv(nmao))
258  NULLIFY (fm_struct_d)
259  CALL cp_fm_struct_create(fm_struct_d, nrow_global=nvirt, ncol_global=nmao, &
260  para_env=para_env, context=blacs_env)
261  CALL cp_fm_create(fm5, fm_struct_d)
262  NULLIFY (fm_struct_e)
263  CALL cp_fm_struct_create(fm_struct_e, nrow_global=nmao, ncol_global=nmao, &
264  para_env=para_env, context=blacs_env)
265  CALL cp_fm_create(fm6, fm_struct_e)
266  ! D(j) = SUM_n (a(nj)*)^2 + SUM_vw R(vw) * a(vj)* * a(wj)*
267  CALL parallel_gemm("N", "N", nvirt, nmao, nvirt, 1.0_dp, fm3, fm2, 0.0_dp, fm5, &
268  b_first_row=homo + 1)
269  CALL parallel_gemm("T", "N", nmao, nmao, nvirt, 1.0_dp, fm2, fm5, 0.0_dp, fm6, &
270  a_first_row=homo + 1)
271  CALL cp_fm_get_diag(fm6, dvalv(1:nmao))
272  CALL parallel_gemm("T", "N", nmao, nmao, homo, 1.0_dp, fm2, fm2, 0.0_dp, fm6)
273  CALL cp_fm_get_diag(fm6, dvalo(1:nmao))
274  DO i = 1, nmao
275  dval(i) = 1.0_dp/sqrt(dvalo(i) + dvalv(i))
276  END DO
277  ! scale intermediate expansion
278  CALL cp_fm_to_fm_submat(fm2, fma, homo, nmao, 1, 1, 1, 1)
279  CALL cp_fm_to_fm_submat(fm5, fma, nvirt, nmao, 1, 1, homo + 1, 1)
280  CALL cp_fm_column_scale(fma, dval)
281  ! Orthogonalization
282  CALL cp_fm_create(fmwork, fm_struct_e)
283  CALL parallel_gemm("T", "N", nmao, nmao, nmo, 1.0_dp, fma, fma, 0.0_dp, fm6)
284  IF (my_full_ortho) THEN
285  ! full orthogonalization
286  CALL cp_fm_power(fm6, fmwork, -0.5_dp, 1.0e-12_dp, ndep)
287  IF (ndep > 0 .AND. unit_nr > 0) THEN
288  WRITE (unit_nr, '(T2,A,T71,I10)') 'Warning: linear dependent basis ', ndep
289  END IF
290  CALL parallel_gemm("N", "N", nmo, nmao, nmao, 1.0_dp, fma, fm6, 0.0_dp, fmb)
291  ELSE
292  ! orthogonalize on-atom blocks
293  CALL copy_fm_to_dbcsr(fm6, sortho, keep_sparsity=.true.)
294  CALL diag_sqrt_invert(sortho)
295  CALL copy_dbcsr_to_fm(sortho, fm6)
296  CALL parallel_gemm("N", "N", nmo, nmao, nmao, 1.0_dp, fma, fm6, 0.0_dp, fmb)
297  END IF
298  ! store as QUAMBO
299  CALL parallel_gemm("N", "N", nao, nmao, nmo, 1.0_dp, fm_mos, fmb, 0.0_dp, fm1)
300  CALL copy_fm_to_dbcsr(fm1, quambo(ispin)%matrix)
301  CALL dbcsr_filter(quambo(ispin)%matrix, my_eps_filter)
302  !
303  DEALLOCATE (eigval, dval, dvalo, dvalv)
304  CALL cp_fm_release(fm3)
305  CALL cp_fm_release(fm4)
306  CALL cp_fm_release(fm5)
307  CALL cp_fm_release(fm6)
308  CALL cp_fm_release(fmwork)
309  CALL cp_fm_struct_release(fm_struct_c)
310  CALL cp_fm_struct_release(fm_struct_d)
311  CALL cp_fm_struct_release(fm_struct_e)
312 
313  END DO
314 
315  ! clean up
316  CALL cp_fm_release(fm1)
317  CALL cp_fm_release(fm2)
318  CALL cp_fm_release(fma)
319  CALL cp_fm_release(fmb)
320  CALL cp_fm_struct_release(fm_struct_a)
321  CALL cp_fm_struct_release(fm_struct_b)
322  CALL dbcsr_release(sortho)
323 
324  ! return MAOs if requested
325  IF (PRESENT(mao)) THEN
326  mao => mao_coef
327  ELSE
328  CALL dbcsr_deallocate_matrix_set(mao_coef)
329  END IF
330 
331  ELSE
332  NULLIFY (quambo)
333  END IF
334 
335  CALL timestop(handle)
336 
337  END SUBROUTINE minbas_calculation
338 
339 ! **************************************************************************************************
340 !> \brief ...
341 !> \param sortho ...
342 ! **************************************************************************************************
343  SUBROUTINE diag_sqrt_invert(sortho)
344  TYPE(dbcsr_type) :: sortho
345 
346  INTEGER :: i, iatom, info, jatom, lwork, n
347  REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: w, work
348  REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: amat, bmat
349  REAL(kind=dp), DIMENSION(:, :), POINTER :: sblock
350  TYPE(dbcsr_iterator_type) :: dbcsr_iter
351 
352  CALL dbcsr_iterator_start(dbcsr_iter, sortho)
353  DO WHILE (dbcsr_iterator_blocks_left(dbcsr_iter))
354  CALL dbcsr_iterator_next_block(dbcsr_iter, iatom, jatom, sblock)
355  cpassert(iatom == jatom)
356  n = SIZE(sblock, 1)
357  lwork = max(n*n, 100)
358  ALLOCATE (amat(n, n), bmat(n, n), w(n), work(lwork))
359  amat(1:n, 1:n) = sblock(1:n, 1:n)
360  info = 0
361  CALL lapack_ssyev("V", "U", n, amat, n, w, work, lwork, info)
362  cpassert(info == 0)
363  w(1:n) = 1._dp/sqrt(w(1:n))
364  DO i = 1, n
365  bmat(1:n, i) = amat(1:n, i)*w(i)
366  END DO
367  sblock(1:n, 1:n) = matmul(amat, transpose(bmat))
368  DEALLOCATE (amat, bmat, w, work)
369  END DO
370  CALL dbcsr_iterator_stop(dbcsr_iter)
371 
372  END SUBROUTINE diag_sqrt_invert
373 
374 END MODULE minbas_methods
methods related to the blacs parallel environment
Definition: cp_blacs_env.F:15
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm)
Copy a DBCSR matrix to a BLACS matrix.
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
basic linear algebra operations for full matrices
subroutine, public cp_fm_column_scale(matrixa, scaling)
scales column i of matrix a with scaling(i)
used for collecting some of the diagonalization schemes available for cp_fm_type. cp_fm_power also mo...
Definition: cp_fm_diag.F:17
subroutine, public cp_fm_power(matrix, work, exponent, threshold, n_dependent, verbose, eigvals)
...
Definition: cp_fm_diag.F:896
subroutine, public choose_eigv_solver(matrix, eigenvectors, eigenvalues, info)
Choose the Eigensolver depending on which library is available ELPA seems to be unstable for small sy...
Definition: cp_fm_diag.F:208
represent the structure of a full matrix
Definition: cp_fm_struct.F:14
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
Definition: cp_fm_struct.F:125
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
Definition: cp_fm_struct.F:320
represent a full matrix distributed on many processors
Definition: cp_fm_types.F:15
subroutine, public cp_fm_get_diag(matrix, diag)
returns the diagonal elements of a fm
Definition: cp_fm_types.F:570
subroutine, public cp_fm_to_fm_submat(msource, mtarget, nrow, ncol, s_firstrow, s_firstcol, t_firstrow, t_firstcol)
copy just a part ot the matrix
Definition: cp_fm_types.F:1473
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
Definition: cp_fm_types.F:167
Defines the basic variable types.
Definition: kinds.F:23
integer, parameter, public dp
Definition: kinds.F:34
Interface to the LAPACK F77 library.
Definition: lapack.F:17
Calculate MAO's and analyze wavefunctions.
Definition: mao_basis.F:15
subroutine, public mao_generate_basis(qs_env, mao_coef, ref_basis_set, pmat_external, smat_external, molecular, max_iter, eps_grad, nmao_external, eps1_mao, iolevel, unit_nr)
...
Definition: mao_basis.F:75
Interface to the message passing library MPI.
Calculate localized minimal basis.
subroutine, public minbas_calculation(qs_env, mos, quambo, mao, iounit, full_ortho, eps_filter)
...
basic linear algebra operations for full matrixes
Define methods related to particle_type.
subroutine, public get_particle_set(particle_set, qs_kind_set, first_sgf, last_sgf, nsgf, nmao, basis)
Get the components of a particle set.
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, 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.
Define the quickstep kind type and their sub types.
Definition: qs_kind_types.F:23
subroutine, public get_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, rho, rho_xc, vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, 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, kpoints, do_kpoints, atomic_kind_set, qs_kind_set, cell, cell_ref, use_ref_cell, particle_set, energy, force, local_particles, local_molecules, molecule_kind_set, molecule_set, subsys, cp_subsys, virial, results, atprop, nkind, natom, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env, nelectron_total, nelectron_spin)
...
Definition: qs_ks_types.F:330
Definition and initialisation of the mo data type.
Definition: qs_mo_types.F:22
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.
Definition: qs_mo_types.F:397