diff --git a/src/qibochem/ansatz/basis_rotation.py b/src/qibochem/ansatz/basis_rotation.py index 82009ae..887480f 100644 --- a/src/qibochem/ansatz/basis_rotation.py +++ b/src/qibochem/ansatz/basis_rotation.py @@ -142,7 +142,6 @@ def br_circuit(n_qubits, parameters, n_occ): # Add the Givens rotation circuits for g_rot_parameter in g_rotation_parameters: for orb1, orb2, theta, _phi in g_rot_parameter: - if not np.allclose(_phi, 0.0): - raise ValueError("Unitary rotation is not real") + assert np.allclose(_phi, 0.0), "Unitary rotation is not real!" circuit += givens_rotation_gate(n_qubits, orb1, orb2, theta) return circuit diff --git a/tests/test_molecule.py b/tests/test_molecule.py index c502570..a4296bc 100644 --- a/tests/test_molecule.py +++ b/tests/test_molecule.py @@ -30,7 +30,7 @@ def test_run_pyscf(): def test_run_pyscf_molecule_xyz(): """Pyscf driver with xyz file""" - file_path = Path("data/lih.xyz") + file_path = Path("tests", "data", "lih.xyz") if not file_path.is_file(): with open(file_path, "w") as file_handler: file_handler.write("2\n0 1\nLi 0.0 0.0 0.0\nH 0.0 0.0 1.2\n") @@ -42,7 +42,7 @@ def test_run_pyscf_molecule_xyz(): def test_run_pyscf_molecule_xyz_charged(): - file_path = Path("data/h2.xyz") + file_path = Path("tests", "data", "h2.xyz") if not file_path.is_file(): with open(file_path, "w") as file_handler: file_handler.write("2\n \nH 0.0 0.0 0.0\nH 0.0 0.0 0.7\n")