Swap the first indexes and the second indexes. Each qubit in element x of
FirstSwapIndexes will be swapped with element x of SecondSwapIndexes. Example:
A register is ordered 0, 1, 2, 3. If FirstIndexes = 0, 2 and SecondIndexes = 3, 1
then the resulting order will be 3, 1, 2, 0.
Declaration Syntax
C# | Visual Basic | Visual C++ |
List<IQuantumOperation> SwapIndexes( int[] FirstSwapIndexes, int[] SecondSwapIndexes )
Function SwapIndexes ( _ FirstSwapIndexes As Integer(), _ SecondSwapIndexes As Integer() _ ) As List(Of IQuantumOperation)
List<IQuantumOperation^>^ SwapIndexes( array<int>^ FirstSwapIndexes, array<int>^ SecondSwapIndexes )
Parameters
- FirstSwapIndexes (array< Int32 >[]()[])
- First set of indexes to swap.
- SecondSwapIndexes (array< Int32 >[]()[])
- Second set of indexes to swap.
Return Value
The operations that perform this swap.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown if the arrays passed in are null. |
ArgumentException | Thrown if the indexes passed in are not
of equal length. |
DuplicateIndexesException | Thrown if any of the indexes
are duplicated. All indexes in and between the two parameters must be unique. |