You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kevinsung
changed the title
CircuitMPS.sample with seed gives incorrect results
CircuitMPS.sample with seed returns the same bitstring for every shot
Jul 19, 2024
What happened?
CircuitMPS
that flips a coin.seed=None
. Behavior is as expected.seed
set to some random integers. In each instance, the same bit is measured every single time.What did you expect to happen?
The same bit should not be returned every time. It's a coin flip.
Minimal Complete Verifiable Example
Relevant log output
Anything else we need to know?
It looks like the same Generator is being recreated before each shot:
quimb/quimb/tensor/tensor_1d.py
Line 3209 in 1960e05
Instead, the Generator should be created only once, before sampling, and reused for every shot.
This is probably unrelated but I noticed that here quimb sets the random number generator seed in a way that is discouraged:
quimb/quimb/tensor/circuit.py
Line 3260 in 1960e05
Instead, a Generator should be created with
np.random.default_rng
and used.Environment
The text was updated successfully, but these errors were encountered: