Skip to content

Commit

Permalink
Update code to not use the Options class (#1936)
Browse files Browse the repository at this point in the history
closes #1929
  • Loading branch information
beckykd authored Sep 13, 2024
1 parent ba2a3e9 commit 367e319
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docs/guides/max-execution-time.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@ To ensure fairness and help control costs, there is a maximum amount of time eac

The maximum execution time for a job is the smaller of these values:

- The value set for max_execution_time
- The value set for `max_execution_time`
- The QPU-determined job timeout value

The `max_execution_time` value is based on _quantum time_, not wall clock time. Quantum time is the time spent by the QPU complex to process the job. Simulator jobs use wall clock time because they do not have quantum time.

Set the maximum execution time (in seconds) on the job options by using one of the following methods:
Set the maximum execution time (in seconds) on the job options, as shown in the following example. See [Specify options](/guides/specify-runtime-options) for information about setting options.

```python
# Initiate the Options class with parameters
options = Options(max_execution_time=360)
```
from qiskit_ibm_runtime import QiskitRuntimeService
from qiskit_ibm_runtime import EstimatorV2 as Estimator

```python
# Create the options object with attributes and values
options = {"max_execution_time": 360}
service = QiskitRuntimeService()
backend = service.least_busy(operational=True, simulator=False)

estimator = Estimator(mode=backend)

estimator.options.max_execution_time = 2500
```

You can also find how much quantum time completed jobs have used by returning the job metrics as follows:
Expand Down

0 comments on commit 367e319

Please sign in to comment.