Get the operation to perform add n over the specified indexes. After this is applied
the result will be in all indexes of YIndexes and also the last ScratchIndexes qubit.
| C# | Visual Basic | Visual C++ |
public static GeneralSimulatedOperation[] GetAddN( int[] XIndexes, int[] YIndexes, int[] ScratchIndexes, ref int[] ResultIndexes )
Public Shared Function GetAddN ( _ XIndexes As Integer(), _ YIndexes As Integer(), _ ScratchIndexes As Integer(), _ ByRef ResultIndexes As Integer() _ ) As GeneralSimulatedOperation()
public: static array<GeneralSimulatedOperation^>^ GetAddN( array<int>^ XIndexes, array<int>^ YIndexes, array<int>^ ScratchIndexes, array<int>^% ResultIndexes )
- XIndexes (array< Int32 >[]()[])
- Indexes that represent the first number to add. These indexes remain unchanged after application.
- YIndexes (array< Int32 >[]()[])
- Indexes that represent the second number to add. These plus the last ScratchIndexes index will have the result after application.
- ScratchIndexes (array< Int32 >[]()[])
- These are the scratch indexes and should be initialized to 0, although they will not be reset to 0. The final index in this is the last output index.
- ResultIndexes ( array< Int32 >[]()[] %)
- The indexes that will hold the result. This can be null.
The operations to perform add n.
| Exception | Condition |
|---|---|
| ArgumentNullException | Thrown if any of the parameters except
ResultIndexes are null. |
| SizeMismatchException | Thrown if the length of XIndexes and YIndexes
are not equal (must add equal length registers). |
| SizeMismatchException | Thrown if ScratchIndexes is not 1 larger
than XIndexes and YIndexes |