Skip to main contentIBM Quantum Documentation Preview
This is a preview build of IBM Quantumâ„¢ documentation. Refer to docs.quantum.ibm.com for the official documentation.

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 topic 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

  • 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.

Important

Scroll to see the full table.

OptionSub-optionSub-sub-optionChoicesDefaultOption
default_shotsInteger in the range[0, backend.max_shots]Nonedefault_shots
default_precisionfloat > 00.015625 (1 / sqrt(4096))default_precision
dynamical_decouplingdynamical_decoupling
enableTrue/FalseFalse
extra_slack_distributionmiddle/edgesmiddle
scheduling_methodasap/alapalap
sequence_typeXX/XpXm/XY4XX
skip_reset_qubitsTrue/FalseFalse
environmentenvironment
callbackCallable function that receives Job ID and Job result.None
job_tagsList of tagsNone
log_levelDEBUG/INFO/WARNING/ERROR/CRITICALWARNING
privateTrue/FalseFalse
executionexecution
init_qubitsTrue/FalseTrue
rep_delayValue in the range supplied by backend.rep_delay_range.Given by backend.default_rep_delay.
max_execution_timeInteger number of seconds in the range [1, 10800]10800 (3 hours)max_execution_time
resilienceresilience
layer_noise_learning
layer_pair_depthslist[int] of 2-10 values in the range [0, 200](0, 1, 2, 4, 16, 32)
max_layers_to_learnNone/ integer >= 14
num_randomizationsinteger >= 132
shots_per_randomizationinteger >= 1128
layer_noise_modelNoiseLearnerResult/Sequence[LayerError]None
measure_mitigationTrue/FalseTrue
measure_noise_learningnum_randomizationsinteger >= 132
shots_per_randomizationinteger'auto'
pec_mitigationTrue/FalseFalse
pecmax_overheadNone/ integer >1100
noise_gainauto/ float in the range [0, 1]auto
zne_mitigationTrue/FalseFalse
zneamplifiergate_folding, gate_folding_front, gate_folding_back, pea gate_folding
extrapolated_noise_factorslist of floats[0, *noise_factors]
extrapolatorone or more of exponential
linear
double_exponential
polynomial_degree_(1 <= k <= 7)
fallback
(exponential, linear)
noise_factorslist of floats; each float >= 1(1, 1.5, 2) for PEA, and (1, 3, 5) otherwise.
resilience_level0/1/21resilience_level
seed_estimatorintegerNoneseed_estimator
simulatorsimulator
basis_gatesList of basis gate names to unroll toThe set of all basis gates supported by Qiskit Aer simulator
coupling_mapList of directed two-qubit interactionsfull connectivity
noise_modelQiskit Aer NoiseModel, or its representationNone
seed_simulatorintegerNone
twirlingtwirling
enable_gatesTrue/FalseFalse
enable_measureTrue/FalseTrue
num_randomizationsauto/ integer >= 1auto
shots_per_randomizationauto/ Integer no larger than backend.max_shots.auto
strategyactive
active-circuit
active-accum
all
active-accum
experimental
execution_pathgen3-turbo (see note)None
Note

Setting gen3-turbo enables the next-generation execution path, which provides a great improvement in performance. This option is experimental (subject to change without notice, and stability is not guaranteed) and is only available on ibm_brisbane, ibm_brussels, ibm_fez, ibm_marrakesh, ibm_strasbourg, and ibm_torino.

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:

Incompatible with:

  • Gate-folding ZNE
  • gen3-turbo
  • PEA
  • PEC
  • Dynamical decoupling
  • Fractional gates
  • Pulse gates

Can be used with gate twirling for non-conditional gates.


Next steps

Recommendations