SWAP

pyquil.gates.SWAP(q1, q2)[source]

Produces a SWAP gate which swaps the state of two qubits:

SWAP = [[1, 0, 0, 0],
        [0, 0, 1, 0],
        [0, 1, 0, 0],
        [0, 0, 0, 1]]
Parameters:
  • q1 – Qubit 1.
  • q2 – Qubit 2.
Returns:

A Gate object.