46#include "../base/base_uses.f90"
52 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'rt_make_propagators'
76 CHARACTER(len=*),
PARAMETER :: routinen =
'propagate_exp'
77 REAL(kind=
dp),
PARAMETER :: one = 1.0_dp, zero = 0.0_dp
79 INTEGER :: handle, i, im, nmo, re
80 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: mos_new, mos_next, mos_old
81 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: exp_h_new, exp_h_old, propagator_matrix
83 CALL timeset(routinen, handle)
85 CALL get_rtp(rtp=rtp, propagator_matrix=propagator_matrix, mos_old=mos_old, mos_new=mos_new, &
86 mos_next=mos_next, exp_h_new=exp_h_new, exp_h_old=exp_h_old)
91 DO i = 1,
SIZE(mos_new)/2
98 IF (rtp%iter == 1)
THEN
99 IF (rtp_control%propagator ==
do_etrs)
THEN
101 mos_next(re), nmo, alpha=one, beta=zero)
103 mos_next(re), nmo, alpha=-one, beta=one)
105 mos_next(im), nmo, alpha=one, beta=zero)
107 mos_next(im), nmo, alpha=one, beta=one)
114 mos_new(re), nmo, alpha=one, beta=zero)
116 mos_new(re), nmo, alpha=-one, beta=one)
118 mos_new(im), nmo, alpha=one, beta=zero)
120 mos_new(im), nmo, alpha=one, beta=one)
123 CALL timestop(handle)
140 CHARACTER(len=*),
PARAMETER :: routinen =
'propagate_exp_density'
141 REAL(kind=
dp),
PARAMETER :: one = 1.0_dp, zero = 0.0_dp
143 INTEGER :: handle, i, im, re
144 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: exp_h_new, exp_h_old, propagator_matrix, &
145 rho_new, rho_next, rho_old
148 CALL timeset(routinen, handle)
150 CALL get_rtp(rtp=rtp, propagator_matrix=propagator_matrix, exp_h_new=exp_h_new, &
151 exp_h_old=exp_h_old, rho_old=rho_old, rho_new=rho_new, rho_next=rho_next)
158 CALL dbcsr_create(tmp_re, template=propagator_matrix(1)%matrix, matrix_type=
"N")
161 CALL dbcsr_create(tmp_im, template=propagator_matrix(1)%matrix, matrix_type=
"N")
163 DO i = 1,
SIZE(exp_h_new)/2
168 IF (rtp%iter == 1)
THEN
169 IF (rtp_control%propagator ==
do_etrs)
THEN
171 rho_old(re)%matrix, rho_old(im)%matrix, zero, tmp_re, tmp_im, filter_eps=rtp%filter_eps)
173 zero, rho_next(re)%matrix, rho_next(im)%matrix, filter_eps=rtp%filter_eps)
175 CALL dbcsr_copy(rho_next(re)%matrix, rho_old(re)%matrix)
176 CALL dbcsr_copy(rho_next(im)%matrix, rho_old(im)%matrix)
180 rho_next(re)%matrix, rho_next(im)%matrix, zero, tmp_re, tmp_im, filter_eps=rtp%filter_eps)
182 zero, rho_new(re)%matrix, rho_new(im)%matrix, filter_eps=rtp%filter_eps)
188 CALL timestop(handle)
203 CHARACTER(len=*),
PARAMETER :: routinen =
'propagate_arnoldi'
205 INTEGER :: handle, i, im, ispin, nspin, re
206 REAL(
dp) :: eps_arnoldi, t
207 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: propagator_matrix_fm
208 TYPE(
cp_fm_type),
DIMENSION(:),
POINTER :: mos_new, mos_next, mos_old
209 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: propagator_matrix
211 CALL timeset(routinen, handle)
213 CALL get_rtp(rtp=rtp, dt=t, mos_new=mos_new, mos_old=mos_old, &
214 mos_next=mos_next, propagator_matrix=propagator_matrix)
216 nspin =
SIZE(mos_new)/2
217 eps_arnoldi = rtp_control%eps_exp
221 IF (rtp_control%propagator ==
do_etrs .AND. rtp%iter == 1)
THEN
222 DO i = 1,
SIZE(mos_new)
227 ALLOCATE (propagator_matrix_fm(
SIZE(propagator_matrix)))
228 DO i = 1,
SIZE(propagator_matrix)
230 matrix_struct=rtp%ao_ao_fmstruct, &
238 IF (rtp_control%fixed_ions .AND. .NOT. rtp%propagate_complex_ks)
THEN
239 CALL arnoldi(mos_old(re:im), mos_new(re:im), &
240 eps_arnoldi, him=propagator_matrix_fm(im), &
241 mos_next=mos_next(re:im), narn_old=rtp%narn_old)
243 CALL arnoldi(mos_old(re:im), mos_new(re:im), &
244 eps_arnoldi, hre=propagator_matrix_fm(re), &
245 him=propagator_matrix_fm(im), mos_next=mos_next(re:im), &
246 narn_old=rtp%narn_old)
255 CALL timestop(handle)
272 CHARACTER(len=*),
PARAMETER :: routinen =
'propagate_bch'
274 INTEGER :: handle, im, ispin, re
276 REAL(kind=
dp) :: prefac
277 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: exp_h_old, propagator_matrix, rho_new, &
280 CALL timeset(routinen, handle)
282 CALL get_rtp(rtp=rtp, propagator_matrix=propagator_matrix, rho_old=rho_old, rho_new=rho_new, &
285 DO ispin = 1,
SIZE(propagator_matrix)/2
289 IF (rtp%iter == 1)
THEN
292 CALL dbcsr_copy(rho_next(re)%matrix, rho_old(re)%matrix)
293 CALL dbcsr_copy(rho_next(im)%matrix, rho_old(im)%matrix)
294 IF (rtp_control%propagator ==
do_etrs)
THEN
296 CALL get_rtp(rtp=rtp, exp_h_old=exp_h_old, dt=dt)
299 IF (rtp_control%fixed_ions .AND. .NOT. rtp%propagate_complex_ks)
THEN
301 exp_h_old(im)%matrix, rho_next(re)%matrix, rho_next(im)%matrix, &
302 rtp%filter_eps, rtp%filter_eps_small, rtp_control%eps_exp)
306 exp_h_old(re)%matrix, exp_h_old(im)%matrix, rho_next(re)%matrix, rho_next(im)%matrix, &
307 rtp%filter_eps, rtp%filter_eps_small, rtp_control%eps_exp)
311 CALL dbcsr_copy(rho_new(re)%matrix, rho_next(re)%matrix)
312 CALL dbcsr_copy(rho_new(im)%matrix, rho_next(im)%matrix)
313 IF (rtp_control%fixed_ions .AND. .NOT. rtp%propagate_complex_ks)
THEN
315 propagator_matrix(im)%matrix, rho_new(re)%matrix, rho_new(im)%matrix, &
316 rtp%filter_eps, rtp%filter_eps_small, rtp_control%eps_exp)
319 propagator_matrix(re)%matrix, propagator_matrix(im)%matrix, rho_new(re)%matrix, rho_new(im)%matrix, &
320 rtp%filter_eps, rtp%filter_eps_small, rtp_control%eps_exp)
325 CALL timestop(handle)
339 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: propagator, propagator_matrix
343 INTEGER :: i, im, ispin, re
344 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: propagator_fm, propagator_matrix_fm
346 ALLOCATE (propagator_fm(
SIZE(propagator)))
347 ALLOCATE (propagator_matrix_fm(
SIZE(propagator_matrix)))
348 DO i = 1,
SIZE(propagator)
350 matrix_struct=rtp%ao_ao_fmstruct, &
354 matrix_struct=rtp%ao_ao_fmstruct, &
359 DO ispin = 1,
SIZE(propagator)/2
363 SELECT CASE (rtp_control%mat_exp)
366 IF (rtp_control%fixed_ions .AND. .NOT. rtp%propagate_complex_ks)
THEN
368 rtp%orders(1, ispin), rtp%orders(2, ispin))
370 CALL taylor_full_complex(propagator_fm(re:im), propagator_matrix_fm(re), propagator_matrix_fm(im), &
371 rtp%orders(1, ispin), rtp%orders(2, ispin))
374 IF (rtp_control%fixed_ions .AND. .NOT. rtp%propagate_complex_ks)
THEN
376 rtp%orders(1, ispin), rtp%orders(2, ispin))
378 CALL exp_pade_full_complex(propagator_fm(re:im), propagator_matrix_fm(re), propagator_matrix_fm(im), &
379 rtp%orders(1, ispin), rtp%orders(2, ispin))
384 DO i = 1,
SIZE(propagator)
403 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: propagator, propagator_matrix
407 CHARACTER(len=*),
PARAMETER :: routinen =
'compute_exponential_sparse'
409 INTEGER :: handle, im, ispin, re
411 CALL timeset(routinen, handle)
413 DO ispin = 1,
SIZE(propagator)/2
416 IF (rtp_control%fixed_ions .AND. .NOT. rtp%propagate_complex_ks)
THEN
418 rtp%orders(1, ispin), rtp%orders(2, ispin), rtp%filter_eps)
421 rtp%orders(1, ispin), rtp%orders(2, ispin), rtp%filter_eps)
425 CALL timestop(handle)
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
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)
...
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.
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
represent a full matrix distributed on many processors
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)
creates a new full matrix with the given structure
Defines the basic variable types.
integer, parameter, public dp
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...
Routines for calculating a complex matrix exponential.
subroutine, public taylor_full_complex(exp_h, re_part, im_part, nsquare, ntaylor)
subroutine for general complex matrix exponentials on input a separate cp_fm_type for real and comple...
subroutine, public arnoldi(mos_old, mos_new, eps_exp, hre, him, mos_next, narn_old)
exponential of a complex matrix, calculated using arnoldi subspace method (directly applies to the MO...
subroutine, public exp_pade_only_imaginary(exp_h, im_part, nsquare, npade)
exponential of a complex matrix, calculated using pade approximation together with scaling and squari...
subroutine, public taylor_only_imaginary(exp_h, im_matrix, nsquare, ntaylor)
specialized subroutine for purely imaginary matrix exponentials
subroutine, public exp_pade_full_complex(exp_h, re_part, im_part, nsquare, npade)
exponential of a complex matrix, calculated using pade approximation together with scaling and squari...
Routines for calculating a complex matrix exponential.
subroutine, public propagate_exp(rtp, rtp_control)
performs propagations if explicit matrix exponentials are used ETRS: exp(i*H(t+dt)*dt/2)*exp(i*H(t)*d...
subroutine, public compute_exponential_sparse(propagator, propagator_matrix, rtp_control, rtp)
Sparse versions of the matrix exponentials.
subroutine, public propagate_bch(rtp, rtp_control)
Propagation using the Baker-Campbell-Hausdorff expansion, currently only works for rtp.
subroutine, public compute_exponential(propagator, propagator_matrix, rtp_control, rtp)
decides which type of exponential has to be computed
subroutine, public propagate_exp_density(rtp, rtp_control)
Propagation of the density matrix instead of the atomic orbitals via a matrix exponential.
subroutine, public propagate_arnoldi(rtp, rtp_control)
computes U_prop*MOs using arnoldi subspace algorithm
Types and set_get for real time propagation depending on runtype and diagonalization method different...
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)
...