-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-deterministic behaviour with fixed seed #89
Comments
Using the state-vector backend engine = HybridEngine(qsim="state-vector", error_model=error_model) the results are still non-deterministic. |
I think the cause is PECOS/python/pecos/engines/hybrid_engine.py Line 174 in b16b27a
|
I see, thanks. So if |
Note however that I am calling |
... which means I actually need to set This behaviour must have changed recently. |
Yeah, that's what I mean. It's possible that |
I tried changing to: # engine.use_seed(7)
results = engine.run(phir, shots=100, seed=7) but still get non-deterministic results. |
For clarification, does the same behaviour apply to both sparse and statevector simulations when the seed is provided in I'm trying to track down the random seeding and uses of randomness. It doesn't look like the qulacs API supports seeding but I might be wrong. The sparse sim appears to use the python random number generation, so if it also isn't deterministic then somewhere along the line the random state is likely being overwritten. |
I've tried |
Pablo mentioned previously that qulacs (as well as QuEST) doesn't support seeds as Jake mentioned in this thread. So not surprised by that behavior, although it should be made clear to users (at least probably give a warning if th seed is set and recommend the use of another backend). Stabilizer sims being non-deterministic is unexpected and disturbing... |
Version: 0.6.0.dev6
The following code uses an error model to simulate a Bell circuit, with a fixed seed. It gives non-deterministic results.
May output 24, 25, 26, 27 etc.
The text was updated successfully, but these errors were encountered: