quantum_circuit::ccx()← Back to Class quantum_circuit
Apply \(CCX\) (also known as Toffoli) gate to the circuit
quantum_circuit::ccx(qubit_control_1, qubit_control_2, qubit_target)
qubit_control_1 (number) — The qubit control 1 to apply the gate toqubit_control_2 (number) — The qubit control 2 to apply the gate toqubit_target (number) — The qubit target to apply the gate to
quantum_circuit — Returns the instance of class quantum_circuit
import quantum
qc = quantum_circuit(3)
qc.h(0)
qc.h(1)
qc.ccx(0, 1, 2)