quantum_circuit::cp()← Back to Class quantum_circuit
Apply \(CP\) gate to the circuit
quantum_circuit::cp(theta, qubit_control, qubit_target)
theta (number) — The rotation angle \(theta\)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.cp(pi / 2, 0, 1)