Prefix Arithmetic#
While syntactically more compact/elegant, infix arithmetic expressions allow barely any customization regarding precision, method etc. which can be detrimental when efficiency is a concern. Because of this we expose the underlying prefix arithmetic functions:
In-place adders#
|
In-place adder function based on this paper Performs the addition |
|
|
|
|
|
Implementation of the higher radix quantum carry lookahead adder (QCLA) as described here. |
QuantumFloat processing#
|
Performs multiplication based on the evaluation of semi-boolean polynomials. |
|
|
|
|
|
An advanced algorithm for multiplication which has better depth, gate-count and compile time than |
|
|
|
Performs inplace multiplication of a QuantumFloat with a classical integer. |
|
Performs division up to arbitrary precision. |
|
Performs division up to arbitrary precision and uncomputes the remainder. |
|
Calculates the multiplicative inverse of a QuantumFloat. |
QuantumArray processing#
|
Matrix multiplication for QuantumArrays. |
|
Performs matrix multiplication between a classical numpy array and a QuantumArray |
|
Performs inplace matrix application to a vector-valued QuantumArray. |
|
Port of the popular numpy function with similar semantics. |
|
Port of numpy tensordot with similar semantics. |