quantum_circuit::cswap()← Back to Class quantum_circuit
Apply \(CSWAP\) (also known as Fredkin) gate to the circuit
quantum_circuit::cswap(qubit_control, qubit_target_1, qubit_target_2)
qubit_control (number) — The qubit control to apply the gate toqubit_target_1 (number) — The qubit target 1 to apply the gate toqubit_target_2 (number) — The qubit target 2 to apply the gate to
quantum_circuit — Returns the instance of class quantum_circuit
import quantum
qc = quantum_circuit(3)
qc.x(0)
qc.x(2)
qc.cswap(0, 1, 2)