Ang pahinang ito ay hindi pa naisalin. Nakikita mo ang orihinal na bersyon sa Ingles.
Introduction to options
You can pass options to primitives to customize them to meet your needs. This section focuses on Qiskit Runtime primitive options. While the interface of the primitives' run() method is common across all implementations, their options are not. Consult the corresponding API references for information about the qiskit.primitives and qiskit_aer.primitives options.
Overview
Structure
When calling the primitives, you can pass in options by using an options class or a dictionary. Commonly-used options, such as resilience_level, are at the first level. Other options are grouped into different categories, such as execution. See the Set primitive options section for full details.
Defaults
If you do not specify a value for an option, it is given a special value of Unset and the server default value is used. Thus, the default value will be the same regardless of your code version.
The tables in the Options classes summary section lists the default values.
Set options
Options can be defined before a primitive is constructed and passed to the primitive, which makes a copy of them. This can be done either as a nested dictionary, or by using the options classes. Additionally, after the primitive is constructed, its options can be changed. Use the workflow that works best for your application. See Specify options for full details.
Options classes summary
- Estimator
- Sampler
- Dynamical decoupling: Options for dynamical decoupling.
- Environment: Execution environment options, such as the logging level to set and job tags to add.
- Execution: Primitive execution options, including whether to initialize qubits and the repetition delay.
- Resilience: Advanced options for configuring error mitigation methods such as measurement error mitigation, ZNE, and PEC.
- Simulator: Simulator options, such as the basis gates, simulator seed, and coupling map. Applies to local testing mode only.
- Twirling: Twirling options, such as whether to apply two-qubit gate twirling and the number of shots to run for each random sample.
- Dynamical decoupling: Options for dynamical decoupling.
- Environment: Execution environment options, such as the logging level to set and job tags to add.
- Execution: Primitive execution options, including whether to initialize qubits and the repetition delay.
- Simulator: Simulator options, such as the basis gates, simulator seed, and coupling map. Applies to local testing mode only.
- Twirling: Twirling options, such as whether to apply two-qubit gate twirling and the number of shots to run for each random sample.
Available options
The following table documents options from the latest version of qiskit-ibm-runtime. To see older option versions, visit the qiskit-ibm-runtime API reference and select a previous version.
- Estimator
- Sampler
default_shots
default_shotsThe total number of shots to use per circuit per configuration.
Choices: Integer >= 0
Default: None
default_precision
default_precisionThe default precision to use for any PUB or run() call that does not specify one.
Choices: Float > 0
Default: 0.015625 (1 / sqrt(4096))
dynamical_decoupling
dynamical_decouplingControl dynamical decoupling error mitigation settings.
dynamical_decoupling API documentation
dynamical_decoupling.enable
dynamical_decoupling.enableChoices: True, False
Default: False