MultiplyByModularInteger 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
Performs modular multiplication by an integer constant on a qubit register.
operation MultiplyByModularInteger (constMultiplier : Int, modulus : Int, multiplicand : Microsoft.Quantum.Arithmetic.LittleEndian) : Unit is Adj + Ctl
Description
Let us denote modulus
by $N$ and constMultiplier
by $a$.
Then this operation implements a unitary operation defined by the following map on the
computational basis:
$$
\begin{align}
\ket{y} \mapsto \ket{(a \cdot y) \operatorname{mod} N}
\end{align}
$$
for all $y$ between $0$ and $N - 1$.
Input
constMultiplier : Int
Constant by which multiplicand is being multiplied. Must be co-prime to modulus.
modulus : Int
The multiplication operation is performed modulo modulus
.
multiplicand : LittleEndian
The number being multiplied by a constant. This is an array of qubits encoding an integer in little-endian format.
Output : Unit
Remarks
- For the circuit diagram and explanation see Figure 7 on Page 8 of arXiv:quant-ph/0205095v3
- This operation corresponds to Uₐ in arXiv:quant-ph/0205095v3
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