Performs modular addition of X and Y: (x + y) mod n. All index arrays must be of
equal length.

C# | Visual Basic | Visual C++ |
public List<IQuantumOperation> ModularNAdder( int[] XIndexes, int[] YIndexes, int[] NIndexes, int[] AncilliaIndexes )
Public Function ModularNAdder ( _ XIndexes As Integer(), _ YIndexes As Integer(), _ NIndexes As Integer(), _ AncilliaIndexes As Integer() _ ) As List(Of IQuantumOperation)
public: virtual List<IQuantumOperation^>^ ModularNAdder( array<int>^ XIndexes, array<int>^ YIndexes, array<int>^ NIndexes, array<int>^ AncilliaIndexes ) sealed

- XIndexes (array< Int32 >[]()[])
- The indexes for x.
- YIndexes (array< Int32 >[]()[])
- The indexes for y.
- NIndexes (array< Int32 >[]()[])
- The indexes for N.
- AncilliaIndexes (array< Int32 >[]()[])
- The index of an ancillia qubits, must be set to 0. This array has to be 1 qubit greater than the others.

The operations to perform modular addition.

Exception | Condition |
---|---|
ArgumentNullException | Thrown if any of the arrays passed in are
null. |
ArgumentException | Thrown if the arrays passed in are not
of equal length (excep ancillia) or less than zero. |
DuplicateIndexesException | Thrown if any indexes are specified
more than once. |