35 use,
intrinsic :: iso_fortran_env
62 subroutine td_magnus(hm, ext_partners, gr, st, tr, namespace, time, dt)
63 type(hamiltonian_elec_t),
intent(inout) :: hm
64 type(partner_list_t),
intent(in) :: ext_partners
65 type(grid_t),
intent(in) :: gr
66 type(states_elec_t),
intent(inout) :: st
67 type(propagator_base_t),
intent(inout) :: tr
68 type(namespace_t),
intent(in) :: namespace
69 real(real64),
intent(in) :: time
70 real(real64),
intent(in) :: dt
73 real(real64) :: atime(2)
74 real(real64),
allocatable :: vaux(:, :, :), pot(:)
75 type(lasers_t),
pointer :: lasers
81 safe_allocate(vaux(1:gr%np, 1:st%d%nspin, 1:2))
97 if(
associated(lasers))
then
98 do i = 1, lasers%no_lasers
101 safe_allocate(pot(1:gr%np))
104 do is = 1, st%d%nspin
105 vaux(:, is, j) = vaux(:, is, j) + pot(:)
107 safe_deallocate_a(pot)
109 write(
message(1),
'(a)')
'The Magnus propagator cannot be used with magnetic fields, or'
110 write(
message(2),
'(a)')
'with an electric field described in the velocity gauge.'
117 tr%vmagnus(:, :, 2) =
m_half*(vaux(:, :, 1) + vaux(:, :, 2))
118 tr%vmagnus(:, :, 1) = (
sqrt(
m_three)/12.0_real64)*dt*(vaux(:, :, 2) - vaux(:, :, 1))
122 safe_deallocate_a(vaux)
129 subroutine td_cfmagnus4(ks, namespace, space, hm, gr, st, tr, time, dt, ions_dyn, ions, ext_partners, iter)
130 type(v_ks_t),
target,
intent(inout) :: ks
131 type(namespace_t),
intent(in) :: namespace
132 type(electron_space_t),
intent(in) :: space
133 type(hamiltonian_elec_t),
target,
intent(inout) :: hm
134 type(grid_t),
target,
intent(in) :: gr
135 type(states_elec_t),
target,
intent(inout) :: st
136 type(propagator_base_t),
target,
intent(inout) :: tr
137 real(real64),
intent(in) :: time
138 real(real64),
intent(in) :: dt
139 type(ion_dynamics_t),
intent(inout) :: ions_dyn
140 type(ions_t),
intent(inout) :: ions
141 type(partner_list_t),
intent(in) :: ext_partners
142 integer,
intent(in) :: iter
144 real(real64) :: alpha1, alpha2, c1, c2, t1, t2
145 real(real64),
allocatable :: vhxc1(:, :), vhxc2(:, :)
148 message(1) =
"The commutator-free Magnus expansion cannot be used with moving ions or gauge fields"
155 call td_explicit_runge_kutta4(ks, namespace, space, hm, gr, st, time, dt, ions_dyn, ions, ext_partners)
165 t1 = time - dt + c1*dt
166 t2 = time - dt + c2*dt
168 safe_allocate(vhxc1(1:gr%np, 1:st%d%nspin))
169 safe_allocate(vhxc2(1:gr%np, 1:st%d%nspin))
174 hm%vhxc =
m_two * (alpha2 * vhxc1 + alpha1 * vhxc2)
179 hm%vhxc =
m_two * (alpha1 * vhxc1 + alpha2 * vhxc2)
187 safe_deallocate_a(vhxc1)
188 safe_deallocate_a(vhxc2)
double sqrt(double __x) __attribute__((__nothrow__
This module implements batches of mesh functions.
This module implements a calculator for the density and defines related functions.
subroutine, public density_calc(st, gr, density, istin)
Computes the density from the orbitals in st.
logical function, public list_has_gauge_field(partners)
type(lasers_t) function, pointer, public list_get_lasers(partners)
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_half
real(real64), parameter, public m_three
This module implements the underlying real-space grid.
integer, parameter, public independent_particles
subroutine, public hamiltonian_elec_update_with_ext_pot(this, mesh, space, ext_partners, time, mu)
This is an extension of "hamiltonian_elec_update_pot" to be used by the CFM4 propagator....
This module defines classes and functions for interaction partners.
logical pure function, public ion_dynamics_ions_move(this)
integer, parameter, public e_field_electric
integer, parameter, public e_field_vector_potential
subroutine, public laser_potential(laser, mesh, pot, time)
integer pure elemental function, public laser_kind(laser)
integer, parameter, public e_field_magnetic
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public potential_interpolation_interpolate(potential_interpolation, order, time, dt, t, vhxc, vtau)
subroutine, public propagation_ops_elec_exp_apply(te, namespace, st, mesh, hm, dt)
subroutine, public propagation_ops_elec_fuse_density_exp_apply(te, namespace, st, gr, hm, dt, dt2, vmagnus)
subroutine, public td_cfmagnus4(ks, namespace, space, hm, gr, st, tr, time, dt, ions_dyn, ions, ext_partners, iter)
Commutator-free Magnus propagator of order 4.
subroutine, public td_magnus(hm, ext_partners, gr, st, tr, namespace, time, dt)
Magnus propagator.
subroutine, public td_explicit_runge_kutta4(ks, namespace, space, hm, gr, st, time, dt, ions_dyn, ions, ext_partners, qcchi)
logical pure function, public family_is_mgga_with_exc(xcs)
Is the xc function part of the mGGA family with an energy functional.