pymor.algorithms.svd_va

Module for SVD method of operators represented by VectorArrays.

Module Contents

Functions

method_of_snapshots

SVD of a VectorArray using the method of snapshots.

qr_svd

SVD of a VectorArray using Gram-Schmidt orthogonalization.

pymor.algorithms.svd_va.method_of_snapshots(A, product=None, modes=None, rtol=1e-07, atol=0.0, l2_err=0.0)[source]

SVD of a VectorArray using the method of snapshots.

Viewing the VectorArray A as a A.dim x len(A) matrix, the return value of this method is the singular value decomposition of A, where the inner product on R^(dim(A)) is given by product and the inner product on R^(len(A)) is the Euclidean inner product.

Warning

The left singular vectors may not be numerically orthonormal for ill-conditioned A.

Parameters

A

The VectorArray for which the SVD is to be computed.

product

Inner product Operator w.r.t. which the SVD is computed.

modes

If not None, at most the first modes singular values and vectors are returned.

rtol

Singular values smaller than this value multiplied by the largest singular value are ignored.

atol

Singular values smaller than this value are ignored.

l2_err

Do not return more modes than needed to bound the l2-approximation error by this value. I.e. the number of returned modes is at most

argmin_N { sum_{n=N+1}^{infty} s_n^2 <= l2_err^2 }

where s_n denotes the n-th singular value.

Returns

U

VectorArray of left singular vectors.

s

One-dimensional NumPy array of singular values.

Vh

NumPy array of right singular vectors.

pymor.algorithms.svd_va.qr_svd(A, product=None, modes=None, rtol=4e-08, atol=0.0, l2_err=0.0)[source]

SVD of a VectorArray using Gram-Schmidt orthogonalization.

Viewing the VectorArray A as a A.dim x len(A) matrix, the return value of this method is the singular value decomposition of A, where the inner product on R^(dim(A)) is given by product and the inner product on R^(len(A)) is the Euclidean inner product.

Parameters

A

The VectorArray for which the SVD is to be computed.

product

Inner product Operator w.r.t. which the left singular vectors are computed.

modes

If not None, at most the first modes singular values and vectors are returned.

rtol

Singular values smaller than this value multiplied by the largest singular value are ignored.

atol

Singular values smaller than this value are ignored.

l2_err

Do not return more modes than needed to bound the l2-approximation error by this value. I.e. the number of returned modes is at most

argmin_N { sum_{n=N+1}^{infty} s_n^2 <= l2_err^2 }

where s_n denotes the n-th singular value.

Returns

U

VectorArray of left singular vectors.

s

One-dimensional NumPy array of singular values.

Vh

NumPy array of right singular vectors.