double_gram_schmidt¶
- probnum.utils.linalg.double_gram_schmidt(v, orthogonal_basis, inner_product=None, normalize=False, gram_schmidt_fn=<function modified_gram_schmidt>)[source]¶
Perform the (modified) Gram-Schmidt process twice.
Computes a vector \(v'\) such that \(\langle v', b_i \rangle = 0\) for all basis vectors \(b_i \in B\) in the orthogonal basis. This performs the (modified) Gram-Schmidt orthogonalization process twice, which is generally more stable than just reorthogonalizing once. [1] [2]
- Parameters:
v (ndarray) – Vector (or stack of vectors) to orthogonalize against
orthogonal_basis
.inner_product (ndarray | LinearOperator | Callable[[ndarray, ndarray], ndarray] | None) – Inner product defining orthogonality. Can be either a
numpy.ndarray
or aCallable
defining the inner product. Defaults to the euclidean inner product.normalize (bool) – Normalize the output vector, s.t. \(\langle v', v' \rangle = 1\).
gram_schmidt_fn (Callable) – Gram-Schmidt process to use. One of
gram_schmidt()
ormodified_gram_schmidt()
.
- Returns:
Orthogonalized vector.
- Return type:
v_orth
References