qiskit_noise_learning.gate_sets.ModelGate
class qiskit_noise_learning.gate_sets.ModelGate(name: str, cliffords: Iterable[tuple[tuple[int, ...], Clifford]] | None = None, qubit_idxs: Iterable[int] | None = None, meas_idxs: Iterable[int] = (), prep_idxs: Iterable[int] = (), latex_str: str | None = None)
Bases: Gate
A model for a gate of the form Clifford - MCM - reset.
Parameters
- cliffords – An iterable of tuples of physical qubit indices and
Cliffords corresponding to the ideal Clifford layer. The order of the iterable should start with the first applied Clifford and proceed temporally, andNoneis interpreted as the identity. - qubit_idxs – The physical qubit indices.
- meas_idxs – The physical qubit indices that this gate measures.
- prep_idxs – The physical qubit indices that this gate prepares, or resets.
- latex_str – An optional LaTeX string for rendering this gate.
Raises
- ValueError – If both
cliffordsandqubit_idxsare not specified. - ValueError – If any of the elements of
cliffordshave mismatched length of qubit indices and number of qubits of the Clifford.
__init__
__init__(name: str, cliffords: Iterable[tuple[tuple[int, ...], Clifford]] | None = None, qubit_idxs: Iterable[int] | None = None, meas_idxs: Iterable[int] = (), prep_idxs: Iterable[int] = (), latex_str: str | None = None)
Methods
Column 1 | Column 2 |
|---|---|
__init__(name[, cliffords, qubit_idxs, ...]) | |
clifford_propagate(...) | Given a Pauli, propagate it through the ideal Clifford operation. |
Attributes
Column 1 | Column 2 |
|---|---|
clifford | The overall Clifford operation for this gate. |
cliffords | A list of tuples of qubit indices and a Clifford that acts on them. |
constituent_gate_idxs | Iterator over tuples of physical indices that specify where constituent gates act. |
gate_idxs | The physical indices where this gate undergoes unitary action. |
idling_idxs | The physical qubit indices that this gate is idling on. |
label | A string label for use in plotter legends. |
latex_str | A LaTeX string for this gate. |
math_label | A string label for use within latex math mode. |
meas_idxs | The physical qubit indices that this gate measures. |
model_gate | Return a ModelGate representing this gate. |
name | The gate name. |
num_qubits | The number of qubits this gate acts on. |
prep_idxs | The physical qubit indices that this gate prepares (or resets). |
qubit_idxs | The physical qubit indices this gate acts on. |
sorted_meas_idxs | The indices of the measured qubits in increasing order. |
sorted_prep_idxs | The indices of the reset qubits in increasing order. |
clifford
Type: Clifford
The overall Clifford operation for this gate.
cliffords
Type: list[tuple[tuple[int, ...], Clifford]]
A list of tuples of qubit indices and a Clifford that acts on them.
The list is in temporal order. Each element contains the qubit indices that the corresponding Clifford acts on.
model_gate
constituent_gate_idxs
Type: Iterator[tuple[int, ...]]
Iterator over tuples of physical indices that specify where constituent gates act.
Some subclasses may not have a meaningful notion of what a “constituent gate” is, because they don’t choose to represent unitary action by some seperable representation. The only contract they need to obey is that the union of all yielded integers is equal to gate_idxs.
clifford_propagate
clifford_propagate(pauli: QubitSparsePauli, inverse: bool = False) → QubitSparsePauli
clifford_propagate(pauli: PhasedQubitSparsePauli, inverse: bool = False) → PhasedQubitSparsePauli
Given a Pauli, propagate it through the ideal Clifford operation.
If inverse == False (the default), then this method returns , and otherwise returns .
If the input is a phaseless Pauli type, the propagation will be phaseless.
Note that the Clifford will be applied to on self.qubit_idxs.
Parameters
- pauli – The Pauli to propagate.
- inverse – Whether to apply the gate or its inverse.
Returns
The propagated result, which has the same type as the input.
Raises
TypeError – If invalid type supplied.