From d9aace0cec5fe7897f47ff2f73b6520699840239 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Mon, 1 Jul 2024 21:18:29 -0400 Subject: [PATCH] handle core energy in MolecularHamiltonian.from_fcidump --- tests/python/hamiltonians/molecular_hamiltonian_test.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/python/hamiltonians/molecular_hamiltonian_test.py b/tests/python/hamiltonians/molecular_hamiltonian_test.py index 4622fd1d0..0e600677d 100644 --- a/tests/python/hamiltonians/molecular_hamiltonian_test.py +++ b/tests/python/hamiltonians/molecular_hamiltonian_test.py @@ -12,7 +12,6 @@ from __future__ import annotations -import dataclasses import pathlib import numpy as np @@ -171,10 +170,9 @@ def test_from_fcidump(tmp_path: pathlib.Path): tmp_path / "test.fcidump", h1e=mol_data.one_body_integrals, h2e=mol_data.two_body_integrals, + nuc=mol_data.core_energy, nmo=mol_data.norb, nelec=mol_data.nelec, ) mol_ham = ffsim.MolecularHamiltonian.from_fcidump(tmp_path / "test.fcidump") - assert ffsim.approx_eq( - mol_ham, dataclasses.replace(mol_data.hamiltonian, constant=0.0) - ) + assert ffsim.approx_eq(mol_ham, mol_data.hamiltonian)