(git:0de0cc2)
admm_types.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 Types and set/get functions for auxiliary density matrix methods
10 !> \par History
11 !> 05.2008 created [Manuel Guidon]
12 !> 12.2019 Made GAPW compatiblae [Augustin Bussy]
13 !> \author Manuel Guidon
14 ! **************************************************************************************************
15 MODULE admm_types
16  USE admm_dm_types, ONLY: admm_dm_release,&
17  admm_dm_type
18  USE bibliography, ONLY: guidon2010,&
19  cite_reference
20  USE cp_blacs_env, ONLY: cp_blacs_env_type
21  USE cp_control_types, ONLY: admm_control_type
25  cp_fm_struct_type
26  USE cp_fm_types, ONLY: cp_fm_create,&
27  cp_fm_release,&
28  cp_fm_type
29  USE dbcsr_api, ONLY: dbcsr_p_type
38  section_vals_type
39  USE kinds, ONLY: dp
43  kpoint_transitional_type,&
46  USE message_passing, ONLY: mp_para_env_type
48  qs_kind_type
50  local_rho_type
51  USE qs_mo_types, ONLY: deallocate_mo_set,&
52  get_mo_set,&
53  mo_set_type
54  USE qs_neighbor_list_types, ONLY: neighbor_list_set_p_type,&
56  USE qs_oce_types, ONLY: deallocate_oce_set,&
57  oce_matrix_type
58  USE qs_rho_types, ONLY: qs_rho_release,&
59  qs_rho_type
61  task_list_type
62 #include "./base/base_uses.f90"
63 
64  IMPLICIT NONE
65  PRIVATE
66  PUBLIC :: admm_env_create, admm_env_release, admm_type, admm_gapw_r3d_rs_type, set_admm_env, get_admm_env
67 
68  CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'admm_types'
69 
70  TYPE eigvals_type
71  REAL(dp), DIMENSION(:), POINTER :: DATA => null()
72  END TYPE
73 
74  TYPE eigvals_p_type
75  TYPE(eigvals_type), POINTER :: eigvals => null()
76  END TYPE
77 
78 ! **************************************************************************************************
79 !> \brief A subtype of the admm_env that contains the extra data needed for an ADMM GAPW calculation
80 !> \param admm_kind_set gets its own qs_kind set to store all relevant basis/grid/etc info
81 !> \param local_rho_set caontains soft and hard AUX_FIT atomoc densities
82 !> \param task_list the task list used for all soft density pw operations
83 !> \param oce stores the precomputed oce integrals
84 ! **************************************************************************************************
85  TYPE admm_gapw_r3d_rs_type
86  TYPE(qs_kind_type), DIMENSION(:), POINTER :: admm_kind_set => null()
87  TYPE(local_rho_type), POINTER :: local_rho_set => null()
88  TYPE(task_list_type), POINTER :: task_list => null()
89  TYPE(oce_matrix_type), POINTER :: oce => null()
90  END TYPE admm_gapw_r3d_rs_type
91 
92 ! **************************************************************************************************
93 !> \brief stores some data used in wavefunction fitting
94 !> \param S overlap matrix for auxiliary fit basis set
95 !> \param P overlap matrix for mixed aux_fit/orb basis set
96 !> \param A contains inv(S)*P
97 !> \param B contains transpose(P)*inv(S)*P = transpose(P)*A
98 !> \param lambda contains transpose(mo_coeff_aux_fit)*B*mo_coeff_aux_fit
99 !> \param lambda_inv_sqrt contains inv(SQRT(lambda))
100 !> \param R contains eigenvectors of lambda
101 !> \param work_aux_aux temporary matrix
102 !> \param work_orb_nmo temporary matrix
103 !> \param work_nmo_nmo1 temporary matrix
104 !> \param work_nmo_nmo2 temporary matrix
105 !> \param work_aux_nmo temporary matrix
106 !> \param H contains KS_matrix * mo_coeff for auxiliary basis set
107 !> \param K contains KS matrix for auxiliary basis set
108 !> \param M contains matrix holding the 2nd order residues
109 !> \param nao_orb number of atomic orbitals in orb basis set
110 !> \param nao_aux_fit number of atomic orbitals in aux basis set
111 !> \param nmo number of molecular orbitals per spin
112 !> \param eigvals_lamda eigenvalues of lambda matrix
113 !> \param gsi contains ratio N_dens_m/N_aux_dens_m
114 !> \param admm_gapw_env the type containing ADMM GAPW specific data
115 !> \param do_gapw an internal logical switch for GAPW
116 !> \par History
117 !> 05.2008 created [Manuel Guidon]
118 !> \author Manuel Guidon
119 ! **************************************************************************************************
120  TYPE admm_type
121  TYPE(cp_fm_type), POINTER :: S_inv => null(), &
122  s => null(), &
123  q => null(), &
124  a => null(), &
125  b => null(), &
126  work_orb_orb => null(), &
127  work_orb_orb2 => null(), &
128  work_orb_orb3 => null(), &
129  work_aux_orb => null(), &
130  work_aux_orb2 => null(), &
131  work_aux_orb3 => null(), &
132  work_aux_aux => null(), &
133  work_aux_aux2 => null(), &
134  work_aux_aux3 => null(), &
135  work_aux_aux4 => null(), &
136  work_aux_aux5 => null()
137 
138  TYPE(cp_fm_type), DIMENSION(:), &
139  POINTER :: lambda => null(), &
140  lambda_inv => null(), &
141  lambda_inv_sqrt => null(), &
142  r => null(), &
143  r_purify => null(), &
144  work_orb_nmo => null(), &
145  work_nmo_nmo1 => null(), &
146  r_schur_r_t => null(), &
147  work_nmo_nmo2 => null(), &
148  work_aux_nmo => null(), &
149  work_aux_nmo2 => null(), &
150  h => null(), &
151  h_corr => null(), &
152  mo_derivs_tmp => null(), &
153  k => null(), &
154  m => null(), &
155  m_purify => null(), &
156  p_to_be_purified => null(), &
157  lambda_inv2 => null(), &
158  c_hat => null(), &
159  p_tilde => null(), &
160  ks_to_be_merged => null(), &
161  scf_work_aux_fit => null()
162  TYPE(eigvals_p_type), DIMENSION(:), &
163  POINTER :: eigvals_lambda => null(), &
164  eigvals_p_to_be_purified => null()
165  TYPE(section_vals_type), POINTER :: xc_section_primary => null(), &
166  xc_section_aux => null()
167  REAL(KIND=dp) :: gsi(3) = 0.0_dp, &
168  lambda_merlot(2) = 0.0_dp, &
169  n_large_basis(3) = 0.0_dp
170  INTEGER :: nao_orb = 0, nao_aux_fit = 0, nmo(2) = 0
171  INTEGER :: purification_method = do_admm_purify_none
172  LOGICAL :: charge_constrain = .false., do_admmp = .false., &
173  do_admmq = .false., do_admms = .false.
174  INTEGER :: scaling_model = do_admm_exch_scaling_none, &
175  aux_exch_func = do_admm_aux_exch_func_none
176  LOGICAL :: aux_exch_func_param = .false.
177  REAL(KIND=dp), DIMENSION(3) :: aux_x_param = 0.0_dp
178  LOGICAL :: block_dm = .false.
179  LOGICAL :: block_fit = .false.
180  INTEGER, DIMENSION(:, :), POINTER :: block_map => null()
181  TYPE(admm_gapw_r3d_rs_type), POINTER :: admm_gapw_env => null()
182  LOGICAL :: do_gapw = .false.
183  TYPE(admm_dm_type), POINTER :: admm_dm => null()
184 
185  TYPE(mo_set_type), DIMENSION(:), &
186  POINTER :: mos_aux_fit => null()
187  TYPE(neighbor_list_set_p_type), &
188  DIMENSION(:), POINTER :: sab_aux_fit => null(), sab_aux_fit_asymm => null(), sab_aux_fit_vs_orb => null()
189  TYPE(dbcsr_p_type), DIMENSION(:), &
190  POINTER :: matrix_ks_aux_fit_im => null()
191  TYPE(kpoint_transitional_type) :: matrix_ks_aux_fit, &
192  matrix_ks_aux_fit_dft, &
193  matrix_ks_aux_fit_hfx, &
194  matrix_s_aux_fit, &
195  matrix_s_aux_fit_vs_orb
196  TYPE(qs_rho_type), POINTER :: rho_aux_fit => null(), rho_aux_fit_buffer => null()
197  TYPE(task_list_type), POINTER :: task_list_aux_fit => null()
198  TYPE(cp_fm_type), DIMENSION(:), &
199  POINTER :: mo_derivs_aux_fit => null()
200 
201  END TYPE
202 
203 CONTAINS
204 
205 ! **************************************************************************************************
206 !> \brief creates ADMM environment, initializes the basic types
207 !>
208 !> \param admm_env The ADMM env
209 !> \param admm_control ...
210 !> \param mos the MO's of the orbital basis set
211 !> \param para_env The parallel env
212 !> \param natoms ...
213 !> \param nao_aux_fit ...
214 !> \param blacs_env_ext ...
215 !> \par History
216 !> 05.2008 created [Manuel Guidon]
217 !> \author Manuel Guidon
218 ! **************************************************************************************************
219  SUBROUTINE admm_env_create(admm_env, admm_control, mos, para_env, natoms, nao_aux_fit, blacs_env_ext)
220 
221  TYPE(admm_type), POINTER :: admm_env
222  TYPE(admm_control_type), POINTER :: admm_control
223  TYPE(mo_set_type), DIMENSION(:), INTENT(IN) :: mos
224  TYPE(mp_para_env_type), POINTER :: para_env
225  INTEGER, INTENT(IN) :: natoms, nao_aux_fit
226  TYPE(cp_blacs_env_type), OPTIONAL, POINTER :: blacs_env_ext
227 
228  INTEGER :: i, iatom, iblock, ispin, j, jatom, &
229  nao_orb, nmo, nspins
230  TYPE(cp_blacs_env_type), POINTER :: blacs_env
231  TYPE(cp_fm_struct_type), POINTER :: fm_struct_aux_aux, fm_struct_aux_nmo, fm_struct_aux_orb, &
232  fm_struct_nmo_nmo, fm_struct_orb_nmo, fm_struct_orb_orb
233  TYPE(cp_fm_type), POINTER :: mo_coeff
234 
235  CALL cite_reference(guidon2010)
236 
237  ALLOCATE (admm_env)
238 
239  nspins = SIZE(mos)
240  CALL get_mo_set(mos(1), mo_coeff=mo_coeff, nmo=nmo, nao=nao_orb)
241  blacs_env => mo_coeff%matrix_struct%context
242  IF (PRESENT(blacs_env_ext)) blacs_env => blacs_env_ext
243 
244  admm_env%nmo = 0
245  admm_env%nao_aux_fit = nao_aux_fit
246  admm_env%nao_orb = nao_orb
247  CALL cp_fm_struct_create(fm_struct_aux_aux, &
248  context=blacs_env, &
249  nrow_global=nao_aux_fit, &
250  ncol_global=nao_aux_fit, &
251  para_env=para_env)
252  CALL cp_fm_struct_create(fm_struct_aux_orb, &
253  context=blacs_env, &
254  nrow_global=nao_aux_fit, &
255  ncol_global=nao_orb, &
256  para_env=para_env)
257  CALL cp_fm_struct_create(fm_struct_orb_orb, &
258  context=blacs_env, &
259  nrow_global=nao_orb, &
260  ncol_global=nao_orb, &
261  para_env=para_env)
262 
263  NULLIFY (admm_env%S, admm_env%S_inv, admm_env%Q, admm_env%A, admm_env%B, &
264  admm_env%work_orb_orb, admm_env%work_orb_orb2, admm_env%work_orb_orb3, &
265  admm_env%work_aux_orb, admm_env%work_aux_orb2, admm_env%work_aux_orb3, &
266  admm_env%work_aux_aux, admm_env%work_aux_aux2, admm_env%work_aux_aux3, &
267  admm_env%work_aux_aux4, admm_env%work_aux_aux5)
268  ALLOCATE (admm_env%S, admm_env%S_inv, admm_env%Q, admm_env%A, admm_env%B, &
269  admm_env%work_orb_orb, admm_env%work_orb_orb2, admm_env%work_orb_orb3, &
270  admm_env%work_aux_orb, admm_env%work_aux_orb2, admm_env%work_aux_orb3, &
271  admm_env%work_aux_aux, admm_env%work_aux_aux2, admm_env%work_aux_aux3, &
272  admm_env%work_aux_aux4, admm_env%work_aux_aux5)
273  CALL cp_fm_create(admm_env%S, fm_struct_aux_aux, name="aux_fit_overlap")
274  CALL cp_fm_create(admm_env%S_inv, fm_struct_aux_aux, name="aux_fit_overlap_inv")
275  CALL cp_fm_create(admm_env%Q, fm_struct_aux_orb, name="mixed_overlap")
276  CALL cp_fm_create(admm_env%A, fm_struct_aux_orb, name="work_A")
277  CALL cp_fm_create(admm_env%B, fm_struct_orb_orb, name="work_B")
278  CALL cp_fm_create(admm_env%work_orb_orb, fm_struct_orb_orb, name="work_orb_orb")
279  CALL cp_fm_create(admm_env%work_orb_orb2, fm_struct_orb_orb, name="work_orb_orb")
280  CALL cp_fm_create(admm_env%work_orb_orb3, fm_struct_orb_orb, name="work_orb_orb3")
281  CALL cp_fm_create(admm_env%work_aux_orb, fm_struct_aux_orb, name="work_aux_orb")
282  CALL cp_fm_create(admm_env%work_aux_orb2, fm_struct_aux_orb, name="work_aux_orb2")
283  CALL cp_fm_create(admm_env%work_aux_orb3, fm_struct_aux_orb, name="work_aux_orb3")
284  CALL cp_fm_create(admm_env%work_aux_aux, fm_struct_aux_aux, name="work_aux_aux")
285  CALL cp_fm_create(admm_env%work_aux_aux2, fm_struct_aux_aux, name="work_aux_aux2")
286  CALL cp_fm_create(admm_env%work_aux_aux3, fm_struct_aux_aux, name="work_aux_aux3")
287  CALL cp_fm_create(admm_env%work_aux_aux4, fm_struct_aux_aux, name="work_aux_aux4")
288  CALL cp_fm_create(admm_env%work_aux_aux5, fm_struct_aux_aux, name="work_aux_aux5")
289 
290  ALLOCATE (admm_env%lambda_inv(nspins))
291  ALLOCATE (admm_env%lambda(nspins))
292  ALLOCATE (admm_env%lambda_inv_sqrt(nspins))
293  ALLOCATE (admm_env%R(nspins))
294  ALLOCATE (admm_env%R_purify(nspins))
295  ALLOCATE (admm_env%work_orb_nmo(nspins))
296  ALLOCATE (admm_env%work_nmo_nmo1(nspins))
297  ALLOCATE (admm_env%R_schur_R_t(nspins))
298  ALLOCATE (admm_env%work_nmo_nmo2(nspins))
299  ALLOCATE (admm_env%eigvals_lambda(nspins))
300  ALLOCATE (admm_env%eigvals_P_to_be_purified(nspins))
301  ALLOCATE (admm_env%H(nspins))
302  ALLOCATE (admm_env%K(nspins))
303  ALLOCATE (admm_env%M(nspins))
304  ALLOCATE (admm_env%M_purify(nspins))
305  ALLOCATE (admm_env%P_to_be_purified(nspins))
306  ALLOCATE (admm_env%work_aux_nmo(nspins))
307  ALLOCATE (admm_env%work_aux_nmo2(nspins))
308  ALLOCATE (admm_env%mo_derivs_tmp(nspins))
309  ALLOCATE (admm_env%H_corr(nspins))
310  ALLOCATE (admm_env%ks_to_be_merged(nspins))
311  ALLOCATE (admm_env%lambda_inv2(nspins))
312  ALLOCATE (admm_env%C_hat(nspins))
313  ALLOCATE (admm_env%P_tilde(nspins))
314 
315  DO ispin = 1, nspins
316  CALL get_mo_set(mos(ispin), mo_coeff=mo_coeff, nmo=nmo)
317  admm_env%nmo(ispin) = nmo
318  CALL cp_fm_struct_create(fm_struct_aux_nmo, &
319  context=blacs_env, &
320  nrow_global=nao_aux_fit, &
321  ncol_global=nmo, &
322  para_env=para_env)
323  CALL cp_fm_struct_create(fm_struct_orb_nmo, &
324  context=blacs_env, &
325  nrow_global=nao_orb, &
326  ncol_global=nmo, &
327  para_env=para_env)
328  CALL cp_fm_struct_create(fm_struct_nmo_nmo, &
329  context=blacs_env, &
330  nrow_global=nmo, &
331  ncol_global=nmo, &
332  para_env=para_env)
333 
334  CALL cp_fm_create(admm_env%work_orb_nmo(ispin), fm_struct_orb_nmo, name="work_orb_nmo")
335  CALL cp_fm_create(admm_env%work_nmo_nmo1(ispin), fm_struct_nmo_nmo, name="work_nmo_nmo1")
336  CALL cp_fm_create(admm_env%R_schur_R_t(ispin), fm_struct_nmo_nmo, name="R_schur_R_t")
337  CALL cp_fm_create(admm_env%work_nmo_nmo2(ispin), fm_struct_nmo_nmo, name="work_nmo_nmo2")
338  CALL cp_fm_create(admm_env%lambda(ispin), fm_struct_nmo_nmo, name="lambda")
339  CALL cp_fm_create(admm_env%lambda_inv(ispin), fm_struct_nmo_nmo, name="lambda_inv")
340  CALL cp_fm_create(admm_env%lambda_inv_sqrt(ispin), fm_struct_nmo_nmo, name="lambda_inv_sqrt")
341  CALL cp_fm_create(admm_env%R(ispin), fm_struct_nmo_nmo, name="R")
342  CALL cp_fm_create(admm_env%R_purify(ispin), fm_struct_aux_aux, name="R_purify")
343  CALL cp_fm_create(admm_env%K(ispin), fm_struct_aux_aux, name="K")
344  CALL cp_fm_create(admm_env%H(ispin), fm_struct_aux_nmo, name="H")
345  CALL cp_fm_create(admm_env%H_corr(ispin), fm_struct_orb_orb, name="H_corr")
346  CALL cp_fm_create(admm_env%M(ispin), fm_struct_nmo_nmo, name="M")
347  CALL cp_fm_create(admm_env%M_purify(ispin), fm_struct_aux_aux, name="M aux")
348  CALL cp_fm_create(admm_env%P_to_be_purified(ispin), fm_struct_aux_aux, name="P_to_be_purified")
349  CALL cp_fm_create(admm_env%work_aux_nmo(ispin), fm_struct_aux_nmo, name="work_aux_nmo")
350  CALL cp_fm_create(admm_env%work_aux_nmo2(ispin), fm_struct_aux_nmo, name="work_aux_nmo2")
351  CALL cp_fm_create(admm_env%mo_derivs_tmp(ispin), fm_struct_orb_nmo, name="mo_derivs_tmp")
352  CALL cp_fm_create(admm_env%lambda_inv2(ispin), fm_struct_nmo_nmo, name="lambda_inv2")
353  CALL cp_fm_create(admm_env%C_hat(ispin), fm_struct_aux_nmo, name="C_hat")
354  CALL cp_fm_create(admm_env%P_tilde(ispin), fm_struct_aux_aux, name="P_tilde")
355  CALL cp_fm_create(admm_env%ks_to_be_merged(ispin), fm_struct_orb_orb, name="KS_to_be_merged ")
356 
357  ALLOCATE (admm_env%eigvals_lambda(ispin)%eigvals)
358  ALLOCATE (admm_env%eigvals_P_to_be_purified(ispin)%eigvals)
359  ALLOCATE (admm_env%eigvals_lambda(ispin)%eigvals%data(nmo))
360  ALLOCATE (admm_env%eigvals_P_to_be_purified(ispin)%eigvals%data(nao_aux_fit))
361  admm_env%eigvals_lambda(ispin)%eigvals%data = 0.0_dp
362  admm_env%eigvals_P_to_be_purified(ispin)%eigvals%data = 0.0_dp
363  CALL cp_fm_struct_release(fm_struct_aux_nmo)
364  CALL cp_fm_struct_release(fm_struct_orb_nmo)
365  CALL cp_fm_struct_release(fm_struct_nmo_nmo)
366  END DO
367 
368  CALL cp_fm_struct_release(fm_struct_aux_aux)
369  CALL cp_fm_struct_release(fm_struct_aux_orb)
370  CALL cp_fm_struct_release(fm_struct_orb_orb)
371 
372  ! Copy settings from admm_control
373  cpassert(ASSOCIATED(admm_control))
374  admm_env%purification_method = admm_control%purification_method
375  admm_env%scaling_model = admm_control%scaling_model
376  admm_env%aux_exch_func = admm_control%aux_exch_func
377  admm_env%charge_constrain = (admm_control%method == do_admm_charge_constrained_projection)
378  admm_env%block_dm = ((admm_control%method == do_admm_blocking_purify_full) .OR. &
379  (admm_control%method == do_admm_blocked_projection))
380  admm_env%block_fit = admm_control%method == do_admm_blocked_projection
381  admm_env%aux_exch_func_param = admm_control%aux_exch_func_param
382  admm_env%aux_x_param(:) = admm_control%aux_x_param(:)
383 
384  !ADMMP, ADMMQ, ADMMS
385  IF ((.NOT. admm_env%charge_constrain) .AND. (admm_env%scaling_model == do_admm_exch_scaling_merlot)) &
386  admm_env%do_admmp = .true.
387  IF (admm_env%charge_constrain .AND. (admm_env%scaling_model == do_admm_exch_scaling_none)) &
388  admm_env%do_admmq = .true.
389  IF (admm_env%charge_constrain .AND. (admm_env%scaling_model == do_admm_exch_scaling_merlot)) &
390  admm_env%do_admms = .true.
391 
392  IF ((admm_control%method == do_admm_blocking_purify_full) .OR. &
393  (admm_control%method == do_admm_blocked_projection)) THEN
394  ! Create block map
395  ALLOCATE (admm_env%block_map(natoms, natoms))
396  admm_env%block_map(:, :) = 0
397  DO iblock = 1, SIZE(admm_control%blocks)
398  DO i = 1, SIZE(admm_control%blocks(iblock)%list)
399  iatom = admm_control%blocks(iblock)%list(i)
400  DO j = 1, SIZE(admm_control%blocks(iblock)%list)
401  jatom = admm_control%blocks(iblock)%list(j)
402  admm_env%block_map(iatom, jatom) = 1
403  END DO
404  END DO
405  END DO
406  END IF
407 
408  NULLIFY (admm_env%admm_gapw_env)
409  admm_env%do_gapw = .false.
410 
411  NULLIFY (admm_env%mos_aux_fit, admm_env%sab_aux_fit, admm_env%sab_aux_fit_asymm, admm_env%sab_aux_fit_vs_orb)
412  NULLIFY (admm_env%matrix_ks_aux_fit_im)
413  NULLIFY (admm_env%rho_aux_fit, admm_env%rho_aux_fit_buffer, admm_env%task_list_aux_fit, admm_env%mo_derivs_aux_fit)
414 
415  END SUBROUTINE admm_env_create
416 
417 ! **************************************************************************************************
418 !> \brief releases the ADMM environment, cleans up all types
419 !>
420 !> \param admm_env The ADMM env
421 !> \par History
422 !> 05.2008 created [Manuel Guidon]
423 !> \author Manuel Guidon
424 ! **************************************************************************************************
425  SUBROUTINE admm_env_release(admm_env)
426 
427  TYPE(admm_type), POINTER :: admm_env
428 
429  INTEGER :: ispin
430 
431  cpassert(ASSOCIATED(admm_env))
432 
433  CALL cp_fm_release(admm_env%S)
434  CALL cp_fm_release(admm_env%S_inv)
435  CALL cp_fm_release(admm_env%Q)
436  CALL cp_fm_release(admm_env%A)
437  CALL cp_fm_release(admm_env%B)
438  CALL cp_fm_release(admm_env%work_orb_orb)
439  CALL cp_fm_release(admm_env%work_orb_orb2)
440  CALL cp_fm_release(admm_env%work_orb_orb3)
441  CALL cp_fm_release(admm_env%work_aux_aux)
442  CALL cp_fm_release(admm_env%work_aux_aux2)
443  CALL cp_fm_release(admm_env%work_aux_aux3)
444  CALL cp_fm_release(admm_env%work_aux_aux4)
445  CALL cp_fm_release(admm_env%work_aux_aux5)
446  CALL cp_fm_release(admm_env%work_aux_orb)
447  CALL cp_fm_release(admm_env%work_aux_orb2)
448  CALL cp_fm_release(admm_env%work_aux_orb3)
449  DEALLOCATE (admm_env%S, admm_env%S_inv, admm_env%Q, admm_env%A, admm_env%B, &
450  admm_env%work_orb_orb, admm_env%work_orb_orb2, admm_env%work_orb_orb3, &
451  admm_env%work_aux_orb, admm_env%work_aux_orb2, admm_env%work_aux_orb3, &
452  admm_env%work_aux_aux, admm_env%work_aux_aux2, admm_env%work_aux_aux3, &
453  admm_env%work_aux_aux4, admm_env%work_aux_aux5)
454  CALL cp_fm_release(admm_env%lambda)
455  CALL cp_fm_release(admm_env%lambda_inv)
456  CALL cp_fm_release(admm_env%lambda_inv_sqrt)
457  CALL cp_fm_release(admm_env%lambda_inv2)
458  CALL cp_fm_release(admm_env%C_hat)
459  CALL cp_fm_release(admm_env%P_tilde)
460  CALL cp_fm_release(admm_env%R)
461  CALL cp_fm_release(admm_env%R_purify)
462  CALL cp_fm_release(admm_env%H)
463  CALL cp_fm_release(admm_env%H_corr)
464  CALL cp_fm_release(admm_env%K)
465  CALL cp_fm_release(admm_env%M)
466  CALL cp_fm_release(admm_env%M_purify)
467  CALL cp_fm_release(admm_env%P_to_be_purified)
468  CALL cp_fm_release(admm_env%work_orb_nmo)
469  CALL cp_fm_release(admm_env%work_nmo_nmo1)
470  CALL cp_fm_release(admm_env%R_schur_R_t)
471  CALL cp_fm_release(admm_env%work_nmo_nmo2)
472  CALL cp_fm_release(admm_env%work_aux_nmo)
473  CALL cp_fm_release(admm_env%work_aux_nmo2)
474  CALL cp_fm_release(admm_env%mo_derivs_tmp)
475  CALL cp_fm_release(admm_env%ks_to_be_merged)
476  CALL cp_fm_release(admm_env%lambda_inv2)
477  DO ispin = 1, SIZE(admm_env%eigvals_lambda)
478  DEALLOCATE (admm_env%eigvals_lambda(ispin)%eigvals%data)
479  DEALLOCATE (admm_env%eigvals_P_to_be_purified(ispin)%eigvals%data)
480  DEALLOCATE (admm_env%eigvals_lambda(ispin)%eigvals)
481  DEALLOCATE (admm_env%eigvals_P_to_be_purified(ispin)%eigvals)
482  END DO
483  DEALLOCATE (admm_env%eigvals_lambda)
484  DEALLOCATE (admm_env%eigvals_P_to_be_purified)
485 
486  IF (ASSOCIATED(admm_env%block_map)) &
487  DEALLOCATE (admm_env%block_map)
488 
489  IF (ASSOCIATED(admm_env%xc_section_primary)) &
490  CALL section_vals_release(admm_env%xc_section_primary)
491  IF (ASSOCIATED(admm_env%xc_section_aux)) &
492  CALL section_vals_release(admm_env%xc_section_aux)
493 
494  IF (ASSOCIATED(admm_env%admm_gapw_env)) CALL admm_gapw_env_release(admm_env%admm_gapw_env)
495  IF (ASSOCIATED(admm_env%admm_dm)) CALL admm_dm_release(admm_env%admm_dm)
496 
497  IF (ASSOCIATED(admm_env%mos_aux_fit)) THEN
498  DO ispin = 1, SIZE(admm_env%mos_aux_fit)
499  CALL deallocate_mo_set(admm_env%mos_aux_fit(ispin))
500  END DO
501  DEALLOCATE (admm_env%mos_aux_fit)
502  END IF
503  CALL cp_fm_release(admm_env%mo_derivs_aux_fit)
504 
505  IF (ASSOCIATED(admm_env%scf_work_aux_fit)) THEN
506  CALL cp_fm_release(admm_env%scf_work_aux_fit)
507  END IF
508 
509  IF (ASSOCIATED(admm_env%sab_aux_fit)) CALL release_neighbor_list_sets(admm_env%sab_aux_fit)
510  IF (ASSOCIATED(admm_env%sab_aux_fit_vs_orb)) CALL release_neighbor_list_sets(admm_env%sab_aux_fit_vs_orb)
511  IF (ASSOCIATED(admm_env%sab_aux_fit_asymm)) CALL release_neighbor_list_sets(admm_env%sab_aux_fit_asymm)
512 
513  CALL kpoint_transitional_release(admm_env%matrix_ks_aux_fit)
514  CALL kpoint_transitional_release(admm_env%matrix_ks_aux_fit_dft)
515  CALL kpoint_transitional_release(admm_env%matrix_ks_aux_fit_hfx)
516  CALL kpoint_transitional_release(admm_env%matrix_s_aux_fit)
517  CALL kpoint_transitional_release(admm_env%matrix_s_aux_fit_vs_orb)
518 
519  IF (ASSOCIATED(admm_env%matrix_ks_aux_fit_im)) CALL dbcsr_deallocate_matrix_set(admm_env%matrix_ks_aux_fit_im)
520 
521  IF (ASSOCIATED(admm_env%rho_aux_fit)) THEN
522  CALL qs_rho_release(admm_env%rho_aux_fit)
523  DEALLOCATE (admm_env%rho_aux_fit)
524  END IF
525  IF (ASSOCIATED(admm_env%rho_aux_fit_buffer)) THEN
526  CALL qs_rho_release(admm_env%rho_aux_fit_buffer)
527  DEALLOCATE (admm_env%rho_aux_fit_buffer)
528  END IF
529 
530  IF (ASSOCIATED(admm_env%task_list_aux_fit)) CALL deallocate_task_list(admm_env%task_list_aux_fit)
531 
532  DEALLOCATE (admm_env)
533 
534  END SUBROUTINE admm_env_release
535 
536 ! **************************************************************************************************
537 !> \brief Release the ADMM GAPW stuff
538 !> \param admm_gapw_env ...
539 ! **************************************************************************************************
540  SUBROUTINE admm_gapw_env_release(admm_gapw_env)
541 
542  TYPE(admm_gapw_r3d_rs_type), POINTER :: admm_gapw_env
543 
544  IF (ASSOCIATED(admm_gapw_env%admm_kind_set)) THEN
545  CALL deallocate_qs_kind_set(admm_gapw_env%admm_kind_set)
546  END IF
547 
548  IF (ASSOCIATED(admm_gapw_env%local_rho_set)) THEN
549  CALL local_rho_set_release(admm_gapw_env%local_rho_set)
550  END IF
551 
552  IF (ASSOCIATED(admm_gapw_env%task_list)) THEN
553  CALL deallocate_task_list(admm_gapw_env%task_list)
554  END IF
555 
556  IF (ASSOCIATED(admm_gapw_env%oce)) THEN
557  CALL deallocate_oce_set(admm_gapw_env%oce)
558  END IF
559 
560  DEALLOCATE (admm_gapw_env)
561 
562  END SUBROUTINE admm_gapw_env_release
563 
564 ! **************************************************************************************************
565 !> \brief Get routine for the ADMM env
566 !> \param admm_env ...
567 !> \param mo_derivs_aux_fit ...
568 !> \param mos_aux_fit ...
569 !> \param sab_aux_fit ...
570 !> \param sab_aux_fit_asymm ...
571 !> \param sab_aux_fit_vs_orb ...
572 !> \param matrix_s_aux_fit ...
573 !> \param matrix_s_aux_fit_kp ...
574 !> \param matrix_s_aux_fit_vs_orb ...
575 !> \param matrix_s_aux_fit_vs_orb_kp ...
576 !> \param task_list_aux_fit ...
577 !> \param matrix_ks_aux_fit ...
578 !> \param matrix_ks_aux_fit_kp ...
579 !> \param matrix_ks_aux_fit_im ...
580 !> \param matrix_ks_aux_fit_dft ...
581 !> \param matrix_ks_aux_fit_hfx ...
582 !> \param matrix_ks_aux_fit_dft_kp ...
583 !> \param matrix_ks_aux_fit_hfx_kp ...
584 !> \param rho_aux_fit ...
585 !> \param rho_aux_fit_buffer ...
586 !> \param admm_dm ...
587 ! **************************************************************************************************
588  SUBROUTINE get_admm_env(admm_env, mo_derivs_aux_fit, mos_aux_fit, sab_aux_fit, sab_aux_fit_asymm, &
589  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, &
590  task_list_aux_fit, matrix_ks_aux_fit, matrix_ks_aux_fit_kp, matrix_ks_aux_fit_im, &
591  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, &
592  rho_aux_fit_buffer, admm_dm)
593 
594  TYPE(admm_type), INTENT(IN), POINTER :: admm_env
595  TYPE(cp_fm_type), DIMENSION(:), OPTIONAL, POINTER :: mo_derivs_aux_fit
596  TYPE(mo_set_type), DIMENSION(:), OPTIONAL, POINTER :: mos_aux_fit
597  TYPE(neighbor_list_set_p_type), DIMENSION(:), &
598  OPTIONAL, POINTER :: sab_aux_fit, sab_aux_fit_asymm, &
599  sab_aux_fit_vs_orb
600  TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
601  POINTER :: matrix_s_aux_fit
602  TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, &
603  POINTER :: matrix_s_aux_fit_kp
604  TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
605  POINTER :: matrix_s_aux_fit_vs_orb
606  TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, &
607  POINTER :: matrix_s_aux_fit_vs_orb_kp
608  TYPE(task_list_type), OPTIONAL, POINTER :: task_list_aux_fit
609  TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
610  POINTER :: matrix_ks_aux_fit
611  TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, &
612  POINTER :: matrix_ks_aux_fit_kp
613  TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
614  POINTER :: matrix_ks_aux_fit_im, &
615  matrix_ks_aux_fit_dft, &
616  matrix_ks_aux_fit_hfx
617  TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, &
618  POINTER :: matrix_ks_aux_fit_dft_kp, &
619  matrix_ks_aux_fit_hfx_kp
620  TYPE(qs_rho_type), OPTIONAL, POINTER :: rho_aux_fit, rho_aux_fit_buffer
621  TYPE(admm_dm_type), OPTIONAL, POINTER :: admm_dm
622 
623  cpassert(ASSOCIATED(admm_env))
624 
625  IF (PRESENT(mo_derivs_aux_fit)) mo_derivs_aux_fit => admm_env%mo_derivs_aux_fit
626  IF (PRESENT(mos_aux_fit)) mos_aux_fit => admm_env%mos_aux_fit
627  IF (PRESENT(sab_aux_fit)) sab_aux_fit => admm_env%sab_aux_fit
628  IF (PRESENT(sab_aux_fit_asymm)) sab_aux_fit_asymm => admm_env%sab_aux_fit_asymm
629  IF (PRESENT(sab_aux_fit_vs_orb)) sab_aux_fit_vs_orb => admm_env%sab_aux_fit_vs_orb
630  IF (PRESENT(task_list_aux_fit)) task_list_aux_fit => admm_env%task_list_aux_fit
631  IF (PRESENT(matrix_ks_aux_fit_im)) matrix_ks_aux_fit_im => admm_env%matrix_ks_aux_fit_im
632  IF (PRESENT(rho_aux_fit)) rho_aux_fit => admm_env%rho_aux_fit
633  IF (PRESENT(rho_aux_fit_buffer)) rho_aux_fit_buffer => admm_env%rho_aux_fit_buffer
634  IF (PRESENT(admm_dm)) admm_dm => admm_env%admm_dm
635 
636  IF (PRESENT(matrix_ks_aux_fit)) matrix_ks_aux_fit => get_1d_pointer(admm_env%matrix_ks_aux_fit)
637  IF (PRESENT(matrix_ks_aux_fit_kp)) matrix_ks_aux_fit_kp => get_2d_pointer(admm_env%matrix_ks_aux_fit)
638  IF (PRESENT(matrix_ks_aux_fit_dft)) matrix_ks_aux_fit_dft => get_1d_pointer(admm_env%matrix_ks_aux_fit_dft)
639  IF (PRESENT(matrix_ks_aux_fit_dft_kp)) matrix_ks_aux_fit_dft_kp => get_2d_pointer(admm_env%matrix_ks_aux_fit_dft)
640  IF (PRESENT(matrix_ks_aux_fit_hfx)) matrix_ks_aux_fit_hfx => get_1d_pointer(admm_env%matrix_ks_aux_fit_hfx)
641  IF (PRESENT(matrix_ks_aux_fit_hfx_kp)) matrix_ks_aux_fit_hfx_kp => get_2d_pointer(admm_env%matrix_ks_aux_fit_hfx)
642  IF (PRESENT(matrix_s_aux_fit)) matrix_s_aux_fit => get_1d_pointer(admm_env%matrix_s_aux_fit)
643  IF (PRESENT(matrix_s_aux_fit_kp)) matrix_s_aux_fit_kp => get_2d_pointer(admm_env%matrix_s_aux_fit)
644  IF (PRESENT(matrix_s_aux_fit_vs_orb)) matrix_s_aux_fit_vs_orb => get_1d_pointer(admm_env%matrix_s_aux_fit_vs_orb)
645  IF (PRESENT(matrix_s_aux_fit_vs_orb_kp)) matrix_s_aux_fit_vs_orb_kp => get_2d_pointer(admm_env%matrix_s_aux_fit_vs_orb)
646  END SUBROUTINE get_admm_env
647 
648 ! **************************************************************************************************
649 !> \brief Set routine for the ADMM env
650 !> \param admm_env ...
651 !> \param mo_derivs_aux_fit ...
652 !> \param mos_aux_fit ...
653 !> \param sab_aux_fit ...
654 !> \param sab_aux_fit_asymm ...
655 !> \param sab_aux_fit_vs_orb ...
656 !> \param matrix_s_aux_fit ...
657 !> \param matrix_s_aux_fit_kp ...
658 !> \param matrix_s_aux_fit_vs_orb ...
659 !> \param matrix_s_aux_fit_vs_orb_kp ...
660 !> \param task_list_aux_fit ...
661 !> \param matrix_ks_aux_fit ...
662 !> \param matrix_ks_aux_fit_kp ...
663 !> \param matrix_ks_aux_fit_im ...
664 !> \param matrix_ks_aux_fit_dft ...
665 !> \param matrix_ks_aux_fit_hfx ...
666 !> \param matrix_ks_aux_fit_dft_kp ...
667 !> \param matrix_ks_aux_fit_hfx_kp ...
668 !> \param rho_aux_fit ...
669 !> \param rho_aux_fit_buffer ...
670 !> \param admm_dm ...
671 ! **************************************************************************************************
672  SUBROUTINE set_admm_env(admm_env, mo_derivs_aux_fit, mos_aux_fit, sab_aux_fit, sab_aux_fit_asymm, &
673  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, &
674  task_list_aux_fit, matrix_ks_aux_fit, matrix_ks_aux_fit_kp, matrix_ks_aux_fit_im, &
675  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, &
676  rho_aux_fit_buffer, admm_dm)
677 
678  TYPE(admm_type), INTENT(INOUT), POINTER :: admm_env
679  TYPE(cp_fm_type), DIMENSION(:), OPTIONAL, POINTER :: mo_derivs_aux_fit
680  TYPE(mo_set_type), DIMENSION(:), OPTIONAL, POINTER :: mos_aux_fit
681  TYPE(neighbor_list_set_p_type), DIMENSION(:), &
682  OPTIONAL, POINTER :: sab_aux_fit, sab_aux_fit_asymm, &
683  sab_aux_fit_vs_orb
684  TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
685  POINTER :: matrix_s_aux_fit
686  TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, &
687  POINTER :: matrix_s_aux_fit_kp
688  TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
689  POINTER :: matrix_s_aux_fit_vs_orb
690  TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, &
691  POINTER :: matrix_s_aux_fit_vs_orb_kp
692  TYPE(task_list_type), OPTIONAL, POINTER :: task_list_aux_fit
693  TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
694  POINTER :: matrix_ks_aux_fit
695  TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, &
696  POINTER :: matrix_ks_aux_fit_kp
697  TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
698  POINTER :: matrix_ks_aux_fit_im, &
699  matrix_ks_aux_fit_dft, &
700  matrix_ks_aux_fit_hfx
701  TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, &
702  POINTER :: matrix_ks_aux_fit_dft_kp, &
703  matrix_ks_aux_fit_hfx_kp
704  TYPE(qs_rho_type), OPTIONAL, POINTER :: rho_aux_fit, rho_aux_fit_buffer
705  TYPE(admm_dm_type), OPTIONAL, POINTER :: admm_dm
706 
707  cpassert(ASSOCIATED(admm_env))
708 
709  IF (PRESENT(mo_derivs_aux_fit)) admm_env%mo_derivs_aux_fit => mo_derivs_aux_fit
710  IF (PRESENT(mos_aux_fit)) admm_env%mos_aux_fit => mos_aux_fit
711  IF (PRESENT(sab_aux_fit)) admm_env%sab_aux_fit => sab_aux_fit
712  IF (PRESENT(sab_aux_fit_asymm)) admm_env%sab_aux_fit_asymm => sab_aux_fit_asymm
713  IF (PRESENT(sab_aux_fit_vs_orb)) admm_env%sab_aux_fit_vs_orb => sab_aux_fit_vs_orb
714  IF (PRESENT(task_list_aux_fit)) admm_env%task_list_aux_fit => task_list_aux_fit
715  IF (PRESENT(matrix_ks_aux_fit_im)) admm_env%matrix_ks_aux_fit_im => matrix_ks_aux_fit_im
716  IF (PRESENT(rho_aux_fit)) admm_env%rho_aux_fit => rho_aux_fit
717  IF (PRESENT(rho_aux_fit_buffer)) admm_env%rho_aux_fit_buffer => rho_aux_fit_buffer
718  IF (PRESENT(admm_dm)) admm_env%admm_dm => admm_dm
719 
720  IF (PRESENT(matrix_ks_aux_fit)) CALL set_1d_pointer(admm_env%matrix_ks_aux_fit, matrix_ks_aux_fit)
721  IF (PRESENT(matrix_ks_aux_fit_kp)) CALL set_2d_pointer(admm_env%matrix_ks_aux_fit, matrix_ks_aux_fit_kp)
722  IF (PRESENT(matrix_ks_aux_fit_dft)) CALL set_1d_pointer(admm_env%matrix_ks_aux_fit_dft, matrix_ks_aux_fit_dft)
723  IF (PRESENT(matrix_ks_aux_fit_dft_kp)) CALL set_2d_pointer(admm_env%matrix_ks_aux_fit_dft, matrix_ks_aux_fit_dft_kp)
724  IF (PRESENT(matrix_ks_aux_fit_hfx)) CALL set_1d_pointer(admm_env%matrix_ks_aux_fit_hfx, matrix_ks_aux_fit)
725  IF (PRESENT(matrix_ks_aux_fit_hfx_kp)) CALL set_2d_pointer(admm_env%matrix_ks_aux_fit_hfx, matrix_ks_aux_fit_hfx_kp)
726  IF (PRESENT(matrix_s_aux_fit)) CALL set_1d_pointer(admm_env%matrix_s_aux_fit, matrix_s_aux_fit)
727  IF (PRESENT(matrix_s_aux_fit_kp)) CALL set_2d_pointer(admm_env%matrix_s_aux_fit, matrix_s_aux_fit_kp)
728  IF (PRESENT(matrix_s_aux_fit_vs_orb)) CALL set_1d_pointer(admm_env%matrix_s_aux_fit_vs_orb, matrix_s_aux_fit_vs_orb)
729  IF (PRESENT(matrix_s_aux_fit_vs_orb_kp)) CALL set_2d_pointer(admm_env%matrix_s_aux_fit_vs_orb, matrix_s_aux_fit_vs_orb_kp)
730 
731  END SUBROUTINE set_admm_env
732 
733 END MODULE admm_types
734 
Types and set/get functions for auxiliary density matrix methods.
Definition: admm_dm_types.F:14
subroutine, public admm_dm_release(admm_dm)
Release a admm_dm type.
Definition: admm_dm_types.F:99
Types and set/get functions for auxiliary density matrix methods.
Definition: admm_types.F:15
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.
Definition: admm_types.F:593
subroutine, public set_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)
Set routine for the ADMM env.
Definition: admm_types.F:677
subroutine, public admm_env_release(admm_env)
releases the ADMM environment, cleans up all types
Definition: admm_types.F:426
subroutine, public admm_env_create(admm_env, admm_control, mos, para_env, natoms, nao_aux_fit, blacs_env_ext)
creates ADMM environment, initializes the basic types
Definition: admm_types.F:220
collects all references to literature in CP2K as new algorithms / method are included from literature...
Definition: bibliography.F:28
integer, save, public guidon2010
Definition: bibliography.F:43
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.
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_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
Definition: cp_fm_types.F:167
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_admm_purify_none
integer, parameter, public do_admm_blocking_purify_full
integer, parameter, public do_admm_blocked_projection
integer, parameter, public do_admm_aux_exch_func_none
integer, parameter, public do_admm_charge_constrained_projection
integer, parameter, public do_admm_exch_scaling_none
integer, parameter, public do_admm_exch_scaling_merlot
objects that represent the structure of input sections and the data contained in an input section
recursive subroutine, public section_vals_release(section_vals)
releases the given object
Defines the basic variable types.
Definition: kinds.F:23
integer, parameter, public dp
Definition: kinds.F:34
Datatype to translate between k-points (2d) and gamma-point (1d) code.
type(dbcsr_p_type) function, dimension(:), pointer, public get_1d_pointer(this)
Smart getter, raises an error when called during a k-point calculation.
type(dbcsr_p_type) function, dimension(:, :), pointer, public get_2d_pointer(this)
Simple getter, needed because of PRIVATE.
subroutine, public kpoint_transitional_release(this)
Release the matrix set, using the right pointer.
subroutine, public set_1d_pointer(this, ptr_1d)
Assigns a 1D pointer.
subroutine, public set_2d_pointer(this, ptr_2d)
Assigns a 2D pointer.
Interface to the message passing library MPI.
Define the quickstep kind type and their sub types.
Definition: qs_kind_types.F:23
subroutine, public deallocate_qs_kind_set(qs_kind_set)
Destructor routine for a set of qs kinds.
subroutine, public local_rho_set_release(local_rho_set)
...
Definition and initialisation of the mo data type.
Definition: qs_mo_types.F:22
subroutine, public deallocate_mo_set(mo_set)
Deallocate a wavefunction data structure.
Definition: qs_mo_types.F:352
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
Define the neighbor list data types and the corresponding functionality.
subroutine, public release_neighbor_list_sets(nlists)
releases an array of neighbor_list_sets
subroutine, public deallocate_oce_set(oce_set)
Deallocate the matrix set of oce coefficients.
Definition: qs_oce_types.F:98
superstucture that hold various representations of the density and keeps track of which ones are vali...
Definition: qs_rho_types.F:18
subroutine, public qs_rho_release(rho_struct)
releases a rho_struct by decreasing the reference count by one and deallocating if it reaches 0 (to b...
Definition: qs_rho_types.F:113
types for task lists
subroutine, public deallocate_task_list(task_list)
deallocates the components and the object itself