Perform the TargetOperation on all qubits except the qubit at ControlIndex
if the qubit at ControlIndex is |1>. Else there is no change in the register.
This arbitrary application of a single qubit operator to n qubits in a register
based on a control qubit is called ControlU.
Declaration Syntax
C# | Visual Basic | Visual C++ |
IQuantumRegister OperationControlledU( IQubitOperation TargetOperation, int ControlIndex )
Function OperationControlledU ( _ TargetOperation As IQubitOperation, _ ControlIndex As Integer _ ) As IQuantumRegister
IQuantumRegister^ OperationControlledU( IQubitOperation^ TargetOperation, int ControlIndex )
Parameters
- TargetOperation (IQubitOperation)
- The operation to apply to all qubits except the qubit at ControlIndex.
- ControlIndex (Int32)
- The index of the qubit that will serve as the control. If this is |1> then the TargetOperation is applied to all other qubits.
Return Value
A reference to this register after the operation has been applied.
Exceptions
Exception | Condition |
---|---|
IndexOutOfRangeException | Thrown if ControlIndex is out
of range. |