Decompositions

class cola.linalg.decompositions.Cholesky[source]

Bases: Algorithm

Cholesky algorithm for decomposing a positive definite operator as \(A = L L^{*}\), where \(L\) is a lower triangular operator.

Example

>>> A = MyLinearOperator()
>>> L = cola.linalg.decompositions.Cholesky()(A)
class cola.linalg.decompositions.LU[source]

Bases: Algorithm

LU algorithm for decomposing a general square operator as \(A = PLU\), where \(P\) is a permutation operator, \(L\) is a lower triangular operator and \(U\) is an upper triangular operator.

Example

>>> A = MyLinearOperator()
>>> P,L,U = cola.linalg.decompositions.LU()(A)
class cola.linalg.decompositions.Arnoldi(start_vector=None, max_iters=1000, tol=1e-06, pbar=False, key=None)[source]

Bases: Algorithm

Arnoldi decomposition for a general square operator, \(H \approx Q^{*} A Q\) where \(H\) is an upper Hessenberg operator. This algorithm is used to approximate eig(A) through eig(H).

Parameters:
  • start_vector (Array, optional) – (n,) or (n, b) vector to start the algorithm.

  • max_iters (int, optional) – The maximum number of iterations to run.

  • tol (float, optional) – Relative error tolerance.

  • pbar (bool, optional) – Whether to show progress bar.

  • key (PRNGKey, optional) – Random key to use for the algorithm. PRNGKey for jax, long integer for numpy or pytorch.

Example

>>> A = MyLinearOperator()
>>> Q,H,info = Arnoldi(max_iters=100,pbar=True)(A)
class cola.linalg.decompositions.Lanczos(start_vector=None, max_iters=1000, tol=1e-06, pbar=False, key=None)[source]

Bases: Algorithm

Lanczos decomposition for Symmetric (or Hermitian) operators, \(T = Q^{*} A Q\) where \(T\) is a tridiagional operator. This algorithm is used to approximate eig(A) through eig(T).

Parameters:
  • start_vector (Array, optional) – (n,) or (n, b) vector to start the algorithm.

  • max_iters (int, optional) – The maximum number of iterations to run.

  • tol (float, optional) – Relative error tolerance.

  • pbar (bool, optional) – Whether to show progress bar.

  • key (PRNGKey, optional) – Random key to use for the algorithm. PRNGKey for jax, long integer for numpy or pytorch.

Example

>>> A = MyLinearOperator()
>>> Q,T,info = Lanczos(max_iters=100,pbar=True)(A)