Skip to content

Unite Session from qiskit_ibm_provider with Session in this repository#1280

Closed
merav-aharoni wants to merge 24 commits intoQiskit:mainfrom
merav-aharoni:unite_sessions
Closed

Unite Session from qiskit_ibm_provider with Session in this repository#1280
merav-aharoni wants to merge 24 commits intoQiskit:mainfrom
merav-aharoni:unite_sessions

Conversation

@merav-aharoni
Copy link
Copy Markdown
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
Copy Markdown

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

Comment thread qiskit_ibm_runtime/ibm_backend.py
Comment thread test/integration/test_session.py Outdated
@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
Copy Markdown
Contributor

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