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

Make sure backend.run and Sampler.run can run in a single session #1203

Merged
merged 14 commits into from
Nov 14, 2023

Conversation

merav-aharoni
Copy link
Contributor

Summary

Added a test to make sure they run properly.

Details and comments

Fixes #1180

@merav-aharoni
Copy link
Contributor Author

There was a proposal to issue a warning to let the user know that if backend is run in qiskit_ibm_runtime.Session, then it will actually not be executed in the session (and vice versa). I couldn't find a way to check whether this occurs. Any suggestions?

@coveralls
Copy link

coveralls commented Nov 8, 2023

Pull Request Test Coverage Report for Build 6868448170

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 17 of 21 (80.95%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 55.902%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_ibm_runtime/base_primitive.py 4 5 80.0%
qiskit_ibm_runtime/utils/default_session.py 11 12 91.67%
qiskit_ibm_runtime/ibm_backend.py 1 3 33.33%
Totals Coverage Status
Change from base Build 6856124798: 0.03%
Covered Lines: 2477
Relevant Lines: 4431

💛 - Coveralls

@merav-aharoni merav-aharoni marked this pull request as ready for review November 8, 2023 17:24
@merav-aharoni merav-aharoni requested a review from kt474 November 8, 2023 17:25
@kt474
Copy link
Member

kt474 commented Nov 9, 2023

There was a proposal to issue a warning to let the user know that if backend is run in qiskit_ibm_runtime.Session, then it will actually not be executed in the session (and vice versa). I couldn't find a way to check whether this occurs. Any suggestions?

That's true, I don't see a good way to do this either - maybe we can just write in the docs that this type of behaviour is not supported?

@merav-aharoni
Copy link
Contributor Author

I added a warning for the case that a Primitive is run within a IBMBackend session. The opposite is not possible, because it creates a circular import.This occurs because Session includes an IBMBackend, so IBMBackend cannot include a Session.

@merav-aharoni
Copy link
Contributor Author

@kt474 - I think this can be reviewed now. I think a release note is not needed, because it is really part of the backend.run() PR.

Copy link
Member

@kt474 kt474 left a comment

Choose a reason for hiding this comment

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

LGTM

@kt474 kt474 merged commit 6cc8197 into Qiskit:main Nov 14, 2023
14 checks passed
@merav-aharoni merav-aharoni deleted the two_in_session branch November 15, 2023 07:52
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

Successfully merging this pull request may close these issues.

Enable Session to contain both primitive.run and backend.run
3 participants