Skip to content

Commit

Permalink
Fix for cupy and tensorflow backends
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Mar 25, 2022
1 parent 6196f49 commit ed0f9e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/qibo/tests/test_core_circuit_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,14 @@ def test_circuit_add_sampling(backend):
circ.add(gates.M(0))

# Sampling using 10 shots
np.random.seed(123)
K.set_seed(123)
samples = circ(nshots=10).samples()

# Sampling using 1 shot in for loop
target_samples = []
K.set_seed(123)
np.random.seed(123)
for _ in range(10):
target_samples.append(circ(nshots=1).samples())

Expand Down

0 comments on commit ed0f9e7

Please sign in to comment.