Skip to content

Latest commit

 

History

History
70 lines (42 loc) · 2.1 KB

microsoft.quantum.arithmetic.ripplecarryadderd.md

File metadata and controls

70 lines (42 loc) · 2.1 KB
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.

RippleCarryAdderD operation

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

Description

Given two $n$-bit integers encoded in LittleEndian registers xs and ys, and a qubit carry, the operation computes the sum of the two integers where the $n$ least significant bits of the result are held in ys and the carry out bit is xored to the qubit carry.

Input

xs : LittleEndian

LittleEndian qubit register encoding the first integer summand.

ys : LittleEndian

LittleEndian qubit register encoding the second integer summand, is modified to hold the $n$ least significant bits of the sum.

carry : Qubit

Carry qubit, is xored with the most significant bit of the sum.

Output : Unit

Remarks

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.

References