-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Allow Generator object for seed in QuantumVolume circuit #4867
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, but can you add a release note about support for passing a generator (and also maybe about the name change).
It would be nice if the circuit name had the seed and the offset from this seed in the name. Then each circuit could be reconstructed from the name alone. |
@nonhermitian As far as i know this info can't be extract from the PCG64 Generator since it doesn't actually use an integer seed internally but using the int to generate a SeedSequence to generate a BitGenerator. |
I am basically advocating for something like I did here: where the seed used to start the generator is attached to the circuit, plus the number of times the generator was called. Flor example if the seed was With this convention I can reproduce the circuit, I would just re-seed with the same seed, and then call offset number of times before generating the circuit. |
Note that if seed is a generator object the name contain [num_qubits, depth, Generator(PCG64)at<memory>]
This means we are not using the shared Generator object, but instead instantiating new generator objects with fixed integer seeds for each call to random_unitary.
Summary
Allows passing in a Numpy random
Generator
object as seed value forQuantumVolume
circuit.Closes #4866
Details and comments