FiQCISampler#
FiQCISampler is a sampling interface that wraps an IQM backend and applies error mitigation to measurement results. It executes quantum circuits and returns mitigated counts.
Basic Configuration#
Initialize the sampler with an IQM backend, mitigation level, and optional parameters:
from fiqci.ems import FiQCISampler
# Initialize sampler with mitigation level 1
sampler = FiQCISampler(backend, mitigation_level=1, calibration_shots=2000, calibration_file="cals.json")
For more details see the API reference documentation for FiQCISampler.
Mitigation Levels#
Mitigation levels apply predefined sets of error mitigation techniques.
Level |
Mitigation Applied |
Technique |
|---|---|---|
0 |
None |
Raw results |
1 |
Readout Error Mitigation |
M3 (matrix-free measurement mitigation) |
2 |
Level 1 + Dynamical Decoupling |
Dynamical Decoupling standard sequence (see below) |
3 |
Level 2 + Pauli Twirling |
Pauli Twirling with 10 twirls on all two-qubit gates |
Mitigation Options#
Mitigators can also be configured manually using the provided methods.
REM (Readout Error Mitigation)#
Readout error mitigation uses M3 (matrix-free measurement mitigation) to correct measurement errors. It is enabled by default at mitigation level 1.
Configure REM using the rem() method:
sampler.rem(enabled=True, calibration_shots=2000, calibration_file="cals.json")
Parameter |
Default |
Description |
|---|---|---|
|
|
Enable or disable readout error mitigation |
|
|
Number of shots used for M3 calibration circuits |
|
|
Path to save/load calibration data (JSON). Reuses cached calibrations when available. |
Dynamical Decoupling (DD)#
Dynamical decoupling inserts sequences of gates to mitigate decoherence. It is enabled at mitigation level 2.
Configure DD using the dd() method:
sampler.dd(enabled=True, gate_sequences=None) # None uses a standard set of sequences
The standard sequence is:
[
(9, 'XYXYYXYX', 'asap'),
(5, 'YXYX', 'asap'),
(2, 'XX', 'center'),
]
Parameter |
Default |
Description |
|---|---|---|
|
|
Enable or disable DD |
|
|
|
Pauli Twirling#
Pauli twirling sandwiches two-qubit gates with random single-qubit Pauli gates to mitigate coherent errors. It is enabled at mitigation level 3.
Configure Pauli Twirling using the pauli_twirl() method:
sampler.pauli_twirl(enabled=True, num_twirls=10, gates_to_twirl=None) # None twirls all two-qubit gates
Inspecting Options#
Use the mitigator_options property to view currently applied mitigation settings:
sampler.mitigator_options