qml.ftqc.pauli_tracker.pauli_to_xz

pauli_to_xz(op)[source]

Convert a Pauli operator to its xz representation up to a global phase, i.e., \(encode_{xz}(Pauli)=(x,z)=X^xZ^z\), where \(x\) is the exponent of the X and \(z\) is the exponent of the Z, meaning \(encode_{xz}(I) = (0, 0)\), \(encode_{xz}(X) = (1, 0)\), \(encode_{xz}(Y) = (1, 1)\) and \(encode_{xz}(Z) = (0, 1)\).

Parameters:

op (qml.operation.Operator) – A Pauli operator.

Returns:

A tuple of xz encoding data, \(x\) is the exponent of the X, \(z\) is the exponent of the Z.

Example:

The following example shows how the Pauli to XZ works.

from pennylane.ftqc.pauli_tracker import pauli_to_xz
from pennylane import I
>>> pauli_to_xz(I(0))
(0, 0)

A xz tuple representation is returned for a given Pauli operator.