French
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.circuit.Gate.control

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

Return controlled version of gate. See ControlledGate for usage.

Paramètres
  • num_ctrl_qubits (int) – number of controls to add to gate (default=1)

  • label (Optional[str]) – optional gate label

  • ctrl_state (Union[int, str, None]) – The control state in decimal or as a bitstring (e.g. “111”). If None, use 2**num_ctrl_qubits-1.

Renvoie

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.

Type renvoyé

qiskit.circuit.ControlledGate

Lève

QiskitError – unrecognized mode or invalid ctrl_state