Skip to content

Commit

Permalink
test for custom basis
Browse files Browse the repository at this point in the history
  • Loading branch information
damarkian committed Dec 18, 2023
1 parent fe586a0 commit e59f884
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/qibochem/driver/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def hamiltonian(
if ham_type in ("s", "sym"):
# Qibo SymbolicHamiltonian
return symbolic_hamiltonian(ham)
raise NameError(f"Unknown {ham_type}!") # Shouldn't ever reach here
# raise NameError(f"Unknown {ham_type}!") # Shouldn't ever reach here

@staticmethod
def eigenvalues(hamiltonian):
Expand Down
6 changes: 6 additions & 0 deletions tests/test_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ def test_run_pyscf_molecule_xyz():
assert lih.e_hf == pytest.approx(lih_ref_energy)


def test_molecule_custom_basis():
mol = Molecule([("Li", (0.0, 0.0, 0.0)), ("H", (0.0, 0.0, 1.2))], 0, 1, "6-31g")
mol.run_pyscf()
assert np.isclose(mol.e_hf, -7.94129296352493)


def test_hf_embedding_1():
mol = Molecule([("Li", (0.0, 0.0, 0.0)), ("H", (0.0, 0.0, 1.2))])
mol.run_pyscf()
Expand Down

0 comments on commit e59f884

Please sign in to comment.