Module: cirq.ops.swap_gates

SWAP and ISWAP gates.

This module creates Gate instances for the following gates: SWAP: the swap gate. ISWAP: a swap gate with a phase on the swapped subspace. SQRT_ISWAP: square root of the ISWAP gate. SQRT_ISWAP_INV: inverse square root of the ISWAP gate.

Each of these are implemented as EigenGates, which means that they can be raised to a power (i.e. SQRT_ISWAP_INV=cirq.ISWAP**-0.5). See the definition in EigenGate.

Classes

class ISwapPowGate: Rotates the |01⟩ vs |10⟩ subspace of two qubits around its Bloch X-axis.

class SwapPowGate: The SWAP gate, possibly raised to a power. Exchanges qubits.

Functions

ISWAP(...): The iswap gate.

SQRT_ISWAP(...): The square root of iswap gate.

SQRT_ISWAP_INV(...): The inverse square root of iswap gate.

SWAP(...): The swap gate.

riswap(...): Returns gate with matrix exp(+i angle_rads (X⊗X + Y⊗Y) / 2).

TYPE_CHECKING False