From 9b86810345ca84f559a06709ed758523de0eed48 Mon Sep 17 00:00:00 2001 From: Wong Zi Cheng <70616433+chmwzc@users.noreply.github.com> Date: Tue, 19 Dec 2023 09:42:49 +0000 Subject: [PATCH] Finish tests for eigenvalues function --- tests/test_molecule.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_molecule.py b/tests/test_molecule.py index a4296bc..9d2e536 100644 --- a/tests/test_molecule.py +++ b/tests/test_molecule.py @@ -266,3 +266,7 @@ def test_eigenvalues(): # SymbolicHamiltonian test: sym_ham = SymbolicHamiltonian(Z(0) * Z(1)) assert np.allclose(dummy.eigenvalues(sym_ham), sorted(np.kron(np.array([1.0, -1.0]), np.array([1.0, -1.0])))) + + # Unknown Hamiltonian type + with pytest.raises(TypeError): + dummy.eigenvalues(0.0)