Expand description
Dense complex kernels for caroli: the Schur decomposition, its reordering, LU solves, QR and SVD, and matrix products. They dominate the lead modes and the nested-dissection fronts.
On macOS, with the accelerate feature (on by default), they can call Apple’s Accelerate
framework (LAPACK and BLAS, which run on the matrix units of Apple silicon); elsewhere, or
with the feature off, they use faer and an in-house QR algorithm. The reordering is in-house
everywhere: adjacent swaps (LAPACK ztrexc) made in small windows, whose rotations reach the
rest of the matrix as products.
set_backend chooses the library at run time (see Backend); the environment variable
CAROLI_DENSE_BACKEND (accelerate, faer) sets the initial choice.
Structs§
- Lu
- LU factorisation with partial pivoting of a square matrix.
- Svd
- Thin singular value decomposition
a = u diag(s) v†.
Enums§
- Accum
- determines whether to replace or add to the result of a matmul operatio
- Backend
- Which library runs the dense kernels. Without Accelerate in the build, both choices run faer.
- Dense
Error - Errors of the dense kernels.
- Op
- How a factor enters a product.
Constants§
- BACKEND
- Libraries this build can use:
"accelerate"(with faer) on macOS with the feature, else"faer".
Traits§
- Field
- A complex scalar the elimination kernels run in:
c64, orc32for reduced precision. Through Accelerate on Apple silicon, the Schur step of a front of 128 to 2048 variables runs 2.7–3.7× faster inc32.
Functions§
- backend
- The current choice (from
CAROLI_DENSE_BACKENDat the first call, Accelerate by default). - hermitian_
eigen - Eigen-decomposition
a = v diag(w) v†of a Hermitian matrix, from its lower triangle: eigenvalues in increasing order, orthonormal eigenvectors in columns. - is_real
- Whether a matrix has no imaginary part at all.
- matmul
dst = α op(a) op(b)(Accum::Replace) ordst += α op(a) op(b)(Accum::Add).- norm_1
‖a‖₁, the largest column sum of moduli.- orthonormal_
columns - Orthonormal basis of the columns of a full-rank
m × nmatrix,m ≥ n: the thinQof its QR factorisation. - partition
- Moves the selected eigenvalues of the Schur form
(t, q)to the leading positions, keeping the order among the selected and among the others (as LAPACK ztrsen). Returns their number. - product
op(a) op(b)as a new matrix.- reorder
- Stable reordering of the Schur form
(t, q)by increasingkeys, by adjacent swaps on the whole matrix. Cheap when few eigenvalues move;partitionis the fast way to move many. - schur
- Complex Schur decomposition
a = q t q†:qunitary,tupper triangular with exact zeros below the diagonal. Returns(q, t). - schur_
of_ real - Complex Schur decomposition
a = q t q†of a real matrix (given with zero imaginary parts): the real Schur form (a quarter of the arithmetic of the complex one), whose 2 × 2 blocks of complex pairs are then split by complex rotations (rsf2csf). Same output asschur. - set_
backend - Chooses the library of the dense kernels for the whole process.
- svd
- Thin singular value decomposition of
a. - svd_
of_ real - Thin singular value decomposition of a real matrix (given with zero imaginary parts), with
real singular vectors (a complex decomposition may mix degenerate ones with phases). Without
Accelerate,
svd.