50 integer,
public :: n_c
51 complex(real64),
allocatable :: bra(:, :)
52 complex(real64),
public,
allocatable :: ket(:, :, :, :)
53 real(real64),
public,
allocatable :: f(:, :, :)
61 type(rkb_projector_t),
intent(inout) :: rkb_p
62 type(submesh_t),
intent(in) :: sm
63 class(pseudopotential_t),
intent(in) :: spec
64 integer,
intent(in) :: l, lm
65 real(real64),
intent(in) :: so_strength
72 rkb_p%n_c = spec%ps%projectors_per_l(l+1)
73 assert(mod(rkb_p%n_c, 2) == 0)
77 safe_allocate(rkb_p%bra(1:rkb_p%n_s, 1:rkb_p%n_c))
78 safe_allocate(rkb_p%ket(1:rkb_p%n_s, 1:rkb_p%n_c, 1:2, 1:2))
79 safe_allocate(rkb_p%f(1:rkb_p%n_c, 1:2, 1:2))
86 call pseudopotential_nl_projector(spec, rkb_p%n_s, sm%rel_x, sm%r, l, lm, i, rkb_p%ket(:, i, 1, 1))
87 rkb_p%bra(:, i) = conjg(rkb_p%ket(:, i, 1, 1))
88 rkb_p%ket(:, i, 2, 2) = rkb_p%ket(:, i, 1, 1)
91 call pseudopotential_nl_projector(spec, rkb_p%n_s, sm%rel_x, sm%r, l, lm+1, i, rkb_p%ket(:, i, 2, 1))
93 rkb_p%ket(:, i, 2, 1) =
m_z0
96 call pseudopotential_nl_projector(spec, rkb_p%n_s, sm%rel_x, sm%r, l, lm-1, i, rkb_p%ket(:, i, 1, 2))
98 rkb_p%ket(:, i, 1, 2) =
m_z0
104 do i = 0, rkb_p%n_c/2-1
105 rkb_p%f(i*2+1, 1, 1) = real(l + so_strength*lm + 1, real64)
106 rkb_p%f(i*2+1, 2, 1) = so_strength*
sqrt(real((l + lm + 1)*(l - lm), real64))
107 rkb_p%f(i*2+1, 1, 2) = so_strength*
sqrt(real((l - lm + 1)*(l + lm), real64))
108 rkb_p%f(i*2+1, 2, 2) = real(l - so_strength*lm + 1, real64)
109 rkb_p%f(i*2+2, 1, 1) = real(l - so_strength*lm, real64)
110 rkb_p%f(i*2+2, 2, 1) = -so_strength*
sqrt(real((l + lm + 1)*(l - lm), real64))
111 rkb_p%f(i*2+2, 1, 2) = -so_strength*
sqrt(real((l - lm + 1)*(l + lm), real64))
112 rkb_p%f(i*2+2, 2, 2) = real(l + so_strength*lm, real64)
114 rkb_p%f = rkb_p%f/real(2*l + 1, real64)
118 rkb_p%f(i, :, :) = rkb_p%f(i, :, :) * spec%ps%h(l, i, i)
126 type(rkb_projector_t),
intent(inout) :: rkb_p
130 safe_deallocate_a(rkb_p%bra)
131 safe_deallocate_a(rkb_p%ket)
132 safe_deallocate_a(rkb_p%f)
139 type(mesh_t),
intent(in) :: mesh
140 type(submesh_t),
intent(in) :: sm
141 type(rkb_projector_t),
intent(in) :: rkb_p
142 complex(real64),
intent(in) :: psi(:, :)
143 complex(real64),
intent(inout) :: ppsi(:, :)
145 complex(real64) :: uvpsi(1:2, 1:rkb_p%n_c)
150 if (mesh%parallel_in_domains)
then
151 call mesh%allreduce(uvpsi)
162 type(
mesh_t),
intent(in) :: mesh
165 complex(real64),
intent(in) :: psi(:, :)
166 complex(real64),
intent(out) :: uvpsi(:,:)
168 integer :: idim, n_s, is, ic
170 complex(real64),
allocatable :: bra(:, :)
178 uvpsi(1:2, 1:rkb_p%n_c) =
m_zero
182 if (mesh%use_curvilinear)
then
183 safe_allocate(bra(1:n_s, 1:rkb_p%n_c))
185 bra(1:n_s, ic) = rkb_p%bra(1:n_s, ic)*mesh%vol_pp(sm%map(1:n_s))
188 uvpsi(idim, ic) = uvpsi(idim, ic) + psi(is, idim)*bra(is, ic)
192 safe_deallocate_a(bra)
197 uvpsi(idim, ic) = uvpsi(idim, ic) + psi(is, idim)*rkb_p%bra(is, ic)
203 uvpsi(1:2, 1:rkb_p%n_c) = uvpsi(1:2, 1:rkb_p%n_c)*mesh%volume_element
205 safe_deallocate_a(bra)
218 complex(real64),
intent(in) :: uvpsi(:, :)
219 complex(real64),
intent(inout) :: psi(:, :)
221 integer :: idim, jdim, n_s, is, ic
222 complex(real64) :: aa
223 complex(real64) :: weight(2,2,rkb_p%n_c)
237 weight(jdim, idim, ic) = rkb_p%f(ic, jdim, idim)*uvpsi(idim, ic)
247 aa = aa + weight(jdim, idim, ic)*rkb_p%ket(is, ic, jdim, idim)
249 psi(is, jdim) = psi(is, jdim) + aa
double sqrt(double __x) __attribute__((__nothrow__
real(real64), parameter, public m_zero
complex(real64), parameter, public m_z0
This module defines the meshes, which are used in Octopus.
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
integer, parameter, public proj_j_dependent
Fully-relativistic j-dependent pseudopotentials.
subroutine, public pseudopotential_nl_projector(spec, np, x, r, l, lm, i, uV)
This routine returns the non-local projector, built using spherical harmonics.
subroutine, public rkb_project_bra(mesh, sm, rkb_p, psi, uvpsi)
THREADSAFE.
subroutine, public rkb_projector_init(rkb_p, sm, spec, l, lm, so_strength)
subroutine, public rkb_project_ket(rkb_p, uvpsi, psi)
THREADSAFE.
subroutine, public rkb_projector_end(rkb_p)
subroutine, public rkb_project(mesh, sm, rkb_p, psi, ppsi)
Describes mesh distribution to nodes.
The rkb_projector data type holds the KB projectors build with total angular momentum eigenfunctions....
A submesh is a type of mesh, used for the projectors in the pseudopotentials It contains points on a ...