Skip to main content
IBM Quantum Platform

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)

GitHub

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, and None is 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 cliffords and qubit_idxs are not specified.
  • ValueError – If any of the elements of cliffords have 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
cliffordThe overall Clifford operation for this gate.
cliffordsA list of tuples of qubit indices and a Clifford that acts on them.
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.

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

Type: Self

Return a ModelGate representing this 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 CPC†C P C^\dagger, and otherwise returns C†PCC^\dagger P C.

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.

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