Set the control and target indexes when this operation is applied.
The parameters must be (0, 1) or (1, 0).
| C# | Visual Basic | Visual C++ |
IOperationCNot SetIndexes( int ControlIndex, int TargetIndex )
Function SetIndexes ( _ ControlIndex As Integer, _ TargetIndex As Integer _ ) As IOperationCNot
IOperationCNot^ SetIndexes( int ControlIndex, int TargetIndex )
- ControlIndex (Int32)
- Index of the control qubit: 0 or 1.
- TargetIndex (Int32)
- Index of the target qubit: 0 or 1.
A reference to this operation after this method has been performed.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown if either
of the parameters is not 0 or 1. |
| DuplicateIndexesException | Thrown if the same index is specified
for both parameters. |