qiskit_noise_learning.sequences.FidelityIndex
class qiskit_noise_learning.sequences.FidelityIndex(gate_name: str, pauli: QubitSparsePauli, in_z_idxs: frozenset[int], out_z_idxs: frozenset[int], input_pauli: QubitSparsePauli, output_pauli: QubitSparsePauli, sign_flip: bool, meas_idxs: frozenset[int])
Bases: object
Index data for a fidelity in a Pauli-MCM-reset gate set.
Let be the number of qubits, , denote the measured qubits, and the reset qubits for the gate. For a given gate, each fidelity is specified by:
- A Pauli on the unmeasured and unreset qubits ,
- A -type operator on the measured qubits, , and
- A -type operator on the measured and reset qubits, .
This list constitutes the “index data” for a generalized fidelity for a given gate, in the sense that there is a bijection between all generalized fidelities and the above set of all objects satisfying the above description. See Equation (3) of the mathematical formalism for the decomposition in which these appear.
The exponents and are stored as the sets of qubit indices on which they are non-zero, namely in_z_idxs and out_z_idxs – equivalently, the qubits on which and act non-trivially.
The constructor FidelityIndex.from_gate() builds a FidelityIndex from a ModelGate and the above unique index data. Alternatively, FidelityIndex.from_transition() can be used to build an instance from the Pauli transition implied by the index data. The FidelityIndex.__init__() is viewed as a “low-level” constructor which takes all stored properties without validation.
Parameters
- gate_name – The name of the gate.
- pauli – A Pauli operator with support on unmeasured and unreset qubits. Note that
pauli.num_qubitscontrols the size of the operators returned byself.transition. - in_z_idxs – The qubit indices on which is non-zero.
- out_z_idxs – The qubit indices on which is non-zero.
- input_pauli – The input Pauli of the transition.
- output_pauli – The output Pauli of the transition.
- sign_flip – Whether the transition involves a sign flip.
- meas_idxs – The measurement qubit indices for the gate.
__init__
__init__(gate_name: str, pauli: QubitSparsePauli, in_z_idxs: frozenset[int], out_z_idxs: frozenset[int], input_pauli: QubitSparsePauli, output_pauli: QubitSparsePauli, sign_flip: bool, meas_idxs: frozenset[int])
Methods
Column 1 | Column 2 |
|---|---|
__init__(gate_name, pauli, in_z_idxs, ...) | |
from_gate(gate, pauli[, in_z_idxs, out_z_idxs]) | Construct a fidelity index from a gate and unique index data. |
from_transition(gate, in_pauli, out_pauli) | Construct a fidelity index from a Pauli transition on the quantum registers. |
is_valid_for_gate(gate, pauli[, in_z_idxs, ...]) | Whether the given index data forms a valid fidelity index for the gate. |
Attributes
Column 1 | Column 2 |
|---|---|
gate_name | The name of the gate. |
in_z_idxs | The measured qubits carrying a on the instrument input. |
mask | The mask for marginalizing measurement outcomes. |
observable_idxs | Qubit indices of the associated observable in ascending order. |
out_z_idxs | The measured and reset qubits carrying a on the instrument output. |
pauli | The Pauli operator on the Clifford portion of the model gate. |
sign_flip | Whether the transition associated with this fidelity involves a sign flip. |
transition | The phaseless Pauli operator transition associated with this fidelity index. |
from_gate
classmethod from_gate(gate: ModelGate, pauli: QubitSparsePauli, in_z_idxs: frozenset[int] = frozenset({}), out_z_idxs: frozenset[int] = frozenset({})) → Self
Construct a fidelity index from a gate and unique index data.
Parameters
- gate – The model gate.
- pauli – A Pauli operator with support on unmeasured and unreset qubits.
- in_z_idxs – The subset of measurement qubit indices carrying a on the instrument input.
- out_z_idxs – The subset of the union of measurement and reset qubit indices carrying a on the instrument output.
Raises
ValueError – If the provided data is inconsistent with the gate.
is_valid_for_gate
classmethod is_valid_for_gate(gate: ModelGate, pauli: QubitSparsePauli, in_z_idxs: frozenset[int] = frozenset({}), out_z_idxs: frozenset[int] = frozenset({})) → bool
Whether the given index data forms a valid fidelity index for the gate.
This performs the same (side-effect-free) consistency checks as from_gate(), without constructing the index or computing its transition.
Parameters
- gate – The model gate.
- pauli – A Pauli operator with support on unmeasured and unreset qubits.
- in_z_idxs – The subset of measurement qubit indices carrying a on the instrument input.
- out_z_idxs – The subset of the union of measurement and reset qubit indices carrying a on the instrument output.
from_transition
classmethod from_transition(gate: ModelGate, in_pauli: QubitSparsePauli, out_pauli: QubitSparsePauli) → Self
Construct a fidelity index from a Pauli transition on the quantum registers.
This constructor deduces the Pauli and index sets of a FidelityIndex from the given Pauli transition.
Parameters
- gate – The model gate.
- in_pauli – The input Pauli on the quantum register.
- out_pauli – The output Pauli on the quantum register.
Raises
ValueError – If the pair of Pauli operators do not imply a valid FidelityIndex.
gate_name
Type: str
The name of the gate.
pauli
Type: QubitSparsePauli
The Pauli operator on the Clifford portion of the model gate.
in_z_idxs
out_z_idxs
sign_flip
Type: bool
Whether the transition associated with this fidelity involves a sign flip.
transition
Type: tuple[QubitSparsePauli, QubitSparsePauli]
The phaseless Pauli operator transition associated with this fidelity index.