Skip to content

Commit

Permalink
Fix large stencil bug (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipmnel authored Sep 10, 2024
1 parent 4a4f174 commit afa9fd0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyvpt2/quartic.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,10 @@ def transform_grad(grad):
grad_2pp = grad[f"{k}: 2, {j}: 1"][i]
grad_2p2p = grad[f"{k}: 2, {j}: 2"][i]

phi_ijk[i, j, k] = 1/144 * grad_2n2p - 1/18 * grad_n2p + 1/18 * grad_p2p - 1/144 * grad_2p2p
phi_ijk[i, j, k] += -1/18 * grad_2n2p + 4/9 * grad_n2p - 4/9 * grad_p2p + 1/18 * grad_2p2p
phi_ijk[i, j, k] += 1/18 * grad_2n2p - 4/9 * grad_n2p + 4/9 * grad_p2p - 1/18 * grad_2p2p
phi_ijk[i, j, k] += -1/144 * grad_2n2p + 1/18 * grad_n2p - 1/18 * grad_p2p + 1/144 * grad_2p2p
phi_ijk[i, j, k] = 1/144 * grad_2n2n - 1/18 * grad_2nn + 1/18 * grad_2np - 1/144 * grad_2n2p
phi_ijk[i, j, k] += -1/18 * grad_n2n + 4/9 * grad_nn - 4/9 * grad_np + 1/18 * grad_n2p
phi_ijk[i, j, k] += 1/18 * grad_p2n - 4/9 * grad_pn + 4/9 * grad_pp - 1/18 * grad_p2p
phi_ijk[i, j, k] += -1/144 * grad_2p2n + 1/18 * grad_2pn - 1/18 * grad_2pp + 1/144 * grad_2p2p
phi_ijk[i, j, k] /= disp_size**2

phi_ijk = phi_ijk / wave_to_hartree
Expand Down

0 comments on commit afa9fd0

Please sign in to comment.