pysrw.lib.uti_math_eigen.UtiMathEigen#
- class pysrw.lib.uti_math_eigen.UtiMathEigen(dim=None, fptype=1, alg='PM', lower=False, rescale=True)[source]#
Bases:
object
- __init__(dim=None, fptype=1, alg='PM', lower=False, rescale=True)[source]#
Initiate the object :param dim: rank of the matrix :param fptype: precision, 1(2) for single(double) :param alg: eigensolver algorithm, ‘SP’ – SciPy, ‘SPS’ – SciPy Sparse, ‘PM’ – Primme :param lower: use only the lower triangle part of the matrix for (SP) eigensolver; valid only when alg=’SP’
Methods
__init__
([dim, fptype, alg, lower, rescale])Initiate the object :param dim: rank of the matrix :param fptype: precision, 1(2) for single(double) :param alg: eigensolver algorithm, 'SP' -- SciPy, 'SPS' -- SciPy Sparse, 'PM' -- Primme :param lower: use only the lower triangle part of the matrix for (SP) eigensolver; valid only when alg='SP'
angle2eigenvec_left
(v[, indxs, indxe])Geometric angle between a column vector and a subset of the left eigenspace :param v: array of column vector :param indxs: left-end index of the eigenvector in the eigenspace :param indxe: right-end index of the eigenvector in the eigenspace :return: angle between the vector and the eigenspace
eigen_left
(data[, n_modes, alg, queue, pid])Solve for the eigensystem of input matrix w.
pca
(data[, n_modes])PCA algorithm :param data: input matrix :param n_modes: number of components of interest :return: n_modes singular values
reconst_mat_left
([indxs, indxe])Reconstruct the matrix from a subset of the left eigenspace :param indxs: left-end index of the eigenvector in the eigenspace :param indxe: right-end index of the eigenvector in the eigenspace :return: reconstructed matrix
- angle2eigenvec_left(v, indxs=0, indxe=None)[source]#
Geometric angle between a column vector and a subset of the left eigenspace :param v: array of column vector :param indxs: left-end index of the eigenvector in the eigenspace :param indxe: right-end index of the eigenvector in the eigenspace :return: angle between the vector and the eigenspace
- eigen_left(data, n_modes=None, alg=None, queue=None, pid=None)[source]#
Solve for the eigensystem of input matrix w. largest N eigenvalues and column eigenvectors :param data: input real or complex matrix with dimension (self.dim, self.dim) :param n_modes: number of eigenpairs (w. largest eigenvalues) of interest :param alg: eigensolver algorithm :param queue: list to append the generated eigenpairs to, default not applicable :param pid: predefined ID of the generated eigenpairs, applies only when param queue is not None :return: (queue is None) array of eigenvalues, array of eigenvectors (normalized) with dimension (rank, N), order of eigenpairs (True in descending order of eigenvalues, False o.w.)