modified_gram_schmidt

probnum.utils.linalg.modified_gram_schmidt(v, orthogonal_basis, inner_product=None, normalize=False)[source]

Stabilized Gram-Schmidt process.

Computes a vector \(v'\) such that \(\langle v', b_i \rangle = 0\) for all basis vectors \(b_i \in B\) in the orthogonal basis in a numerically stable fashion.

Parameters:
  • v (ndarray) – Vector (or stack of vectors) to orthogonalize against orthogonal_basis.

  • orthogonal_basis (Iterable[ndarray]) – Orthogonal basis.

  • inner_product (ndarray | LinearOperator | Callable[[ndarray, ndarray], ndarray] | None) – Inner product defining orthogonality. Can be either a numpy.ndarray or a Callable defining the inner product. Defaults to the euclidean inner product.

  • normalize (bool) – Normalize the output vector, s.t. \(\langle v', v' \rangle = 1\).

Returns:

Orthogonalized vector.

Return type:

v_orth