45 integer,
parameter,
public :: &
46 ZORA_NONE = 0, & !< no ZORA
55 real(real64),
allocatable :: pot(:,:)
56 real(real64),
allocatable :: grad_pot(:,:,:)
58 real(real64),
allocatable :: soc(:,:,:)
61 real(real64) :: so_strength =
m_zero
62 real(real64) :: mass =
m_zero
64 integer :: zora_level = zora_none
74 procedure zora_constructor
84 type(namespace_t),
intent(in) :: namespace
85 type(derivatives_t),
intent(in) :: der
86 type(states_elec_dim_t),
intent(in) :: st_d
87 type(epot_t),
intent(in) :: ep
88 real(real64),
intent(in) :: mass
89 class(zora_t),
pointer :: this
95 this%so_strength = ep%so_strength
98 select case (ep%reltype)
104 this%zora_level = zora_none
109 if (der%dim /= 3)
then
113 safe_allocate(this%pot(1:der%mesh%np_part, 1:st_d%nspin))
114 safe_allocate(this%grad_pot(1:der%mesh%np, 1:st_d%nspin, 1:der%dim))
118 assert(st_d%nspin == 4)
119 safe_allocate(this%soc(1:der%mesh%np, 1:st_d%nspin, 1:der%dim))
129 type(zora_t),
intent(inout) :: this
133 safe_deallocate_a(this%pot)
134 safe_deallocate_a(this%grad_pot)
135 safe_deallocate_a(this%soc)
161 class(
zora_t),
intent(inout) :: this
163 real(real64),
contiguous,
intent(in) :: potential(:, :)
165 real(real64),
allocatable :: zora_scpot(:), grad_pot(:,:)
166 real(real64) :: prefactor, two_c2
173 if (this%zora_level == zora_none)
then
178 nspin =
size(this%pot, dim=2)
183 safe_allocate( zora_scpot(1:der%mesh%np_part) )
184 safe_allocate( grad_pot(1:der%mesh%np_part, 1:der%dim) )
192 do ip = 1, der%mesh%np
194 zora_scpot(ip) = potential(ip, 1)
197 this%pot(ip,1) = two_c2 / (this%mass * two_c2 - zora_scpot(ip) )
203 do ip = 1, der%mesh%np
204 this%pot(ip,2) = this%pot(ip,1)
210 do ip = 1, der%mesh%np
225 do ip = 1, der%mesh%np
226 this%grad_pot(ip, 1, idir)= grad_pot(ip,idir)
232 do ip = 1, der%mesh%np
233 this%grad_pot(ip, 2, idir)= grad_pot(ip,idir)
240 do ip = 1, der%mesh%np
241 this%grad_pot(ip, 3, idir)=
m_zero
242 this%grad_pot(ip, 4, idir)=
m_zero
255 safe_deallocate_a( zora_scpot )
256 safe_deallocate_a( grad_pot )
270 real(real64),
allocatable :: grad_v(:,:)
274 safe_allocate(grad_v(1:der%mesh%np, 1:der%dim))
282 do ip = 1, der%mesh%np
285 prefactor = this%so_strength * two_c2 / (this%mass*two_c2 - zora_scpot(ip))**2
287 grad_v(ip, 1) = grad_v(ip, 1) * prefactor
288 grad_v(ip, 2) = grad_v(ip, 2) * prefactor
289 grad_v(ip, 3) = grad_v(ip, 3) * prefactor
293 this%soc(ip, 1, 1) = -grad_v(ip, 2)
294 this%soc(ip, 2, 1) = grad_v(ip, 2)
295 this%soc(ip, 3, 1) =
m_zero
296 this%soc(ip, 4, 1) = -grad_v(ip, 3)
298 this%soc(ip, 1, 2) = grad_v(ip, 1)
299 this%soc(ip, 2, 2) = -grad_v(ip, 1)
300 this%soc(ip, 3, 2) = -grad_v(ip, 3)
301 this%soc(ip, 4, 2) =
m_zero
303 this%soc(ip, 1, 3) =
m_zero
304 this%soc(ip, 2, 3) =
m_zero
305 this%soc(ip, 3, 3) = grad_v(ip, 2)
306 this%soc(ip, 4, 3) = grad_v(ip, 1)
312 safe_deallocate_a(grad_v)
321#include "zora_inc.F90"
324#include "complex.F90"
325#include "zora_inc.F90"
This module implements batches of mesh functions.
This module implements common operations on batches of mesh functions.
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public dderivatives_grad(der, ff, op_ff, ghost_update, set_bc, to_cartesian)
apply the gradient to a mesh function
integer, parameter, public scalar_relativistic_zora
integer, parameter, public fully_relativistic_zora
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public p_c
Electron gyromagnetic ratio, see Phys. Rev. Lett. 130, 071801 (2023)
This module implements the underlying real-space grid.
This module defines the meshes, which are used in Octopus.
subroutine, public messages_not_implemented(feature, namespace)
This module handles spin dimensions of the states and the k-point distribution.
This module implements the ZORA terms for the Hamoiltonian.
integer, parameter, public zora_scalar_relativistic
ZORA for scalar relativistic calculations.
subroutine zora_update(this, der, potential)
update the ZORA potentials
subroutine zzora_apply_batch(this, mesh, der, states_dim, psib, hpsib, set_bc)
apply the ZORA to a batch of states psib
class(zora_t) function, pointer zora_constructor(namespace, der, st_d, ep, mass)
initialize the ZORA
subroutine zora_finalize(this)
finalize the ZORA object and free memory
subroutine dzora_apply_batch(this, mesh, der, states_dim, psib, hpsib, set_bc)
apply the ZORA to a batch of states psib
integer, parameter, public zora_fully_relativistic
ZORA for fully relativistic calculations.
class representing derivatives
This class is responsible for calculating and applying the ZORA.
subroutine zora_update_fully_relativistic()
update quantities, necessary only for fully relativistic ZORA