openfermion.circuits.FSWAP

The FSWAP gate, possibly raised to a power.

FSwapPowGate()**t = FSwapPowGate(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, p]]

where:

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

openfermion.FSWAP is an instance of this gate at exponent=1. It swaps adjacent fermionic modes under the Jordan-Wigner Transform.