Skip to content

Commit

Permalink
Finish tests for eigenvalues function
Browse files Browse the repository at this point in the history
  • Loading branch information
chmwzc committed Dec 19, 2023
1 parent 7b65dc3 commit 9b86810
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 9b86810

Please sign in to comment.