About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
TwirlingOptions
class TwirlingOptions(*args, **kwargs)
Twirling options. This is only used by V2 primitives.
Parameters
-
enable_gates – Whether to apply 2-qubit Clifford gate twirling. Default: False.
-
enable_measure – Whether to enable twirling of measurements. Twirling will only be applied to those measurement registers not involved within a conditional logic. Default: True for Estimator, false for Sampler.
-
num_randomizations –
The number of random samples to use when twirling or peforming sampled mitigation. If
num_randomizations
is “auto”, for every pub executedshots
times:- If
shots_per_randomization
is also “auto”,shots_per_randomization
is set first as described below, thennum_randomizations
is set asceil(shots/shots_per_randomization)
, whereceil
is the ceiling function. - Otherwise, the value is set to
ceil(shots/shots_per_randomization)
.
Default: “auto”.
- If
-
shots_per_randomization –
The number of shots to run for each random sample. If “auto”, for every pub executed
shots
times:- If
num_randomizations
is also “auto”, the value is set to64
for PEC mitigation or tomax(64, ceil(shots / 32))
in all other cases, whereceil
is the ceiling function. - Otherwise, the value is set to
ceil(shots/num_randomizations)
.
Default: “auto”.
- If
-
strategy –
Specify the strategy of twirling qubits in identified layers of 2-qubit twirled gates. Allowed values are
- If
"active"
only the instruction qubits in each individual twirled layer will be twirled. - If
"active-circuit"
the union of all instruction qubits in the circuit will be twirled in each twirled layer. - If
"active-accum"
the union of instructions qubits in the circuit up to the current twirled layer will be twirled in each individual twirled layer. - If
"all"
all qubits in the input circuit will be twirled in each twirled layer.
Default: “active-accum”.
- If
Attributes
enable_gates
Type: UnsetType | bool
Default value: Unset
enable_measure
Type: UnsetType | bool
Default value: Unset
num_randomizations
Type: UnsetType | int | Literal['auto']
Default value: Unset
shots_per_randomization
Type: UnsetType | int | Literal['auto']
Default value: Unset
strategy
Type: UnsetType | Literal['active', 'active-accum', 'active-circuit', 'all']
Default value: Unset
Methods
Was this page helpful?
Report a bug or request content on GitHub.