diff --git a/contents/quantum_systems/code/julia/energy.jl b/contents/quantum_systems/code/julia/energy.jl index d045d073c..3efce0cb7 100644 --- a/contents/quantum_systems/code/julia/energy.jl +++ b/contents/quantum_systems/code/julia/energy.jl @@ -1,12 +1,12 @@ # We are calculating the energy to check function calculate_energy(wfc, H_k, H_r, dx) # Creating momentum and conjugate wavefunctions - wfc_k = fft(wfc_r) - wfc_c = conj(wfc_r) + wfc_k = fft(wfc) + wfc_c = conj(wfc) # Finding the momentum and real-space energy terms energy_k = wfc_c.*ifft((H_k) .* wfc_k) - energy_r = wfc_c.* H_r .* wfc_r + energy_r = wfc_c.* H_r .* wfc # Integrating over all space energy_final = 0