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
When initialized with a seed, StatevectorSampler will reuse the same seed for all PUBs instead of generating a RNG once using this seed and then sticking to it. This causes undesired behaviors when running (close to) identical PUBs.
The code should instantiate a RNG once using the provided seed and then generate subsequent random numbers using this generator for all PUBs without re-instantiate it with the provided seed, so that the experiment is reproducible, but results between PUBs are not correlated.
Any suggestions?
It's definitely a niche problem, that I noticed because I had to run identical QuantumCircuits among different PUBs, so I'd understand if this isn't fixed.
The text was updated successfully, but these errors were encountered:
The result of running quantum circuit qc 10 times using the StatevectorSampler. It shows some random alternated output, how to see that the results between the pubs are not correlated:
{1: 1}
{0: 1}
{1: 1}
{1: 1}
{0: 1}
{1: 1}
{1: 1}
{1: 1}
{0: 1}
{0: 1}
One could update the run method to use _rng for generating random numbers, but is it necessary?
@BramDo I'm not sure I understand where do the numbers you printed come from. Did you got them running the code I provided (in particular, setting the seed)?
Environment
1.3.0
3.10.10
Ubuntu
What is happening?
When initialized with a seed,
StatevectorSampler
will reuse the same seed for all PUBs instead of generating a RNG once using this seed and then sticking to it. This causes undesired behaviors when running (close to) identical PUBs.How can we reproduce the issue?
What should happen?
The code should instantiate a RNG once using the provided seed and then generate subsequent random numbers using this generator for all PUBs without re-instantiate it with the provided seed, so that the experiment is reproducible, but results between PUBs are not correlated.
Any suggestions?
It's definitely a niche problem, that I noticed because I had to run identical
QuantumCircuit
s among different PUBs, so I'd understand if this isn't fixed.The text was updated successfully, but these errors were encountered: