-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 qiskit.Aer
and qiskit.providers.aer
#11439
Conversation
These were intended to be deprecated after the release of Aer 0.11, but we apparently never actually got around to it. This fully deprecates the `qiskit.Aer` object, along with imports from `qiskit.providers.aer`, as we will be removing those completely in Qiskit 1.0. The namespace loaders in `qiskit.namespace` will also be removed in Qiskit 1.0, but I have not marked these with deprecation warnings because: - we need to continue using them to effect the deprecations of the imports. - they have never been documented as public interface, so are a private implementation detail. All the use of `qiskit.providers.aer` in Terra and its tests is replaced with `qiskit_aer`. This name is only available from Aer 0.11, but in practice, Aer 0.10 already does not work with Qiskit 0.46 (fails during import), so this change does not affect the working set of Aer versions. I haven't touched old imports of IBMQ, because that package is already completely deprecated and we should be removing all attempted use of it from Qiskit 1.0, because that code would never be able to succeed.
One or more of the the following people are requested to review this:
|
With Aer 0.13 removing the capability, this is not something we will be able to support moving forwards. This deprecates the functionality, in preparation for its full removal in Qiskit 1.0.
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. At the time we added the namespace import redirect I think we discussed just leaving qiskit.providers.aer
-> qiskit_aer
in perpetuity because it didn't have any real cost just the qiskit.namespace
module. I think removing it for Qiskit 1.0.0 makes sense though if we're going to do it.
Just a couple small comments inline.
@@ -55,14 +54,7 @@ def is_aer_provider_available(): | |||
Returns: | |||
bool: True if simulator executable is available | |||
""" | |||
# TODO: HACK FROM THE DEPTHS OF DESPAIR AS AER DOES NOT WORK ON MAC |
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.
How long as this been here? Aer has worked on mac for a really long time now...
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.
commit b2bbb3f05968f3cadc2993ed66123077d80026ef
Author: Jay M. Gambetta <jay.gambetta@us.ibm.com>
Date: Fri Dec 28 17:32:27 2018 -0500
Remove legacy simulators (#1615)
so not too long, you know
should instead use the same object from the ``qiskit_aer`` namespace, which is a drop-in | ||
replacement. | ||
- | | ||
Importing from ``qiskit.providers.aer`` is deprecated and will stop working in Qiskit 1.0. You |
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.
Did we have a deprecation warning for the namespace hooks in general? Not that it hurts to do this explicitly because we're deprecating the backwards compat import machinery in this PR.
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.
What kind of statements do you mean, sorry?
If you mean the objects in qiskit.namespace
themselves, I haven't put deprecations on them a) we need to use them for the whole length of their existence so would trigger warnings by our regular use of them (or we'd have to wait another cycle to deprecate), and b) they're not public per our policy (there's no documentation of qiskit.namespace
).
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.
For linking purposes: at the time, we discussed whether to make qiskit.namespace
explicitly private, but equally didn't make a positive decision that it would be public per the deprecation policy, we just didn't call it qiskit._namespace
. By the intended current terms of the deprecation policy, it doesn't count as public because it's not documented, though caveat: we never merged #11205 on Terra, and then the deprecation policy got moved to DEPRECATIONS.md
on Terra in #11218 in its old form, so we need to resurrect #11205 here.
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 meant #11223 which implicitly covered qiskit.providers.aer
at least in my head, the qiskit.namespace
machinery was just an explicit exception to that.
I'm keen to get rid of |
That does raise a concern for me in rustworkx where we use the same basic code to redirect imports from |
To be fair, I'm 100% certain it'll still be possible to do this, I just think we'll have to go look at the Fixed the dodgy deprecation message in 4add053. |
Summary
These were intended to be deprecated after the release of Aer 0.11, but we apparently never actually got around to it. This fully deprecates the
qiskit.Aer
object, along with imports fromqiskit.providers.aer
, as we will be removing those completely in Qiskit 1.0.The namespace loaders in
qiskit.namespace
will also be removed in Qiskit 1.0, but I have not marked these with deprecation warnings because:All the use of
qiskit.providers.aer
in Terra and its tests is replaced withqiskit_aer
. This name is only available from Aer 0.11, but in practice, Aer 0.10 already does not work with Qiskit 0.46 (fails during import), so this change does not affect the working set of Aer versions.I haven't touched old imports of IBMQ, because that package is already completely deprecated and we should be removing all attempted use of it from Qiskit 1.0, because that code would never be able to succeed.
Details and comments
See #5089 for the history of these deprecations.