diff --git a/mess/hamiltonian.py b/mess/hamiltonian.py index d3ea6d7..d85a290 100644 --- a/mess/hamiltonian.py +++ b/mess/hamiltonian.py @@ -153,10 +153,11 @@ def __init__( self.xcfunc = build_xcfunc(xc_method, basis, self.two_electron) def __call__(self, P: FloatNxN) -> float: + E_core = jnp.sum(self.H_core * P) E_xc = self.xcfunc(P) J = self.two_electron.coloumb(P) E_es = 0.5 * jnp.sum(J * P) - E = jnp.sum(self.H_core * P) + E_xc + E_es + E = E_core + E_xc + E_es return E