Cove - A Practical Quantum Computer Programming Framework
AddNInverse Method (XIndexes, YIndexes, AncilliaIndexes, ResultIndexes, CarryIndex)
NamespacesCove.LocalSimulationQuantumAlgorithmsAddNInverse(array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[]%, Int32%)
Return the operations needed to perform Add Inverse over two registers of equal size. Add inverse is subtraction.
Declaration Syntax
C#Visual BasicVisual C++
public List<IQuantumOperation> AddNInverse(
	int[] XIndexes,
	int[] YIndexes,
	int[] AncilliaIndexes,
	out int[] ResultIndexes,
	out int CarryIndex
Public Function AddNInverse ( _
	XIndexes As Integer(), _
	YIndexes As Integer(), _
	AncilliaIndexes As Integer(), _
	<OutAttribute> ByRef ResultIndexes As Integer(), _
	<OutAttribute> ByRef CarryIndex As Integer _
) As List(Of IQuantumOperation)
virtual List<IQuantumOperation^>^ AddNInverse(
	array<int>^ XIndexes, 
	array<int>^ YIndexes, 
	array<int>^ AncilliaIndexes, 
	[OutAttribute] array<int>^% ResultIndexes, 
	[OutAttribute] int% CarryIndex
) sealed
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.
ResultIndexes ( array< Int32 >[]()[] %)
The YIndexes index contain the result, but this parameter will be populated with them explicitly for ease of use.
CarryIndex ( Int32 %)
The carry index, the element at that location will be 1 if (Y - X) less than 0, else the value at that location will be 0.
Return Value
The operations to apply add n.
ArgumentNullExceptionThrown if any of the indexes passed in are null.
DuplicateIndexesExceptionThrown if any of the indexes specified are duplicates. All indexes must be unique.
SizeMismatchExceptionThrown if XIndexes and YIndexes are not of equal length, or if AncilliaIndexes is not 1 larger than XIndexes and YIndexes.

Assembly: Cove.LocalSimulation (Module: Cove.LocalSimulation) Version: (