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

Use Qiskit Runtime SamplerV2 in local mode instead of BackendSamplerV2 in test #513

Merged
merged 5 commits into from
Apr 17, 2024

Conversation

garrison
Copy link
Member

@garrison garrison commented Mar 26, 2024

This is a draft of something we could do once the next qiskit-ibm-runtime release comes out (we must wait until then because we need Qiskit/qiskit-ibm-runtime#1558). Once that happens, I will likely further iterate on this open another pull request that builds on this to fix some or (ideally) all of the following issues:

More info on this migration is at https://docs.quantum.ibm.com/api/migration-guides/local-simulators.

@garrison garrison added on hold Let's wait for something before merging tests Related to tests labels Mar 26, 2024
@garrison garrison self-assigned this Mar 26, 2024
@garrison garrison changed the title Use Qiskit Runtime SamplerV2 in local mode instead of BackendSampler Use Qiskit Runtime SamplerV2 in local mode instead of BackendSamplerV2 Mar 26, 2024
@garrison garrison added this to the 0.7.0 milestone Apr 11, 2024
@garrison
Copy link
Member Author

garrison commented Apr 11, 2024

I'm going to add this to the 0.7.0 milestone because it'd be really nice to knock these items off and move to using fake backends and qiskit runtime local mode in the docs as soon as possible. Even if we were to merge this minimal PR before our next release, we could backport the other changes because ckt would already depend on the requisite qiskit-ibm-runtime version. To enable this, though, we'll need a qiskit-ibm-runtime release, either 0.22.1 from the current stable branch or 0.23.0.

There will be no 0.22.1 release, it seems, but 0.23.0 is out now
so we can use it instead.
@coveralls
Copy link

coveralls commented Apr 16, 2024

Pull Request Test Coverage Report for Build 8712251243

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.438%

Totals Coverage Status
Change from base Build 8696380179: 0.0%
Covered Lines: 3452
Relevant Lines: 3617

💛 - Coveralls

@garrison garrison removed the on hold Let's wait for something before merging label Apr 16, 2024
@garrison garrison changed the title Use Qiskit Runtime SamplerV2 in local mode instead of BackendSamplerV2 Use Qiskit Runtime SamplerV2 in local mode instead of BackendSamplerV2 in test Apr 16, 2024
@garrison garrison requested a review from caleb-johnson April 16, 2024 00:41
@garrison garrison marked this pull request as ready for review April 16, 2024 02:18
@caleb-johnson
Copy link
Collaborator

caleb-johnson commented Apr 16, 2024

Could you please remind me why we need to wait for another release of qiskit-ibm-runtime to knock out all of the issues in the original PR? Is that a dated comment?

EDIT: I see you've opened #552

@garrison
Copy link
Member Author

garrison commented Apr 17, 2024

Could you please remind me why we need to wait for another release of qiskit-ibm-runtime to knock out all of the issues in the original PR? Is that a dated comment?

We need to bump the version of qiskit-ibm-runtime even for this PR to work because it is the first version that includes Qiskit/qiskit-ibm-runtime#1558.

I bumped the version of Aer here, too, so that we can backport #552 (if it doesn't land in time for the release) without needing to further bump any versions on the stable branch. Aer 0.14 is required there because that is when EstimatorV2 was introduced.

Copy link
Collaborator

@caleb-johnson caleb-johnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks!

Line 51 in the test uses GenericBackendV2. Should we make a test explicitly testing against that backend and use AerSimulator everywhere by default? The only places we would need to switch would be here and Tutorial 2, cutting for depth.

@garrison
Copy link
Member Author

garrison commented Apr 17, 2024

Line 51 in the test uses GenericBackendV2. Should we make a test explicitly testing against that backend and use AerSimulator everywhere by default? The only places we would need to switch would be here and Tutorial 2, cutting for depth.

Actually, in #552 I am transitioning to using Qiskit Runtime in local mode with fake backends in all the tutorials, so I think that, the test you mention, plus AerSimulator in this PR's test covers all our bases.

We can always continue this conversation at #552, too.

@garrison garrison merged commit 7831bba into main Apr 17, 2024
11 checks passed
@garrison garrison deleted the runtime-samplerv2 branch April 17, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants