Skip to content

Commit 2ea5d16

Browse files
committed
Add the kpoint phase to the relativistic projectors.
1 parent fbea34d commit 2ea5d16

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/hamiltonian/relativistic_projector.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class relativistic_projector {
4646

4747
beta_.reextent({nproj_, sphere_.size(), 2});
4848
kb_coeff_.reextent(nproj_);
49-
50-
std::cout << "NUM " << ps.num_projectors_l() << std::endl;
5149

5250
int iproj_lm = 0;
5351
for(int iproj = 0; iproj < ps.num_projectors_l(); iproj++){
@@ -150,10 +148,11 @@ class relativistic_projector {
150148
gpu::array<complex, 3> sphere_phi({sphere_.size(), phi.local_spinor_set_size(), 2});
151149

152150
gpu::run(phi.local_spinor_set_size(), sphere_.size(),
153-
[gr = begin(phi.spinor_hypercubic()), sph = sphere_.ref(), sgr = begin(sphere_phi)] GPU_LAMBDA (auto ist, auto ipoint){
151+
[gr = begin(phi.spinor_hypercubic()), sph = sphere_.ref(), sgr = begin(sphere_phi), kpoint] GPU_LAMBDA (auto ist, auto ipoint){
154152
auto point = sph.grid_point(ipoint);
155-
sgr[ipoint][ist][0] = gr[point[0]][point[1]][point[2]][0][ist];
156-
sgr[ipoint][ist][1] = gr[point[0]][point[1]][point[2]][1][ist];
153+
auto phase = polar(1.0, dot(kpoint, sph.point_pos(ipoint)));
154+
sgr[ipoint][ist][0] = phase*gr[point[0]][point[1]][point[2]][0][ist];
155+
sgr[ipoint][ist][1] = phase*gr[point[0]][point[1]][point[2]][1][ist];
157156
});
158157

159158
gpu::array<complex, 2> projections({nproj_, phi.local_spinor_set_size()});
@@ -187,8 +186,9 @@ class relativistic_projector {
187186
});
188187

189188
gpu::run(phi.local_spinor_set_size(), sphere_.size(),
190-
[gr = begin(vnlphi.spinor_hypercubic()), sph = sphere_.ref(), nproj = nproj_, bet = begin(beta_), proj = begin(projections)] GPU_LAMBDA (auto ist, auto ip){
189+
[gr = begin(vnlphi.spinor_hypercubic()), sph = sphere_.ref(), nproj = nproj_, bet = begin(beta_), proj = begin(projections), kpoint] GPU_LAMBDA (auto ist, auto ip){
191190
auto point = sph.grid_point(ip);
191+
auto phase = polar(1.0, -dot(kpoint, sph.point_pos(ip)));
192192

193193
auto red0 = complex(0.0, 0.0);
194194
auto red1 = complex(0.0, 0.0);
@@ -198,8 +198,8 @@ class relativistic_projector {
198198
red1 += bet[iproj][ip][1]*pp;
199199
}
200200

201-
gpu::atomic::add(&gr[point[0]][point[1]][point[2]][0][ist], red0);
202-
gpu::atomic::add(&gr[point[0]][point[1]][point[2]][1][ist], red1);
201+
gpu::atomic::add(&gr[point[0]][point[1]][point[2]][0][ist], phase*red0);
202+
gpu::atomic::add(&gr[point[0]][point[1]][point[2]][1][ist], phase*red1);
203203

204204
});
205205
}

0 commit comments

Comments
 (0)