diff --git a/src/qibo/backends/tensorflow.py b/src/qibo/backends/tensorflow.py index 6490b37d9e..88b9d505ac 100644 --- a/src/qibo/backends/tensorflow.py +++ b/src/qibo/backends/tensorflow.py @@ -205,10 +205,10 @@ def calculate_hamiltonian_state_product(self, matrix, state): def test_regressions(self, name): if name == "test_measurementresult_apply_bitflips": return [ - [4, 0, 0, 1, 0, 2, 2, 4, 4, 0], - [4, 0, 0, 1, 0, 2, 2, 4, 4, 0], - [4, 0, 0, 1, 0, 0, 0, 4, 4, 0], - [4, 0, 0, 0, 0, 0, 0, 4, 4, 0], + [4, 0, 0, 1, 0, 0, 1, 0, 0, 0], + [0, 1, 1, 2, 1, 1, 4, 0, 0, 4], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 4, 0, 0, 0, 4], ] elif name == "test_probabilistic_measurement": if "GPU" in self.device: # pragma: no cover @@ -223,6 +223,6 @@ def test_regressions(self, name): elif name == "test_post_measurement_bitflips_on_circuit": return [ {5: 30}, - {5: 16, 7: 10, 6: 2, 3: 1, 4: 1}, - {3: 6, 5: 6, 7: 5, 2: 4, 4: 3, 0: 2, 1: 2, 6: 2}, + {5: 12, 7: 6, 4: 6, 1: 5, 6: 1}, + {3: 7, 6: 4, 2: 4, 7: 4, 0: 4, 5: 3, 4: 2, 1: 2}, ] diff --git a/tests/test_measurements_probabilistic.py b/tests/test_measurements_probabilistic.py index 4f5c14a4cc..6b018c3f08 100644 --- a/tests/test_measurements_probabilistic.py +++ b/tests/test_measurements_probabilistic.py @@ -146,9 +146,7 @@ def test_measurementresult_apply_bitflips(backend, i, p0, p1): c = models.Circuit(3) c.add(gates.M(*range(3))) - state = np.zeros(8) - state[0] = 1.0 - state = backend.cast(state) + state = backend.zero_state(8) result = CircuitResult(state, c.measurements, backend) result._samples = backend.cast(np.zeros((10, 3)), dtype="int32") backend.set_seed(123)