Repository navigation
The operator spelling of #30. Application and its results are unchanged since v0.5.0.
Breaking change
- composition AB:
A * B(wasA | B) - direct product A⊗B:
A % B(wasA * B) - scalar multiplication:
c * A, unchanged
Code that composes with | no longer compiles. A direct product left as A * B fails to compile when the two ranks differ, but between operators of equal rank it now compiles as a composition (and throws if their dimensions differ). Port in two steps, compiling in between: first every direct product to %, then every | to *.
Why
- Precedence:
|binds more loosely than+,-and==, soA | B + Cwas A(B+C) andA + B | Cwas (A+B)C.*and%share multiplicative precedence and associate from left to right, so neither binds silently around a+. A misparse of a mixed expression such asA % B * C % Dtypically fails to compile, because the ranks don't match; the mixed-product law reads(A % B) * (C % D) == (A * C) % (B * D). - Convention:
*is the operator product in Eigen, Armadillo, QuTiP and QuantumOptics.jl. C++ has no ⊗, and%keeps an infix form. Unlike Armadillo's%, it is not the element-wise product.
Consumers: request 0.6 (FIND_PACKAGE_ARGS 0.6, find_package(cppqed-multidiagonal 0.6)); an installed 0.6.x doesn't satisfy a request for 0.5 (#9). C++QED pins v0.6.0.