|
| bool | isNonZero (dcomp c) |
| | Returns true if either the real or imaginary part of c is non-zero.
|
| |
| bool | hasRealPart (dcomp c) |
| | Returns true if the real part of c is non-zero.
|
| |
| bool | hasImagPart (dcomp c) |
| | Returns true if the imaginary part of c is non-zero.
|
| |
| bool | absCompare (dcomp c1, dcomp c2) |
| | Comparator by absolute value, for use with sorting algorithms.
|
| |
| bool | realCompare (dcomp c1, dcomp c2) |
| | Comparator by real part, for use with sorting algorithms.
|
| |
| auto | sqr (auto &&x) noexcept(noexcept(x *x)) -> decltype(x *x) |
| | Generic square: x*x. Return type is deduced; noexcept and SFINAE are propagated.
|
| |
| double | relativeDeviation (const auto &a, const auto &b) |
| | Relative deviation between two values: |a-b| / (|a|+|b|). Returns 0 if both are zero.
|
| |
| double | sqrAbs (dcomp v) |
| | Squared absolute value of a complex number: |v|^2 = re^2 + im^2, computed as such (std::norm), not as the square of the rounded std::abs.
|
| |
| dcomp | textbookProduct (dcomp a, dcomp b) |
| | Complex product by the textbook formula \((a+ib)(c+id)=(ac-bd)+i(ad+bc)\), for hot loops.
|
| |
| template<class T > |
| void | boost::json::tag_invoke (value_from_tag, value &jv, const std::complex< T > &c) |
| | Boost.JSON serialization for std::complex<T>: emits a two-element JSON array [re, im].
|
| |
| template<class T > |
| std::complex< T > | boost::json::tag_invoke (value_to_tag< std::complex< T > >, const value &jv) |
| | Boost.JSON deserialization for std::complex<T>: reads from a two-element JSON array [re, im].
|
| |
| template<size_t RANK> |
| auto | cppqedutils::vectorize (MultiArray< dcomp, RANK > &ma) |
| | Maps a mutable MultiArray<dcomp,RANK> to an Eigen column vector (no data copy).
|
| |
| template<size_t RANK> |
| auto | cppqedutils::vectorize (const MultiArray< dcomp, RANK > &ma) |
| | Maps a const MultiArray<dcomp,RANK> to a const Eigen column vector (no data copy).
|
| |
template<size_t TWO_TIMES_RANK>
requires ( !(TWO_TIMES_RANK%2) ) |
| Extents< TWO_TIMES_RANK/2 > | cppqedutils::halveExtents (Extents< TWO_TIMES_RANK > extents) |
| | Extracts the first half of a rank-2R extent array, verifying that both halves are equal.
|
| |
| template<size_t TWO_TIMES_RANK> |
| auto | cppqedutils::matricize (MultiArray< dcomp, TWO_TIMES_RANK > &ma) |
| | Maps a mutable rank-2R MultiArray<dcomp> to an Eigen square matrix (no data copy). The matrix dimension is prod(extents[0..R-1]); requires equal first and second half extents.
|
| |
| template<size_t TWO_TIMES_RANK> |
| auto | cppqedutils::matricize (const MultiArray< dcomp, TWO_TIMES_RANK > &ma) |
| | Maps a const rank-2R MultiArray<dcomp> to a const Eigen square matrix (no data copy).
|
| |
| template<size_t RANK1, size_t RANK2> |
| auto | cppqedutils::directProduct (const MultiArray< dcomp, RANK1 > &m1, const MultiArray< dcomp, RANK2 > &m2, std::function< dcomp(dcomp, dcomp)> func=std::multiplies< dcomp >{}) |
| | Tensor (outer) product of two complex multi-arrays.
|
| |
| template<size_t RANK> |
| MultiArray< dcomp, RANK > & | cppqedutils::conj (MultiArray< dcomp, RANK > &ma) |
| | In-place complex conjugation of all elements of ma.
|
| |
| template<size_t RANK> |
| double | cppqedutils::frobeniusNormSqr (const MultiArray< dcomp, RANK > &ma) |
| | Squared Frobenius norm: \(\sum_{i}|a_i|^2\). Returns 0 for an empty array.
|
| |
| template<size_t RANK> |
| double | cppqedutils::frobeniusNorm (const MultiArray< dcomp, RANK > &ma) |
| | Frobenius norm: \(\sqrt{\sum_{i}|a_i|^2}\).
|
| |
| template<size_t TWO_TIMES_RANK> |
| void | cppqedutils::hermitianConjugateSelf (MultiArrayView< dcomp, TWO_TIMES_RANK > mav) |
| | In-place Hermitian conjugation of a rank-2R matrix view mav.
|
| |
| template<size_t TWO_TIMES_RANK> |
| void | cppqedutils::twoTimesRealPartOfSelf (MultiArrayView< dcomp, TWO_TIMES_RANK > mav) |
| | In-place replacement of a rank-2R matrix view mav with M + M† (twice its Hermitian part).
|
| |