(git:1155b05)
Loading...
Searching...
No Matches
rixs_methods.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Methods for Resonant Inelastic XRAY Scattering (RIXS) calculations
10!> \author BSG (02.2025)
11! **************************************************************************************************
13 USE bibliography, ONLY: vazdacruz2021,&
14 cite_reference
21 USE cp_dbcsr_api, ONLY: dbcsr_p_type
26 USE cp_fm_types, ONLY: cp_fm_create,&
37 USE header, ONLY: rixs_header
38 USE input_constants, ONLY: xas_1s_type,&
43 USE kinds, ONLY: dp
46 USE physcon, ONLY: evolt
49 USE qs_tddfpt2_methods, ONLY: tddfpt
50 USE rixs_types, ONLY: rixs_env_create,&
54 USE xas_tdp_methods, ONLY: xas_tdp
57#include "./base/base_uses.f90"
58
59 IMPLICIT NONE
60 PRIVATE
61
62 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'rixs_methods'
63
64 PUBLIC :: rixs
65
66CONTAINS
67
68! **************************************************************************************************
69!> \brief Driver for RIXS calculations.
70!> \param qs_env the inherited qs_environment
71!> \author BSG
72! **************************************************************************************************
73
74 SUBROUTINE rixs(qs_env)
75
76 TYPE(qs_environment_type), POINTER :: qs_env
77
78 CHARACTER(len=*), PARAMETER :: routinen = 'rixs'
79
80 INTEGER :: handle, output_unit
81 TYPE(dft_control_type), POINTER :: dft_control
82 TYPE(section_vals_type), POINTER :: rixs_section, tddfp2_section, &
83 xas_tdp_section
84
85 CALL timeset(routinen, handle)
86
87 NULLIFY (rixs_section)
88 rixs_section => section_vals_get_subs_vals(qs_env%input, "PROPERTIES%RIXS")
89 output_unit = cp_logger_get_default_io_unit()
90
91 qs_env%do_rixs = .true.
92
93 CALL cite_reference(vazdacruz2021)
94
95 CALL get_qs_env(qs_env, dft_control=dft_control)
96
97 xas_tdp_section => section_vals_get_subs_vals(rixs_section, "XAS_TDP")
98 tddfp2_section => section_vals_get_subs_vals(rixs_section, "TDDFPT")
99
100 CALL rixs_core(rixs_section, qs_env)
101
102 IF (output_unit > 0) THEN
103 WRITE (unit=output_unit, fmt="(/,(T2,A79))") &
104 "*******************************************************************************", &
105 "! Normal termination of Resonant Inelastic X-RAY Scattering calculation !", &
106 "*******************************************************************************"
107 END IF
108
109 CALL timestop(handle)
110
111 END SUBROUTINE rixs
112
113! **************************************************************************************************
114!> \brief Perform RIXS calculation.
115!> \param rixs_section ...
116!> \param qs_env ...
117! **************************************************************************************************
118 SUBROUTINE rixs_core(rixs_section, qs_env)
119
120 TYPE(section_vals_type), POINTER :: rixs_section
121 TYPE(qs_environment_type), POINTER :: qs_env
122
123 CHARACTER(len=*), PARAMETER :: routinen = 'rixs_core'
124
125 INTEGER :: ax, c_nstates, current_state_index, handle, iatom, ispin, istate, k, &
126 n_states_donor, nactive_max, nao, nex_atoms, nspins, output_unit, td_state, v_nstates
127 INTEGER, ALLOCATABLE, DIMENSION(:) :: nactive, nocc
128 LOGICAL :: do_sc, do_sg, roks, uks
129 REAL(dp), ALLOCATABLE, DIMENSION(:) :: w_i0, w_if
130 REAL(dp), ALLOCATABLE, DIMENSION(:, :) :: dip_block, mu_i0
131 REAL(dp), ALLOCATABLE, DIMENSION(:, :, :) :: mu_if
132 TYPE(cp_blacs_env_type), POINTER :: blacs_env
133 TYPE(cp_fm_struct_type), POINTER :: core_evect_struct, crc_struct, dip_0_struct, &
134 gs_coeff_struct, i_dip_0_struct, matrix_struct, overlap_struct, rc_struct
135 TYPE(cp_fm_type) :: dip_0
136 TYPE(cp_fm_type), ALLOCATABLE, DIMENSION(:) :: core_evects, crc, i_dip_0, mat_product, &
137 overlap_x, rc, state_gs_coeffs, &
138 y_overlap_x
139 TYPE(cp_fm_type), DIMENSION(:), POINTER :: local_gs_coeffs, mo_active
140 TYPE(cp_fm_type), DIMENSION(:, :), POINTER :: valence_evects
141 TYPE(cp_fm_type), POINTER :: target_ex_coeffs
142 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: dipmat, matrix_s
143 TYPE(dft_control_type), POINTER :: dft_control
144 TYPE(donor_state_type), POINTER :: current_state
145 TYPE(mp_para_env_type), POINTER :: para_env
146 TYPE(rixs_control_type), POINTER :: rixs_control
147 TYPE(rixs_env_type), POINTER :: rixs_env
148 TYPE(tddfpt2_valence_type), POINTER :: valence_state
149 TYPE(xas_tdp_env_type), POINTER :: core_state
150
151 NULLIFY (rixs_control, dft_control, rixs_env)
152 NULLIFY (valence_state, core_state)
153 NULLIFY (para_env, blacs_env)
154 NULLIFY (local_gs_coeffs, mo_active, valence_evects)
155 NULLIFY (dipmat, dip_0_struct, i_dip_0_struct, &
156 core_evect_struct, gs_coeff_struct)
157
158 output_unit = cp_logger_get_default_io_unit()
159
160 CALL get_qs_env(qs_env, &
161 dft_control=dft_control, &
162 matrix_s=matrix_s, &
163 para_env=para_env, &
164 blacs_env=blacs_env)
165 CALL rixs_control_create(rixs_control)
166 CALL read_rixs_control(rixs_control, rixs_section, dft_control%qs_control)
167
168 ! create rixs_env
169 CALL rixs_env_create(rixs_env)
170
171 ! first, xas_tdp calculation
172 CALL xas_tdp(qs_env, rixs_env)
173
174 do_sg = rixs_control%xas_tdp_control%do_singlet
175 do_sc = rixs_control%xas_tdp_control%do_spin_cons
176
177 IF (rixs_control%xas_tdp_control%check_only) THEN
178 cpwarn("CHECK_ONLY run for XAS_TDP requested, RIXS and TDDFPT will not be performed.")
179 ELSE
180
181 ! then, tddfpt calculation
182 CALL tddfpt(qs_env, calc_forces=.false., rixs_env=rixs_env)
183
184 IF (output_unit > 0) THEN
185 CALL rixs_header(output_unit)
186 END IF
187
188 ! timings for rixs only, excluding xas_tdp and tddft calls
189 CALL timeset(routinen, handle)
190
191 IF (do_sg) THEN ! singlet
192 nspins = 1
193 ELSE IF (do_sc) THEN ! spin-conserving
194 nspins = 2
195 ELSE
196 cpabort("RIXS only implemented for singlet and spin-conserving excitations")
197 END IF
198
199 roks = .false.
200 uks = .false.
201
202 IF (dft_control%uks) THEN
203 uks = .true.
204 ELSE IF (dft_control%roks) THEN
205 roks = .true.
206 END IF
207
208 IF (output_unit > 0) THEN
209 IF (uks) THEN
210 WRITE (unit=output_unit, fmt="(T2,A)") "RIXS| Unrestricted Open-Shell Kohn-Sham"
211 ELSE IF (roks) THEN
212 WRITE (unit=output_unit, fmt="(T2,A)") "RIXS| Restricted Open-Shell Kohn-Sham"
213 ELSE
214 WRITE (unit=output_unit, fmt="(T2,A)") "RIXS| Restricted Closed-Shell Kohn-Sham"
215 END IF
216 END IF
217
218 core_state => rixs_env%core_state
219 valence_state => rixs_env%valence_state
220
221 ! gs coefficients from tddfpt
222 mo_active => valence_state%mos_active
223 ! localised gs coefficients from xas_tdp
224 local_gs_coeffs => core_state%mo_coeff
225 valence_evects => valence_state%evects
226
227 ! find max nactive for open-shell cases
228 ALLOCATE (nactive(nspins))
229 ALLOCATE (nocc(nspins))
230 DO ispin = 1, nspins
231 IF (roks) THEN
232 CALL cp_fm_get_info(matrix=local_gs_coeffs(1), ncol_global=nocc(ispin))
233 ELSE
234 CALL cp_fm_get_info(matrix=local_gs_coeffs(ispin), ncol_global=nocc(ispin))
235 END IF
236 CALL cp_fm_get_info(matrix=mo_active(ispin), nrow_global=nao, ncol_global=nactive(ispin))
237 END DO
238 nactive_max = maxval(nactive)
239
240 nex_atoms = core_state%nex_atoms
241 v_nstates = valence_state%nstates
242 c_nstates = core_state%nstates
243
244 IF (rixs_control%core_states > 0) THEN
245 rixs_control%core_states = min(rixs_control%core_states, c_nstates)
246 ELSE
247 rixs_control%core_states = c_nstates
248 END IF
249 c_nstates = rixs_control%core_states
250
251 IF (rixs_control%valence_states > 0) THEN
252 rixs_control%valence_states = min(rixs_control%valence_states, v_nstates)
253 ELSE
254 rixs_control%valence_states = v_nstates
255 END IF
256 v_nstates = rixs_control%valence_states
257
258 IF (output_unit > 0) THEN
259 WRITE (unit=output_unit, fmt="(T2,A,I5,A,I5)") &
260 "RIXS| Using ", c_nstates, " core states out of ", core_state%nstates
261 WRITE (unit=output_unit, fmt="(T2,A,I5,A,I5,/)") &
262 "RIXS| Using ", v_nstates, " valence states out of ", valence_state%nstates
263 END IF
264
265 dipmat => core_state%dipmat
266
267 ALLOCATE (core_evects(nspins), state_gs_coeffs(nspins))
268 ALLOCATE (dip_block(1, nspins), mu_i0(4, c_nstates), mu_if(4, c_nstates, v_nstates), w_i0(c_nstates), w_if(v_nstates))
269 w_if(:) = valence_state%evals(1:v_nstates)*evolt
270 ALLOCATE (i_dip_0(nspins))
271 ALLOCATE (rc(nspins), crc(nspins))
272 ALLOCATE (overlap_x(nspins), y_overlap_x(nspins), mat_product(nspins))
273
274 CALL cp_fm_struct_create(core_evect_struct, para_env=para_env, context=blacs_env, &
275 nrow_global=nao, ncol_global=c_nstates)
276 CALL cp_fm_struct_create(gs_coeff_struct, para_env=para_env, context=blacs_env, &
277 nrow_global=nao, ncol_global=1)
278
279 ! looping over ex_atoms and ex_kinds is enough as excited atoms have to be unique
280 current_state_index = 1
281 DO iatom = 1, nex_atoms
282 current_state => core_state%donor_states(current_state_index)
283
284 IF (current_state%state_type == xas_1s_type) THEN
285 n_states_donor = 1
286 ELSE IF (current_state%state_type == xas_2s_type) THEN
287 n_states_donor = 1
288 ELSE IF (current_state%state_type == xas_2p_type) THEN
289 n_states_donor = 3
290 ELSE
291 cpabort("Unsupported core state type")
292 END IF
293
294 IF (output_unit > 0) THEN
295 WRITE (unit=output_unit, fmt="(T2,A,A,A,I3,A,A)") &
296 "RIXS| Calculating dipole moment from core-excited state ", &
297 core_state%state_type_char(current_state%state_type), " for atom ", &
298 current_state%at_index, " of kind ", trim(current_state%at_symbol)
299 END IF
300
301 IF (do_sg) THEN ! singlet
302 target_ex_coeffs => current_state%sg_coeffs
303 w_i0(:) = current_state%sg_evals(1:c_nstates)*evolt
304 ELSE IF (do_sc) THEN ! spin-conserving
305 target_ex_coeffs => current_state%sc_coeffs
306 w_i0(:) = current_state%sc_evals(1:c_nstates)*evolt
307 END IF
308
309 ! reshape sc and sg coeffs (separate spins to columns)
310 DO ispin = 1, nspins
311 CALL cp_fm_create(core_evects(ispin), core_evect_struct)
312 CALL cp_fm_to_fm_submat(msource=target_ex_coeffs, mtarget=core_evects(ispin), s_firstrow=1, &
313 s_firstcol=(c_nstates*(ispin - 1) + 1), t_firstrow=1, t_firstcol=1, nrow=nao, ncol=c_nstates)
314 END DO
315 DO ispin = 1, nspins
316 CALL cp_fm_create(state_gs_coeffs(ispin), gs_coeff_struct)
317 IF (roks) THEN
318 ! store same coeffs for both spins, easier later on
319 CALL cp_fm_to_fm_submat(msource=current_state%gs_coeffs, mtarget=state_gs_coeffs(ispin), s_firstrow=1, &
320 s_firstcol=1, t_firstrow=1, t_firstcol=1, nrow=nao, ncol=n_states_donor)
321 ELSE
322 CALL cp_fm_to_fm_submat(msource=current_state%gs_coeffs, mtarget=state_gs_coeffs(ispin), s_firstrow=1, &
323 s_firstcol=ispin, t_firstrow=1, t_firstcol=1, nrow=nao, ncol=n_states_donor)
324 END IF
325 END DO
326
327 ! initialise matrices for i->0
328 CALL cp_fm_struct_create(dip_0_struct, para_env=para_env, context=blacs_env, &
329 nrow_global=nao, ncol_global=1)
330 CALL cp_fm_create(dip_0, dip_0_struct)
331 CALL cp_fm_struct_create(i_dip_0_struct, para_env=para_env, context=blacs_env, &
332 nrow_global=c_nstates, ncol_global=1)
333 DO ispin = 1, nspins
334 CALL cp_fm_create(i_dip_0(ispin), i_dip_0_struct)
335 END DO
336
337 DO ispin = 1, nspins
338 ! initialise cRc (nocc x nactive)
339 CALL cp_fm_struct_create(rc_struct, para_env=para_env, context=blacs_env, &
340 nrow_global=nao, ncol_global=nactive(ispin))
341 CALL cp_fm_struct_create(crc_struct, para_env=para_env, context=blacs_env, &
342 nrow_global=n_states_donor, ncol_global=nactive(ispin))
343 CALL cp_fm_create(rc(ispin), rc_struct)
344 CALL cp_fm_create(crc(ispin), crc_struct)
345
346 CALL cp_fm_struct_create(overlap_struct, para_env=para_env, context=blacs_env, &
347 nrow_global=c_nstates, ncol_global=nactive(ispin))
348
349 CALL cp_fm_struct_create(matrix_struct, para_env=para_env, context=blacs_env, &
350 nrow_global=c_nstates, ncol_global=n_states_donor)
351
352 ! initialise overlap_X
353 CALL cp_fm_create(overlap_x(ispin), rc_struct) ! nao x nactive
354
355 ! initialise Y_overlap_X
356 CALL cp_fm_create(y_overlap_x(ispin), overlap_struct) ! c_nstates x nactive
357
358 ! initialise mat_product = Y_overlap_X * cRc
359 CALL cp_fm_create(mat_product(ispin), matrix_struct) ! c_nstates x nocc
360
361 CALL cp_fm_struct_release(crc_struct)
362 CALL cp_fm_struct_release(rc_struct)
363 CALL cp_fm_struct_release(overlap_struct)
364 CALL cp_fm_struct_release(matrix_struct)
365 END DO
366
367 mu_i0 = 0.0_dp
368 mu_if = 0.0_dp
369 ! 0 -> i
370 DO ax = 1, 3
371
372 ! i*R*0
373 DO ispin = 1, nspins
374 CALL cp_dbcsr_sm_fm_multiply(dipmat(ax)%matrix, state_gs_coeffs(ispin), dip_0, ncol=1)
375 CALL parallel_gemm('T', 'N', c_nstates, 1, nao, 1.0_dp, core_evects(ispin), dip_0, 0.0_dp, i_dip_0(ispin))
376 END DO
377
378 DO istate = 1, c_nstates
379 dip_block = 0.0_dp
380 DO ispin = 1, nspins
381 CALL cp_fm_get_submatrix(fm=i_dip_0(ispin), target_m=dip_block, start_row=istate, &
382 start_col=1, n_rows=1, n_cols=1)
383 mu_i0(ax, istate) = mu_i0(ax, istate) + dip_block(1, 1)
384 END DO ! ispin
385 mu_i0(4, istate) = mu_i0(4, istate) + mu_i0(ax, istate)**2
386 END DO ! istate
387
388 END DO ! ax
389
390 ! i -> f
391 DO td_state = 1, v_nstates
392
393 IF (output_unit > 0) THEN
394 WRITE (unit=output_unit, fmt="(T9,A,I3,A,F10.4)") &
395 "to valence-excited state ", td_state, " with energy ", w_if(td_state)
396 END IF
397
398 DO ispin = 1, nspins
399 ! 1) build S*X (nao x nactive)
400 CALL cp_dbcsr_sm_fm_multiply(matrix_s(1)%matrix, valence_evects(ispin, td_state), overlap_x(ispin), &
401 ncol=nactive(ispin))
402 ! 2) build Y^T*S*X (c_states x nactive)
403 CALL parallel_gemm('T', 'N', c_nstates, nactive(ispin), nao, 1.0_dp, core_evects(ispin), &
404 overlap_x(ispin), 0.0_dp, y_overlap_x(ispin))
405 END DO
406
407 DO ax = 1, 3
408
409 DO ispin = 1, nspins
410 ! 3) build c_i^T*R*c (k x nactive)
411 CALL cp_dbcsr_sm_fm_multiply(dipmat(ax)%matrix, mo_active(ispin), rc(ispin), ncol=nactive(ispin))
412 CALL parallel_gemm('T', 'N', n_states_donor, nactive(ispin), nao, 1.0_dp, state_gs_coeffs(ispin), &
413 rc(ispin), 0.0_dp, crc(ispin))
414
415 ! 4) build mat_product (Y^T*S*X*c_i^T*R*c) (c_nstates x k)
416 CALL parallel_gemm('N', 'T', c_nstates, n_states_donor, nactive(ispin), 1.0_dp, y_overlap_x(ispin), &
417 crc(ispin), 0.0_dp, mat_product(ispin))
418 END DO
419
420 DO istate = 1, c_nstates
421 DO k = 1, n_states_donor
422 dip_block = 0.0_dp
423 DO ispin = 1, nspins
424 CALL cp_fm_get_submatrix(fm=mat_product(ispin), target_m=dip_block, start_row=istate, &
425 start_col=k, n_rows=1, n_cols=1)
426 mu_if(ax, istate, td_state) = mu_if(ax, istate, td_state) + dip_block(1, 1)
427 END DO ! ispin
428 END DO ! k
429 mu_if(4, istate, td_state) = mu_if(4, istate, td_state) + mu_if(ax, istate, td_state)**2
430 END DO ! istate (core)
431
432 END DO ! ax
433
434 END DO ! td_state
435
436 IF (output_unit > 0) THEN
437 WRITE (unit=output_unit, fmt="(/,T2,A,/)") "RIXS| Printing spectrum to file"
438 END IF
439 CALL print_rixs_to_file(current_state, mu_i0, mu_if, w_i0, w_if, rixs_env, rixs_section, rixs_control)
440
441 current_state_index = current_state_index + 1
442
443 ! cleanup
444 DO ispin = 1, nspins
445 CALL cp_fm_release(core_evects(ispin))
446 CALL cp_fm_release(state_gs_coeffs(ispin))
447 CALL cp_fm_release(i_dip_0(ispin))
448 CALL cp_fm_release(rc(ispin))
449 CALL cp_fm_release(crc(ispin))
450 CALL cp_fm_release(overlap_x(ispin))
451 CALL cp_fm_release(y_overlap_x(ispin))
452 CALL cp_fm_release(mat_product(ispin))
453 END DO
454 CALL cp_fm_struct_release(i_dip_0_struct)
455 CALL cp_fm_struct_release(dip_0_struct)
456 CALL cp_fm_release(dip_0)
457
458 END DO ! iatom
459
460 NULLIFY (current_state)
461
462 ! cleanup
463 CALL cp_fm_struct_release(core_evect_struct)
464 CALL cp_fm_struct_release(gs_coeff_struct)
465
466 END IF
467
468 ! more cleanup
469 CALL rixs_control_release(rixs_control)
470 CALL rixs_env_release(rixs_env)
471 NULLIFY (valence_state, core_state)
472
473 CALL timestop(handle)
474
475 END SUBROUTINE rixs_core
476
477!**************************************************************************************************
478!> \brief Print RIXS spectrum.
479!> \param donor_state ...
480!> \param mu_i0 ...
481!> \param mu_if ...
482!> \param w_i0 ...
483!> \param w_if ...
484!> \param rixs_env ...
485!> \param rixs_section ...
486!> \param rixs_control ...
487! **************************************************************************************************
488 SUBROUTINE print_rixs_to_file(donor_state, mu_i0, mu_if, w_i0, w_if, &
489 rixs_env, rixs_section, rixs_control)
490
491 TYPE(donor_state_type), POINTER :: donor_state
492 REAL(dp), DIMENSION(:, :) :: mu_i0
493 REAL(dp), DIMENSION(:, :, :) :: mu_if
494 REAL(dp), DIMENSION(:) :: w_i0, w_if
495 TYPE(rixs_env_type), POINTER :: rixs_env
496 TYPE(section_vals_type), POINTER :: rixs_section
497 TYPE(rixs_control_type), POINTER :: rixs_control
498
499 INTEGER :: f, i, output_unit, rixs_unit
500 TYPE(cp_logger_type), POINTER :: logger
501
502 NULLIFY (logger)
503 logger => cp_get_default_logger()
504
505 rixs_unit = cp_print_key_unit_nr(logger, rixs_section, "PRINT%SPECTRUM", &
506 extension=".rixs", file_position="APPEND", &
507 file_action="WRITE", file_form="FORMATTED")
508
509 output_unit = cp_logger_get_default_io_unit()
510
511 IF (rixs_unit > 0) THEN
512
513 WRITE (rixs_unit, fmt="(A,/,T2,A,A,A,I3,A,A,A/,A)") &
514 "=====================================================================================", &
515 "Excitation from ground-state (", &
516 rixs_env%core_state%state_type_char(donor_state%state_type), " for atom ", &
517 donor_state%at_index, " of kind ", trim(donor_state%at_symbol), &
518 ") to core-excited state i ", &
519 "====================================================================================="
520
521 WRITE (rixs_unit, fmt="(T3,A)") &
522 "w_0i (eV) mu^x_0i (a.u.) mu^y_0i (a.u.) mu^z_0i (a.u.) mu^2_0i (a.u.)"
523 DO i = 1, rixs_control%core_states
524 WRITE (rixs_unit, fmt="(T2,F10.4,T26,E12.5,T42,E12.5,T58,E12.5,T74,E12.5)") &
525 w_i0(i), mu_i0(1, i), mu_i0(2, i), mu_i0(3, i), mu_i0(4, i)
526 END DO
527
528 WRITE (rixs_unit, fmt="(A,/,T2,A,/,A)") &
529 "=====================================================================================", &
530 "Emission from core-excited state i to valence-excited state f ", &
531 "====================================================================================="
532
533 WRITE (rixs_unit, fmt="(T3,A)") &
534 "w_0i (eV) w_if (eV) mu^x_if (a.u.) mu^y_if (a.u.) mu^z_if (a.u.) mu^2_if (a.u.)"
535
536 DO i = 1, rixs_control%core_states
537 DO f = 1, rixs_control%valence_states
538 WRITE (rixs_unit, fmt="(T2,F10.4,T14,F8.4,T26,E12.5,T42,E12.5,T58,E12.5,T74,E12.5)") &
539 w_i0(i), w_if(f), mu_if(1, i, f), mu_if(2, i, f), mu_if(3, i, f), mu_if(4, i, f)
540 END DO
541 END DO
542
543 END IF
544
545 CALL cp_print_key_finished_output(rixs_unit, logger, rixs_section, "PRINT%SPECTRUM")
546
547 END SUBROUTINE print_rixs_to_file
548
549END MODULE rixs_methods
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public vazdacruz2021
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public rixs_control_release(rixs_control)
Releases the rixs_control_type.
subroutine, public rixs_control_create(rixs_control)
Creates and initializes the rixs_control_type.
Utilities to set up the control types.
subroutine, public read_rixs_control(rixs_control, rixs_section, qs_control)
Reads the input and stores in the rixs_control_type.
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
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_create(matrix, matrix_struct, name, use_sp, nrow, ncol, set_zero)
creates a new full matrix with the given structure
subroutine, public cp_fm_to_fm_submat(msource, mtarget, nrow, ncol, s_firstrow, s_firstcol, t_firstrow, t_firstcol)
copy just a part ot the matrix
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,...
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
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)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
subroutine, public rixs_header(iw)
...
Definition header.F:516
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public xas_1s_type
integer, parameter, public xas_2p_type
integer, parameter, public xas_2s_type
objects that represent the structure of input sections and the data contained in an input section
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
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
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public evolt
Definition physcon.F:183
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, mimic, 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, sab_cneo, 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, xcint_weights, 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, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_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, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
subroutine, public tddfpt(qs_env, calc_forces, rixs_env)
Perform TDDFPT calculation. If calc_forces then it also builds the response vector for the Z-vector m...
Methods for Resonant Inelastic XRAY Scattering (RIXS) calculations.
subroutine, public rixs(qs_env)
Driver for RIXS calculations.
Define Resonant Inelastic XRAY Scattering (RIXS) control type and associated create,...
Definition rixs_types.F:13
subroutine, public rixs_env_create(rixs_env)
Creates a rixs environment type.
Definition rixs_types.F:66
subroutine, public rixs_env_release(rixs_env)
Releases the rixs environment type.
Definition rixs_types.F:81
Methods for X-Ray absorption spectroscopy (XAS) using TDDFPT.
subroutine, public xas_tdp(qs_env, rixs_env)
Driver for XAS TDDFT calculations.
Define XAS TDP control type and associated create, release, etc subroutines, as well as XAS TDP envir...
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
Valence state coming from the qs_tddfpt2 routine.
Definition rixs_types.F:40
Type containing informations about a single donor state.
Type containing informations such as inputs and results for TDP XAS calculations.