Skip to content

Unite Session from qiskit_ibm_provider with Session in this repository #1280

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

Closed
wants to merge 24 commits into from

Conversation

merav-aharoni
Copy link
Contributor

@merav-aharoni merav-aharoni commented Dec 12, 2023

Summary

IBMBackend.run() now uses the same Session as used by the primitives.

Details and comments

I made changes in the imports because of cyclic imports.
IBMBackend can receive a Session in 3 ways:

  1. As a context manager (as for primitives)
  2. As a parameter to IBMBackend.run(). This makes more sense than setting it in __init__, because often the user will define the backend as backend = service.get_backend(), so the backend will keep the same Session object even if the session is closed, causing failures. Even if we call backend = service.get_backend() again, backend will still be the same object as before.
  3. Using IBMBackend.open_session(). I believe this should eventually be deprecated.

@merav-aharoni merav-aharoni marked this pull request as ready for review December 12, 2023 17:21
@merav-aharoni merav-aharoni requested a review from kt474 December 12, 2023 17:21
@coveralls
Copy link

coveralls commented Dec 12, 2023

Pull Request Test Coverage Report for Build 7749509110

  • -5 of 17 (70.59%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 69.15%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_ibm_runtime/ibm_backend.py 6 11 54.55%
Totals Coverage Status
Change from base Build 7747929718: 0.001%
Covered Lines: 5485
Relevant Lines: 7932

💛 - Coveralls

@kt474 kt474 self-assigned this Jan 4, 2024
@kt474 kt474 added the Changelog: New Feature Include in the Added section of the changelog label Jan 31, 2024
@kt474
Copy link
Member

kt474 commented Apr 4, 2024

With the upcoming deprecation of backend.run() I will close this for now

@kt474 kt474 closed this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the Added section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants