ExpModuloExtension ClassA Sandcastle Documented Class Library
Extension methods for performing modular exponentiation of quantum registers.
Inheritance Hierarchy

System Object
  Quantum.Operations ExpModuloExtension

Namespace: Quantum.Operations
Assembly: Quantum (in Quantum.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public static class ExpModuloExtension

The ExpModuloExtension type exposes the following members.

Methods

  NameDescription
Public methodStatic memberExpModulo(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.

Public methodStatic memberExpModulo(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.

Public methodStatic memberInversionModulo
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
Remarks

The implementation is based on "Quantum networks for elementary arithmetic operations", Vlatko Vedral, Adriano Barenco, and Artur Ekert, JULY 1996, page 149, FIG. 2 and FIG. 3
See Also