QuantumComputer is a singleton, which instance can be obtained by calling GetInstance method. QuantumComputer can create and delete the Register class (Registers cannot be created independently by new operator). Quantum computations can be performed by Register class, but also by QuantumComputer class, by using its extension methods located in namespace Quantum.Operations.
Quantum QuantumComputer
Namespace: Quantum
Assembly: Quantum (in Quantum.dll) Version: 1.0.0.0 (1.0.0.0)
The QuantumComputer type exposes the following members.
Name  Description  

DeleteRegister 
Deletes register, given in argument, with its references, which enables freeing the memory by garbage collector.
Registers consume large amount of memory, so this method is very useful when computations are complex and requires many registers.
 
Equals  Determines whether the specified object is equal to the current object. (Inherited from Object.)  
Finalize  Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)  
GetHashCode  Serves as a hash function for a particular type. (Inherited from Object.)  
GetInstance 
Method for obtaining QuantumComputer's singleton instance.
 
GetRootRegister 
Connects given registers into one root register and returns that root.
If registers was already connected, returns simply their root register.
It is strongly required before doing any operation on qubits in different registers.
This method is used at the begin of every operation from namespace Quantum.Operations, as these methods usually operate on more than one register.
 
GetType  Gets the Type of the current instance. (Inherited from Object.)  
MemberwiseClone  Creates a shallow copy of the current Object. (Inherited from Object.)  
NewRegister(IDictionary UInt64, Complex , Int32) 
Creates new Register, with given width and initial states with their amplitudes.
Very useful, when there is a need for creating register in nontrivial state, with some possible values.
 
NewRegister(UInt64, Int32, Nullable Int32 ) 
Creates new Register, with given width and initial state.
 
TensorProduct 
Returns the tensor product of given registers. It has the same result as connecting registers into one in the method GetRootRegister( RegisterRef ).
However, tensor product could be obtained only when given arguments are independent registers (neither connected with nor being a part of any other register).
 
ToString  Returns a string that represents the current object. (Inherited from Object.) 
Name  Description  

Add(Register, Register)  Overloaded. Adds two registers. The result is stored in the second. No extra registers are required. Add(a, b, 0) > (a, a+b, 0) This method checks if arguments are valid. If not, an exception is thrown. The following conditions must be satisfied:
 
Add(Register, Register, Register)  Overloaded. Adds two registers. The result is stored in the second. An extra register is needed for storing carry bits. Add(a, b, 0) > (a, a+b, 0) In order to improve performance, this method do not check if arguments are valid. They must satisfy following conditions:
 
AddModulo(Register, Register, UInt64)  Overloaded. (Defined by AddModuloExtension.)  
AddModulo(Register, Register, Register, Register, UInt64)  Overloaded. (Defined by AddModuloExtension.)  
Carry 
Sets the carry bit (in point of fact, a carry qubit).
Used with Sum(QuantumComputer, RegisterRef, RegisterRef, RegisterRef) to perform addition.
(Defined by AddExtension.)  
CMultModulo(Register, Register, RegisterRef, UInt64, UInt64)  Overloaded. (Defined by MultModuloExtension.)  
CMultModulo(Register, Register, Register, Register, Register, RegisterRef, UInt64, UInt64)  Overloaded. (Defined by MultModuloExtension.)  
CNot  Performs a controlled not operation (CNOT Gate). The target bit gets inverted if the control bit is enabled. The operation can be written as the unitary operation matrix:  
CPhaseShift  Performs a conditional phase kick (or phase shift) on the registers' state by the angle PI / 2 ^ dist. The operation is represented by the unitary matrix:  
ExpModulo(Register, Register, Int32, Int32)  Overloaded. 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(Register, Register, Register, Register, Register, Register, Int32, Int32)  Overloaded. 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.  
Gate1  Performs any arbitrary unitary operation on target qubit. The operation is described by unitary matrix of complex numbers, as follows:  
Hadamard  Applies the Hadamard gate to the target qubit. The unitary matrix for this operation is:  
InverseAdd(Register, Register)  Overloaded. Performs an exact inversion of Add(QuantumComputer, Register, Register) method. InverseAdd(a, a+b, 0) > (a, b, 0) This method checks if arguments are valid. If not, an exception is thrown. The following conditions must be satisfied:
 
InverseAdd(Register, Register, Register)  Overloaded. Performs an exact inversion of Add(QuantumComputer, Register, Register, Register) method. InverseAdd(a, a+b, 0) > (a, b, 0) In order to improve performance, this method do not check if arguments are valid. They must satisfy following conditions:
 
