quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.27k stars 1.01k forks source link

move away from np.random.RandomStates` #6321

Open AlMrvn opened 1 year ago

AlMrvn commented 1 year ago

Is your feature request related to a use case or problem? Please describe. the random generator of cirq rely on legacy code from numpy:

Describe the solution you'd like use the "new numpy way" of dealing with random number generators:

What is the urgency from your perspective for this issue? Is it blocking important work? P3 - I'm not really blocked by it, it is an idea I'd like to discuss / suggestion based on principle

mpharrigan commented 1 year ago

Yes, I put a lot of the RandomStates there in the first place. The new way (last I checked) has a bit more boilerplate but is better designed. The general philosophy of using an actual random generator object everywhere we can instead of the np.random module global-generator is still a good one