![]() ![]() |
MQT Core
The Backbone of the Munich Quantum Toolkit (MQT)
|
A class for managing complex numbers in the DD package. More...
#include <ComplexNumbers.hpp>
Public Member Functions | |
| ComplexNumbers (RealNumberUniqueTable &table) | |
| Default constructor. | |
| ~ComplexNumbers ()=default | |
| Default destructor. | |
| Complex | lookup (const Complex &c) |
| Lookup a complex value in the complex table; if not found add it. | |
| Complex | lookup (const std::complex< fp > &c) |
| Complex | lookup (const ComplexValue &c) |
| Complex | lookup (fp r) |
| Lookup a real value in the complex table; if not found add it. | |
| Complex | lookup (fp r, fp i) |
| Lookup a complex value in the complex table; if not found add it. | |
| Complex | lookupRoot (const ComplexValue &c) |
| Preserve matrix root components, including nonzero values below tolerance. | |
| template<class Node> | |
| Edge< Node > | lookup (const CachedEdge< Node > &ce) |
| Turn a root CachedEdge into Edge via lookup. | |
| std::size_t | realCount () const noexcept |
| Get the number of stored real numbers. | |
Static Public Member Functions | |
| static void | setTolerance (fp tol) |
| Set the numerical tolerance for comparisons of floats. | |
| static fp | mag2 (const Complex &a) noexcept |
| Compute the squared magnitude of a complex number. | |
| static fp | mag (const Complex &a) noexcept |
| Compute the magnitude of a complex number. | |
| static fp | arg (const Complex &a) noexcept |
| Compute the argument of a complex number. | |
| static Complex | conj (const Complex &a) noexcept |
| Compute the complex conjugate of a complex number. | |
| static Complex | neg (const Complex &a) noexcept |
| Compute the negation of a complex number. | |
| static constexpr bool | isStaticComplex (const Complex &c) |
| Check whether a complex number is one of the static ones. | |
A class for managing complex numbers in the DD package.
|
inlineexplicit |
Default constructor.
|
default |
Default destructor.
|
static |
Set the numerical tolerance for comparisons of floats.
This is global to all packages. Existing DDs are not recanonicalized.
| tol | The new positive, normal tolerance. |
| std::invalid_argument | If the tolerance is not positive and normal. |
Compute the squared magnitude of a complex number.
| a | The complex number. |
Compute the magnitude of a complex number.
| a | The complex number. |
Compute the argument of a complex number.
| a | The complex number. |
Compute the complex conjugate of a complex number.
| a | The complex number. |
Compute the negation of a complex number.
| a | The complex number. |
Lookup a complex value in the complex table; if not found add it.
| c | The complex number. |
|
nodiscard |
Lookup a real value in the complex table; if not found add it.
| r | The real number. |
Lookup a complex value in the complex table; if not found add it.
| r | The real part. |
| i | The imaginary part. |
|
inlinenodiscard |
Preserve matrix root components, including nonzero values below tolerance.
Nonzero special constants keep their existing tolerance priority.
|
inlinenodiscard |
Turn a root CachedEdge into Edge via lookup.
Matrix roots preserve range; vector roots retain ordinary lookup.
| Node | The type of the node. |
| ce | The cached edge. |
|
inlinestaticnodiscardconstexpr |
Check whether a complex number is one of the static ones.
| c | The complex number. |
|
nodiscardnoexcept |
Get the number of stored real numbers.