deltakit.circuit.gates.HERALD_LEAKAGE_EVENT#

class deltakit.circuit.gates.HERALD_LEAKAGE_EVENT(qubit: Qubit[T] | T, probability: float = 0.0, invert: bool = False, *, tag: str | None = None)#

Bases: OneQubitMeasurementGate[T]

The single qubit leakage heralding gate (optionally noisy).

Determines whether or not a qubit is leaked and populates the measurement record with this data.

Parameters:
  • qubit (Qubit[T] | T) – The qubit that this gate acts on.

  • probability (float, optional) – A single float specifying the probability of flipping each reported leaked measurement result, by default 0.0.

  • invert (bool, optional) – Whether to invert the result of this measurement.

  • Targets

  • -------- – Qubits to herald leakage for.

  • Examples

  • ---------

    # Herald leakage on qubit 0. If 0 is leaked put a 1 in the measurement # record, otherwise a 0 HERALD_LEAKAGE_EVENT 0

    # Same as above but heralds leakage on both qubit 0 and 1 HERALD_LEAKAGE_EVENT 0 1

    # To populate a syndrome with the heralding bit during detector sampling # use a DETECTOR # annotation that refers back to this channel HERALD_LEAKAGE_EVENT 0 DETECTOR rec[-1]

Methods#

HERALD_LEAKAGE_EVENT.approx_equals

Determine whether two measurement gates are approximately equal within a tolerance.

HERALD_LEAKAGE_EVENT.stim_targets

Convert the qubits this gate acts on to equivalent stim targets.

HERALD_LEAKAGE_EVENT.transform_qubits

Transform this gates's qubits according to the id mapping.