We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 729c174 commit 3613e2dCopy full SHA for 3613e2d
contents/quantum_systems/code/julia/energy.jl
@@ -1,12 +1,12 @@
1
# We are calculating the energy to check <Psi|H|Psi>
2
function calculate_energy(wfc, H_k, H_r, dx)
3
# Creating momentum and conjugate wavefunctions
4
- wfc_k = fft(wfc_r)
5
- wfc_c = conj(wfc_r)
+ wfc_k = fft(wfc)
+ wfc_c = conj(wfc)
6
7
# Finding the momentum and real-space energy terms
8
energy_k = wfc_c.*ifft((H_k) .* wfc_k)
9
- energy_r = wfc_c.* H_r .* wfc_r
+ energy_r = wfc_c.* H_r .* wfc
10
11
# Integrating over all space
12
energy_final = 0
0 commit comments