deltakit.circuit.gates.SWAP#

class deltakit.circuit.gates.SWAP(operand1: UT | T, operand2: VT | T, *, tag: str | None = None)#

Bases: SymmetricTwoQubitGate[T]

Swaps two qubits.

Notes

Stabilizer Generators:
X_ -> +_X
Z_ -> +_Z
_X -> +X_
_Z -> +Z_
Unitary Matrix:
\[\begin{split}\begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}\end{split}\]

Methods#

SWAP.from_consecutive

Yield an class instance for each pair in a flattened sequence of data.

SWAP.stim_targets

Get the stim gate targets which define this operation.

SWAP.transform_qubits

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