mindquantum.core.gates.BarrierGate

View Source On Gitee
class mindquantum.core.gates.BarrierGate(show=True)[source]

Barrier gate will separate two gate in two different layer.

Parameters

show (bool) – whether show the barrier gate. Default: True.

get_cpp_obj()[source]

Get cpp obj.

on(obj_qubits, ctrl_qubits=None)[source]

Define which qubits the gate act on.

The control qubits should always be none, since this gate can never be controlled by other qubits.

Parameters
  • obj_qubits (int, list[int]) – Specific which qubits the gate act on, can be a single qubit or a set of consecutive qubits.

  • ctrl_qubits (int, list[int]) – Specific the control qubits. Default, None.

Returns

Gate, Return a new gate.