quantum_circuit::cx()← Back to Class quantum_circuit
Apply \(CX\) (\(CNOT\)) gate to the circuit
quantum_circuit::cx(qubit_control, qubit_target)
qubit_control (number) — The qubit control 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(2)
qc.h(0)
qc.cx(0, 1)