From 4c8690976d46810235fb7260b93081988abb0138 Mon Sep 17 00:00:00 2001 From: Wong Zi Cheng <70616433+chmwzc@users.noreply.github.com> Date: Wed, 20 Mar 2024 08:42:28 +0000 Subject: [PATCH] Remove unstable test --- tests/test_expectation_samples.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/test_expectation_samples.py b/tests/test_expectation_samples.py index bd2ba4d..0407e4d 100644 --- a/tests/test_expectation_samples.py +++ b/tests/test_expectation_samples.py @@ -16,21 +16,20 @@ @pytest.mark.parametrize( - "terms,gates_to_add,expected,threshold", + "terms,gates_to_add,expected", [ - (Z(0), [gates.X(0)], -1.0, None), - (Z(0) * Z(1), [gates.X(0)], -1.0, None), - (X(0), [gates.H(0)], 1.0, None), - (X(0), [gates.X(0), gates.X(0)], 0.0, 0.05), + (Z(0), [gates.X(0)], -1.0), + (Z(0) * Z(1), [gates.X(0)], -1.0), + (X(0), [gates.H(0)], 1.0), ], ) -def test_expectation_samples(terms, gates_to_add, expected, threshold): +def test_expectation_samples(terms, gates_to_add, expected): """Test from_samples functionality of expectation function with various Hamiltonians""" hamiltonian = SymbolicHamiltonian(terms) circuit = Circuit(2) circuit.add(gates_to_add) result = expectation(circuit, hamiltonian, from_samples=True) - assert pytest.approx(result, abs=threshold) == expected + assert result == expected def test_measurement_basis_rotations_error():