cirq.SWAP

cirq.SWAP = cirq.SWAP

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

SwapPowGate()**t = SwapPowGate(exponent=t) and acts on two qubits in the
computational basis as the matrix:
[[1, 0, 0, 0],
 [0, g·c, -i·g·s, 0],
 [0, -i·g·s, g·c, 0],
 [0, 0, 0, 1]]

where:

c = cos(π·t/2)
s = sin(π·t/2)
g = exp(i·π·t/2).

cirq.SWAP, the swap gate, is an instance of this gate at exponent=1.