qiskit_noise_learning.gate_sets.Gate
class qiskit_noise_learning.gate_sets.Gate(name: str, qubit_idxs: Iterable[int], prep_idxs: Iterable[int] = (), meas_idxs: Iterable[int] = (), latex_str: str | None = None)
Bases: ABC
Represents qubit metadata for a single gate in a gate set.
Typically serves as a base class for types that implement non-trivial gates.
Parameters
- name – The gate name.
- qubit_idxs – The physical qubit indices that the gate acts on.
- prep_idxs – The physical qubit indices that this gate prepares, or resets to the 0 state.
- meas_idxs – The physical qubit indices that this gate measures.
- latex_str – An optional LaTeX string for rendering this gate.
__init__
__init__(name: str, qubit_idxs: Iterable[int], prep_idxs: Iterable[int] = (), meas_idxs: Iterable[int] = (), latex_str: str | None = None)
Methods
Column 1 | Column 2 |
|---|---|
__init__(name, qubit_idxs[, prep_idxs, ...]) |
Attributes
Column 1 | Column 2 |
|---|---|
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. |
model_gate
name
Type: str
The gate name.
latex_str
Type: str
A LaTeX string for this gate.
label
Type: str
A string label for use in plotter legends.
math_label
Type: str
A string label for use within latex math mode.
num_qubits
Type: int
The number of qubits this gate acts on.
qubit_idxs
meas_idxs
sorted_meas_idxs
prep_idxs
sorted_prep_idxs
idling_idxs
gate_idxs
constituent_gate_idxs
abstract property
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.