deltakit.circuit.gates.MPP#

class deltakit.circuit.gates.MPP(pauli_product: PauliX[T] | PauliY[T] | PauliZ[T] | InvertiblePauliX[T] | InvertiblePauliY[T] | InvertiblePauliZ[T] | Iterable[PauliX[T] | PauliY[T] | PauliZ[T] | InvertiblePauliX[T] | InvertiblePauliY[T] | InvertiblePauliZ[T]] | MeasurementPauliProduct[T], probability: float = 0.0, *, tag: str | None = None)#

Bases: Gate[T]

Measure Pauli products.

Parameters:
  • pauli_product (Union[PauliGateT, InvertiblePauliGateT, Iterable[PauliGateT | InvertiblePauliGateT], MeasurementPauliProduct[T]]) – The product of pauli gates to measure. All options will internally be converted to a MeasurementPauliProduct instance.

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

Examples

>>> import deltakit_circuit as sp
>>> sp.gates.MPP([sp.PauliX(1), sp.PauliY(2)])
MPP([PauliX(Qubit(1)), PauliY(Qubit(2))], probability=0.0)
>>> sp.gates.MPP(~sp.InvertiblePauliZ(5))
MPP([!PauliZ(Qubit(5))], probability=0.0)
>>> sp.gates.MPP([sp.PauliX(1), sp.PauliX(2)], 0.01)
MPP([PauliX(Qubit(1)), PauliX(Qubit(2))], probability=0.01)

Notes

If this gate is parameterized by a probability argument, the recorded result will be flipped with that probability. If not, the recorded result is noiseless. Note that the noise only affects the recorded result, not the target qubit’s state.

Stabilizer Generators:
P -> m xor chance(p)
P -> P

Methods#

MPP.approx_equals

Determines whether two MPP gates are approximately equal within a tolerance.

MPP.stim_targets

Get all qubits for this gate in a tuple.

MPP.transform_qubits

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