Crate rusty_compression

Source
Expand description

This library provides routines to compute low-rank approximations of matrices.

§Overview

Let ACm×nA\in\mathbb{C}^{m\times n} be a given matrix. A low-rank approximation is a representation of the form AUVH A\approx UV^H with UCm×kU\in\mathbb{C}^{m\times k} and VCn×kV\in\mathbb{C}^{n\times k}, where kk is sufficiently small for the required application. A frequently used representation is also AU~XV~H A\approx \tilde{U}X\tilde{V}^H with a k×kk\times k matrix XX.

The basis of the library is a pivoted QR decomposition of AA of the form AP=QR AP = QR with PP a permutation matrix, QCm×Q\in\mathbb{C}^{m\times \ell} a matrix with orthogonal columns of unit norm, RC×nR\in\mathbb{C}^{\ell\times n} upper triangular, and =min{m,n}\ell=\min\{m, n\}.

In a pivoted QR decomposition the diagonal elements of RR are sorted in non-increasing order, that is r11r22|r_{11}|\geq |r_{22}|\geq \dots. We can therefore compress AA by choosing an index kk and only keeping the first kk columns of QQ and the first kk rows of RR. The library allows to choose the parameter kk directly or by a given tolerance τ\tau such that rkkr11<τ\langle|\frac{r_{kk}}{r_{11}}\rangle|< \tau.

Alternatively, one can also low-rank compress by first computing the Singular Value Decomposition. This is more accurate but also more costly.

From the compressed QR decomposition we can compute a column pivoted interpolative decomposition of the form ACZ A \approx CZ The matrix CC is defined as C=A[:,[i1,i2, ]], C = A[:, [i_1, i_2, \dots]], that is a selection of columns of AA with indices i1,i2,i_1, i_2, \dots.

The column pivoted interpolative decomposition has the advantage that we are using columns of AA as low-rank basis, which in applications often have physical meaning as opposed to the columns of QQ.

From the column pivoted interpolative decomposition we can also compute a two-sided decomposition of the form ACXR A\approx C X R Here, XX is a k×kk\times k matrix, which is the submatrix of AA formed of the column indices i1,i2,i_1, i_2, \dots and row indices j1,j2,j_1, j_2, \dots.

Similarly to a column interpolative decomposition, a corresponding row interpolative decomposition is available that selects rows of AA for the low rank approximation.

Re-exports§

pub use qr::QR;
pub use qr::LQ;
pub use qr::QRTraits;
pub use qr::LQTraits;
pub use col_interp_decomp::ColumnID;
pub use col_interp_decomp::ColumnIDTraits;
pub use row_interp_decomp::RowID;
pub use row_interp_decomp::RowIDTraits;
pub use two_sided_interp_decomp::TwoSidedID;
pub use two_sided_interp_decomp::TwoSidedIDTraits;
pub use svd::SVD;
pub use svd::SVDTraits;
pub use random_matrix::RandomMatrix;
pub use types::RelDiff;
pub use types::Result;
pub use permutation::*;
pub use random_sampling::*;

Modules§

col_interp_decomp
Data structures for Column Interpolative Decomposition.
compute_svd
A simple trait to wrap SVD Computation.
examples
Library examples
permutation
Traits and functions for permutation vectors.
qr
Data Structures and traits for QR Decompositions
random_matrix
Generation of random matrices for various types
random_sampling
Random sampling of matrices
row_interp_decomp
Data structure for Row Interpolative Decomposition
svd
Define an SVD container and conversion tools.
two_sided_interp_decomp
Implementation of the two sided interpolative decomposition
types
This module collects the various traits definitions

Enums§

CompressionType

Traits§

Scalar

Type Aliases§

c32
Alias for a Complex<f32>
c64
Alias for a Complex<f64>