iqm.error_reduction_tools.twirling.twirling_api.TwirlingConfiguration#
- class iqm.error_reduction_tools.twirling.twirling_api.TwirlingConfiguration(readout_twirl_strategy='LOCAL', seed=None, circuit_twirling=True, num_twirling_instances=20)#
Bases:
objectConfiguration for circuit twirling.
Attributes
Whether to apply Pauli twirling to two-qubit gates ("Poor Man's Pauli Twirling").
Total number of randomized variants per input circuit when
circuit_twirling=True.Readout-twirling strategy.
RNG seed for reproducibility.
Methods
__eq__(other)Return self==value.
__repr__()Return repr(self).
- Parameters:
- readout_twirl_strategy: Literal['LOCAL', 'MINIMAL', 'HADAMARD', 'NONE'] = 'LOCAL'#
Readout-twirling strategy.
Supported values are
"LOCAL"(4 strings, requires topology),"MINIMAL"(2 strings),"HADAMARD"(up to $2^n$ strings), and"NONE"to disable readout twirling entirely. When"NONE"is combined withcircuit_twirling=True,num_twirling_instancesrandom circuit-twirled variants are generated instead.
- circuit_twirling: bool = True#
Whether to apply Pauli twirling to two-qubit gates (“Poor Man’s Pauli Twirling”).
When
False, the inserted Pauli rotations on single-qubit gates are suppressed; readout twirling (if any) still works.
- num_twirling_instances: int = 20#
Total number of randomized variants per input circuit when
circuit_twirling=True.This budget is split evenly across the readout-twirling rot-strings (whose count is fixed by
readout_twirl_strategy) so that every rot-string receives the same number of independent Pauli randomizations.Reconciliation rules (a warning is emitted whenever the effective count differs from the requested one):
If
num_twirling_instancesis a multiple of the number of rot-strings, it is used as-is.If it is not a multiple, it is rounded up to the next multiple.
If it is smaller than the number of rot-strings, the number of rot-strings is used (one Pauli randomization per rot-string).
When
circuit_twirling=Falsethis field is ignored: each rot-string is emitted exactly once. Default of 20 follows common Pauli-twirling practice (10–50 instances).