Orthogonal.m

Andrew D. Lewis

16 August 1998

1 Some linear algebra for Mathematica

Although Mathematica has its own very useful linear algebra functions, I have need of some special stuff which I include here.

2 The functions

Here are the lot, in alphabetical order.

GramSchmidt[A,g] A is a matrix whose columns contain the components of linearly independent vectors. Thus, if you have m vectors of length n, A is an m × n matrix. What you get back is another m × n matrix containing an orthonormal (with respect to the inner product with components g) basis for the column span of A.

Normalise[A,g] A is an m × n matrix whose columns are vectors. These are normalised (with respect to the inner product with components g) and returned. Thus output is also an m × n matrix.

OrthogonalComplement[A,g] A is a matrix whose rows are vectors. Thus, if you have m vectors of length n, A is an m × n matrix. The result is an (n − m) × n matrix of vectors forming a basis for the orthogonal (with respect to the inner product with components g) complement of the vectors in A.

OrthogonalProjection[A,g] A is an m × n matrix whose columns are orthonormal (with respect to the inner product with components g) vectors. The result is an n × n matrix which is orthogonal (again, with respect to the inner product with components g) projection onto the column span of A.