Return the operations to perform the carry gate.

C# | Visual Basic | Visual C++ |
public List<IQuantumOperation> Carry( int CarryIndex, int XIndex, int YIndex, int AncilliaIndex )
Public Function Carry ( _ CarryIndex As Integer, _ XIndex As Integer, _ YIndex As Integer, _ AncilliaIndex As Integer _ ) As List(Of IQuantumOperation)
public: virtual List<IQuantumOperation^>^ Carry( int CarryIndex, int XIndex, int YIndex, int AncilliaIndex ) sealed

- CarryIndex (Int32)
- The index of the carry qubit. Remains unchanged after the operations are applied.
- XIndex (Int32)
- The index of the X qubit. Remains unchanged after the operations are applied.
- YIndex (Int32)
- The index of the Y qubit. On output this will be a + b (mod 2 addition)
- AncilliaIndex (Int32)
- The index of the ancillia (scratch) qubit. On output this will be (CarryIndex)(XIndex) + (XIndex)(CarryIndex) + (YIndex)(CarryIndex) (mod 2 addition)

The operations to perform carry.

Exception | Condition |
---|---|
DuplicateIndexesException | Thrown if any of the indexes
are duplicates. |