You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Session.from_id method is returning a Session instance whose backend method returns a backend name different from the session whose ID was passed into from_id.
Steps to reproduce
from qiskit_ibm_runtime import QiskitRuntimeService, Session
service = QiskitRuntimeService(
token="your_token", instance="your_instance", channel="ibm_cloud"
)
first_backend_name = "ibm_brisbane"
first_session = Session(backend=service.backend(first_backend_name), max_time=8 * 60 * 60)
second_backend_name = "ibm_fez"
second_session = Session(backend=service.backend(second_backend_name), max_time=8 * 60 * 60)
second_session_copy = Session.from_id(second_session.session_id, service)
print(second_session.backend()) # gives me ibm_fez
print(second_session_copy.backend()) # gives me ibm_brisbane (i.e., the backend from first_session)
assert second_session.session_id == second_sesssion_copy.session_id # no error thrown
Expected behavior
The second_session and second_session_copy should both return "ibm_fez" from their backend method.
Suggested solutions
Not sure, but perhaps there is a bug in the session_details method of the QiskitRuntimeService._api_client attribute (used here in Session.from_id)?
Additional Information
qiskit-ibm-runtime version: 0.28.0
Python version: 3.10.9
Operating system: MacOS Sonoma 14.6.1
The text was updated successfully, but these errors were encountered:
@dcanuto Thanks for reporting this. Looks like the session details response from the API doesn't return a backend so the first backend from the list of available backends is returned instead.
Describe the bug
The
Session.from_id
method is returning aSession
instance whosebackend
method returns a backend name different from the session whose ID was passed intofrom_id
.Steps to reproduce
Expected behavior
The
second_session
andsecond_session_copy
should both return"ibm_fez"
from theirbackend
method.Suggested solutions
Not sure, but perhaps there is a bug in the
session_details
method of theQiskitRuntimeService._api_client
attribute (used here inSession.from_id
)?Additional Information
The text was updated successfully, but these errors were encountered: