Skip to main content
IBM Quantum Platform

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)

GitHub

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_idxsIterator over tuples of physical indices that specify where constituent gates act.
gate_idxsThe physical indices where this gate undergoes unitary action.
idling_idxsThe physical qubit indices that this gate is idling on.
labelA string label for use in plotter legends.
latex_strA LaTeX string for this gate.
math_labelA string label for use within latex math mode.
meas_idxsThe physical qubit indices that this gate measures.
model_gateReturn a ModelGate representing this gate.
nameThe gate name.
num_qubitsThe number of qubits this gate acts on.
prep_idxsThe physical qubit indices that this gate prepares (or resets).
qubit_idxsThe physical qubit indices this gate acts on.
sorted_meas_idxsThe indices of the measured qubits in increasing order.
sorted_prep_idxsThe indices of the reset qubits in increasing order.

model_gate

abstract property

Type: ModelGate

Return a ModelGate representing this 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

Type: tuple[int, ...]

The physical qubit indices this gate acts on.

meas_idxs

Type: frozenset[int]

The physical qubit indices that this gate measures.

sorted_meas_idxs

Type: list[int]

The indices of the measured qubits in increasing order.

prep_idxs

Type: frozenset[int]

The physical qubit indices that this gate prepares (or resets).

sorted_prep_idxs

Type: list[int]

The indices of the reset qubits in increasing order.

idling_idxs

Type: set[int]

The physical qubit indices that this gate is idling on.

gate_idxs

Type: frozenset[int]

The physical indices where this gate undergoes unitary action.

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.

Was this page helpful?
Report a bug, typo, or request content on GitHub.