qiskit_ibm_runtime.options_models.TwirlingOptions
pydantic model TwirlingOptions
Bases: BaseOptionsModel
Twirling options.
Config
- validate_assignment: bool = True
- extra: str = forbid
enable_gates
field
Type: bool | None
Default value: None
Whether to apply 2-qubit Clifford gate twirling.
If None:
- For the Sampler, it defaults to
False. - For the Estimator, it is determined by the server according to the resilience level: it is
Falsefor resilience levels0and1, andTruefor resilience level2.
enable_measure
field
Type: bool | None
Default value: None
Whether to enable twirling of measurement instructions.
Twirling is only applied to measurements that are not involved in a conditional block.
If None:
- For the Sampler, it defaults to
False. - For the Estimator, it is determined by the server according to the resilience level: it is
Falsefor resilience level0, andTruefor resilience levels1and2.
group
field
Type: Literal['pauli', 'balanced_pauli', 'local_c1', 'local_pauli']
Default value: 'pauli'
The group used to twirl the content of the identified layers.
'pauli'uses the Pauli group.'balanced_pauli'uses the Pauli group with a balanced distribution.'local_c1'uses the subgroup of single-qubit Cliffords that are conjugated to single-qubit Cliffords on any entangling gates in the box, and the Pauli group everywhere else.'local_pauli'uses the Pauli subgroup that commutes with an entangler for non-Clifford gates, and the Pauli group everywhere else.
num_randomizations
field
Type: Annotated[int, Field(ge``=``1)] | Literal['auto']
Default value: 'auto'
The number of random samples to use when twirling or performing sampled mitigation.
If "auto", the value is determined automatically based on the input PUB and other options.
shots_per_randomization
field
Type: Annotated[int, Field(ge``=``1)] | Literal['auto']
Default value: 'auto'
The number of shots to run for each random sample.
If "auto", the value is determined automatically based on the input PUB and other options.
strategy
field
Type: Literal['active', 'active-accum', 'active-circuit', 'all']
Default value: 'active-accum'
Specify the strategy of twirling qubits in identified layers of 2-qubit twirled gates.
"active": Only the instruction qubits in each individual twirled layer will be twirled."active-circuit": The union of all instruction qubits in the circuit will be twirled in each twirled layer."active-accum": The union of instructions qubits in the circuit up to the current twirled layer will be twirled in each individual twirled layer."all": All qubits in the input circuit will be twirled in each twirled layer.