(git:ed6f26b)
Loading...
Searching...
No Matches
rt_delta_pulse.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
8! **************************************************************************************************
9!> \brief Routines to apply a delta pulse for RTP and EMD
10! **************************************************************************************************
11
13 USE bibliography, ONLY: mattiat2019,&
15 cite_reference
16 USE cell_types, ONLY: cell_type
21 USE cp_cfm_diag, ONLY: cp_cfm_heevd
22 USE cp_cfm_types, ONLY: cp_cfm_create,&
28 USE cp_dbcsr_api, ONLY: &
30 dbcsr_init_p, dbcsr_p_type, dbcsr_set, dbcsr_type, dbcsr_type_antisymmetric, &
31 dbcsr_type_symmetric
44 USE cp_fm_diag, ONLY: cp_fm_syevd
48 USE cp_fm_types, ONLY: cp_fm_create,&
62 USE kinds, ONLY: dp
63 USE mathconstants, ONLY: one,&
64 twopi,&
65 zero
74 USE qs_mo_types, ONLY: get_mo_set,&
80 USE rt_propagation_types, ONLY: get_rtp,&
83#include "../base/base_uses.f90"
84
85 IMPLICIT NONE
86
87 PRIVATE
88
89 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'rt_delta_pulse'
90
91 PUBLIC :: apply_delta_pulse
92
93CONTAINS
94
95! **************************************************************************************************
96!> \brief Interface to call the delta pulse depending on the type of calculation.
97!> \param qs_env ...
98!> \param rtp ...
99!> \param rtp_control ...
100!> \author Update: Guillaume Le Breton (2023.01)
101! **************************************************************************************************
102
103 SUBROUTINE apply_delta_pulse(qs_env, rtp, rtp_control)
104 TYPE(qs_environment_type), POINTER :: qs_env
105 TYPE(rt_prop_type), POINTER :: rtp
106 TYPE(rtp_control_type), POINTER :: rtp_control
107
108 CHARACTER(LEN=3), DIMENSION(3) :: rlab
109 INTEGER :: i, output_unit
110 LOGICAL :: my_apply_pulse, periodic
111 REAL(kind=dp), DIMENSION(3) :: kvec
112 TYPE(cell_type), POINTER :: cell
113 TYPE(cp_fm_type), DIMENSION(:), POINTER :: mos_new, mos_old
114 TYPE(cp_logger_type), POINTER :: logger
115 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_s
116 TYPE(dft_control_type), POINTER :: dft_control
117 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
118 TYPE(section_vals_type), POINTER :: input, rtp_section
119
120 NULLIFY (logger, input, rtp_section)
121
122 logger => cp_get_default_logger()
123 CALL get_qs_env(qs_env, &
124 cell=cell, &
125 input=input, &
126 dft_control=dft_control, &
127 matrix_s=matrix_s)
128 rtp_section => section_vals_get_subs_vals(input, "DFT%REAL_TIME_PROPAGATION")
129 output_unit = cp_print_key_unit_nr(logger, rtp_section, "PRINT%PROGRAM_RUN_INFO", &
130 extension=".scfLog")
131 rlab = [CHARACTER(LEN=3) :: "X", "Y", "Z"]
132 periodic = any(cell%perd > 0) ! periodic cell
133 my_apply_pulse = .true.
134 CALL get_qs_env(qs_env, mos=mos)
135
136 IF (rtp%linear_scaling) THEN
137 IF (.NOT. ASSOCIATED(mos)) THEN
138 CALL cp_warn(__location__, "Delta Pulse not implemented for Linear-Scaling based ground "// &
139 "state calculation. If you want to perform a Linear-Scaling RTP from a "// &
140 "Linear-Scaling GS calculation you can do the following: (i) LSCF froms "// &
141 "scratch, (ii) MO-based SCF (for 1 SCF loop for instance) with the LSCF "// &
142 "result as a restart and (iii) linear scaling RTP + delta kick (for 1 "// &
143 "SCF loop for instance).")
144 my_apply_pulse = .false.
145 ELSE
146 ! create temporary mos_old and mos_new to use delta kick routine designed for MOs-based RTP
147 CALL rt_prop_create_mos(rtp, mos, qs_env%mpools, dft_control, &
148 init_mos_old=.true., init_mos_new=.true., &
149 init_mos_next=.false., init_mos_admn=.false.)
150 END IF
151 END IF
152
153 IF (my_apply_pulse) THEN
154 ! The amplitude of the perturbation for all the method, modulo some prefactor:
155 kvec(:) = cell%h_inv(1, :)*rtp_control%delta_pulse_direction(1) + &
156 cell%h_inv(2, :)*rtp_control%delta_pulse_direction(2) + &
157 cell%h_inv(3, :)*rtp_control%delta_pulse_direction(3)
158 kvec = kvec*twopi*rtp_control%delta_pulse_scale
159
160 CALL get_rtp(rtp=rtp, mos_old=mos_old, mos_new=mos_new)
161 IF (rtp_control%apply_delta_pulse) THEN
162 IF (dft_control%qs_control%dftb) &
163 CALL build_dftb_overlap(qs_env, 1, matrix_s)
164 IF (rtp_control%periodic) THEN
165 IF (output_unit > 0) THEN
166 WRITE (unit=output_unit, fmt="(/,(T3,A,T40))") &
167 "An Electric Delta Kick within periodic condition is applied before running RTP. "// &
168 "Its amplitude in atomic unit is:"
169 WRITE (output_unit, "(T3,3(A,A,E16.8,1X))") &
170 (trim(rlab(i)), "=", -kvec(i), i=1, 3)
171 END IF
172 CALL apply_delta_pulse_electric_periodic(qs_env, mos_old, mos_new, -kvec)
173 ELSE
174 cpwarn_if(periodic, "This application of the delta pulse is not compatible with PBC!")
175 IF (output_unit > 0) THEN
176 WRITE (unit=output_unit, fmt="(/,(T3,A,T40))") &
177 "An Electric Delta Kick within the length gauge is applied before running RTP. "// &
178 "Its amplitude in atomic unit is:"
179 WRITE (output_unit, "(T3,3(A,A,E16.8,1X))") &
180 (trim(rlab(i)), "=", -kvec(i), i=1, 3)
181 END IF
182 CALL apply_delta_pulse_electric(qs_env, mos_old, mos_new, -kvec)
183 END IF
184 ELSE IF (rtp_control%apply_delta_pulse_mag) THEN
185 cpwarn_if(periodic, "This application of the delta pulse is not compatible with PBC!")
186 ! The prefactor (strength of the magnetic field, should be divided by 2c)
187 IF (output_unit > 0) THEN
188 WRITE (unit=output_unit, fmt="(/,(T3,A,T40))") &
189 "A Magnetic Delta Kick is applied before running RTP. "// &
190 "Its amplitude in atomic unit is:"
191 WRITE (output_unit, "(T3,3(A,A,E16.8,1X))") &
192 (trim(rlab(i)), "=", -kvec(i)/2, i=1, 3)
193 END IF
194 CALL apply_delta_pulse_mag(qs_env, mos_old, mos_new, -kvec(:)/2)
195 ELSE
196 cpabort("Code error: this case should not happen!")
197 END IF
198 END IF
199
200 END SUBROUTINE apply_delta_pulse
201
202! **************************************************************************************************
203!> \brief uses perturbation theory to get the proper initial conditions
204!> The len_rep option is NOT compatible with periodic boundary conditions!
205!> \param qs_env ...
206!> \param mos_old ...
207!> \param mos_new ...
208!> \param kvec ...
209!> \author Joost & Martin (2011)
210! **************************************************************************************************
211
212 SUBROUTINE apply_delta_pulse_electric_periodic(qs_env, mos_old, mos_new, kvec)
213 TYPE(qs_environment_type), POINTER :: qs_env
214 TYPE(cp_fm_type), DIMENSION(:), POINTER :: mos_old, mos_new
215 REAL(kind=dp), DIMENSION(3) :: kvec
216
217 CHARACTER(len=*), PARAMETER :: routinen = 'apply_delta_pulse_electric_periodic'
218
219 INTEGER :: handle, icol, idir, irow, ispin, nao, &
220 ncol_local, nmo, nrow_local, nvirt, &
221 reference
222 INTEGER, DIMENSION(:), POINTER :: col_indices, row_indices
223 LOGICAL :: com_nl, len_rep, periodic
224 REAL(kind=dp) :: eps_ppnl, factor
225 REAL(kind=dp), CONTIGUOUS, DIMENSION(:, :), &
226 POINTER :: local_data
227 REAL(kind=dp), DIMENSION(3) :: rcc
228 REAL(kind=dp), DIMENSION(:), POINTER :: eigenvalues, ref_point
229 TYPE(cell_type), POINTER :: cell
230 TYPE(cp_fm_struct_type), POINTER :: fm_struct, fm_struct_tmp
231 TYPE(cp_fm_type) :: eigenvectors, mat_ks, mat_tmp, momentum, &
232 s_chol, virtuals
233 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_ks, matrix_r, matrix_rv, matrix_s
234 TYPE(dft_control_type), POINTER :: dft_control
235 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
236 TYPE(neighbor_list_set_p_type), DIMENSION(:), &
237 POINTER :: sab_orb, sap_ppnl
238 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
239 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
240 TYPE(rt_prop_type), POINTER :: rtp
241 TYPE(rtp_control_type), POINTER :: rtp_control
242 TYPE(section_vals_type), POINTER :: input
243
244 CALL timeset(routinen, handle)
245
246 NULLIFY (cell, mos, rtp, matrix_s, matrix_ks, input, dft_control, particle_set, fm_struct)
247 ! we need the overlap and ks matrix for a full diagonalization
248 CALL get_qs_env(qs_env, &
249 cell=cell, &
250 mos=mos, &
251 rtp=rtp, &
252 matrix_s=matrix_s, &
253 matrix_ks=matrix_ks, &
254 dft_control=dft_control, &
255 input=input, &
256 particle_set=particle_set)
257
258 rtp_control => dft_control%rtp_control
259 periodic = any(cell%perd > 0) ! periodic cell
260
261 ! relevant input parameters
262 com_nl = section_get_lval(section_vals=input, keyword_name="DFT%REAL_TIME_PROPAGATION%COM_NL")
263 len_rep = section_get_lval(section_vals=input, keyword_name="DFT%REAL_TIME_PROPAGATION%LEN_REP")
264
265 ! calculate non-local commutator if necessary
266 IF (com_nl) THEN
267 CALL cite_reference(mattiat2019)
268 NULLIFY (qs_kind_set, sab_orb, sap_ppnl)
269 CALL get_qs_env(qs_env, &
270 sap_ppnl=sap_ppnl, &
271 sab_orb=sab_orb, &
272 qs_kind_set=qs_kind_set)
273 eps_ppnl = dft_control%qs_control%eps_ppnl
274
275 NULLIFY (matrix_rv)
276 CALL dbcsr_allocate_matrix_set(matrix_rv, 3)
277 DO idir = 1, 3
278 CALL dbcsr_init_p(matrix_rv(idir)%matrix)
279 CALL dbcsr_create(matrix_rv(idir)%matrix, template=matrix_s(1)%matrix, &
280 matrix_type=dbcsr_type_antisymmetric)
281 CALL cp_dbcsr_alloc_block_from_nbl(matrix_rv(idir)%matrix, sab_orb)
282 CALL dbcsr_set(matrix_rv(idir)%matrix, 0._dp)
283 END DO
284 CALL build_com_mom_nl(qs_kind_set, sab_orb, sap_ppnl, eps_ppnl, particle_set, cell, matrix_rv=matrix_rv)
285 END IF
286
287 ! calculate dipole moment matrix if required, NOT for periodic boundary conditions!
288 IF (len_rep) THEN
289 CALL cite_reference(mattiat2022)
290 cpwarn_if(periodic, "This application of the delta pulse is not compatible with PBC!")
291 ! get reference point
292 reference = section_get_ival(section_vals=input, &
293 keyword_name="DFT%PRINT%MOMENTS%REFERENCE")
294 NULLIFY (ref_point)
295 CALL section_vals_val_get(input, "DFT%PRINT%MOMENTS%REF_POINT", r_vals=ref_point)
296 CALL get_reference_point(rcc, qs_env=qs_env, reference=reference, ref_point=ref_point)
297
298 NULLIFY (sab_orb)
299 CALL get_qs_env(qs_env, sab_orb=sab_orb)
300 ! calculate dipole moment operator
301 NULLIFY (matrix_r)
302 CALL dbcsr_allocate_matrix_set(matrix_r, 3)
303 DO idir = 1, 3
304 CALL dbcsr_init_p(matrix_r(idir)%matrix)
305 CALL dbcsr_create(matrix_r(idir)%matrix, template=matrix_s(1)%matrix, matrix_type=dbcsr_type_symmetric)
306 CALL cp_dbcsr_alloc_block_from_nbl(matrix_r(idir)%matrix, sab_orb)
307 CALL dbcsr_set(matrix_r(idir)%matrix, 0._dp)
308 END DO
309 CALL build_local_moment_matrix(qs_env, matrix_r, 1, rcc)
310 END IF
311
312 IF (rtp_control%velocity_gauge) THEN
313 rtp_control%vec_pot = rtp_control%vec_pot + kvec
314 END IF
315
316 ! struct for fm matrices
317 fm_struct => rtp%ao_ao_fmstruct
318
319 ! create matrices and get Cholesky decomposition of S
320 CALL cp_fm_create(mat_ks, matrix_struct=fm_struct, name="mat_ks")
321 CALL cp_fm_create(eigenvectors, matrix_struct=fm_struct, name="eigenvectors")
322 CALL cp_fm_create(s_chol, matrix_struct=fm_struct, name="S_chol")
323 CALL copy_dbcsr_to_fm(matrix_s(1)%matrix, s_chol)
324 CALL cp_fm_cholesky_decompose(s_chol)
325
326 ! get number of atomic orbitals
327 CALL dbcsr_get_info(matrix_s(1)%matrix, nfullrows_total=nao)
328
329 DO ispin = 1, SIZE(matrix_ks)
330 ! diagonalize KS matrix to get occ and virt mos
331 ALLOCATE (eigenvalues(nao))
332 CALL cp_fm_create(mat_tmp, matrix_struct=fm_struct, name="mat_tmp")
333 CALL copy_dbcsr_to_fm(matrix_ks(ispin)%matrix, mat_ks)
334 CALL cp_fm_cholesky_reduce(mat_ks, s_chol)
335 CALL cp_fm_syevd(mat_ks, mat_tmp, eigenvalues)
336 CALL cp_fm_cholesky_restore(mat_tmp, nao, s_chol, eigenvectors, "SOLVE")
337
338 ! virtuals
339 CALL get_mo_set(mo_set=mos(ispin), nmo=nmo)
340 nvirt = nao - nmo
341 CALL cp_fm_struct_create(fm_struct_tmp, para_env=fm_struct%para_env, context=fm_struct%context, &
342 nrow_global=nao, ncol_global=nvirt)
343 CALL cp_fm_create(virtuals, matrix_struct=fm_struct_tmp, name="virtuals")
344 CALL cp_fm_struct_release(fm_struct_tmp)
345 CALL cp_fm_to_fm(eigenvectors, virtuals, nvirt, nmo + 1, 1)
346
347 ! occupied
348 CALL cp_fm_to_fm(eigenvectors, mos_old(2*ispin - 1), nmo, 1, 1)
349
350 CALL cp_fm_struct_create(fm_struct_tmp, para_env=fm_struct%para_env, context=fm_struct%context, &
351 nrow_global=nvirt, ncol_global=nmo)
352 CALL cp_fm_create(momentum, matrix_struct=fm_struct_tmp, name="momentum")
353 CALL cp_fm_struct_release(fm_struct_tmp)
354
355 ! the momentum operator (in a given direction)
356 CALL cp_fm_set_all(mos_new(2*ispin - 1), 0.0_dp)
357
358 DO idir = 1, 3
359 factor = kvec(idir)
360 IF (factor .NE. 0.0_dp) THEN
361 IF (.NOT. len_rep) THEN
362 CALL cp_dbcsr_sm_fm_multiply(matrix_s(idir + 1)%matrix, mos_old(2*ispin - 1), &
363 mos_old(2*ispin), ncol=nmo)
364 ELSE
365 CALL cp_dbcsr_sm_fm_multiply(matrix_r(idir)%matrix, mos_old(2*ispin - 1), &
366 mos_old(2*ispin), ncol=nmo)
367 END IF
368
369 CALL cp_fm_scale_and_add(1.0_dp, mos_new(2*ispin - 1), factor, mos_old(2*ispin))
370 IF (com_nl) THEN
371 CALL cp_fm_set_all(mos_old(2*ispin), 0.0_dp)
372 CALL cp_dbcsr_sm_fm_multiply(matrix_rv(idir)%matrix, mos_old(2*ispin - 1), &
373 mos_old(2*ispin), ncol=nmo)
374 CALL cp_fm_scale_and_add(1.0_dp, mos_new(2*ispin - 1), factor, mos_old(2*ispin))
375 END IF
376 END IF
377 END DO
378
379 CALL parallel_gemm('T', 'N', nvirt, nmo, nao, 1.0_dp, virtuals, mos_new(2*ispin - 1), 0.0_dp, momentum)
380
381 ! the tricky bit ... rescale by the eigenvalue difference
382 IF (.NOT. len_rep) THEN
383 CALL cp_fm_get_info(momentum, nrow_local=nrow_local, ncol_local=ncol_local, &
384 row_indices=row_indices, col_indices=col_indices, local_data=local_data)
385 DO icol = 1, ncol_local
386 DO irow = 1, nrow_local
387 factor = 1/(eigenvalues(col_indices(icol)) - eigenvalues(nmo + row_indices(irow)))
388 local_data(irow, icol) = factor*local_data(irow, icol)
389 END DO
390 END DO
391 END IF
392 CALL cp_fm_release(mat_tmp)
393 DEALLOCATE (eigenvalues)
394
395 ! now obtain the initial condition in mos_old
396 CALL cp_fm_to_fm(eigenvectors, mos_old(2*ispin - 1), nmo, 1, 1)
397 CALL parallel_gemm("N", "N", nao, nmo, nvirt, 1.0_dp, virtuals, momentum, 0.0_dp, mos_old(2*ispin))
398
399 CALL cp_fm_release(virtuals)
400 CALL cp_fm_release(momentum)
401 END DO
402
403 ! release matrices
404 CALL cp_fm_release(s_chol)
405 CALL cp_fm_release(mat_ks)
406 CALL cp_fm_release(eigenvectors)
407 IF (com_nl) CALL dbcsr_deallocate_matrix_set(matrix_rv)
408 IF (len_rep) CALL dbcsr_deallocate_matrix_set(matrix_r)
409
410 ! orthonormalize afterwards
411 CALL orthonormalize_complex_mos(qs_env, mos_old)
412
413 CALL timestop(handle)
414
415 END SUBROUTINE apply_delta_pulse_electric_periodic
416
417! **************************************************************************************************
418!> \brief applies exp(ikr) to the wavefunction.... stored in mos_old...
419!> \param qs_env ...
420!> \param mos_old ...
421!> \param mos_new ...
422!> \param kvec ...
423!> \author Joost & Martin (2011)
424! **************************************************************************************************
425
426 SUBROUTINE apply_delta_pulse_electric(qs_env, mos_old, mos_new, kvec)
427 TYPE(qs_environment_type), POINTER :: qs_env
428 TYPE(cp_fm_type), DIMENSION(:), POINTER :: mos_old, mos_new
429 REAL(kind=dp), DIMENSION(3) :: kvec
430
431 CHARACTER(len=*), PARAMETER :: routinen = 'apply_delta_pulse_electric'
432
433 INTEGER :: handle, i, nao, nmo
434 TYPE(cell_type), POINTER :: cell
435 TYPE(cp_fm_type) :: s_inv_fm, tmp
436 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_s
437 TYPE(dbcsr_type), POINTER :: cosmat, sinmat
438 TYPE(dft_control_type), POINTER :: dft_control
439 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
440 TYPE(rt_prop_type), POINTER :: rtp
441 TYPE(rtp_control_type), POINTER :: rtp_control
442
443 CALL timeset(routinen, handle)
444 NULLIFY (cell, dft_control, matrix_s, mos, rtp, rtp_control)
445 CALL get_qs_env(qs_env, &
446 cell=cell, &
447 dft_control=dft_control, &
448 matrix_s=matrix_s, &
449 mos=mos, &
450 rtp=rtp)
451 rtp_control => dft_control%rtp_control
452
453 IF (rtp_control%velocity_gauge) THEN
454 rtp_control%vec_pot = rtp_control%vec_pot + kvec
455 END IF
456
457 ! calculate exponentials (= Berry moments)
458 NULLIFY (cosmat, sinmat)
459 ALLOCATE (cosmat, sinmat)
460 CALL dbcsr_copy(cosmat, matrix_s(1)%matrix, 'COS MOM')
461 CALL dbcsr_copy(sinmat, matrix_s(1)%matrix, 'SIN MOM')
462 CALL build_berry_moment_matrix(qs_env, cosmat, sinmat, kvec)
463
464 ! need inverse of overlap matrix
465 CALL cp_fm_create(s_inv_fm, matrix_struct=rtp%ao_ao_fmstruct, name="S_inv_fm")
466 CALL cp_fm_create(tmp, matrix_struct=rtp%ao_ao_fmstruct, name="tmp_mat")
467 CALL copy_dbcsr_to_fm(matrix_s(1)%matrix, s_inv_fm)
468 CALL cp_fm_cholesky_decompose(s_inv_fm)
469 CALL cp_fm_cholesky_invert(s_inv_fm)
470 CALL cp_fm_uplo_to_full(s_inv_fm, tmp)
471 CALL cp_fm_release(tmp)
472
473 DO i = 1, SIZE(mos)
474 ! apply exponentials to mo coefficients
475 CALL get_mo_set(mos(i), nao=nao, nmo=nmo)
476 CALL cp_dbcsr_sm_fm_multiply(cosmat, mos(i)%mo_coeff, mos_new(2*i - 1), ncol=nmo)
477 CALL cp_dbcsr_sm_fm_multiply(sinmat, mos(i)%mo_coeff, mos_new(2*i), ncol=nmo)
478
479 CALL parallel_gemm("N", "N", nao, nmo, nao, 1.0_dp, s_inv_fm, mos_new(2*i - 1), 0.0_dp, mos_old(2*i - 1))
480 CALL parallel_gemm("N", "N", nao, nmo, nao, 1.0_dp, s_inv_fm, mos_new(2*i), 0.0_dp, mos_old(2*i))
481 END DO
482
483 CALL cp_fm_release(s_inv_fm)
484 CALL dbcsr_deallocate_matrix(cosmat)
485 CALL dbcsr_deallocate_matrix(sinmat)
486
487 ! orthonormalize afterwards
488 CALL orthonormalize_complex_mos(qs_env, mos_old)
489
490 CALL timestop(handle)
491
492 END SUBROUTINE apply_delta_pulse_electric
493
494! **************************************************************************************************
495!> \brief apply magnetic delta pulse to linear order
496!> \param qs_env ...
497!> \param mos_old ...
498!> \param mos_new ...
499!> \param kvec ...
500! **************************************************************************************************
501 SUBROUTINE apply_delta_pulse_mag(qs_env, mos_old, mos_new, kvec)
502 TYPE(qs_environment_type), POINTER :: qs_env
503 TYPE(cp_fm_type), DIMENSION(:), POINTER :: mos_old, mos_new
504 REAL(kind=dp), DIMENSION(3) :: kvec
505
506 CHARACTER(len=*), PARAMETER :: routinen = 'apply_delta_pulse_mag'
507
508 INTEGER :: gauge_orig, handle, idir, ispin, nao, &
509 nmo, nrow_global, nvirt
510 REAL(kind=dp) :: eps_ppnl, factor
511 REAL(kind=dp), DIMENSION(3) :: rcc
512 REAL(kind=dp), DIMENSION(:), POINTER :: eigenvalues, ref_point
513 TYPE(cell_type), POINTER :: cell
514 TYPE(cp_fm_struct_type), POINTER :: fm_struct_tmp
515 TYPE(cp_fm_type) :: eigenvectors, mat_ks, perturbation, &
516 s_chol, virtuals
517 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_ks, matrix_mag, matrix_nl, &
518 matrix_s
519 TYPE(dft_control_type), POINTER :: dft_control
520 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
521 TYPE(neighbor_list_set_p_type), DIMENSION(:), &
522 POINTER :: sab_all, sab_orb, sap_ppnl
523 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
524 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
525 TYPE(rt_prop_type), POINTER :: rtp
526 TYPE(section_vals_type), POINTER :: input
527
528 CALL timeset(routinen, handle)
529
530 CALL cite_reference(mattiat2022)
531
532 NULLIFY (rtp, dft_control, matrix_ks, matrix_s, input, mos, cell, sab_orb, sab_all, sap_ppnl, &
533 qs_kind_set, particle_set)
534
535 CALL get_qs_env(qs_env, &
536 rtp=rtp, &
537 dft_control=dft_control, &
538 mos=mos, &
539 matrix_ks=matrix_ks, &
540 matrix_s=matrix_s, &
541 input=input, &
542 cell=cell, &
543 sab_orb=sab_orb, &
544 sab_all=sab_all, &
545 sap_ppnl=sap_ppnl)
546
547 gauge_orig = section_get_ival(section_vals=input, &
548 keyword_name="DFT%REAL_TIME_PROPAGATION%GAUGE_ORIG")
549 NULLIFY (ref_point)
550 CALL section_vals_val_get(input, "DFT%REAL_TIME_PROPAGATION%GAUGE_ORIG_MANUAL", r_vals=ref_point)
551 CALL get_reference_point(rcc, qs_env=qs_env, reference=gauge_orig, ref_point=ref_point)
552
553 ! Create fm matrices
554 CALL cp_fm_create(s_chol, matrix_struct=rtp%ao_ao_fmstruct, name='Cholesky S')
555 CALL cp_fm_create(eigenvectors, matrix_struct=rtp%ao_ao_fmstruct, name="gs evecs fm")
556 CALL cp_fm_create(mat_ks, matrix_struct=rtp%ao_ao_fmstruct, name='KS matrix')
557
558 ! get nrows_global
559 CALL cp_fm_get_info(mat_ks, nrow_global=nrow_global)
560
561 ! cholesky decomposition of overlap matrix
562 CALL copy_dbcsr_to_fm(matrix_s(1)%matrix, s_chol)
563 CALL cp_fm_cholesky_decompose(s_chol)
564
565 ! initiate perturbation matrix
566 NULLIFY (matrix_mag)
567 CALL dbcsr_allocate_matrix_set(matrix_mag, 3)
568 DO idir = 1, 3
569 CALL dbcsr_init_p(matrix_mag(idir)%matrix)
570 CALL dbcsr_create(matrix_mag(idir)%matrix, template=matrix_s(1)%matrix, &
571 matrix_type=dbcsr_type_antisymmetric)
572 CALL cp_dbcsr_alloc_block_from_nbl(matrix_mag(idir)%matrix, sab_orb)
573 CALL dbcsr_set(matrix_mag(idir)%matrix, 0._dp)
574 END DO
575 ! construct magnetic dipole moment matrix
576 CALL build_local_magmom_matrix(qs_env, matrix_mag, 1, ref_point=rcc)
577
578 ! work matrix for non-local potential part if necessary
579 NULLIFY (matrix_nl)
580 IF (ASSOCIATED(sap_ppnl)) THEN
581 CALL dbcsr_allocate_matrix_set(matrix_nl, 3)
582 DO idir = 1, 3
583 CALL dbcsr_init_p(matrix_nl(idir)%matrix)
584 CALL dbcsr_create(matrix_nl(idir)%matrix, template=matrix_s(1)%matrix, &
585 matrix_type=dbcsr_type_antisymmetric)
586 CALL cp_dbcsr_alloc_block_from_nbl(matrix_nl(idir)%matrix, sab_orb)
587 CALL dbcsr_set(matrix_nl(idir)%matrix, 0._dp)
588 END DO
589 ! construct non-local contribution
590 CALL get_qs_env(qs_env, &
591 qs_kind_set=qs_kind_set, &
592 particle_set=particle_set)
593 eps_ppnl = dft_control%qs_control%eps_ppnl
594
595 CALL build_com_nl_mag(qs_kind_set, sab_orb, sap_ppnl, eps_ppnl, particle_set, matrix_nl, rcc, cell)
596
597 DO idir = 1, 3
598 CALL dbcsr_add(matrix_mag(idir)%matrix, matrix_nl(idir)%matrix, -one, one)
599 END DO
600
601 CALL dbcsr_deallocate_matrix_set(matrix_nl)
602 END IF
603
604 DO ispin = 1, dft_control%nspins
605 ! allocate eigenvalues
606 NULLIFY (eigenvalues)
607 ALLOCATE (eigenvalues(nrow_global))
608 ! diagonalize KS matrix in AO basis using Cholesky decomp. of S
609 CALL copy_dbcsr_to_fm(matrix_ks(ispin)%matrix, mat_ks)
610 CALL cp_fm_cholesky_reduce(mat_ks, s_chol)
611 CALL cp_fm_syevd(mat_ks, eigenvectors, eigenvalues)
612 CALL cp_fm_triangular_multiply(s_chol, eigenvectors, invert_tr=.true.)
613
614 ! virtuals
615 CALL get_mo_set(mo_set=mos(ispin), nao=nao, nmo=nmo)
616 nvirt = nao - nmo
617 CALL cp_fm_struct_create(fm_struct_tmp, para_env=rtp%ao_ao_fmstruct%para_env, context=rtp%ao_ao_fmstruct%context, &
618 nrow_global=nrow_global, ncol_global=nvirt)
619 CALL cp_fm_create(virtuals, matrix_struct=fm_struct_tmp, name="virtuals")
620 CALL cp_fm_struct_release(fm_struct_tmp)
621 CALL cp_fm_to_fm(eigenvectors, virtuals, nvirt, nmo + 1, 1)
622
623 ! occupied
624 CALL cp_fm_to_fm(eigenvectors, mos_old(2*ispin - 1), nmo, 1, 1)
625
626 CALL cp_fm_struct_create(fm_struct_tmp, para_env=rtp%ao_ao_fmstruct%para_env, context=rtp%ao_ao_fmstruct%context, &
627 nrow_global=nvirt, ncol_global=nmo)
628 CALL cp_fm_create(perturbation, matrix_struct=fm_struct_tmp, name="perturbation")
629 CALL cp_fm_struct_release(fm_struct_tmp)
630
631 ! apply perturbation
632 CALL cp_fm_set_all(mos_new(2*ispin - 1), 0.0_dp)
633
634 DO idir = 1, 3
635 factor = kvec(idir)
636 IF (factor .NE. 0.0_dp) THEN
637 CALL cp_dbcsr_sm_fm_multiply(matrix_mag(idir)%matrix, mos_old(2*ispin - 1), &
638 mos_old(2*ispin), ncol=nmo)
639 CALL cp_fm_scale_and_add(1.0_dp, mos_new(2*ispin - 1), factor, mos_old(2*ispin))
640 END IF
641 END DO
642
643 CALL parallel_gemm('T', 'N', nvirt, nmo, nao, 1.0_dp, virtuals, mos_new(2*ispin - 1), 0.0_dp, perturbation)
644
645 DEALLOCATE (eigenvalues)
646
647 ! now obtain the initial condition in mos_old
648 CALL cp_fm_to_fm(eigenvectors, mos_old(2*ispin - 1), nmo, 1, 1)
649 CALL parallel_gemm("N", "N", nao, nmo, nvirt, 1.0_dp, virtuals, perturbation, 0.0_dp, mos_old(2*ispin))
650
651 CALL cp_fm_release(virtuals)
652 CALL cp_fm_release(perturbation)
653 END DO
654
655 ! deallocations
656 CALL cp_fm_release(s_chol)
657 CALL cp_fm_release(mat_ks)
658 CALL cp_fm_release(eigenvectors)
659 CALL dbcsr_deallocate_matrix_set(matrix_mag)
660
661 ! orthonormalize afterwards
662 CALL orthonormalize_complex_mos(qs_env, mos_old)
663
664 CALL timestop(handle)
665
666 END SUBROUTINE apply_delta_pulse_mag
667
668! **************************************************************************************************
669!> \brief orthonormalize complex mos, e. g. after non-unitary transformations using Löwdin's algorithm
670!> \param qs_env ...
671!> \param coeffs ...
672! **************************************************************************************************
673 SUBROUTINE orthonormalize_complex_mos(qs_env, coeffs)
674 TYPE(qs_environment_type), POINTER :: qs_env
675 TYPE(cp_fm_type), DIMENSION(:), INTENT(INOUT), &
676 POINTER :: coeffs
677
678 COMPLEX(KIND=dp), ALLOCATABLE, DIMENSION(:) :: eigenvalues_sqrt
679 INTEGER :: im, ispin, j, nao, nmo, nspins, re
680 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: eigenvalues
681 TYPE(cp_blacs_env_type), POINTER :: blacs_env
682 TYPE(cp_cfm_type) :: oo_c, oo_v, oo_vt
683 TYPE(cp_fm_struct_type), POINTER :: fm_struct_tmp
684 TYPE(cp_fm_type) :: oo_1, oo_2, s_fm, tmp
685 TYPE(cp_fm_type), DIMENSION(2) :: coeffs_tmp
686 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_s
687 TYPE(dft_control_type), POINTER :: dft_control
688 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
689 TYPE(mp_para_env_type), POINTER :: para_env
690
691 NULLIFY (para_env, blacs_env, dft_control, matrix_s, mos)
692 CALL get_qs_env(qs_env, &
693 blacs_env=blacs_env, &
694 dft_control=dft_control, &
695 matrix_s=matrix_s, &
696 mos=mos, &
697 para_env=para_env)
698 nspins = dft_control%nspins
699 CALL cp_fm_get_info(coeffs(1), nrow_global=nao)
700
701 ! get overlap matrix
702 CALL cp_fm_struct_create(fm_struct_tmp, nrow_global=nao, ncol_global=nao, &
703 context=blacs_env, para_env=para_env)
704 CALL cp_fm_create(s_fm, matrix_struct=fm_struct_tmp, name="overlap fm")
705 CALL cp_fm_struct_release(fm_struct_tmp)
706 ! copy overlap matrix
707 CALL copy_dbcsr_to_fm(matrix_s(1)%matrix, s_fm)
708
709 DO ispin = 1, nspins
710 CALL get_mo_set(mos(ispin), nmo=nmo)
711 CALL cp_fm_struct_create(fm_struct_tmp, para_env=para_env, context=blacs_env, &
712 nrow_global=nmo, ncol_global=nmo)
713 CALL cp_fm_create(oo_1, matrix_struct=fm_struct_tmp, name="oo_1")
714 CALL cp_fm_create(oo_2, matrix_struct=fm_struct_tmp, name="oo_2")
715 CALL cp_fm_struct_release(fm_struct_tmp)
716
717 CALL cp_fm_create(tmp, matrix_struct=coeffs(2*ispin - 1)%matrix_struct, name="tmp_mat")
718 ! get the complex overlap matrix in MO basis
719 ! x^T S x + y^T S y + i (-y^TS x+x^T S y)
720 CALL parallel_gemm("N", "N", nao, nmo, nao, 1.0_dp, s_fm, coeffs(2*ispin - 1), 0.0_dp, tmp)
721 CALL parallel_gemm("T", "N", nmo, nmo, nao, 1.0_dp, coeffs(2*ispin - 1), tmp, 0.0_dp, oo_1)
722 CALL parallel_gemm("T", "N", nmo, nmo, nao, -1.0_dp, coeffs(2*ispin), tmp, 0.0_dp, oo_2)
723
724 CALL parallel_gemm("N", "N", nao, nmo, nao, 1.0_dp, s_fm, coeffs(2*ispin), 0.0_dp, tmp)
725 CALL parallel_gemm("T", "N", nmo, nmo, nao, 1.0_dp, coeffs(2*ispin), tmp, 1.0_dp, oo_1)
726 CALL parallel_gemm("T", "N", nmo, nmo, nao, 1.0_dp, coeffs(2*ispin - 1), tmp, 1.0_dp, oo_2)
727 CALL cp_fm_release(tmp)
728
729 ! complex Löwdin
730 CALL cp_cfm_create(oo_c, oo_1%matrix_struct)
731 CALL cp_cfm_create(oo_v, oo_1%matrix_struct)
732 CALL cp_cfm_create(oo_vt, oo_1%matrix_struct)
733 oo_c%local_data = cmplx(oo_1%local_data, oo_2%local_data, kind=dp)
734
735 ALLOCATE (eigenvalues(nmo))
736 ALLOCATE (eigenvalues_sqrt(nmo))
737 CALL cp_cfm_heevd(oo_c, oo_v, eigenvalues)
738 eigenvalues_sqrt(:) = cmplx(one/sqrt(eigenvalues(:)), zero, dp)
739 CALL cp_cfm_to_cfm(oo_v, oo_vt)
740 CALL cp_cfm_column_scale(oo_v, eigenvalues_sqrt)
741 DEALLOCATE (eigenvalues)
742 DEALLOCATE (eigenvalues_sqrt)
743 CALL parallel_gemm('N', 'C', nmo, nmo, nmo, (1.0_dp, 0.0_dp), &
744 oo_v, oo_vt, (0.0_dp, 0.0_dp), oo_c)
745 oo_1%local_data = real(oo_c%local_data, kind=dp)
746 oo_2%local_data = aimag(oo_c%local_data)
747 CALL cp_cfm_release(oo_c)
748 CALL cp_cfm_release(oo_v)
749 CALL cp_cfm_release(oo_vt)
750
751 ! transform coefficients accordingly
752 DO j = 1, 2
753 CALL cp_fm_create(coeffs_tmp(j), matrix_struct=coeffs(2*(ispin - 1) + j)%matrix_struct)
754 END DO
755
756 ! indices for coeffs_tmp
757 re = 1
758 im = 2
759 CALL parallel_gemm("N", "N", nao, nmo, nmo, one, coeffs(2*ispin - 1), oo_1, zero, coeffs_tmp(re))
760 CALL parallel_gemm("N", "N", nao, nmo, nmo, one, coeffs(2*ispin - 1), oo_2, zero, coeffs_tmp(im))
761
762 CALL parallel_gemm("N", "N", nao, nmo, nmo, -one, coeffs(2*ispin), oo_2, zero, coeffs(2*ispin - 1))
763 CALL cp_fm_scale_and_add(one, coeffs(2*ispin - 1), one, coeffs_tmp(re))
764
765 CALL parallel_gemm("N", "N", nao, nmo, nmo, one, coeffs(2*ispin), oo_1, one, coeffs_tmp(im))
766 CALL cp_fm_to_fm(coeffs_tmp(im), coeffs(2*ispin))
767
768 DO j = 1, 2
769 CALL cp_fm_release(coeffs_tmp(j))
770 END DO
771 CALL cp_fm_release(oo_1)
772 CALL cp_fm_release(oo_2)
773 END DO
774 CALL cp_fm_release(s_fm)
775
776 END SUBROUTINE orthonormalize_complex_mos
777
778END MODULE rt_delta_pulse
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public mattiat2022
integer, save, public mattiat2019
Handles all functions related to the CELL.
Definition cell_types.F:15
Calculation of the non-local pseudopotential contribution to the core Hamiltonian <a|V(non-local)|b> ...
subroutine, public build_com_mom_nl(qs_kind_set, sab_all, sap_ppnl, eps_ppnl, particle_set, cell, matrix_rv, matrix_rxrv, matrix_rrv, matrix_rvr, matrix_rrv_vrr, matrix_r_rxvr, matrix_rxvr_r, matrix_r_doublecom, pseudoatom, ref_point)
Calculate [r,Vnl] (matrix_rv), r x [r,Vnl] (matrix_rxrv) or [rr,Vnl] (matrix_rrv) in AO basis....
subroutine, public build_com_nl_mag(qs_kind_set, sab_all, sap_ppnl, eps_ppnl, particle_set, matrix_mag_nl, refpoint, cell)
calculate \sum_R_ps (R_ps - R_nu) x [V_nl, r] summing over all pseudized atoms R
methods related to the blacs parallel environment
Basic linear algebra operations for complex full matrices.
subroutine, public cp_cfm_column_scale(matrix_a, scaling)
Scales columns of the full matrix by corresponding factors.
used for collecting diagonalization schemes available for cp_cfm_type
Definition cp_cfm_diag.F:14
subroutine, public cp_cfm_heevd(matrix, eigenvectors, eigenvalues)
Perform a diagonalisation of a complex matrix.
Definition cp_cfm_diag.F:58
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_create(matrix, matrix_struct, name)
Creates a new full matrix with the given structure.
subroutine, public cp_cfm_release(matrix)
Releases a full matrix.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_deallocate_matrix(matrix)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
subroutine, public dbcsr_init_p(matrix)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_sm_fm_multiply(matrix, fm_in, fm_out, ncol, alpha, beta)
multiply a dbcsr with a fm matrix
subroutine, public copy_dbcsr_to_fm(matrix, fm)
Copy a DBCSR matrix to a BLACS matrix.
basic linear algebra operations for full matrices
subroutine, public cp_fm_cholesky_restore(fm_matrix, neig, fm_matrixb, fm_matrixout, op, pos, transa)
...
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....
subroutine, public cp_fm_uplo_to_full(matrix, work, uplo)
given a triangular matrix according to uplo, computes the corresponding full matrix
subroutine, public cp_fm_triangular_multiply(triangular_matrix, matrix_b, side, transpose_tr, invert_tr, uplo_tr, unit_diag_tr, n_rows, n_cols, alpha)
multiplies in place by a triangular matrix: matrix_b = alpha op(triangular_matrix) matrix_b or (if si...
various cholesky decomposition related routines
subroutine, public cp_fm_cholesky_invert(matrix, n, info_out)
used to replace the cholesky decomposition by the inverse
subroutine, public cp_fm_cholesky_decompose(matrix, n, info_out)
used to replace a symmetric positive def. matrix M with its cholesky decomposition U: M = U^T * U,...
subroutine, public cp_fm_cholesky_reduce(matrix, matrixb, itype)
reduce a matrix pencil A,B to normal form B has to be cholesky decomposed with cp_fm_cholesky_decompo...
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_syevd(matrix, eigenvectors, eigenvalues, info)
Computes all eigenvalues and vectors of a real symmetric matrix significantly faster than syevx,...
Definition cp_fm_diag.F:434
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_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env)
returns all kind of information about the full matrix
subroutine, public cp_fm_set_all(matrix, alpha, beta)
set all elements of a matrix to the same value, and optionally the diagonal to a different one
subroutine, public cp_fm_create(matrix, matrix_struct, name, 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 ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
objects that represent the structure of input sections and the data contained in an input section
integer function, public section_get_ival(section_vals, keyword_name)
...
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
logical function, public section_get_lval(section_vals, keyword_name)
...
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Definition of mathematical constants and functions.
real(kind=dp), parameter, public one
real(kind=dp), parameter, public twopi
real(kind=dp), parameter, public zero
Interface to the message passing library MPI.
Calculates the moment integrals <a|r^m|b>
subroutine, public get_reference_point(rpoint, drpoint, qs_env, fist_env, reference, ref_point, ifirst, ilast)
...
basic linear algebra operations for full matrixes
Define the data structure for the particle information.
Calculation of Overlap and Hamiltonian matrices in DFTB.
subroutine, public build_dftb_overlap(qs_env, nderivative, matrix_s)
...
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.
Define the quickstep kind type and their sub types.
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.
Calculates the moment integrals <a|r^m|b> and <a|r x d/dr|b>
Definition qs_moments.F:14
subroutine, public build_local_magmom_matrix(qs_env, magmom, nmoments, ref_point, ref_points, basis_type)
...
subroutine, public build_local_moment_matrix(qs_env, moments, nmoments, ref_point, ref_points, basis_type)
...
Definition qs_moments.F:560
subroutine, public build_berry_moment_matrix(qs_env, cosmat, sinmat, kvec, sab_orb_external, basis_type)
...
Define the neighbor list data types and the corresponding functionality.
Routines to apply a delta pulse for RTP and EMD.
subroutine, public apply_delta_pulse(qs_env, rtp, rtp_control)
Interface to call the delta pulse depending on the type of calculation.
Types and set_get for real time propagation depending on runtype and diagonalization method different...
subroutine, public rt_prop_create_mos(rtp, mos, mpools, dft_control, mos_aux, init_mos_old, init_mos_new, init_mos_next, init_mos_admn)
Initialize the mos for rtp.
subroutine, public get_rtp(rtp, exp_h_old, exp_h_new, h_last_iter, rho_old, rho_next, rho_new, mos, mos_new, mos_old, mos_next, s_inv, s_half, s_minus_half, b_mat, c_mat, propagator_matrix, mixing, mixing_factor, s_der, dt, nsteps, sinvh, sinvh_imag, sinvb, admm_mos)
...
Type defining parameters related to the simulation cell.
Definition cell_types.F:55
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
Represent a complex full matrix.
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
Provides all information about a quickstep kind.