View on GitHub
Open this notebook in GitHub to run it yourself
control
Arguments:
ctrl: Union[QBit, QArray[QBit]]stmt_block: QCallable
control takes a qubit array of length one or more as ctrl, and applies the stmt_block operand if all qubits are in the 1 state
Example
The following example shows how to use thecontrol operator to implement a Multi-Control-X where a 7-qubit quantum variable serves as the control