mindquantum.core.gates.CNOTGate

View Source On Gitee
class mindquantum.core.gates.CNOTGate[source]

Control-X gate.

More usage, please see XGate.

get_cpp_obj()[source]

Construct cpp obj.

on(obj_qubits, ctrl_qubits=None)[source]

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.