Skip to content
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

Provider class was deprecated in qiskit 1.1 #1488

Open
1ucian0 opened this issue Nov 15, 2024 · 1 comment
Open

Provider class was deprecated in qiskit 1.1 #1488

1ucian0 opened this issue Nov 15, 2024 · 1 comment

Comments

@1ucian0
Copy link
Contributor

1ucian0 commented Nov 15, 2024

qiskit-experiments uses Provider abstract class significantly. In the cases I checked, it seems to use it as part of the Backend property to get account and job data.

In qiskit 1.1, upstream decided to deprecate the class and they are going to remove it in qiskit 2.0 (coming in 1Q2025).

github-merge-queue bot pushed a commit that referenced this issue Nov 15, 2024
### Summary

Qiskit 1.1 deprecated the Provider abstract class to be removed in 2.0
(planned for 1Q2025). In those cases where the class is used for only
typechecking purposes, the import should only happen when
`TYPE_CHECKING`. For the rest of the cases, I opened
#1488
mergify bot pushed a commit that referenced this issue Nov 15, 2024
### Summary

Qiskit 1.1 deprecated the Provider abstract class to be removed in 2.0
(planned for 1Q2025). In those cases where the class is used for only
typechecking purposes, the import should only happen when
`TYPE_CHECKING`. For the rest of the cases, I opened
#1488

(cherry picked from commit 519bb53)
wshanks pushed a commit that referenced this issue Nov 15, 2024
…1489) (#1490)

### Summary

Qiskit 1.1 deprecated the Provider abstract class to be removed in 2.0
(planned for 1Q2025). In those cases where the class is used for only
typechecking purposes, the import should only happen when
`TYPE_CHECKING`. For the rest of the cases, I opened
#1488
<hr>This is an automatic backport of pull request #1489 done by
[Mergify](https://mergify.com).

Co-authored-by: Luciano Bello <[email protected]>
@wshanks
Copy link
Collaborator

wshanks commented Nov 15, 2024

Ah, I see why this hasn't raised a deprecation warning in the tests:

class FakeProvider(ProviderV1):
"""Fake provider with no backends for testing"""
def backends(self, name=None, **kwargs):
"""List of available backends. Empty in this case"""
return []
class FakeBackend(BackendV2):
"""
Fake backend for test purposes only.
"""
def __init__(
self,
provider=FakeProvider(),
backend_name="fake_backend",
num_qubits=1,
max_experiments=100,
):

ProviderV1 only gets instantiated as the default keyword argument to FakeBackend, so that happens at import time before the tests start running and set the warnings filter to raise an exception on deprecation warnings, and maybe before the tests set deprecation warnings to be visible? I don't see a warning at all for the provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants