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

Instantiate a Session with an existing session id #581

Closed
caleb-johnson opened this issue Oct 17, 2022 · 1 comment · Fixed by #1101
Closed

Instantiate a Session with an existing session id #581

caleb-johnson opened this issue Oct 17, 2022 · 1 comment · Fixed by #1101
Assignees
Labels
enhancement New feature or request priority: medium Medium Priority issue (must have for current release)
Milestone

Comments

@caleb-johnson
Copy link

What is the expected feature or enhancement?
One should be able to instantiate a Session object with an existing session id str.

Acceptance criteria
Users should have the ability to instantiate a Session object with its private _session_id attribute set.

One implementation might look like:

session_id: str = ...
session = Session.from_id(session_id)
@caleb-johnson caleb-johnson added the enhancement New feature or request label Oct 17, 2022
@jyu00 jyu00 added the priority: medium Medium Priority issue (must have for current release) label Nov 7, 2022
@caleb-johnson
Copy link
Author

caleb-johnson commented Aug 3, 2023

One use case / need for this is: A user is submitting consecutive jobs to the backend within a session, and their local system crashes. They cannot easily instantiate a new Session object and resume their work before the timeout. They would need to use a different/more complicated interface (QiskitRuntimeService.run).

Another use case is: A user who has a Session instantiation inside a remote function. Provider is not serializable, so it is often difficult to pass Qiskit Runtime objects to cloud functions. It may require passing a QiskitRuntimeService and the Provider/Session be spun up inside the remote function.

In this scenario, a user may want to also submit a session_id to the remote function, so when they instantiate the new Session remotely, they can easily get back to the front of the queue. The service.run interface is more difficult to deal with in my experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: medium Medium Priority issue (must have for current release)
Projects
None yet
4 participants