Skip to content

Commit

Permalink
New example of retrieving retired QR jobs (Qiskit#423)
Browse files Browse the repository at this point in the history
closes Qiskit#398
  • Loading branch information
beckykd authored Nov 29, 2023
1 parent dba9d74 commit ebfbdcd
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/run/retired-systems.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ The following systems have been retired. For the full list of available systems,
<span id="retrieve"></span>
## Retrieve a job from a retired system

To retrieve jobs from a retired system, you can use code similar to this:
To retrieve jobs from a retired system, you can use code similar to this, depending on the provider from which the job was sent:

### For a job run from IBM Provider

```python
from qiskit_ibm_provider import IBMProvider
Expand All @@ -74,4 +76,19 @@ jobs = provider.backend.jobs(backend_name=<backend_name>)

#If you want to retrieve a specific job you have the id for
job = provider.backend.retrieve_job(<job_id>)
```

### For a job run from Qiskit Runtime

```python
from qiskit_ibm_runtime import QiskitRuntimeService

# Load your IBM Quantum account(s). Replace "hub/group/project" with your desired instance
service = QiskitRuntimeService(channel="ibm_quantum", instance="hub/group/project")

# Retrieve a single job by id
job = service.job(<job_id>)

# Retrieve a batch of jobs. Filtering options can be found in the QiskitRuntimeService.jobs api reference
jobs = service.jobs(backend_name=<backend_name>)
```

0 comments on commit ebfbdcd

Please sign in to comment.