-
Notifications
You must be signed in to change notification settings - Fork 208
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
Support VQEClient.retrieve_job() #479
Comments
You can retrieve runtime jobs using the following code. See also: https://qiskit.org/documentation/partners/qiskit_runtime/tutorials/00_introduction.html It's retrieved on the provider level not backend level as it is done for normal circuit / Qobj jobs. from qiskit import IBMQ
IBMQ.load_account()
provider = IBMQ.get_provider(hub='HUB_NAME', group='GROUP_NAME', project='PROJECT_NAME')
job = provider.runtime.job('JOB_ID') But I agree that it would be a good idea to add |
May I work on this issue? |
@iuliazidaru Sure thing! Maybe you can sync with @Cryoris who originally wrote the |
We already store the provider = ...
my_vqe = VQEClient(ansatz, ..., provider=provider)
my_result = my_vqe.compute_minimum_eigenvalue(...)
# retrieve job
job = provider.runtime.job(my_result.job_id) Since we design our algorithms to be stateless we also wouldn't want to store the last job ID in the job = my_vqe.retrieve_job(my_result.job_id) # or just my_result would be more useful than just directly calling job = provider.runtime.job(my_result.job_id) ? |
@Cryoris Thanks. You are right. I certainly don't think that VQE.retrieve_job is necessary. What I really want is something that makes it easy to make a |
Ah I see! Yes I think this should be possible -- as long as the job result is still stored on our servers. From the job ID we can query both the result and the inputs which should enable us to construct the results object. @iuliazidaru are you still interested in tackling this issue? 🙂 |
@Cryoris Yes. I'll implement it. |
Great 🙂 let me know if I can help you out! Since it's not about the job but about the result I think we should call the function job = provider.runtime.job(job_id) and then the properties of the It might be good to make this function a staticmethod as it doesn't have anything to do with the algorithm setup, such as the ansatz or backend. |
@Cryoris Thanks. It might be better to name the method differently. |
Closing this as per #1124 |
What is the expected enhancement?
I want this method because I sometimes want to retrieve a runtime job later. Is there another way?
The text was updated successfully, but these errors were encountered: