(git:33f85d8)
Loading...
Searching...
No Matches
qs_tddfpt2_smearing_methods.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
13 USE cp_dbcsr_api, ONLY: dbcsr_type
31 USE fermi_utils, ONLY: fermi
33 USE kinds, ONLY: dp
38 USE qs_mo_types, ONLY: get_mo_set,&
43#include "./base/base_uses.f90"
44
45 IMPLICIT NONE
46
47 PRIVATE
48
49 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_tddfpt2_smearing_methods'
50
51 LOGICAL, PARAMETER, PRIVATE :: debug_this_module = .false.
52
53 PUBLIC :: tddfpt_smeared_occupation, &
56
57CONTAINS
58
59! **************************************************************************************************
60!> \brief ...
61!> \param qs_env ...
62!> \param gs_mos ...
63!> \param log_unit ...
64! **************************************************************************************************
65 SUBROUTINE tddfpt_smeared_occupation(qs_env, gs_mos, log_unit)
66
67 TYPE(qs_environment_type), POINTER :: qs_env
68 TYPE(tddfpt_ground_state_mos), DIMENSION(:), &
69 INTENT(IN), POINTER :: gs_mos
70 INTEGER, INTENT(in) :: log_unit
71
72 CHARACTER(len=*), PARAMETER :: routinen = 'tddfpt_smeared_occupation'
73
74 INTEGER :: handle, iocc, ispin, nspins
75 INTEGER, ALLOCATABLE, DIMENSION(:) :: nocc, nvirt
76 REAL(kind=dp), DIMENSION(:), POINTER :: mo_evals, occup
77 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
78 TYPE(scf_control_type), POINTER :: scf_control
79 TYPE(smear_type), POINTER :: smear
80
81 CALL timeset(routinen, handle)
82
83 nspins = SIZE(gs_mos)
84
85 NULLIFY (mos, scf_control)
86 CALL get_qs_env(qs_env, mos=mos, scf_control=scf_control)
87 NULLIFY (smear)
88 IF (ASSOCIATED(qs_env%scf_control%smear)) THEN
89 smear => qs_env%scf_control%smear
90 ELSE
91 cpabort("Smeared input section no longer associated.")
92 END IF
93
94 IF (debug_this_module) THEN
95 NULLIFY (mo_evals, occup)
96 ALLOCATE (nocc(nspins), nvirt(nspins))
97 DO ispin = 1, nspins
98 CALL get_mo_set(mos(ispin), eigenvalues=mo_evals, occupation_numbers=occup)
99 CALL cp_fm_get_info(gs_mos(ispin)%mos_occ, ncol_global=nocc(ispin))
100 CALL cp_fm_get_info(gs_mos(ispin)%mos_virt, ncol_global=nvirt(ispin))
101 IF (log_unit > 0) THEN
102 DO iocc = 1, nocc(ispin)
103 WRITE (log_unit, '(A,F14.5)') "Occupation numbers", occup(iocc)
104 END DO
105 END IF
106 END DO
107 END IF
108
109 CALL allocate_fermi_params(qs_env, gs_mos)
110 CALL compute_fermia(qs_env, gs_mos, log_unit)
111
112 CALL timestop(handle)
113
114 END SUBROUTINE tddfpt_smeared_occupation
115! **************************************************************************************************
116!> \brief ...
117!> \param qs_env ...
118!> \param gs_mos ...
119!> \param log_unit ...
120! **************************************************************************************************
121 SUBROUTINE compute_fermia(qs_env, gs_mos, log_unit)
122
123 TYPE(qs_environment_type), POINTER :: qs_env
124 TYPE(tddfpt_ground_state_mos), DIMENSION(:), &
125 INTENT(IN), POINTER :: gs_mos
126 INTEGER, INTENT(IN) :: log_unit
127
128 CHARACTER(len=*), PARAMETER :: routinen = 'compute_fermia'
129
130 INTEGER :: handle, iocc, ispin, nspins
131 INTEGER, ALLOCATABLE, DIMENSION(:) :: nocc
132 REAL(kind=dp) :: maxvalue, mu
133 REAL(kind=dp), DIMENSION(:), POINTER :: fermia, mo_evals, occup
134 TYPE(dft_control_type), POINTER :: dft_control
135 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
136 TYPE(scf_control_type), POINTER :: scf_control
137 TYPE(smear_type), POINTER :: smear
138 TYPE(tddfpt2_control_type), POINTER :: tddfpt_control
139
140 CALL timeset(routinen, handle)
141
142 NULLIFY (mos, dft_control, tddfpt_control, scf_control)
143 CALL get_qs_env(qs_env, dft_control=dft_control, scf_control=scf_control)
144 tddfpt_control => dft_control%tddfpt2_control
145
146 CALL get_qs_env(qs_env, mos=mos)
147 nspins = SIZE(mos)
148
149 NULLIFY (smear)
150 IF (ASSOCIATED(qs_env%scf_control%smear)) THEN
151 smear => qs_env%scf_control%smear
152 ELSE
153 cpabort("Smeared input section no longer associated.")
154 END IF
155
156 IF (debug_this_module .AND. (log_unit > 0)) THEN
157 WRITE (log_unit, '(A,F14.5)') "Smearing temperature", smear%electronic_temperature
158 END IF
159
160 NULLIFY (mo_evals, occup)
161 ALLOCATE (nocc(nspins))
162 DO ispin = 1, nspins
163 CALL get_mo_set(mos(ispin), eigenvalues=mo_evals, occupation_numbers=occup, mu=mu)
164 CALL cp_fm_get_info(gs_mos(ispin)%mos_occ, ncol_global=nocc(ispin))
165 END DO
166
167 DO ispin = 1, nspins
168 fermia => tddfpt_control%smeared_occup(ispin)%fermia
169 DO iocc = 1, nocc(ispin)
170 maxvalue = mu + 3.0_dp*smear%electronic_temperature - mo_evals(iocc)
171
172 fermia(iocc) = max(0.0_dp, maxvalue)
173 IF (debug_this_module) THEN
174 IF (log_unit > 0) WRITE (log_unit, '(A,F14.5)') "Fermi smearing parameter alpha", fermia(iocc)
175 END IF
176 END DO
177 END DO
178
179 CALL timestop(handle)
180 END SUBROUTINE compute_fermia
181! **************************************************************************************************
182
183! **************************************************************************************************
184!> \brief ...
185!> \param qs_env ...
186!> \param Aop_evects ...
187!> \param evects ...
188!> \param S_evects ...
189!> \param mos_occ ...
190!> \param fermia ...
191!> \param matrix_s ...
192! **************************************************************************************************
193 SUBROUTINE add_smearing_aterm(qs_env, Aop_evects, evects, S_evects, mos_occ, fermia, matrix_s)
194
195 TYPE(qs_environment_type), POINTER :: qs_env
196 TYPE(cp_fm_type), INTENT(in) :: aop_evects, evects, s_evects, mos_occ
197 REAL(kind=dp), DIMENSION(:), POINTER :: fermia
198 TYPE(dbcsr_type), POINTER :: matrix_s
199
200 CHARACTER(len=*), PARAMETER :: routinen = 'add_smearing_aterm'
201
202 INTEGER :: handle, iounit, nactive, nao
203 TYPE(cp_fm_struct_type), POINTER :: matrix_struct, matrix_struct_tmp
204 TYPE(cp_fm_type) :: ccsxvec, csxvec, cvec, sccsxvec
205 TYPE(cp_logger_type), POINTER :: logger
206 TYPE(dft_control_type), POINTER :: dft_control
207 TYPE(tddfpt2_control_type), POINTER :: tddfpt_control
208
209 CALL timeset(routinen, handle)
210
211 NULLIFY (logger)
212 logger => cp_get_default_logger()
213 iounit = cp_logger_get_default_io_unit(logger)
214
215 NULLIFY (dft_control, tddfpt_control)
216 CALL get_qs_env(qs_env, dft_control=dft_control)
217 tddfpt_control => dft_control%tddfpt2_control
218
219 CALL cp_fm_get_info(matrix=evects, matrix_struct=matrix_struct, &
220 nrow_global=nao, ncol_global=nactive)
221 CALL cp_fm_create(ccsxvec, matrix_struct)
222 CALL cp_fm_create(sccsxvec, matrix_struct)
223 CALL cp_fm_create(cvec, matrix_struct)
224
225 NULLIFY (matrix_struct_tmp)
226 CALL cp_fm_struct_create(matrix_struct_tmp, nrow_global=nactive, &
227 ncol_global=nactive, template_fmstruct=matrix_struct)
228 CALL cp_fm_create(csxvec, matrix_struct_tmp)
229 CALL cp_fm_struct_release(fmstruct=matrix_struct_tmp)
230
231 CALL parallel_gemm('T', 'N', nactive, nactive, nao, 1.0_dp, &
232 mos_occ, s_evects, 0.0_dp, csxvec)
233 CALL cp_fm_to_fm(mos_occ, cvec)
234
235 CALL cp_fm_column_scale(cvec, fermia)
236 CALL parallel_gemm('N', 'N', nao, nactive, nactive, 1.0_dp, &
237 cvec, csxvec, 0.0_dp, ccsxvec)
238
239 ! alpha S C C^T S X
240 CALL cp_dbcsr_sm_fm_multiply(matrix_s, ccsxvec, &
241 sccsxvec, ncol=nactive, alpha=1.0_dp, beta=0.0_dp)
242 CALL cp_fm_scale_and_add(1.0_dp, aop_evects, 1.0_dp, sccsxvec)
243
244 CALL cp_fm_release(sccsxvec)
245 CALL cp_fm_release(ccsxvec)
246 CALL cp_fm_release(csxvec)
247 CALL cp_fm_release(cvec)
248
249 CALL timestop(handle)
250 END SUBROUTINE add_smearing_aterm
251! **************************************************************************************************
252!> \brief ...
253!> \param qs_env ...
254!> \param gs_mos ...
255!> \param evals ...
256! **************************************************************************************************
257 SUBROUTINE compute_fermib(qs_env, gs_mos, evals)
258
259 TYPE(qs_environment_type), POINTER :: qs_env
260 TYPE(tddfpt_ground_state_mos), DIMENSION(:), &
261 INTENT(IN) :: gs_mos
262 REAL(kind=dp), INTENT(in) :: evals
263
264 CHARACTER(len=*), PARAMETER :: routinen = 'compute_fermib'
265
266 INTEGER :: handle, iocc, iounit, ispin, jocc, &
267 nactive, nspins
268 REAL(kind=dp) :: dummykts, nelec
269 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: interocc, occup_im
270 REAL(kind=dp), DIMENSION(:), POINTER :: fermia, mo_evals, occup, occuptmp
271 REAL(kind=dp), DIMENSION(:, :), POINTER :: fermib
272 TYPE(cp_logger_type), POINTER :: logger
273 TYPE(dft_control_type), POINTER :: dft_control
274 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
275 TYPE(scf_control_type), POINTER :: scf_control
276 TYPE(smear_type), POINTER :: smear
277 TYPE(tddfpt2_control_type), POINTER :: tddfpt_control
278
279 CALL timeset(routinen, handle)
280
281 NULLIFY (logger)
282 logger => cp_get_default_logger()
283 iounit = cp_logger_get_default_io_unit(logger)
284
285 NULLIFY (mos, scf_control)
286 CALL get_qs_env(qs_env, mos=mos, scf_control=scf_control)
287 NULLIFY (smear)
288 IF (ASSOCIATED(qs_env%scf_control%smear)) THEN
289 smear => qs_env%scf_control%smear
290 ELSE
291 cpabort("Smeared input section no longer associated.")
292 END IF
293
294 NULLIFY (dft_control, tddfpt_control)
295 CALL get_qs_env(qs_env, dft_control=dft_control)
296 tddfpt_control => dft_control%tddfpt2_control
297
298 NULLIFY (fermib, fermia)
299 nspins = SIZE(gs_mos)
300
301 DO ispin = 1, nspins
302
303 fermib => dft_control%tddfpt2_control%smeared_occup(ispin)%fermib
304 fermia => dft_control%tddfpt2_control%smeared_occup(ispin)%fermia
305 fermib = 0.0_dp
306
307 ! get theta_Fi
308 NULLIFY (mo_evals, occup)
309 CALL get_mo_set(mos(ispin), eigenvalues=mo_evals, occupation_numbers=occup)
310 CALL cp_fm_get_info(gs_mos(ispin)%mos_occ, ncol_global=nactive)
311
312 IF (smear%fixed_mag_mom == -1.0_dp) THEN
313 nelec = real(mos(ispin)%nelectron, dp)
314 ELSE
315 nelec = mos(ispin)%n_el_f
316 END IF
317
318 ! compute theta_im
319 NULLIFY (occuptmp)
320 CALL get_mo_set(mos(ispin), occupation_numbers=occuptmp)
321 ALLOCATE (occup_im(nactive, nactive), interocc(nactive, nactive))
322
323 DO iocc = 1, nactive
324 IF (smear%method .EQ. smear_fermi_dirac) THEN
325 ! Different prefactor in comparison to Octopus !
326 CALL fermi(occuptmp, nelec, dummykts, mos(ispin)%eigenvalues, mos(ispin)%eigenvalues(iocc), &
327 smear%electronic_temperature, mos(ispin)%maxocc)
328 ELSE
329 cpabort("TDDFT with smearing only works with Fermi-Dirac distribution.")
330 END IF
331 DO jocc = 1, nactive
332 occup_im(iocc, jocc) = occuptmp(jocc)
333 END DO
334 END DO
335
336 ! compute fermib
337 DO iocc = 1, nactive
338 DO jocc = 1, nactive
339 interocc(iocc, jocc) = (occup(iocc) - occup(jocc))/(mo_evals(iocc) - mo_evals(jocc) - evals)
340 fermib(iocc, jocc) = fermib(iocc, jocc) + occup(iocc)*occup_im(iocc, jocc) &
341 + occup(jocc)*occup_im(jocc, iocc) &
342 + fermia(jocc)*interocc(iocc, jocc)*occup_im(jocc, iocc)
343 END DO
344 END DO
345
346 IF (debug_this_module .AND. (iounit > 0)) THEN
347 DO iocc = 1, nactive
348 DO jocc = 1, nactive
349 WRITE (iounit, '(A,F14.5)') "Fermi smearing parameter beta,", fermib(iocc, jocc)
350 END DO
351 END DO
352 END IF
353
354 DEALLOCATE (occup_im)
355 DEALLOCATE (interocc)
356
357 END DO ! ispin
358
359 CALL timestop(handle)
360 END SUBROUTINE compute_fermib
361! **************************************************************************************************
362!> \brief ...
363!> \param qs_env ...
364!> \param gs_mos ...
365! **************************************************************************************************
366 SUBROUTINE allocate_fermi_params(qs_env, gs_mos)
367
368 TYPE(qs_environment_type), POINTER :: qs_env
369 TYPE(tddfpt_ground_state_mos), DIMENSION(:), &
370 INTENT(IN), POINTER :: gs_mos
371
372 CHARACTER(len=*), PARAMETER :: routinen = 'allocate_fermi_params'
373
374 INTEGER :: handle, ispin, nocc, nspins
375 TYPE(dft_control_type), POINTER :: dft_control
376 TYPE(smeared_type), DIMENSION(:), POINTER :: smeared_occup
377 TYPE(tddfpt2_control_type), POINTER :: tddfpt_control
378
379 CALL timeset(routinen, handle)
380
381 NULLIFY (dft_control, tddfpt_control)
382 CALL get_qs_env(qs_env, dft_control=dft_control)
383 tddfpt_control => dft_control%tddfpt2_control
384
385 NULLIFY (smeared_occup)
386 smeared_occup => dft_control%tddfpt2_control%smeared_occup
387 nspins = SIZE(gs_mos)
388 ALLOCATE (smeared_occup(nspins))
389
390 DO ispin = 1, nspins
391 CALL cp_fm_get_info(gs_mos(ispin)%mos_occ, ncol_global=nocc)
392 ALLOCATE (smeared_occup(ispin)%fermia(nocc))
393 ALLOCATE (smeared_occup(ispin)%fermib(nocc, nocc))
394 END DO
395 dft_control%tddfpt2_control%smeared_occup => smeared_occup
396
397 CALL timestop(handle)
398 END SUBROUTINE allocate_fermi_params
399! **************************************************************************************************
400!> \brief ...
401!> \param smeared_occup ...
402! **************************************************************************************************
403 SUBROUTINE deallocate_fermi_params(smeared_occup)
404
405 TYPE(smeared_type), DIMENSION(:), POINTER :: smeared_occup
406
407 INTEGER :: ispin
408
409 IF (ASSOCIATED(smeared_occup)) THEN
410 DO ispin = 1, SIZE(smeared_occup)
411 IF (ASSOCIATED(smeared_occup(ispin)%fermia)) THEN
412 DEALLOCATE (smeared_occup(ispin)%fermia)
413 DEALLOCATE (smeared_occup(ispin)%fermib)
414 NULLIFY (smeared_occup(ispin)%fermia, smeared_occup(ispin)%fermib)
415 END IF
416 END DO
417 DEALLOCATE (smeared_occup)
418 NULLIFY (smeared_occup)
419 END IF
420
421 END SUBROUTINE deallocate_fermi_params
422! **************************************************************************************************
423!> \brief ...
424!> \param evects ...
425!> \param qs_env ...
426!> \param mos_occ ...
427!> \param S_C0 ...
428! **************************************************************************************************
429 SUBROUTINE orthogonalize_smeared_occupation(evects, qs_env, mos_occ, S_C0)
430
431 TYPE(cp_fm_type), DIMENSION(:), INTENT(in) :: evects
432 TYPE(qs_environment_type), POINTER :: qs_env
433 TYPE(cp_fm_type), DIMENSION(:), INTENT(in) :: mos_occ, s_c0
434
435 CHARACTER(LEN=*), PARAMETER :: routinen = 'orthogonalize_smeared_occupation'
436
437 INTEGER :: handle, iocc, iounit, ispin, nactive, &
438 nao, nspins
439 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: bscale
440 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: evortholocal, subevects, subevectsresult
441 REAL(kind=dp), DIMENSION(:), POINTER :: occup
442 REAL(kind=dp), DIMENSION(:, :), POINTER :: fermib
443 TYPE(cp_blacs_env_type), POINTER :: blacs_env_global
444 TYPE(cp_fm_struct_type), POINTER :: matrix_struct
445 TYPE(cp_fm_type) :: betascc, cvec, evortho, subevectsfm, &
446 subevectsresultfm
447 TYPE(cp_fm_type), POINTER :: mo_coeff
448 TYPE(cp_logger_type), POINTER :: logger
449 TYPE(dft_control_type), POINTER :: dft_control
450 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
451 TYPE(mp_para_env_type), POINTER :: para_env
452 TYPE(tddfpt2_control_type), POINTER :: tddfpt_control
453
454 CALL timeset(routinen, handle)
455
456 NULLIFY (logger)
457 logger => cp_get_default_logger()
458 iounit = cp_logger_get_default_io_unit(logger)
459
460 NULLIFY (mos)
461 CALL get_qs_env(qs_env, mos=mos)
462 NULLIFY (dft_control, tddfpt_control)
463 CALL get_qs_env(qs_env, dft_control=dft_control)
464 tddfpt_control => dft_control%tddfpt2_control
465
466 CALL cp_fm_get_info(matrix=evects(1), matrix_struct=matrix_struct, &
467 nrow_global=nao, ncol_global=nactive)
468 CALL cp_fm_create(evortho, matrix_struct)
469
470 nspins = SIZE(evects)
471 NULLIFY (para_env)
472 CALL cp_fm_get_info(evects(1), para_env=para_env, context=blacs_env_global)
473
474 NULLIFY (matrix_struct)
475 CALL cp_fm_struct_create(matrix_struct, nrow_global=nao, ncol_global=nao, context=blacs_env_global)
476 CALL cp_fm_create(betascc, matrix_struct)
477 CALL cp_fm_struct_release(fmstruct=matrix_struct)
478
479 ALLOCATE (evortholocal(nao, nactive))
480 ALLOCATE (bscale(nactive))
481
482 DO ispin = 1, nspins
483 NULLIFY (matrix_struct)
484 CALL cp_fm_get_info(matrix=mos_occ(ispin), matrix_struct=matrix_struct)
485 CALL cp_fm_create(cvec, matrix_struct)
486
487 NULLIFY (occup)
488 CALL get_mo_set(mos(ispin), occupation_numbers=occup, mo_coeff=mo_coeff)
489
490 NULLIFY (fermib)
491 IF (.NOT. ASSOCIATED(dft_control%tddfpt2_control%smeared_occup)) THEN
492 cpabort("Smeared occupation intermediates not associated.")
493 END IF
494 fermib => dft_control%tddfpt2_control%smeared_occup(ispin)%fermib
495
496 DO iocc = 1, nactive
497 CALL cp_fm_copy_general(mos_occ(ispin), cvec, para_env)
498 bscale(:) = fermib(iocc, :)
499 CALL cp_fm_column_scale(cvec, bscale)
500
501 CALL parallel_gemm('N', 'T', nao, nao, nactive, 1.0_dp, cvec, s_c0(ispin), 0.0_dp, betascc)
502
503 ! get ith column of X
504 NULLIFY (matrix_struct)
505 CALL cp_fm_struct_create(matrix_struct, nrow_global=nao, ncol_global=1, context=blacs_env_global)
506 CALL cp_fm_create(subevectsfm, matrix_struct)
507 CALL cp_fm_create(subevectsresultfm, matrix_struct)
508 CALL cp_fm_struct_release(fmstruct=matrix_struct)
509
510 ALLOCATE (subevects(nao, 1))
511 ALLOCATE (subevectsresult(nao, 1))
512 CALL cp_fm_get_submatrix(fm=evects(1), target_m=subevects, &
513 start_row=1, start_col=iocc, n_rows=nao, n_cols=1)
514 CALL cp_fm_set_submatrix(subevectsfm, subevects, &
515 start_row=1, start_col=1, n_rows=nao, n_cols=1)
516
517 CALL parallel_gemm('N', 'N', nao, 1, nao, 1.0_dp, betascc, &
518 subevectsfm, 0.0_dp, subevectsresultfm)
519
520 CALL cp_fm_get_submatrix(fm=subevectsresultfm, target_m=subevectsresult, &
521 start_row=1, start_col=1, n_rows=nao, n_cols=1)
522 CALL cp_fm_set_submatrix(evortho, subevectsresult, &
523 start_row=1, start_col=iocc, n_rows=nao, n_cols=1)
524 DEALLOCATE (subevects, subevectsresult)
525 CALL cp_fm_release(subevectsfm)
526 CALL cp_fm_release(subevectsresultfm)
527 END DO ! iocc
528 END DO ! nspins
529
530 CALL cp_fm_column_scale(evects(1), occup)
531 CALL cp_fm_scale_and_add(1.0_dp, evects(1), -1.0_dp, evortho)
532
533 DEALLOCATE (bscale)
534 DEALLOCATE (evortholocal)
535
536 CALL cp_fm_release(betascc)
537 CALL cp_fm_release(cvec)
538
539 CALL cp_fm_release(evortho)
540
541 CALL timestop(handle)
543
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
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
basic linear algebra operations for full matrices
subroutine, public cp_fm_column_scale(matrixa, scaling)
scales column i of matrix a with scaling(i)
subroutine, public cp_fm_scale_and_add(alpha, matrix_a, beta, matrix_b)
calc A <- alpha*A + beta*B optimized for alpha == 1.0 (just add beta*B) and beta == 0....
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
Definition cp_fm_types.F:15
subroutine, public cp_fm_copy_general(source, destination, para_env)
General copy of a fm matrix to another fm matrix. Uses non-blocking MPI rather than ScaLAPACK.
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_submatrix(fm, new_values, start_row, start_col, n_rows, n_cols, alpha, beta, transpose)
sets a submatrix of a full matrix fm(start_row:start_row+n_rows,start_col:start_col+n_cols) = alpha*o...
subroutine, public cp_fm_get_submatrix(fm, target_m, start_row, start_col, n_rows, n_cols, transpose)
gets a submatrix of a full matrix op(target_m)(1:n_rows,1:n_cols) =fm(start_row:start_row+n_rows,...
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
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 ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
deal with the Fermi distribution, compute it, fix mu, get derivs
Definition fermi_utils.F:13
subroutine, public fermi(f, n, kts, e, mu, t, maxocc, estate, festate)
returns occupations according to Fermi-Dirac statistics for a given set of energies and fermi level....
Definition fermi_utils.F:48
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public smear_fermi_dirac
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Interface to the message passing library MPI.
basic linear algebra operations for full matrixes
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, 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, 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)
Get the QUICKSTEP environment.
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.
subroutine, public add_smearing_aterm(qs_env, aop_evects, evects, s_evects, mos_occ, fermia, matrix_s)
...
subroutine, public compute_fermib(qs_env, gs_mos, evals)
...
subroutine, public tddfpt_smeared_occupation(qs_env, gs_mos, log_unit)
...
subroutine, public deallocate_fermi_params(smeared_occup)
...
subroutine, public orthogonalize_smeared_occupation(evects, qs_env, mos_occ, s_c0)
...
parameters that control an scf iteration
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
represent 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
Ground state molecular orbitals.
contains the parameters needed by a scf run