﻿ExpModuloExtension Methods
 ExpModuloExtension Methods A Sandcastle Documented Class Library

The ExpModuloExtension type exposes the following members.

Methods

NameDescription
ExpModulo(QuantumComputer, Register, Register, Int32, Int32)

Performs (a^x) modulo N, for given integers a and N. The x (one value or a superposition) is given in the input register x.

After computation, the result (or results, when x stores superposition of multiple integers) is stored in register x1.

This method is a simple variant of ExpModulo(QuantumComputer, Register, Register, Register, Register, Register, Register, Int32, Int32). It allocates additional registers and frees them at the end. This variant has also requirements for the width of each given register but if they are not fullfilled, the exception is thrown.

ExpModulo(QuantumComputer, Register, Register, Register, Register, Register, Register, Int32, Int32)

Performs (a^x) modulo N, for given integers a and N. The x (one value or a superposition) is given in the input register x.

After computation, the result (or results, when x stores superposition of multiple integers) is stored in register x1.

This method is a variant of ExpModulo function, which operates directly on quantum registers given as arguments. It neither allocates nor frees any additional registers. It is thus recommended, when there is a need for performing modular exponentiation repeatedly. However, this variant has strict requirements for the width of each given register and if they are not fullfilled, the method gives unexpected results.

InversionModulo
Computes the modular multiplicative inverse a modulo N, for given integers a and N.

The multiplicative inverse of a modulo N exists if and only if a and N are coprime (i.e., if gcd(a, N) = 1).

Top