quantum_circuit::swap()← Back to Class quantum_circuit
Apply \(SWAP\) gate to the circuit
quantum_circuit::swap(a, b)
a (number) — The qubit 1 to apply the gate tob (number) — The qubit 2 to apply the gate to
quantum_circuit — Returns the instance of class quantum_circuit
import quantum
qc = quantum_circuit(2)
qc.swap(0, 1)