Orthogonalize

Orthogonalize[{v1,v2,}]

gives an orthonormal basis found by orthogonalizing the vectors vi.

Orthogonalize[{e1,e2,},f]

gives an orthonormal basis found by orthogonalizing the elements ei with respect to the inner product function f.

Details and Options

  • Orthogonalize[{v1,v2,}] uses the ordinary scalar product as an inner product.
  • The output from Orthogonalize always contains the same number of vectors as the input. If some of the input vectors are not linearly independent, the output will contain zero vectors.
  • All nonzero vectors in the output are normalized to unit length.
  • The inner product function f is applied to pairs of linear combinations of the ei.
  • The ei can be any expressions for which f always yields real results.
  • Orthogonalize[{v1,v2,},Dot] effectively assumes that all elements of the vi are real.
  • Orthogonalize by default generates a GramSchmidt basis.
  • Other bases can be obtained by giving alternative settings for the Method option. Possible settings include: "GramSchmidt", "ModifiedGramSchmidt", "Reorthogonalization", and "Householder".
  • Orthogonalize[list,Tolerance->t] sets to zero elements whose relative norm falls below t.

Examples

open allclose all

Basic Examples  (1)

Find an orthonormal basis for two 3D vectors:

Find the coefficients of a general vector with respect to this basis:

Scope  (2)

Use exact arithmetic to find an orthonormal basis:

Use machine arithmetic:

Use 25digit precision arithmetic:

Orthogonalize complex vectors:

Generalizations & Extensions  (2)

Find a symbolic basis, assuming all variables are real:

Orthogonalize symbolic expressions with a symbolic scalar product:

Options  (3)

Tolerance  (1)

Below the tolerance, two vectors are not recognized as linearly independent:

Method  (2)

m forms a set of vectors that are nearly linearly dependent:

Deviation from orthonormality for the default method:

Deviation for all of the methods:

For a large numerical matrix, the Householder method is usually fastest:

Applications  (1)

Derive normalized Legendre polynomials by orthogonalizing powers of :

Derive normalized Hermite polynomials:

Properties & Relations  (6)

In dimensions, there can be at most elements in the orthonormal basis:

Most sets of random -dimensional vectors are spanned by exactly basis vectors:

With the default method, the first element of the basis is always a multiple of the first vector:

For linearly independent vectors, the result is an orthonormal set:

Verify using matrix multiplication:

For linearly independent vectors, the result is a set orthonormal with the given inner product:

Verify orthonormality:

Orthogonalize[m] is related to QRDecomposition[Transpose[m]]:

They are the same up to sign:

Introduced in 2007
 (6.0)