API Reference#
The API reference contains:
Functions: compute log-determinant and trace of functions of matrices.
Interpolators: interpolate functions of one-parameter family of affine matrix functions.
Linear Operators: classes that represent matrices and affine matrix functions.
Sample Matrices: generate matrices for test purposes.
Device Inquiry: inquiry information about CPU and GPU devices.
Functions#
The functions of this package are:
Log-Determinant: computes log-determinant of matrix.
Trace of Inverses: computes trace of the inverse of a matrix or any negative power of the matrix.
Trace: computes the trace of matrix or any positive power of the matrix.
TrExp: computes the trace of matrix exponential.
TrLinFrac: computes the trace of the linear fractional transformation of a matrix.
EigenCount: computes the number of eigenvalues of a matrix within an interval.
Density: computes the spectral density of a matrix within evaluated at a given eigenvalue.
Schatten Norm: computes the Schatten norm of order \(p\), which includes the above three functions.
Each of the above functions are implemented using both direct and randomized algorithms, suitable for various matrices sizes.
Log-Determinant#
|
Log-determinant of non-singular matrix or linear operator. |
This function computes the log-determinant of \(\mathbf{A}^p\) or the Gramian matrix \((\mathbf{A}^{\intercal} \mathbf{A})^p\) where \(p\) is a real exponent.
The imate.logdet function has the following methods:
Method |
Algorithm |
Matrix size |
Matrix type |
Solution |
---|---|---|---|---|
Eigenvalue decomposition |
Small \(n < 2^{12}\) |
Any |
Exact |
|
Cholesky decomposition |
Moderate \(n < 2^{15}\) |
Symmetric Positive-definite |
Exact |
|
Stochastic Lanczos Quadrature |
Large \(n > 2^{12}\) |
Any |
Approximation |
Trace of Inverse#
|
Trace of inverse of non-singular matrix or linear operator. |
This function computes the trace of \(\mathbf{A}^{-p}\) or the Gramian matrix \((\mathbf{A}^{\intercal} \mathbf{A})^{-p}\) where \(p\) is a positive real exponent.
The imate.traceinv function has the following methods:
Method |
Algorithm |
Matrix Size |
Notes |
---|---|---|---|
eigenvalue |
Eigenvalue decomposition |
Small \(n < 2^{12}\) |
For testing and benchmarking other methods |
cholesky |
Cholesky decomposition |
Moderate \(n < 2^{15}\) |
Exact solution |
hutchinson |
Hutchinson |
Large \(2^{12} < n\) |
Randomized method using Monte-Carlo sampling |
slq |
Stochastic Lanczos Quadrature |
Large \(2^{12} < n\) |
Randomized method using Monte-Carlo sampling |
Trace#
|
Trace of matrix or linear operator. |
This function computes the trace of \(\mathbf{A}^p\) or the Gramian matrix \((\mathbf{A}^{\intercal} \mathbf{A})^p\) where \(p\) is a positive real exponent.
The imate.trace function has the following methods:
Method |
Algorithm |
Matrix Size |
Notes |
---|---|---|---|
exact |
Direct |
All sizes |
For all purposes |
eigenvalue |
Eigenvalue decomposition |
Small \(n < 2^{12}\) |
For testing and benchmarking other methods |
slq |
Stochastic Lanczos Quadrature |
Large \(2^{12} < n\) |
Randomized method using Monte-Carlo sampling |
TrExp#
|
Trace of the exponential of matrix or linear operator. |
This function computes the trace of the exponential function of \(\mathbf{A}^p\) or the Gramian matrix \((\mathbf{A}^{\intercal} \mathbf{A})^p\) where \(p\) is a positive real exponent.
The imate.trexp function has the following methods:
Method |
Algorithm |
Matrix Size |
Notes |
---|---|---|---|
eigenvalue |
Eigenvalue decomposition |
Small \(n < 2^{12}\) |
For testing and benchmarking other methods |
slq |
Stochastic Lanczos Quadrature |
Large \(2^{12} < n\) |
Randomized method using Monte-Carlo sampling |
TrLinFrac#
|
Trace of the linear fractional transformation of matrix or linear operator. |
This function computes the trace of the linear fractional transformation of \(\mathbf{A}^p\) or the Gramian matrix \((\mathbf{A}^{\intercal} \mathbf{A})^p\) where \(p\) is a positive real exponent.
The imate.trlinfrac function has the following methods:
Method |
Algorithm |
Matrix Size |
Notes |
---|---|---|---|
eigenvalue |
Eigenvalue decomposition |
Small \(n < 2^{12}\) |
For testing and benchmarking other methods |
slq |
Stochastic Lanczos Quadrature |
Large \(2^{12} < n\) |
Randomized method using Monte-Carlo sampling |
EigenCount#
|
Eigencount of matrix or linear operator. |
This function approximates the number of eigenvalues of \(\mathbf{A}^p\) or the Gramian matrix \((\mathbf{A}^{\intercal} \mathbf{A})^p\) within a given interval where \(p\) is a positive real exponent.
The imate.eigencount function has the following methods:
Method |
Algorithm |
Matrix Size |
Notes |
---|---|---|---|
eigenvalue |
Eigenvalue decomposition |
Small \(n < 2^{12}\) |
For testing and benchmarking other methods |
slq |
Stochastic Lanczos Quadrature |
Large \(2^{12} < n\) |
Randomized method using Monte-Carlo sampling |
Density#
|
Estimate the spectral density of matrix or linear operator. |
This function approximates the spectral density of \(\mathbf{A}^p\) or the Gramian matrix \((\mathbf{A}^{\intercal} \mathbf{A})^p\) for a given eigenvalue where \(p\) is a positive real exponent.
The imate.density function has the following methods:
Method |
Algorithm |
Matrix Size |
Notes |
---|---|---|---|
eigenvalue |
Eigenvalue decomposition |
Small \(n < 2^{12}\) |
For testing and benchmarking other methods |
slq |
Stochastic Lanczos Quadrature |
Large \(2^{12} < n\) |
Randomized method using Monte-Carlo sampling |
Schatten Norm#
|
Schatten p-norm and p-anti-norm of matrix. |
This function computes the Schatten norm of \(\mathbf{A}^p\) or the Gramian matrix \((\mathbf{A}^{\intercal} \mathbf{A})^p\) where \(p\) is a real exponent.
Interpolators#
Interpolate the various matrix functions of the one-parameter family of affine matrix function:
|
Interpolate the log-deterinant of an affine matrix function. |
|
Interpolate the trace of the powers of an affine matrix function. |
|
Interpolate Schatten norm (or anti-norm) of an affine matrix function. |
Each of the above interpolator classes have the following interpolation methods:
- imate.InterpolateSchatten(kind=’ext’)
- imate.InterpolateSchatten(kind=’eig’)
- imate.InterpolateSchatten(kind=’mbf’)
- imate.InterpolateSchatten(kind=’imbf’)
- imate.InterpolateSchatten(kind=’rbf’)
- imate.InterpolateSchatten(kind=’crf’)
- imate.InterpolateSchatten(kind=’spl’)
- imate.InterpolateSchatten(kind=’rpf’)
kind |
Description |
Results |
---|---|---|
|
Exact (no interpolation) |
exact |
|
Eigenvalue (no interpolation) |
exact |
|
Monomial Basis Functions |
interpolated |
|
Inverse Monomial Basis Functions |
interpolated |
|
Radial Basis Functions |
interpolated |
|
Chebyshev Rational Functions |
interpolated |
|
Spline |
interpolated |
|
Rational Polynomial Functions |
interpolated |
Linear Operators#
Create linear operator objects as container for various matrix types with a unified interface, establish a fully automatic dynamic buffer to allocate, deallocate, and transfer data between CPU and multiple GPU devices on demand, as well as perform basic matrix-vector operations with high performance on both CPU or GPU devices. These objects can be passed to imate functions as input matrices.
|
Create a linear operator object from an input matrix. |
|
Create a one-parameter affine matrix function object from input matrices. |
Sample Matrices#
Generate sample matrices for test purposes, such as correlation matrix and Toeplitz matrix. The matrix functions of Toeplitz matrix (such as its log-determinant, trace of its inverse, etc) are known analytically, making Toeplitz matrix suitable for benchmarking the result of randomized methods with analytical solutions.
|
Generate symmetric and positive-definite matrix for test purposes. |
|
Generate a sparse Toeplitz matrix for test purposes. |
|
Compute the log-determinant of Toeplitz matrix using an analytic formula. |
|
Compute the trace of the Toeplitz matrix using an analytic formula. |
Computes the trace of the inverse of Toeplitz matrix using an analytic formula. |
|
Compute the Schatten norm of Toeplitz matrix using an analytic formula. |
Device Inquiry#
Measure the process time and consumed memory of the Python process during computation with the following classes.
|
A timer to measure elapsed wall time and CPU process time of Python process. |
Measures resident memory size or its change for the Python process. |
Inquiry hardware information, including CPU and GPU devices employed during computation and get information about the CUDA Toolkit installation with the following functions.
|
Provides general information about hardware device, package version, and memory usage. |
Gets the model name of CPU processor. |
|
Gets the model name of GPU device. |
|
Returns the number of available CPU processor threads. |
|
Returns the number of available GPU devices in multi-GPU platforms. |
|
Gets the NVIDIA graphic driver version. |
|
Returns the directory paths and version of CUDA Toolkit installation. |
|
Restricts the computations to only one CPU thread. |