Skip to content

v0.4.0 — twoITimesImagPartOf, contiguous-view checks, documentation sweep

Latest

Choose a tag to compare

@vukics vukics released this 27 Oct 11:57
· 8 commits to main since this release

Breaking: twoTimesImagPartOf is renamed to twoITimesImagPartOf. It returns A − A† = 2i·Im A, which is anti-Hermitian, not 2·Im A as the old name said. The value is unchanged; it is exactly H/i of a coherent drive H = i(ηa† − η*a). The old name is removed rather than deprecated, so existing calls fail to compile instead of silently changing meaning (#22). hermitianConjugateSelf now takes a view, like twoTimesRealPartOfSelf; pass an owning array as ma.mutableView() (#8).

Fixes: both in-place matrix functions index the flat storage, so in debug builds they now reject a sub-block or slice view with std::invalid_argument (checkContiguous, #8). A diagonal of zero extent (|o| = D, e.g. a at cutoff 1) on a non-leading axis made application index out of bounds; it is now skipped as a structural zero. The variadic MultiDiagonal constructor is constrained, so a non-const lvalue reaches the deleted copy constructor. sqrAbs is std::norm (re² + im²) instead of the square of the rounded abs. noInit, zeroInit and the slicing placeholder _ are inline variables, removing a formal ODR violation (#12).

Documentation: application accumulates Aψ and applies no factor 1/i (C++QED stores A = H/i), and the interaction picture belongs to the consumer, not to a derived type (#7). Storage is first-index-fastest while incrementMultiIndex iterates last-index-fastest; the stride docstring said row-major (#13). The README's operator formula had the offset direction reversed and implied a single tensor product; (a†)²a² is a main diagonal; a Performance section states that multi-axis application is 2–2.7× slower than Eigen sparse (#1); integration is via FetchContent. The outdated mainpage.md is gone: the README is the Doxygen main page, read through a sed filter for its math (#6).