Skip to content

Commit

Permalink
Merge branch 'improved_spherical_harmonics' into 'master'
Browse files Browse the repository at this point in the history
Better implementation of the spherical harmonics

See merge request npneq/inq!1177
  • Loading branch information
xavierandrade committed Dec 15, 2024
2 parents dd00951 + d002e03 commit ed8fc89
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion external_libs/pseudopod
Submodule pseudopod updated from 4ea662 to 8aa6a9
4 changes: 2 additions & 2 deletions src/hamiltonian/projector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class projector {
spline = ps.projector(iproj_l).function(),
sph = sphere_.ref(), l, iproj_lm,
metric = basis.cell().metric()] GPU_LAMBDA (auto ipoint, auto m) {
mat[iproj_lm + m][ipoint] = spline(sph.distance(ipoint))*pseudo::math::sharmonic(l, m - l, metric.to_cartesian(sph.point_pos(ipoint)));
mat[iproj_lm + m][ipoint] = spline(sph.distance(ipoint))*pseudo::math::sharmonic_real(l, m - l, metric.to_cartesian(sph.point_pos(ipoint)));
});

} else {
Expand All @@ -56,7 +56,7 @@ class projector {
gpu::run(sphere_.size(), 2*l + 1,
[mat = begin(matrix_), spline = ps.projector(iproj_l).function(), sph = sphere_.ref(), l, iproj_lm,
dg = double_grid.ref(), spac = basis.rspacing(), metric = basis.cell().metric()] GPU_LAMBDA (auto ipoint, auto m) {
mat[iproj_lm + m][ipoint] = dg.value([spline, l, m] GPU_LAMBDA(auto pos) { return spline(pos.length())*pseudo::math::sharmonic(l, m - l, pos);}, spac, metric.to_cartesian(sph.point_pos(ipoint)));
mat[iproj_lm + m][ipoint] = dg.value([spline, l, m] GPU_LAMBDA(auto pos) { return spline(pos.length())*pseudo::math::sharmonic_real(l, m - l, pos);}, spac, metric.to_cartesian(sph.point_pos(ipoint)));
});

}
Expand Down
2 changes: 1 addition & 1 deletion src/hamiltonian/projector_fourier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace hamiltonian {
for(int m = -l; m <= l; m++){
for(int ipoint = 0; ipoint < sphere.size(); ipoint++){
auto point = sphere.ref().grid_point(ipoint);
beta_rs.hypercubic()[point[0]][point[1]][point[2]][iproj_lm] = ps.projector(iproj_l).function()(sphere.ref().distance(ipoint))*pseudo::math::sharmonic(l, m, sphere.ref().point_pos(ipoint));
beta_rs.hypercubic()[point[0]][point[1]][point[2]][iproj_lm] = ps.projector(iproj_l).function()(sphere.ref().distance(ipoint))*pseudo::math::sharmonic_real(l, m, sphere.ref().point_pos(ipoint));
}

kb_coeff_[iproj_lm] = ps.kb_coeff(iproj_l);
Expand Down

0 comments on commit ed8fc89

Please sign in to comment.