pymor.algorithms.gram_schmidt
¶
Module Contents¶
Functions¶
Orthonormalize a 

Biorthonormalize a pair of 
 pymor.algorithms.gram_schmidt.gram_schmidt(A, product=None, return_R=False, atol=1e13, rtol=1e13, offset=0, reiterate=True, reiteration_threshold=0.9, check=True, check_tol=0.001, copy=True)[source]¶
Orthonormalize a
VectorArray
using the modified GramSchmidt algorithm.Parameters
 A
The
VectorArray
which is to be orthonormalized. product
The inner product
Operator
w.r.t. which to orthonormalize. IfNone
, the Euclidean product is used. return_R
If
True
, the R matrix from QR decomposition is returned. atol
Vectors of norm smaller than
atol
are removed from the array. rtol
Relative tolerance used to detect linear dependent vectors (which are then removed from the array).
 offset
Assume that the first
offset
vectors are already orthonormal and start the algorithm at theoffset + 1
th vector. reiterate
If
True
, orthonormalize again if the norm of the orthogonalized vector is much smaller than the norm of the original vector. reiteration_threshold
If
reiterate
isTrue
, reorthonormalize if the ratio between the norms of the orthogonalized vector and the original vector is smaller than this value. check
If
True
, check if the resultingVectorArray
is really orthonormal. check_tol
Tolerance for the check.
 copy
If
True
, create a copy ofA
instead of modifyingA
inplace.
Returns
 Q
The orthonormalized
VectorArray
. R
The uppertriangular/trapezoidal matrix (if
compute_R
isTrue
).
 pymor.algorithms.gram_schmidt.gram_schmidt_biorth(V, W, product=None, reiterate=True, reiteration_threshold=0.1, check=True, check_tol=0.001, copy=True)[source]¶
Biorthonormalize a pair of
VectorArrays
using the biorthonormal GramSchmidt process.See Algorithm 1 in [BKohlerS11].
Note that this algorithm can be significantly less accurate compared to orthogonalization, in particular, when
V
andW
are almost orthogonal.Parameters
 V, W
The
VectorArrays
which are to be biorthonormalized. product
The inner product
Operator
w.r.t. which to biorthonormalize. IfNone
, the Euclidean product is used. reiterate
If
True
, orthonormalize again if the norm of the orthogonalized vector is much smaller than the norm of the original vector. reiteration_threshold
If
reiterate
isTrue
, reorthonormalize if the ratio between the norms of the orthogonalized vector and the original vector is smaller than this value. check
If
True
, check if the resultingVectorArray
is really orthonormal. check_tol
Tolerance for the check.
 copy
If
True
, create a copy ofV
andW
instead of modifyingV
andW
inplace.
Returns
The biorthonormalized
VectorArrays
.