Korean
언어
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.circuit.Gate.control

Gate.control(num_ctrl_qubits=1, label=None, ctrl_state=None)[소스]

Return controlled version of gate. See ControlledGate for usage.

매개변수
  • num_ctrl_qubits (int) – number of controls to add to gate (default=1)

  • label (str | None) – optional gate label

  • ctrl_state (int | str | None) – The control state in decimal or as a bitstring (e.g. 〈111〉). If None, use 2**num_ctrl_qubits-1.

반환

Controlled version of gate. This default algorithm uses num_ctrl_qubits-1 ancillae qubits so returns a gate of size num_qubits + 2*num_ctrl_qubits - 1.

반환 형식

qiskit.circuit.ControlledGate

예외 발생

QiskitError – unrecognized mode or invalid ctrl_state