Die Seite is noch nich ΓΌbersetzt. Se kieken die englische Originalversion.
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_shotsβThe total number of shots to use per circuit per configuration.
Choices: Integer >= 0
Default: None
default_precisionβ
default_precisionβThe 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_decouplingβControl dynamical decoupling error mitigation settings.
dynamical_decoupling API documentation
dynamical_decoupling.enableβ
dynamical_decoupling.enableβChoices: True, False
Default: False
dynamical_decoupling.extra_slack_distributionβ
dynamical_decoupling.extra_slack_distributionβChoices: middle, edges
Default: middle
dynamical_decoupling.scheduling_methodβ
dynamical_decoupling.scheduling_methodβChoices: asap, alap
Default: alap
dynamical_decoupling.sequence_typeβ
dynamical_decoupling.sequence_typeβChoices: XX, XpXm, XY4
Default: XX
dynamical_decoupling.skip_reset_qubitsβ
dynamical_decoupling.skip_reset_qubitsβChoices: True, False
Default: False
environmentβ
environmentβenvironment.callbackβ
environment.callbackβCallable function that receives the Job ID and Job result.
Choices: None
Default: None
environment.job_tagsβ
environment.job_tagsβList of tags.
Choices: None
Default: None
environment.log_levelβ
environment.log_levelβChoices: DEBUG, INFO, WARNING, ERROR, CRITICAL
Default: WARNING
environment.privateβ
environment.privateβChoices: True, False
Default: False
executionβ
executionβexecution.init_qubitsβ
execution.init_qubitsβWhether to reset the qubits to the ground state for each shot.
Choices: True, False
Default: True
execution.rep_delayβ
execution.rep_delayβThe delay between a measurement and the subsequent quantum circuit.
Choices: Value in the range supplied by backend.rep_delay_range
Default: Given by backend.default_rep_delay
max_execution_timeβ
max_execution_timeβChoices: Integer number of seconds in the range [1, 10800]
Default: 10800 (3 hours)
resilienceβ
resilienceβAdvanced resilience options to fine tune the resilience strategy.
resilience.layer_noise_learningβ
resilience.layer_noise_learningβOptions for learning layer noise.
resilience.layer_noise_learning.layer_pair_depthsβ
resilience.layer_noise_learning.layer_pair_depthsβChoices: list[int] of 2-10 values in the range [0, 200]
Default: (0, 1, 2, 4, 16, 32)
resilience.layer_noise_learning.max_layers_to_learnβ
resilience.layer_noise_learning.max_layers_to_learnβChoices: None, Integer >= 1
Default: 4
resilience.layer_noise_learning.num_randomizationsβ
resilience.layer_noise_learning.num_randomizationsβChoices: Integer >= 1
Default: 32
resilience.layer_noise_learning.shots_per_randomizationβ
resilience.layer_noise_learning.shots_per_randomizationβChoices: Integer >= 1
Default: 128
resilience.layer_noise_modelβ
resilience.layer_noise_modelβChoices: NoiseLearnerResult, Sequence[LayerError]
Default: None
resilience.measure_mitigationβ
resilience.measure_mitigationβChoices: True, False
Default: True
resilience.measure_noise_learningβ
resilience.measure_noise_learningβOptions for measurement noise learning.
resilience.measure_noise_learning.num_randomizationsβ
resilience.measure_noise_learning.num_randomizationsβChoices: Integer >= 1
Default: 32
resilience.measure_noise_learning.shots_per_randomizationβ
resilience.measure_noise_learning.shots_per_randomizationβChoices: Integer, auto
Default: auto
resilience.pec_mitigationβ
resilience.pec_mitigationβChoices: True, False
Default: False
resilience.pecβ
resilience.pecβProbabilistic error cancellation mitigation options.
resilience.pec.max_overheadβ
resilience.pec.max_overheadβChoices: None, Integer >= 1
Default: 100
resilience.pec.noise_gainβ
resilience.pec.noise_gainβChoices: auto, float in the range [0, 1]
Default: auto
resilience.zne_mitigationβ
resilience.zne_mitigationβChoices: True, False
Default: False
resilience.zneβ
resilience.zneβresilience.zne.amplifierβ
resilience.zne.amplifierβChoices: gate_folding, gate_folding_front, gate_folding_back, pea
Default: gate_folding
resilience.zne.extrapolated_noise_factorsβ
resilience.zne.extrapolated_noise_factorsβChoices: List of floats
Default: [0, *noise_factors]
resilience.zne.extrapolatorβ
resilience.zne.extrapolatorβChoices: One or more of: exponential, linear, double_exponential, polynomial_degree_(1 <= k <= 7), fallback
Default: (exponential, linear)
resilience.zne.noise_factorsβ
resilience.zne.noise_factorsβChoices: List of floats; each float >= 1
Default: (1, 1.5, 2) for PEA, and (1, 3, 5) otherwise
resilience_levelβ
resilience_levelβHow much resilience to build against errors. Higher levels generate more accurate results at the expense of longer processing times.
Choices: 0, 1, 2
Default: 1
seed_estimatorβ
seed_estimatorβsimulatorβ
simulatorβOptions to pass when simulating a backend
simulator.basis_gatesβ
simulator.basis_gatesβChoices: List of basis gate names to unroll to
Default: The set of all basis gates supported by Qiskit Aer simulator
simulator.coupling_mapβ
simulator.coupling_mapβChoices: List of directed two-qubit interactions
Default: None, which implies no connectivity constraints (full connectivity).
simulator.noise_modelβ
simulator.noise_modelβChoices: Qiskit Aer NoiseModel, or its representation
Default: None
simulator.seed_simulatorβ
simulator.seed_simulatorβChoices: Integer
Default: None
twirlingβ
twirlingβTwirling options
twirling.enable_gatesβ
twirling.enable_gatesβChoices: True, False
Default: False
twirling.enable_measureβ
twirling.enable_measureβChoices: True, False
Default: True
twirling.num_randomizationsβ
twirling.num_randomizationsβChoices: auto, Integer >= 1
Default: auto
twirling.shots_per_randomizationβ
twirling.shots_per_randomizationβChoices: auto, Integer >= 1
Default: auto
twirling.strategyβ
twirling.strategyβChoices: active, active-circuit, active-accum, all
Default: active-accum
experimentalβ
experimentalβExperimental options, when available.
default_shotsβ
default_shotsβThe total number of shots to use per circuit per configuration.
Choices: Integer >= 0
Default: None
dynamical_decouplingβ
dynamical_decouplingβControl dynamical decoupling error mitigation settings.
dynamical_decoupling API documentation
dynamical_decoupling.enableβ
dynamical_decoupling.enableβChoices: True, False
Default: False
dynamical_decoupling.extra_slack_distributionβ
dynamical_decoupling.extra_slack_distributionβChoices: middle, edges
Default: middle
dynamical_decoupling.scheduling_methodβ
dynamical_decoupling.scheduling_methodβChoices: asap, alap
Default: alap
dynamical_decoupling.sequence_typeβ
dynamical_decoupling.sequence_typeβChoices: XX, XpXm, XY4
Default: XX
dynamical_decoupling.skip_reset_qubitsβ
dynamical_decoupling.skip_reset_qubitsβChoices: True, False
Default: False
environmentβ
environmentβexecutionβ
executionβexecution.init_qubitsβ
execution.init_qubitsβWhether to reset the qubits to the ground state for each shot.
Choices: True, False
Default: True
execution.rep_delayβ
execution.rep_delayβThe delay between a measurement and the subsequent quantum circuit.
Choices: Value in the range supplied by backend.rep_delay_range
Default: Given by backend.default_rep_delay
execution.meas_typeβ
execution.meas_typeβChoices: classified, kerneled, avg_kerneled
Default: classified
max_execution_timeβ
max_execution_timeβChoices: Integer number of seconds in the range [1, 10800]
Default: 10800 (3 hours)
simulatorβ
simulatorβOptions to pass when simulating a backend
simulator.basis_gatesβ
simulator.basis_gatesβChoices: List of basis gate names to unroll to
Default: The set of all basis gates supported by Qiskit Aer simulator
simulator.coupling_mapβ
simulator.coupling_mapβChoices: List of directed two-qubit interactions
Default: None, which implies no connectivity constraints (full connectivity).
simulator.noise_modelβ
simulator.noise_modelβChoices: Qiskit Aer NoiseModel, or its representation
Default: None
simulator.seed_simulatorβ
simulator.seed_simulatorβChoices: Integer
Default: None
twirlingβ
twirlingβTwirling options
twirling.enable_gatesβ
twirling.enable_gatesβChoices: True, False
Default: False
twirling.enable_measureβ
twirling.enable_measureβChoices: True, False
Default: False
twirling.num_randomizationsβ
twirling.num_randomizationsβChoices: auto, Integer >= 1
Default: auto
twirling.shots_per_randomizationβ
twirling.shots_per_randomizationβChoices: auto, Integer >= 1
Default: auto
twirling.strategyβ
twirling.strategyβChoices: active, active-circuit, active-accum, all
Default: active-accum
experimentalβ
experimentalβExperimental options, when available.
Feature compatibilityβ
Due to differences in the device compilation process, certain runtime features cannot be used together in a single job. Click the appropriate tab for a list of features that are incompatible with the selected feature:
- Dynamic circuits
- Dynamical decoupling
- Fractional gates
- Gate-folding ZNE
- Gate twirling
- PEA
- PEC
Incompatible with:
- Gate-folding ZNE
- PEA
- PEC
- Dynamical decoupling
Other notes:
- Can be used with gate twirling for non-conditional gates.
- Compatible with fractional gates when using
qiskit-ibm-runtimev0.42.0 or later.
Incompatible with dynamic circuits.
Incompatible with:
- Gate twirling
- PEA
- PEC
Compatible with dynamic circuits when using qiskit-ibm-runtime v0.42.0 or later.
Incompatible with:
- Dynamic circuits
- PEA
- PEC
Might not work when using custom gates.
Incompatible with fractional gates or with stretches.
Other notes:
- Can be used with dynamic circuits with non-conditional gates.
- Does not work with non-Clifford entanglers.
Incompatible with:
- Dynamic circuits
- Fractional gates
- Gate-folding ZNE
- PEC
Incompatible with:
- Dynamic circuits
- Fractional gates
- Gate-folding ZNE
- PEA
Next stepsβ
- Find more details about the
EstimatorV2methods in the Estimator API reference. - Find more details about the
SamplerV2methods in the Sampler API reference. - Find details about how to configure error suppression and error mitigation.
- Learn how to specify options.