qiskit-documentation/docs/api/qiskit-ibm-runtime/0.34/options.mdx

75 lines
5.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: options (v0.34)
description: API reference for qiskit_ibm_runtime.options in qiskit-ibm-runtime v0.34
in_page_toc_min_heading_level: 2
python_api_type: module
python_api_name: qiskit_ibm_runtime.options
---
<span id="primitive-options-qiskit-ibm-runtime-options" />
<span id="module-qiskit_ibm_runtime.options" />
# Primitive options
`qiskit_ibm_runtime.options`
Options that can be passed to the Qiskit Runtime primitives.
## V2 Primitives
`SamplerV2` and `EstimatorV2` each have their own options. You can use the `options` attribute to set the options. For example:
```python
from qiskit_ibm_runtime import QiskitRuntimeService, EstimatorV2
service = QiskitRuntimeService()
backend = service.least_busy(operational=True, simulator=False)
estimator = EstimatorV2(mode=backend)
estimator.options.resilience_level = 1
```
You can also use the `update()` method to do bulk update. For example:
```python
from qiskit_ibm_runtime import QiskitRuntimeService, EstimatorV2
service = QiskitRuntimeService()
backend = service.least_busy(operational=True, simulator=False)
estimator = EstimatorV2(mode=backend)
estimator.options.update(resilience_level=1)
```
Refer to [`SamplerOptions`](options-sampler-options "qiskit_ibm_runtime.options.SamplerOptions") and [`EstimatorOptions`](options-estimator-options "qiskit_ibm_runtime.options.EstimatorOptions") for V2 Sampler and V2 Estimator options, respectively.
<Admonition title="Note" type="note">
If an option is not specified, the server default value is used. The default values are subject to change. Refer to this current modules documentation for the latest defaults.
</Admonition>
## Classes
### Base primitive options
| | |
| --------------------------------------------------------------------------------------------- | ------------------------- |
| [`EstimatorOptions`](options-estimator-options "qiskit_ibm_runtime.options.EstimatorOptions") | Options for V2 Estimator. |
| [`SamplerOptions`](options-sampler-options "qiskit_ibm_runtime.options.SamplerOptions") | Options for V2 Sampler. |
### Suboptions
| | |
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| [`NoiseLearnerOptions`](options-noise-learner-options "qiskit_ibm_runtime.options.NoiseLearnerOptions") | Options for [`NoiseLearner`](noise-learner-noise-learner "qiskit_ibm_runtime.noise_learner.NoiseLearner"). |
| [`DynamicalDecouplingOptions`](options-dynamical-decoupling-options "qiskit_ibm_runtime.options.DynamicalDecouplingOptions") | Options for dynamical decoupling (DD). |
| [`ResilienceOptionsV2`](options-resilience-options-v2 "qiskit_ibm_runtime.options.ResilienceOptionsV2") | Resilience options for V2 Estimator. |
| [`LayerNoiseLearningOptions`](options-layer-noise-learning-options "qiskit_ibm_runtime.options.LayerNoiseLearningOptions") | Options for learning layer noise. |
| [`MeasureNoiseLearningOptions`](options-measure-noise-learning-options "qiskit_ibm_runtime.options.MeasureNoiseLearningOptions") | Options for measurement noise learning. |
| [`PecOptions`](options-pec-options "qiskit_ibm_runtime.options.PecOptions") | Probabalistic error cancellation mitigation options. |
| [`ZneOptions`](options-zne-options "qiskit_ibm_runtime.options.ZneOptions") | Zero noise extrapolation mitigation options. |
| [`TwirlingOptions`](options-twirling-options "qiskit_ibm_runtime.options.TwirlingOptions") | Twirling options. |
| [`ExecutionOptionsV2`](options-execution-options-v2 "qiskit_ibm_runtime.options.ExecutionOptionsV2") | Execution options for V2 primitives. |
| [`SamplerExecutionOptionsV2`](options-sampler-execution-options-v2 "qiskit_ibm_runtime.options.SamplerExecutionOptionsV2") | Extension of [`ExecutionOptionsV2`](options-execution-options-v2 "qiskit_ibm_runtime.options.ExecutionOptionsV2") for the sampler primitive. |
| [`EnvironmentOptions`](options-environment-options "qiskit_ibm_runtime.options.EnvironmentOptions") | Options related to the execution environment. |
| [`SimulatorOptions`](options-simulator-options "qiskit_ibm_runtime.options.SimulatorOptions") | Simulator options. |