DivideI 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.Numerics
Divides two quantum integers.
operation DivideI (xs : Microsoft.Quantum.Arithmetic.LittleEndian, ys : Microsoft.Quantum.Arithmetic.LittleEndian, result : Microsoft.Quantum.Arithmetic.LittleEndian) : Unit is Adj + Ctl
Description
xs
will hold the
remainder xs - floor(xs/ys) * ys
and result
will hold
floor(xs/ys)
.
Input
xs : LittleEndian
$n$-bit dividend, will be replaced by the remainder.
ys : LittleEndian
$n$-bit divisor
result : LittleEndian
$n$-bit result, must be in state $\ket{0}$ initially and will be replaced by the result of the integer division.
Output : Unit
Remarks
Uses a standard shift-and-subtract approach to implement the division. The controlled version is specialized such the subtraction does not require additional controls.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for