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))
130 type(zora_t),
intent(inout) :: this
134 safe_deallocate_a(this%pot)
135 safe_deallocate_a(this%grad_pot)
136 safe_deallocate_a(this%soc)
164 real(real64),
contiguous,
intent(in) :: potential(:, :)
166 real(real64),
allocatable :: zora_scpot(:), grad_pot(:,:)
167 real(real64) :: prefactor, two_c2
174 if (this%zora_level == zora_none)
then
179 nspin =
size(this%pot, dim=2)
184 safe_allocate( zora_scpot(1:der%mesh%np_part) )
185 safe_allocate( grad_pot(1:der%mesh%np_part, 1:der%dim) )
189 do ip = 1, der%mesh%np
191 zora_scpot(ip) = potential(ip, 1)
194 this%pot(ip,1) = two_c2 / (this%mass * two_c2 - zora_scpot(ip) )
200 do ip = 1, der%mesh%np
201 this%pot(ip,2) = this%pot(ip,1)
207 do ip = 1, der%mesh%np
222 do ip = 1, der%mesh%np
223 this%grad_pot(ip, 1, idir)= grad_pot(ip,idir)
229 do ip = 1, der%mesh%np
230 this%grad_pot(ip, 2, idir)= grad_pot(ip,idir)
237 do ip = 1, der%mesh%np
238 this%grad_pot(ip, 3, idir)=
m_zero
239 this%grad_pot(ip, 4, idir)=
m_zero
252 safe_deallocate_a( zora_scpot )
253 safe_deallocate_a( grad_pot )
267 real(real64),
allocatable :: grad_v(:,:)
271 safe_allocate(grad_v(1:der%mesh%np, 1:der%dim))
279 do ip = 1, der%mesh%np
282 prefactor = this%so_strength * two_c2 / (this%mass*two_c2 - zora_scpot(ip))**2
284 grad_v(ip, 1) = grad_v(ip, 1) * prefactor
285 grad_v(ip, 2) = grad_v(ip, 2) * prefactor
286 grad_v(ip, 3) = grad_v(ip, 3) * prefactor
290 this%soc(ip, 1, 1) = -grad_v(ip, 2)
291 this%soc(ip, 2, 1) = grad_v(ip, 2)
292 this%soc(ip, 3, 1) =
m_zero
293 this%soc(ip, 4, 1) = -grad_v(ip, 3)
295 this%soc(ip, 1, 2) = grad_v(ip, 1)
296 this%soc(ip, 2, 2) = -grad_v(ip, 1)
297 this%soc(ip, 3, 2) = -grad_v(ip, 3)
298 this%soc(ip, 4, 2) =
m_zero
300 this%soc(ip, 1, 3) =
m_zero
301 this%soc(ip, 2, 3) =
m_zero
302 this%soc(ip, 3, 3) = grad_v(ip, 2)
303 this%soc(ip, 4, 3) = grad_v(ip, 1)
309 safe_deallocate_a(grad_v)
318#include "zora_inc.F90"
321#include "complex.F90"
322#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