I have ran an experiment in one of the IBM processors and the work has finished. However, I can not obtain the data as histograms or counts in the qiskit notebook because the experiment was concluded while I was logged off and therefore now I would need to run the full script again. That is, I would need to run the experiment again. My question is if there is some way to access the results in the notebook without this requirement. I know that the histograms are stored in the section "results" but I specifically want to work with them in the notebook. Thank you.
First, set up your provider
provider = IBMQ.load_account()
From this you can access a list of all your jobs with
Each job is recorded as a dictionary. One of the keys is 'id', which is the job id. To extract this for the first job on the list, for example, use
job_id = provider.circuits.client.get_status_jobs()['id']
You can then use
job_info = provider.circuits.client.get_job(job_id)
To get a JSON which contains all the information about the job, including the results. The counts data for the first circuit in the job, for example, can be found at
Though note that the strings will be hex strings rather than bit strings, and so will need conversion.
You can get a previous result by grabbing the corresponding job from the backend you sent it to:
from qiskit import * provider = IBMQ.load_account() backend = provider.get_backend('ibmq_BLAH') #if you know the job ID job = backend.retrieve_job('JOB_ID') # if not, get the last 10 jobs on backend jobs = backend.jobs() ```