(git:ed6f26b)
Loading...
Searching...
No Matches
ls_matrix_exp.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 for calculating a complex matrix exponential with dbcsr matrices.
10!> Based on the code in matrix_exp.F from Florian Schiffmann
11!> \author Samuel Andermatt (02.14)
12! **************************************************************************************************
14
15 USE cp_dbcsr_api, ONLY: &
22 USE kinds, ONLY: dp
23#include "./base/base_uses.f90"
24
25 IMPLICIT NONE
26
27 PRIVATE
28
29 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ls_matrix_exp'
30
36
37CONTAINS
38
39! **************************************************************************************************
40!> \brief Convenience function. Computes the matrix multiplications needed
41!> for the multiplication of complex sparse matrices.
42!> C = beta * C + alpha * ( A ** transa ) * ( B ** transb )
43!> \param transa : 'N' -> normal 'T' -> transpose
44!> alpha,beta :: can be 0.0_dp and 1.0_dp
45!> \param transb ...
46!> \param alpha ...
47!> \param A_re m x k matrix ( ! for transa = 'N'), real part
48!> \param A_im m x k matrix ( ! for transa = 'N'), imaginary part
49!> \param B_re k x n matrix ( ! for transb = 'N'), real part
50!> \param B_im k x n matrix ( ! for transb = 'N'), imaginary part
51!> \param beta ...
52!> \param C_re m x n matrix, real part
53!> \param C_im m x n matrix, imaginary part
54!> \param filter_eps ...
55!> \author Samuel Andermatt
56!> \note
57!> C should have no overlap with A, B
58!> This subroutine uses three real matrix multiplications instead of two complex
59!> This reduces the amount of flops and memory bandwidth by 25%, but for memory bandwidth
60!> true complex algebra is still superior (one third less bandwidth needed)
61!> limited cases matrix multiplications
62! **************************************************************************************************
63 SUBROUTINE cp_complex_dbcsr_gemm_3(transa, transb, alpha, A_re, A_im, &
64 B_re, B_im, beta, C_re, C_im, filter_eps)
65 CHARACTER(LEN=1), INTENT(IN) :: transa, transb
66 REAL(kind=dp), INTENT(IN) :: alpha
67 TYPE(dbcsr_type), INTENT(IN) :: a_re, a_im, b_re, b_im
68 REAL(kind=dp), INTENT(IN) :: beta
69 TYPE(dbcsr_type), INTENT(INOUT) :: c_re, c_im
70 REAL(kind=dp), INTENT(IN), OPTIONAL :: filter_eps
71
72 CHARACTER(len=*), PARAMETER :: routinen = 'cp_complex_dbcsr_gemm_3'
73 REAL(kind=dp), PARAMETER :: one = 1.0_dp, zero = 0.0_dp
74
75 CHARACTER(LEN=1) :: transa2, transb2
76 INTEGER :: handle
77 REAL(kind=dp) :: alpha2, alpha3, alpha4
78 TYPE(dbcsr_type), POINTER :: a_plus_b, ac, bd, c_plus_d
79
80 CALL timeset(routinen, handle)
81 !A complex matrix matrix multiplication can be done with only three multiplications
82 !(a+ib)*(c+id)=ac-bd+i((a+b)*(c+d) - ac - bd)
83 !A_re=a, A_im=b, B_re=c, B_im=d
84
85 alpha2 = -alpha
86 alpha3 = alpha
87 alpha4 = alpha
88
89 IF (transa == "C") THEN
90 alpha2 = -alpha2
91 alpha3 = -alpha3
92 transa2 = "T"
93 ELSE
94 transa2 = transa
95 END IF
96 IF (transb == "C") THEN
97 alpha2 = -alpha2
98 alpha4 = -alpha4
99 transb2 = "T"
100 ELSE
101 transb2 = transb
102 END IF
103
104 !create the work matrices
105 NULLIFY (ac)
106 ALLOCATE (ac)
107 CALL dbcsr_create(ac, template=a_re, matrix_type="N")
108 NULLIFY (bd)
109 ALLOCATE (bd)
110 CALL dbcsr_create(bd, template=a_re, matrix_type="N")
111 NULLIFY (a_plus_b)
112 ALLOCATE (a_plus_b)
113 CALL dbcsr_create(a_plus_b, template=a_re, matrix_type="N")
114 NULLIFY (c_plus_d)
115 ALLOCATE (c_plus_d)
116 CALL dbcsr_create(c_plus_d, template=a_re, matrix_type="N")
117
118 !Do the neccesarry multiplications
119 CALL dbcsr_multiply(transa2, transb2, alpha, a_re, b_re, zero, ac, filter_eps=filter_eps)
120 CALL dbcsr_multiply(transa2, transb2, alpha2, a_im, b_im, zero, bd, filter_eps=filter_eps)
121
122 CALL dbcsr_add(a_plus_b, a_re, zero, alpha)
123 CALL dbcsr_add(a_plus_b, a_im, one, alpha3)
124 CALL dbcsr_add(c_plus_d, b_re, zero, alpha)
125 CALL dbcsr_add(c_plus_d, b_im, one, alpha4)
126
127 !this can already be written into C_im
128 !now both matrixes have been scaled which means we currently multiplied by alpha squared
129 CALL dbcsr_multiply(transa2, transb2, one/alpha, a_plus_b, c_plus_d, beta, c_im, filter_eps=filter_eps)
130
131 !now add up all the terms into the result
132 CALL dbcsr_add(c_re, ac, beta, one)
133 !the minus sign was already taken care of at the definition of alpha2
134 CALL dbcsr_add(c_re, bd, one, one)
135 CALL dbcsr_filter(c_re, filter_eps)
136
137 CALL dbcsr_add(c_im, ac, one, -one)
138 !the minus sign was already taken care of at the definition of alpha2
139 CALL dbcsr_add(c_im, bd, one, one)
140 CALL dbcsr_filter(c_im, filter_eps)
141
142 !Deallocate the work matrices
145 CALL dbcsr_deallocate_matrix(a_plus_b)
146 CALL dbcsr_deallocate_matrix(c_plus_d)
147
148 CALL timestop(handle)
149
150 END SUBROUTINE cp_complex_dbcsr_gemm_3
151
152! **************************************************************************************************
153!> \brief specialized subroutine for purely imaginary matrix exponentials
154!> \param exp_H ...
155!> \param im_matrix ...
156!> \param nsquare ...
157!> \param ntaylor ...
158!> \param filter_eps ...
159!> \author Samuel Andermatt (02.2014)
160! **************************************************************************************************
161 SUBROUTINE taylor_only_imaginary_dbcsr(exp_H, im_matrix, nsquare, ntaylor, filter_eps)
162
163 TYPE(dbcsr_p_type), DIMENSION(2) :: exp_h
164 TYPE(dbcsr_type), POINTER :: im_matrix
165 INTEGER, INTENT(in) :: nsquare, ntaylor
166 REAL(kind=dp), INTENT(in) :: filter_eps
167
168 CHARACTER(len=*), PARAMETER :: routinen = 'taylor_only_imaginary_dbcsr'
169 REAL(kind=dp), PARAMETER :: one = 1.0_dp, zero = 0.0_dp
170
171 INTEGER :: handle, i, nloop
172 REAL(kind=dp) :: square_fac, tfac, tmp
173 TYPE(dbcsr_type), POINTER :: t1, t2, tres_im, tres_re
174
175 CALL timeset(routinen, handle)
176
177 !The divider that comes from the scaling and squaring procedure
178 square_fac = 1.0_dp/(2.0_dp**real(nsquare, dp))
179
180 !Allocate work matrices
181 NULLIFY (t1)
182 ALLOCATE (t1)
183 CALL dbcsr_create(t1, template=im_matrix, matrix_type="N")
184 NULLIFY (t2)
185 ALLOCATE (t2)
186 CALL dbcsr_create(t2, template=im_matrix, matrix_type="N")
187 NULLIFY (tres_re)
188 ALLOCATE (tres_re)
189 CALL dbcsr_create(tres_re, template=im_matrix, matrix_type="N")
190 NULLIFY (tres_im)
191 ALLOCATE (tres_im)
192 CALL dbcsr_create(tres_im, template=im_matrix, matrix_type="N")
193
194 !Create the unit matrices
195 CALL dbcsr_set(t1, zero)
196 CALL dbcsr_add_on_diag(t1, one)
197 CALL dbcsr_set(tres_re, zero)
198 CALL dbcsr_add_on_diag(tres_re, one)
199 CALL dbcsr_set(tres_im, zero)
200
201 nloop = ceiling(real(ntaylor, dp)/2.0_dp)
202 !the inverse of the prefactor in the taylor series
203 tmp = 1.0_dp
204 DO i = 1, nloop
205 CALL dbcsr_scale(t1, 1.0_dp/(real(i, dp)*2.0_dp - 1.0_dp))
206 CALL dbcsr_filter(t1, filter_eps)
207 CALL dbcsr_multiply("N", "N", square_fac, im_matrix, t1, zero, &
208 t2, filter_eps=filter_eps)
209 tfac = one
210 IF (mod(i, 2) == 0) tfac = -tfac
211 CALL dbcsr_add(tres_im, t2, one, tfac)
212 CALL dbcsr_scale(t2, 1.0_dp/(real(i, dp)*2.0_dp))
213 CALL dbcsr_filter(t2, filter_eps)
214 CALL dbcsr_multiply("N", "N", square_fac, im_matrix, t2, zero, &
215 t1, filter_eps=filter_eps)
216 tfac = one
217 IF (mod(i, 2) == 1) tfac = -tfac
218 CALL dbcsr_add(tres_re, t1, one, tfac)
219 END DO
220
221 !Square the matrices, due to the scaling and squaring procedure
222 IF (nsquare .GT. 0) THEN
223 DO i = 1, nsquare
224 CALL cp_complex_dbcsr_gemm_3("N", "N", one, tres_re, tres_im, &
225 tres_re, tres_im, zero, exp_h(1)%matrix, exp_h(2)%matrix, &
226 filter_eps=filter_eps)
227 CALL dbcsr_copy(tres_re, exp_h(1)%matrix)
228 CALL dbcsr_copy(tres_im, exp_h(2)%matrix)
229 END DO
230 ELSE
231 CALL dbcsr_copy(exp_h(1)%matrix, tres_re)
232 CALL dbcsr_copy(exp_h(2)%matrix, tres_im)
233 END IF
236 CALL dbcsr_deallocate_matrix(tres_re)
237 CALL dbcsr_deallocate_matrix(tres_im)
238
239 CALL timestop(handle)
240
241 END SUBROUTINE taylor_only_imaginary_dbcsr
242
243! **************************************************************************************************
244!> \brief subroutine for general complex matrix exponentials
245!> on input a separate dbcsr_type for real and complex part
246!> on output a size 2 dbcsr_p_type, first element is the real part of
247!> the exponential second the imaginary
248!> \param exp_H ...
249!> \param re_part ...
250!> \param im_part ...
251!> \param nsquare ...
252!> \param ntaylor ...
253!> \param filter_eps ...
254!> \author Samuel Andermatt (02.2014)
255! **************************************************************************************************
256 SUBROUTINE taylor_full_complex_dbcsr(exp_H, re_part, im_part, nsquare, ntaylor, filter_eps)
257 TYPE(dbcsr_p_type), DIMENSION(2) :: exp_h
258 TYPE(dbcsr_type), POINTER :: re_part, im_part
259 INTEGER, INTENT(in) :: nsquare, ntaylor
260 REAL(kind=dp), INTENT(in) :: filter_eps
261
262 CHARACTER(len=*), PARAMETER :: routinen = 'taylor_full_complex_dbcsr'
263
264 INTEGER :: handle, i
265 REAL(kind=dp) :: square_fac
266 TYPE(dbcsr_type) :: t1_im, t1_re, t2_im, t2_re
267 TYPE(dbcsr_type), POINTER :: tres_im, tres_re
268
269 CALL timeset(routinen, handle)
270
271 ! convenient aliases for result matrices
272 tres_re => exp_h(1)%matrix
273 tres_im => exp_h(2)%matrix
274
275 ! The divider that comes from the scaling and squaring procedure
276 square_fac = 1.0_dp/real(2**nsquare, dp)
277
278 ! Allocate work matrices
279 CALL dbcsr_create(t1_re, template=re_part, matrix_type="N")
280 CALL dbcsr_create(t1_im, template=re_part, matrix_type="N")
281 CALL dbcsr_create(t2_re, template=re_part, matrix_type="N")
282 CALL dbcsr_create(t2_im, template=re_part, matrix_type="N")
283
284 ! T1 = identity
285 CALL dbcsr_set(t1_re, 0.0_dp)
286 CALL dbcsr_set(t1_im, 0.0_dp)
287 CALL dbcsr_add_on_diag(t1_re, 1.0_dp)
288
289 ! Tres = identity
290 CALL dbcsr_set(tres_re, 0.0_dp)
291 CALL dbcsr_set(tres_im, 0.0_dp)
292 CALL dbcsr_add_on_diag(tres_re, 1.0_dp)
293
294 DO i = 1, ntaylor
295 ! T1 = T1 / i
296 CALL dbcsr_scale(t1_re, 1.0_dp/real(i, dp))
297 CALL dbcsr_scale(t1_im, 1.0_dp/real(i, dp))
298 CALL dbcsr_filter(t1_re, filter_eps)
299 CALL dbcsr_filter(t1_im, filter_eps)
300
301 ! T2 = square_fac * T1 * input
302 CALL cp_complex_dbcsr_gemm_3("N", "N", alpha=square_fac, beta=0.0_dp, &
303 a_re=t1_re, a_im=t1_im, &
304 b_re=re_part, b_im=im_part, &
305 c_re=t2_re, c_im=t2_im, filter_eps=filter_eps)
306
307 ! Tres = Tres + T2
308 CALL dbcsr_add(tres_re, t2_re, 1.0_dp, 1.0_dp)
309 CALL dbcsr_add(tres_im, t2_im, 1.0_dp, 1.0_dp)
310
311 ! T1 = T2
312 CALL dbcsr_copy(t1_re, t2_re)
313 CALL dbcsr_copy(t1_im, t2_im)
314 END DO
315
316 IF (nsquare .GT. 0) THEN
317 DO i = 1, nsquare
318 ! T2 = Tres * Tres
319 CALL cp_complex_dbcsr_gemm_3("N", "N", alpha=1.0_dp, beta=0.0_dp, &
320 a_re=tres_re, a_im=tres_im, &
321 b_re=tres_re, b_im=tres_im, &
322 c_re=t2_re, c_im=t2_im, filter_eps=filter_eps)
323
324 ! Tres = T2
325 CALL dbcsr_copy(tres_re, t2_re)
326 CALL dbcsr_copy(tres_im, t2_im)
327 END DO
328 END IF
329
330 CALL dbcsr_release(t1_re)
331 CALL dbcsr_release(t1_im)
332 CALL dbcsr_release(t2_re)
333 CALL dbcsr_release(t2_im)
334
335 CALL timestop(handle)
336
337 END SUBROUTINE taylor_full_complex_dbcsr
338
339! **************************************************************************************************
340!> \brief The Baker-Campbell-Hausdorff expansion for a purely imaginary exponent (e.g. rtp)
341!> Works for a non unitary propagator, because the density matrix is hermitian
342!> \param propagator The exponent of the matrix exponential
343!> \param density_re Real part of the density matrix
344!> \param density_im Imaginary part of the density matrix
345!> \param filter_eps The filtering threshold for all matrices
346!> \param filter_eps_small ...
347!> \param eps_exp The accuracy of the exponential
348!> \author Samuel Andermatt (02.2014)
349! **************************************************************************************************
350 SUBROUTINE bch_expansion_imaginary_propagator(propagator, density_re, density_im, filter_eps, filter_eps_small, eps_exp)
351 TYPE(dbcsr_type), POINTER :: propagator, density_re, density_im
352 REAL(kind=dp), INTENT(in) :: filter_eps, filter_eps_small, eps_exp
353
354 CHARACTER(len=*), PARAMETER :: routinen = 'bch_expansion_imaginary_propagator'
355 REAL(kind=dp), PARAMETER :: one = 1.0_dp, zero = 0.0_dp
356
357 INTEGER :: handle, i, unit_nr
358 LOGICAL :: convergence
359 REAL(kind=dp) :: alpha, max_alpha, prefac
360 TYPE(dbcsr_type), POINTER :: comm, comm2, tmp, tmp2
361
362 CALL timeset(routinen, handle)
363
365
366 NULLIFY (tmp)
367 ALLOCATE (tmp)
368 CALL dbcsr_create(tmp, template=propagator)
369 NULLIFY (tmp2)
370 ALLOCATE (tmp2)
371 CALL dbcsr_create(tmp2, template=propagator)
372 NULLIFY (comm)
373 ALLOCATE (comm)
374 CALL dbcsr_create(comm, template=propagator)
375 NULLIFY (comm2)
376 ALLOCATE (comm2)
377 CALL dbcsr_create(comm2, template=propagator)
378
379 CALL dbcsr_copy(tmp, density_re)
380 CALL dbcsr_copy(tmp2, density_im)
381
382 convergence = .false.
383 DO i = 1, 20
384 prefac = one/i
385 CALL dbcsr_multiply("N", "N", -prefac, propagator, tmp2, zero, comm, &
386 filter_eps=filter_eps_small)
387 CALL dbcsr_multiply("N", "N", prefac, propagator, tmp, zero, comm2, &
388 filter_eps=filter_eps_small)
389 CALL dbcsr_transposed(tmp, comm)
390 CALL dbcsr_transposed(tmp2, comm2)
391 CALL dbcsr_add(comm, tmp, one, one)
392 CALL dbcsr_add(comm2, tmp2, one, -one)
393 CALL dbcsr_add(density_re, comm, one, one)
394 CALL dbcsr_add(density_im, comm2, one, one)
395 CALL dbcsr_copy(tmp, comm)
396 CALL dbcsr_copy(tmp2, comm2)
397 !check for convergence
398 max_alpha = zero
399 alpha = dbcsr_frobenius_norm(comm)
400 IF (alpha > max_alpha) max_alpha = alpha
401 alpha = dbcsr_frobenius_norm(comm2)
402 IF (alpha > max_alpha) max_alpha = alpha
403 IF (max_alpha < eps_exp) convergence = .true.
404 IF (convergence) THEN
405 IF (unit_nr > 0) WRITE (unit=unit_nr, fmt="((T3,A,I2,A))") &
406 "BCH converged after ", i, " steps"
407 EXIT
408 END IF
409 END DO
410
411 CALL dbcsr_filter(density_re, filter_eps)
412 CALL dbcsr_filter(density_im, filter_eps)
413
414 cpwarn_if(.NOT. convergence, "BCH method did not converge")
415
417 CALL dbcsr_deallocate_matrix(tmp2)
418 CALL dbcsr_deallocate_matrix(comm)
419 CALL dbcsr_deallocate_matrix(comm2)
420
421 CALL timestop(handle)
422
424
425! **************************************************************************************************
426!> \brief The Baker-Campbell-Hausdorff expansion for a complex exponent (e.g. rtp)
427!> Works for a non unitary propagator, because the density matrix is hermitian
428!> \param propagator_re Real part of the exponent
429!> \param propagator_im Imaginary part of the exponent
430!> \param density_re Real part of the density matrix
431!> \param density_im Imaginary part of the density matrix
432!> \param filter_eps The filtering threshold for all matrices
433!> \param filter_eps_small ...
434!> \param eps_exp The accuracy of the exponential
435!> \author Samuel Andermatt (02.2014)
436! **************************************************************************************************
437 SUBROUTINE bch_expansion_complex_propagator(propagator_re, propagator_im, density_re, density_im, &
438 filter_eps, filter_eps_small, eps_exp)
439 TYPE(dbcsr_type), POINTER :: propagator_re, propagator_im, &
440 density_re, density_im
441 REAL(kind=dp), INTENT(in) :: filter_eps, filter_eps_small, eps_exp
442
443 CHARACTER(len=*), PARAMETER :: routinen = 'bch_expansion_complex_propagator'
444 REAL(kind=dp), PARAMETER :: one = 1.0_dp, zero = 0.0_dp
445
446 INTEGER :: handle, i, unit_nr
447 LOGICAL :: convergence
448 REAL(kind=dp) :: alpha, max_alpha, prefac
449 TYPE(dbcsr_type), POINTER :: comm, comm2, tmp, tmp2
450
451 CALL timeset(routinen, handle)
452
454
455 NULLIFY (tmp)
456 ALLOCATE (tmp)
457 CALL dbcsr_create(tmp, template=propagator_re)
458 NULLIFY (tmp2)
459 ALLOCATE (tmp2)
460 CALL dbcsr_create(tmp2, template=propagator_re)
461 NULLIFY (comm)
462 ALLOCATE (comm)
463 CALL dbcsr_create(comm, template=propagator_re)
464 NULLIFY (comm2)
465 ALLOCATE (comm2)
466 CALL dbcsr_create(comm2, template=propagator_re)
467
468 CALL dbcsr_copy(tmp, density_re)
469 CALL dbcsr_copy(tmp2, density_im)
470
471 convergence = .false.
472
473 DO i = 1, 20
474 prefac = one/i
475 CALL cp_complex_dbcsr_gemm_3("N", "N", prefac, propagator_re, propagator_im, &
476 tmp, tmp2, zero, comm, comm2, filter_eps=filter_eps_small)
477 CALL dbcsr_transposed(tmp, comm)
478 CALL dbcsr_transposed(tmp2, comm2)
479 CALL dbcsr_add(comm, tmp, one, one)
480 CALL dbcsr_add(comm2, tmp2, one, -one)
481 CALL dbcsr_add(density_re, comm, one, one)
482 CALL dbcsr_add(density_im, comm2, one, one)
483 CALL dbcsr_copy(tmp, comm)
484 CALL dbcsr_copy(tmp2, comm2)
485 !check for convergence
486 max_alpha = zero
487 alpha = dbcsr_frobenius_norm(comm)
488 IF (alpha > max_alpha) max_alpha = alpha
489 alpha = dbcsr_frobenius_norm(comm2)
490 IF (alpha > max_alpha) max_alpha = alpha
491 IF (max_alpha < eps_exp) convergence = .true.
492 IF (convergence) THEN
493 IF (unit_nr > 0) WRITE (unit=unit_nr, fmt="((T3,A,I2,A))") &
494 "BCH converged after ", i, " steps"
495 EXIT
496 END IF
497 END DO
498
499 CALL dbcsr_filter(density_re, filter_eps)
500 CALL dbcsr_filter(density_im, filter_eps)
501
502 cpwarn_if(.NOT. convergence, "BCH method did not converge")
503
505 CALL dbcsr_deallocate_matrix(tmp2)
506 CALL dbcsr_deallocate_matrix(comm)
507 CALL dbcsr_deallocate_matrix(comm2)
508
509 CALL timestop(handle)
510
512
513END MODULE ls_matrix_exp
subroutine, public dbcsr_transposed(transposed, normal, shallow_data_copy, transpose_distribution, use_distribution)
...
subroutine, public dbcsr_scale(matrix, alpha_scalar)
...
subroutine, public dbcsr_deallocate_matrix(matrix)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_multiply(transa, transb, alpha, matrix_a, matrix_b, beta, matrix_c, first_row, last_row, first_column, last_column, first_k, last_k, retain_sparsity, filter_eps, flop)
...
subroutine, public dbcsr_filter(matrix, eps)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
subroutine, public dbcsr_add_on_diag(matrix, alpha)
Adds the given scalar to the diagonal of the matrix. Reserves any missing diagonal blocks.
real(dp) function, public dbcsr_frobenius_norm(matrix)
Compute the frobenius norm of a dbcsr matrix.
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...
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Routines for calculating a complex matrix exponential with dbcsr matrices. Based on the code in matri...
subroutine, public taylor_only_imaginary_dbcsr(exp_h, im_matrix, nsquare, ntaylor, filter_eps)
specialized subroutine for purely imaginary matrix exponentials
subroutine, public bch_expansion_imaginary_propagator(propagator, density_re, density_im, filter_eps, filter_eps_small, eps_exp)
The Baker-Campbell-Hausdorff expansion for a purely imaginary exponent (e.g. rtp) Works for a non uni...
subroutine, public taylor_full_complex_dbcsr(exp_h, re_part, im_part, nsquare, ntaylor, filter_eps)
subroutine for general complex matrix exponentials on input a separate dbcsr_type for real and comple...
subroutine, public cp_complex_dbcsr_gemm_3(transa, transb, alpha, a_re, a_im, b_re, b_im, beta, c_re, c_im, filter_eps)
Convenience function. Computes the matrix multiplications needed for the multiplication of complex sp...
subroutine, public bch_expansion_complex_propagator(propagator_re, propagator_im, density_re, density_im, filter_eps, filter_eps_small, eps_exp)
The Baker-Campbell-Hausdorff expansion for a complex exponent (e.g. rtp) Works for a non unitary prop...