uid | title | ms.date | ms.topic | qsharp.kind | qsharp.namespace | qsharp.name | qsharp.summary |
---|---|---|---|---|---|---|---|
Microsoft.Quantum.Arithmetic.RippleCarryAdderD |
RippleCarryAdderD operation |
7/28/2023 12:00:00 AM |
managed-reference |
operation |
Microsoft.Quantum.Arithmetic |
RippleCarryAdderD |
Reversible, in-place ripple-carry addition of two integers. |
Warning
This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.
Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.
Namespace: Microsoft.Quantum.Arithmetic
Package: Microsoft.Quantum.Standard
Reversible, in-place ripple-carry addition of two integers.
operation RippleCarryAdderD (xs : Microsoft.Quantum.Arithmetic.LittleEndian, ys : Microsoft.Quantum.Arithmetic.LittleEndian, carry : Qubit) : Unit is Adj + Ctl
Given two xs
and ys
,
and a qubit carry, the operation computes the sum of the two integers
where the ys
and
the carry out bit is xored to the qubit carry
.
LittleEndian qubit register encoding the first integer summand.
LittleEndian qubit register encoding the second integer summand, is
modified to hold the
Carry qubit, is xored with the most significant bit of the sum.
The specified controlled operation makes use of symmetry and mutual cancellation of operations to improve on the default implementation that adds a control to every operation.
- Thomas G. Draper: "Addition on a Quantum Computer", 2000. https://arxiv.org/abs/quant-ph/0008033