diff --git a/qualtran/bloqs/generalized_qsp_test.py b/qualtran/bloqs/generalized_qsp_test.py index 2650051492..bb8514cbab 100644 --- a/qualtran/bloqs/generalized_qsp_test.py +++ b/qualtran/bloqs/generalized_qsp_test.py @@ -144,6 +144,11 @@ def _unitary_(self): def adjoint(self) -> GateWithRegisters: return RandomGate(self.bitsize, self.matrix.conj().T) + def __pow__(self, power): + if power == -1: + return self.adjoint() + return NotImplemented + def __hash__(self): return hash(tuple(np.ravel(self.matrix))) @@ -208,7 +213,7 @@ def test_generalized_qsp_with_real_poly_on_random_unitaries(bitsize: int, degree verify_generalized_qsp(U, P) -@pytest.mark.slow +# @pytest.mark.slow @pytest.mark.parametrize("bitsize", [1, 2, 3]) @pytest.mark.parametrize("degree", [2, 3, 4, 5, 50, 100, 120]) @pytest.mark.parametrize("negative_power", [0, 1, 2]) @@ -427,9 +432,9 @@ def verify_hamiltonian_simulation_by_gqsp( assert_matrices_almost_equal(expected_top_left, actual_top_left) -@pytest.mark.slow -@pytest.mark.parametrize("select_bitsize", [1, 2, 3]) -@pytest.mark.parametrize("target_bitsize", [1, 2, 3]) +# @pytest.mark.slow +@pytest.mark.parametrize("select_bitsize", [1]) +@pytest.mark.parametrize("target_bitsize", [1]) def test_hamiltonian_simulation_by_gqsp(select_bitsize: int, target_bitsize: int): random_state = np.random.RandomState(42)