InverseAddModulo(Register, Register, UInt64)  Overloaded. (Defined by AddModuloExtension.)  
InverseAddModulo(Register, Register, Register, Register, UInt64)  Overloaded. (Defined by AddModuloExtension.)  
InverseCarry 
Inversion of Carry(QuantumComputer, RegisterRef, RegisterRef, RegisterRef, RegisterRef) method.
(Defined by AddExtension.)  
InverseCMultModulo(Register, Register, RegisterRef, UInt64, UInt64)  Overloaded. (Defined by MultModuloExtension.)  
InverseCMultModulo(Register, Register, Register, Register, Register, RegisterRef, UInt64, UInt64)  Overloaded. (Defined by MultModuloExtension.)  
InverseCPhaseShift  Performs a inversed conditional phase kick (or phase shift) on the registers' state by the angle PI / 2 ^ dist. The operation is represented by the unitary matrix:  
InverseLoadNumber  (Defined by TrivialInverseExtension.)  
InverseQFT  Performs an exact inversion of Quantum Fourier Transform (see QFT(QuantumComputer, Register)).  
InverseReverse  (Defined by TrivialInverseExtension.)  
InverseSum  (Defined by TrivialInverseExtension.)  
InverseSwap(RegisterRef, RegisterRef)  Overloaded. (Defined by TrivialInverseExtension.)  
InverseSwap(Register, Register, RegisterRef)  Overloaded. (Defined by TrivialInverseExtension.)  
InverseWalsh  (Defined by TrivialInverseExtension.)  
LoadNumber  (Defined by LoadNumberExtension.)  
PhaseKick  Performs a phase kick (or phase shift) on the the registers' state. The operation is represented by the unitary matrix: The controlled version of this operation can be written as an other unitary matrix:  
PhaseScale  Adds a global phase on the registers' state. The operation is represented by the unitary matrix:  
QFT  Performs the Quantum Fourier Transform on given Register.  
Reset  (Defined by GatesExtension.)  
Reverse  (Defined by SwapExtension.)  
RotateX  Performs a rotation of the target qubit about the xaxis of the Bloch sphere. The angle of rotation is given in first argument (double gamma). The unitary matrix of this operation is:  
RotateY  Performs a rotation of the target qubit about the yaxis of the Bloch sphere. The angle of rotation is given in first argument (double gamma). The operation is represented by the unitary matrix:  
RotateZ  Performs a rotation of the target qubit about the zaxis of the Bloch sphere. The angle of rotation is given in first argument (double gamma). The operation is represented by the unitary matrix:  
SigmaX  Performs a Sigma X Pauli's Gate on target qubit. Actually, it is a simple Not. The unitary operation matrix is:  
SigmaY  Performs a Sigma Y Pauli's Gate on target qubit. The operation is represented by unitary matrix:  
SigmaZ  Performs a Sigma Z Pauli's Gate on target qubit. The operation is represented by unitary matrix:  
SqrtX  Performs the Square Root of Not on the target qubit. The Square Root of Not Gate is such a gate, that applied twice, performs Not operation. The operation can be represented as the unitary matrix:  
Sum 
Computes the least significant bit of sum of two given bits.
Used with Carry(QuantumComputer, RegisterRef, RegisterRef, RegisterRef, RegisterRef) to perform addition.
(Defined by AddExtension.)  
Swap(RegisterRef, RegisterRef)  Overloaded.
Swaps the values of two given qubits.
(Defined by SwapExtension.)  
Swap(Register, Register, RegisterRef)  Overloaded.
The controlled Swap. Swaps the values of two given qubits, if the control qubit is set.
(Defined by SwapExtension.)  
Toffoli  Applies Toffoli gate. If all of the control bits are enabled, the target bit gets inverted. This gate with more than two control bits is not considered elementary and is not available on all physical realizations of a quantum computer. Toffoli gate with two control bits can be represented by unitary matrix:  
Walsh 
Applies the WalshHadamard transform on given register.
In other words, applies Hadamard gate on every qubit in the register.
(Defined by WalshExtension.) 
Name  Description  

Epsilon 
Constant value of Epsilon. This is a threshold for double values.
It is used mainly in performing quantum gates operation.
When the absolute amplitude value (real or imaginary) during computations reach the value smaller than Epsilon, it is rounded to 0.
