-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Deprecate BasicAer
and introduce BasicProvider
#11583
Conversation
Co-authored-by: Julien Gacon <gaconju@gmail.com>
One or more of the the following people are requested to review this:
|
Co-authored-by: Julien Gacon <gaconju@gmail.com>
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.
Overall this LGTM. It's very thorough especially on dealing with the deprecation warnings everywhere. I just left a few small comments inline it shouldn't be anything major though.
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
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.
Thanks for the quick update. I think this is basically ready, I just had two super small comments that I caught on my final pass through, one small one about the docstring for the new simulator class and the other about the usage of rngs in numpy using the legacy interface.
self._configuration = None | ||
|
||
# Internal simulator variables | ||
self._local_random = np.random.RandomState() |
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 is actually the legacy interface for numpy random number generators. We probably should use the newer interface: https://numpy.org/doc/stable/reference/random/generator.html there are some small changes needed but it shouldn't be too bad.
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.
I was not sure about making this change because the number generation algorithm is different with the new interface. At least, I have not found a way to generate the same values with the same seed (I noticed this when migrating algorithm_globals
). But I keep forgetting that this is technically a new class, so that is technically not a behavior change.
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.
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
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.
LGTM, thanks for the quick updates
…-terra into deprecate-basic-aer
Summary
This PR introduces
BasicProvider
in the 0.46 branch (analogous to #11422 in the main branch but up-to-date with 0.46 changes), and raises deprecation warnings forBasicAer
.The migration path from
BasicAer
toBasicProvider
is summarized in both the release note and as a warning in the corresponding API doc entry.Details and comments
The fact that most users access the basic aer provider via its global instance +
get_backend
made the deprecation trickier than usual. To make sure that a warning would always be seen, this PR inserts not only deprecation decorators in the class inits (to be raised when instantiated directly), but also a deprecation warning to be raised uponfrom qiskit import BasicAer
.