qiskit-community / qiskit-braket-provider

Qiskit-Braket provider to execute Qiskit programs on quantum computing hardware devices through Amazon Braket.
https://qiskit-community.github.io/qiskit-braket-provider/
Apache License 2.0
58 stars 45 forks source link

Providerv1 deprication patch #182

Closed LowkeyCoding closed 3 months ago

LowkeyCoding commented 3 months ago

Summary

Qiskit's ProviderV1 and Provider abstract classes are deprecated and will be removed after the release of v2.0. This change requires the removal of the abstract class from the BraketProvider and the re-implementation of get_backend(self, name=None, **kwargs).

Details and comments

The change described in the summary has been implemented, and additionally, comments for the self.backends() and self.get_backend() methods have been added.

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

yitchen-tim commented 3 months ago

Hi @LowkeyCoding thanks for the PR. The PR looks good. Could you merge the latest commit from main which will fix the checks.

LowkeyCoding commented 3 months ago

It seems like the behavior of get_backend() is not filtering in the test environment (most likely due to self.mock_session.search_devices.return_value and self.mock_session.get_device.side_effect). I have fixed it by creating a mock session with no simulators to catch the case where no backends are found and an exception is raised.