(git:1f285aa)
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-2024 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 ! **************************************************************************************************
13 
15 
17  USE dbcsr_api, ONLY: &
18  dbcsr_add, dbcsr_add_on_diag, dbcsr_copy, dbcsr_create, dbcsr_deallocate_matrix, &
19  dbcsr_filter, dbcsr_frobenius_norm, dbcsr_multiply, dbcsr_p_type, dbcsr_scale, dbcsr_set, &
20  dbcsr_transposed, dbcsr_type, dbcsr_type_complex_8
21  USE kinds, ONLY: dp
22 #include "./base/base_uses.f90"
23 
24  IMPLICIT NONE
25 
26  PRIVATE
27 
28  CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ls_matrix_exp'
29 
30  PUBLIC :: taylor_only_imaginary_dbcsr, &
35 
36 CONTAINS
37 
38 ! **************************************************************************************************
39 !> \brief Convenience function. Computes the matrix multiplications needed
40 !> for the multiplication of complex sparse matrices.
41 !> C = beta * C + alpha * ( A ** transa ) * ( B ** transb )
42 !> \param transa : 'N' -> normal 'T' -> transpose
43 !> alpha,beta :: can be 0.0_dp and 1.0_dp
44 !> \param transb ...
45 !> \param alpha ...
46 !> \param A_re m x k matrix ( ! for transa = 'N'), real part
47 !> \param A_im m x k matrix ( ! for transa = 'N'), imaginary part
48 !> \param B_re k x n matrix ( ! for transb = 'N'), real part
49 !> \param B_im k x n matrix ( ! for transb = 'N'), imaginary part
50 !> \param beta ...
51 !> \param C_re m x n matrix, real part
52 !> \param C_im m x n matrix, imaginary part
53 !> \param filter_eps ...
54 !> \author Samuel Andermatt
55 !> \note
56 !> C should have no overlap with A, B
57 !> This subroutine uses three real matrix multiplications instead of two complex
58 !> This reduces the amount of flops and memory bandwidth by 25%, but for memory bandwidth
59 !> true complex algebra is still superior (one third less bandwidth needed)
60 !> limited cases matrix multiplications
61 ! **************************************************************************************************
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
143  CALL dbcsr_deallocate_matrix(ac)
144  CALL dbcsr_deallocate_matrix(bd)
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
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 
162  SUBROUTINE taylor_only_imaginary_dbcsr(exp_H, im_matrix, nsquare, ntaylor, filter_eps)
163 
164  TYPE(dbcsr_p_type), DIMENSION(2) :: exp_h
165  TYPE(dbcsr_type), POINTER :: im_matrix
166  INTEGER, INTENT(in) :: nsquare, ntaylor
167  REAL(kind=dp), INTENT(in) :: filter_eps
168 
169  CHARACTER(len=*), PARAMETER :: routinen = 'taylor_only_imaginary_dbcsr'
170  REAL(kind=dp), PARAMETER :: one = 1.0_dp, zero = 0.0_dp
171 
172  INTEGER :: handle, i, nloop
173  REAL(kind=dp) :: square_fac, tfac, tmp
174  TYPE(dbcsr_type), POINTER :: t1, t2, tres_im, tres_re
175 
176  CALL timeset(routinen, handle)
177 
178  !The divider that comes from the scaling and squaring procedure
179  square_fac = 1.0_dp/(2.0_dp**real(nsquare, dp))
180 
181  !Allocate work matrices
182  NULLIFY (t1)
183  ALLOCATE (t1)
184  CALL dbcsr_create(t1, template=im_matrix, matrix_type="N")
185  NULLIFY (t2)
186  ALLOCATE (t2)
187  CALL dbcsr_create(t2, template=im_matrix, matrix_type="N")
188  NULLIFY (tres_re)
189  ALLOCATE (tres_re)
190  CALL dbcsr_create(tres_re, template=im_matrix, matrix_type="N")
191  NULLIFY (tres_im)
192  ALLOCATE (tres_im)
193  CALL dbcsr_create(tres_im, template=im_matrix, matrix_type="N")
194 
195  !Create the unit matrices
196  CALL dbcsr_set(t1, zero)
197  CALL dbcsr_add_on_diag(t1, one)
198  CALL dbcsr_set(tres_re, zero)
199  CALL dbcsr_add_on_diag(tres_re, one)
200  CALL dbcsr_set(tres_im, zero)
201 
202  nloop = ceiling(real(ntaylor, dp)/2.0_dp)
203  !the inverse of the prefactor in the taylor series
204  tmp = 1.0_dp
205  DO i = 1, nloop
206  CALL dbcsr_scale(t1, 1.0_dp/(real(i, dp)*2.0_dp - 1.0_dp))
207  CALL dbcsr_filter(t1, filter_eps)
208  CALL dbcsr_multiply("N", "N", square_fac, im_matrix, t1, zero, &
209  t2, filter_eps=filter_eps)
210  tfac = one
211  IF (mod(i, 2) == 0) tfac = -tfac
212  CALL dbcsr_add(tres_im, t2, one, tfac)
213  CALL dbcsr_scale(t2, 1.0_dp/(real(i, dp)*2.0_dp))
214  CALL dbcsr_filter(t2, filter_eps)
215  CALL dbcsr_multiply("N", "N", square_fac, im_matrix, t2, zero, &
216  t1, filter_eps=filter_eps)
217  tfac = one
218  IF (mod(i, 2) == 1) tfac = -tfac
219  CALL dbcsr_add(tres_re, t1, one, tfac)
220  END DO
221 
222  !Square the matrices, due to the scaling and squaring procedure
223  IF (nsquare .GT. 0) THEN
224  DO i = 1, nsquare
225  CALL cp_complex_dbcsr_gemm_3("N", "N", one, tres_re, tres_im, &
226  tres_re, tres_im, zero, exp_h(1)%matrix, exp_h(2)%matrix, &
227  filter_eps=filter_eps)
228  CALL dbcsr_copy(tres_re, exp_h(1)%matrix)
229  CALL dbcsr_copy(tres_im, exp_h(2)%matrix)
230  END DO
231  ELSE
232  CALL dbcsr_copy(exp_h(1)%matrix, tres_re)
233  CALL dbcsr_copy(exp_h(2)%matrix, tres_im)
234  END IF
235  CALL dbcsr_deallocate_matrix(t1)
236  CALL dbcsr_deallocate_matrix(t2)
237  CALL dbcsr_deallocate_matrix(tres_re)
238  CALL dbcsr_deallocate_matrix(tres_im)
239 
240  CALL timestop(handle)
241 
242  END SUBROUTINE taylor_only_imaginary_dbcsr
243 
244 ! **************************************************************************************************
245 !> \brief subroutine for general complex matrix exponentials
246 !> on input a separate dbcsr_type for real and complex part
247 !> on output a size 2 dbcsr_p_type, first element is the real part of
248 !> the exponential second the imaginary
249 !> \param exp_H ...
250 !> \param re_part ...
251 !> \param im_part ...
252 !> \param nsquare ...
253 !> \param ntaylor ...
254 !> \param filter_eps ...
255 !> \author Samuel Andermatt (02.2014)
256 ! **************************************************************************************************
257  SUBROUTINE taylor_full_complex_dbcsr(exp_H, re_part, im_part, nsquare, ntaylor, filter_eps)
258  TYPE(dbcsr_p_type), DIMENSION(2) :: exp_h
259  TYPE(dbcsr_type), POINTER :: re_part, im_part
260  INTEGER, INTENT(in) :: nsquare, ntaylor
261  REAL(kind=dp), INTENT(in) :: filter_eps
262 
263  CHARACTER(len=*), PARAMETER :: routinen = 'taylor_full_complex_dbcsr'
264  COMPLEX(KIND=dp), PARAMETER :: one = (1.0_dp, 0.0_dp), &
265  zero = (0.0_dp, 0.0_dp)
266 
267  COMPLEX(KIND=dp) :: square_fac
268  INTEGER :: handle, i
269  TYPE(dbcsr_type), POINTER :: t1, t2, t3, tres
270 
271  CALL timeset(routinen, handle)
272 
273  !The divider that comes from the scaling and squaring procedure
274  square_fac = cmplx(1.0_dp/(2.0_dp**real(nsquare, dp)), 0.0_dp, kind=dp)
275 
276  !Allocate work matrices
277  NULLIFY (t1)
278  ALLOCATE (t1)
279  CALL dbcsr_create(t1, template=re_part, matrix_type="N", &
280  data_type=dbcsr_type_complex_8)
281  NULLIFY (t2)
282  ALLOCATE (t2)
283  CALL dbcsr_create(t2, template=re_part, matrix_type="N", &
284  data_type=dbcsr_type_complex_8)
285  NULLIFY (t3)
286  ALLOCATE (t3)
287  CALL dbcsr_create(t3, template=re_part, matrix_type="N", &
288  data_type=dbcsr_type_complex_8)
289  NULLIFY (tres)
290  ALLOCATE (tres)
291  CALL dbcsr_create(tres, template=re_part, matrix_type="N", &
292  data_type=dbcsr_type_complex_8)
293 
294  !Fuse the input matrices to a single complex matrix
295  CALL dbcsr_copy(t3, re_part)
296  CALL dbcsr_copy(tres, im_part) !will later on be set back to zero
297  CALL dbcsr_scale(tres, cmplx(0.0_dp, 1.0_dp, kind=dp))
298  CALL dbcsr_add(t3, tres, one, one)
299 
300  !Create the unit matrices
301  CALL dbcsr_set(t1, zero)
302  CALL dbcsr_add_on_diag(t1, one)
303  CALL dbcsr_set(tres, zero)
304  CALL dbcsr_add_on_diag(tres, one)
305 
306  DO i = 1, ntaylor
307  CALL dbcsr_scale(t1, one/cmplx(i*1.0_dp, 0.0_dp, kind=dp))
308  CALL dbcsr_filter(t1, filter_eps)
309  CALL dbcsr_multiply("N", "N", square_fac, t1, t3, &
310  zero, t2, filter_eps=filter_eps)
311  CALL dbcsr_add(tres, t2, one, one)
312  CALL dbcsr_copy(t1, t2)
313  END DO
314 
315  IF (nsquare .GT. 0) THEN
316  DO i = 1, nsquare
317  CALL dbcsr_multiply("N", "N", one, tres, tres, zero, &
318  t2, filter_eps=filter_eps)
319  CALL dbcsr_copy(tres, t2)
320  END DO
321  END IF
322 
323  CALL dbcsr_copy(exp_h(1)%matrix, tres, keep_imaginary=.false.)
324  CALL dbcsr_scale(tres, cmplx(0.0_dp, -1.0_dp, kind=dp))
325  CALL dbcsr_copy(exp_h(2)%matrix, tres, keep_imaginary=.false.)
326 
327  CALL dbcsr_deallocate_matrix(t1)
328  CALL dbcsr_deallocate_matrix(t2)
329  CALL dbcsr_deallocate_matrix(t3)
330  CALL dbcsr_deallocate_matrix(tres)
331 
332  CALL timestop(handle)
333 
334  END SUBROUTINE taylor_full_complex_dbcsr
335 
336 ! **************************************************************************************************
337 !> \brief The Baker-Campbell-Hausdorff expansion for a purely imaginary exponent (e.g. rtp)
338 !> Works for a non unitary propagator, because the density matrix is hermitian
339 !> \param propagator The exponent of the matrix exponential
340 !> \param density_re Real part of the density matrix
341 !> \param density_im Imaginary part of the density matrix
342 !> \param filter_eps The filtering threshold for all matrices
343 !> \param filter_eps_small ...
344 !> \param eps_exp The accuracy of the exponential
345 !> \author Samuel Andermatt (02.2014)
346 ! **************************************************************************************************
347 
348  SUBROUTINE bch_expansion_imaginary_propagator(propagator, density_re, density_im, filter_eps, filter_eps_small, eps_exp)
349  TYPE(dbcsr_type), POINTER :: propagator, density_re, density_im
350  REAL(kind=dp), INTENT(in) :: filter_eps, filter_eps_small, eps_exp
351 
352  CHARACTER(len=*), PARAMETER :: routinen = 'bch_expansion_imaginary_propagator'
353  REAL(kind=dp), PARAMETER :: one = 1.0_dp, zero = 0.0_dp
354 
355  INTEGER :: handle, i, unit_nr
356  LOGICAL :: convergence
357  REAL(kind=dp) :: alpha, max_alpha, prefac
358  TYPE(dbcsr_type), POINTER :: comm, comm2, tmp, tmp2
359 
360  CALL timeset(routinen, handle)
361 
363 
364  NULLIFY (tmp)
365  ALLOCATE (tmp)
366  CALL dbcsr_create(tmp, template=propagator)
367  NULLIFY (tmp2)
368  ALLOCATE (tmp2)
369  CALL dbcsr_create(tmp2, template=propagator)
370  NULLIFY (comm)
371  ALLOCATE (comm)
372  CALL dbcsr_create(comm, template=propagator)
373  NULLIFY (comm2)
374  ALLOCATE (comm2)
375  CALL dbcsr_create(comm2, template=propagator)
376 
377  CALL dbcsr_copy(tmp, density_re)
378  CALL dbcsr_copy(tmp2, density_im)
379 
380  convergence = .false.
381  DO i = 1, 20
382  prefac = one/i
383  CALL dbcsr_multiply("N", "N", -prefac, propagator, tmp2, zero, comm, &
384  filter_eps=filter_eps_small)
385  CALL dbcsr_multiply("N", "N", prefac, propagator, tmp, zero, comm2, &
386  filter_eps=filter_eps_small)
387  CALL dbcsr_transposed(tmp, comm)
388  CALL dbcsr_transposed(tmp2, comm2)
389  CALL dbcsr_add(comm, tmp, one, one)
390  CALL dbcsr_add(comm2, tmp2, one, -one)
391  CALL dbcsr_add(density_re, comm, one, one)
392  CALL dbcsr_add(density_im, comm2, one, one)
393  CALL dbcsr_copy(tmp, comm)
394  CALL dbcsr_copy(tmp2, comm2)
395  !check for convergence
396  max_alpha = zero
397  alpha = dbcsr_frobenius_norm(comm)
398  IF (alpha > max_alpha) max_alpha = alpha
399  alpha = dbcsr_frobenius_norm(comm2)
400  IF (alpha > max_alpha) max_alpha = alpha
401  IF (max_alpha < eps_exp) convergence = .true.
402  IF (convergence) THEN
403  IF (unit_nr > 0) WRITE (unit=unit_nr, fmt="((T3,A,I2,A))") &
404  "BCH converged after ", i, " steps"
405  EXIT
406  END IF
407  END DO
408 
409  CALL dbcsr_filter(density_re, filter_eps)
410  CALL dbcsr_filter(density_im, filter_eps)
411 
412  IF (.NOT. convergence) &
413  cpwarn("BCH method did not converge")
414 
415  CALL dbcsr_deallocate_matrix(tmp)
416  CALL dbcsr_deallocate_matrix(tmp2)
417  CALL dbcsr_deallocate_matrix(comm)
418  CALL dbcsr_deallocate_matrix(comm2)
419 
420  CALL timestop(handle)
421 
422  END SUBROUTINE
423 
424 ! **************************************************************************************************
425 !> \brief The Baker-Campbell-Hausdorff expansion for a complex exponent (e.g. rtp)
426 !> Works for a non unitary propagator, because the density matrix is hermitian
427 !> \param propagator_re Real part of the exponent
428 !> \param propagator_im Imaginary part of the exponent
429 !> \param density_re Real part of the density matrix
430 !> \param density_im Imaginary part of the density matrix
431 !> \param filter_eps The filtering threshold for all matrices
432 !> \param filter_eps_small ...
433 !> \param eps_exp The accuracy of the exponential
434 !> \author Samuel Andermatt (02.2014)
435 ! **************************************************************************************************
436 
437  SUBROUTINE bch_expansion_complex_propagator(propagator_re, propagator_im, density_re, density_im, filter_eps, &
438  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  IF (.NOT. convergence) &
503  cpwarn("BCH method did not converge ")
504 
505  CALL dbcsr_deallocate_matrix(tmp)
506  CALL dbcsr_deallocate_matrix(tmp2)
507  CALL dbcsr_deallocate_matrix(comm)
508  CALL dbcsr_deallocate_matrix(comm2)
509 
510  CALL timestop(handle)
511 
512  END SUBROUTINE
513 
514 END MODULE ls_matrix_exp
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...
Definition: ls_matrix_exp.F:14
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_only_imaginary_dbcsr(exp_H, im_matrix, nsquare, ntaylor, filter_eps)
specialized subroutine for purely imaginary matrix exponentials
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 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...
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...
Definition: ls_matrix_exp.F:65