Return the operations needed to perform Add over two registers of equal size.
Declaration Syntax
C# | Visual Basic | Visual C++ |
List<IQuantumOperation> AddN( int[] XIndexes, int[] YIndexes, int[] AncilliaIndexes )
Function AddN ( _ XIndexes As Integer(), _ YIndexes As Integer(), _ AncilliaIndexes As Integer() _ ) As List(Of IQuantumOperation)
List<IQuantumOperation^>^ AddN( array<int>^ XIndexes, array<int>^ YIndexes, array<int>^ AncilliaIndexes )
Parameters
- XIndexes (array< Int32 >[]()[])
- The indexes of the X register. These remain unchanged once the operations are applied.
- YIndexes (array< Int32 >[]()[])
- The indexes of the Y register. These contain the result after the operations are applied, along with the last ancillia qubit
- AncilliaIndexes (array< Int32 >[]()[])
- The indexes of the ancillia qubits, which should be initialized to |0>. There should be one more ancillia qubit than there are X or Y qubits. The result will be in the YIndexes and the last ancillia index.
Return Value
The operations to apply add n.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown if any of the indexes passed
in are null. |
DuplicateIndexesException | Thrown if any of the indexes specified
are duplicates. All indexes must be unique. |
SizeMismatchException | Thrown if XIndexes and YIndexes are not of
equal length, or if AncilliaIndexes is not 1 larger than XIndexes and
YIndexes. |