mindquantum.core.gates.CNOTGate#
- class mindquantum.core.gates.CNOTGate#
Control-X gate.
More usage, please see
XGate.- get_cpp_obj()#
Construct cpp obj.
- on(obj_qubits, ctrl_qubits=None)#
Define which qubit the gate act on and the control qubit.
Note
In this framework, the qubit that the gate act on is specified first, even for control gate, e.g. CNOT, the second arg is control qubits.
- Parameters:
obj_qubits (int, list[int]) – Specific which qubits the gate act on.
ctrl_qubits (int, list[int]) – Specific the control qubits. Default:
None.
- Returns:
Gate, Return a new gate.