Gram matrix

From The Right Wiki
(Redirected from Gramian)
Jump to navigationJump to search

In linear algebra, the Gram matrix (or Gramian matrix, Gramian) of a set of vectors v1,,vn in an inner product space is the Hermitian matrix of inner products, whose entries are given by the inner product Gij=vi,vj.[1] If the vectors v1,,vn are the columns of matrix X then the Gram matrix is XX in the general case that the vector coordinates are complex numbers, which simplifies to XX for the case that the vector coordinates are real numbers. An important application is to compute linear independence: a set of vectors are linearly independent if and only if the Gram determinant (the determinant of the Gram matrix) is non-zero. It is named after Jørgen Pedersen Gram.

Examples

For finite-dimensional real vectors in n with the usual Euclidean dot product, the Gram matrix is G=VV, where V is a matrix whose columns are the vectors vk and V is its transpose whose rows are the vectors vk. For complex vectors in n, G=VV, where V is the conjugate transpose of V. Given square-integrable functions {i(),i=1,,n} on the interval [t0,tf], the Gram matrix G=[Gij] is:

Gij=t0tfi*(τ)j(τ)dτ.

where i*(τ) is the complex conjugate of i(τ). For any bilinear form B on a finite-dimensional vector space over any field we can define a Gram matrix G attached to a set of vectors v1,,vn by Gij=B(vi,vj). The matrix will be symmetric if the bilinear form B is symmetric.

Applications

Properties

Positive-semidefiniteness

The Gram matrix is symmetric in the case the inner product is real-valued; it is Hermitian in the general, complex case by definition of an inner product. The Gram matrix is positive semidefinite, and every positive semidefinite matrix is the Gramian matrix for some set of vectors. The fact that the Gramian matrix is positive-semidefinite can be seen from the following simple derivation:

xGx=i,jxi*xjvi,vj=i,jxivi,xjvj=ixivi,jxjvj=ixivi20.

The first equality follows from the definition of matrix multiplication, the second and third from the bi-linearity of the inner-product, and the last from the positive definiteness of the inner product. Note that this also shows that the Gramian matrix is positive definite if and only if the vectors vi are linearly independent (that is, ixivi0 for all x).[1]

Finding a vector realization

Given any positive semidefinite matrix M, one can decompose it as:

M=BB,

where B is the conjugate transpose of B (or M=BTB in the real case). Here B is a k×n matrix, where k is the rank of M. Various ways to obtain such a decomposition include computing the Cholesky decomposition or taking the non-negative square root of M. The columns b(1),,b(n) of B can be seen as n vectors in k (or k-dimensional Euclidean space k, in the real case). Then

Mij=b(i)b(j)

where the dot product ab==1ka*b is the usual inner product on k. Thus a Hermitian matrix M is positive semidefinite if and only if it is the Gram matrix of some vectors b(1),,b(n). Such vectors are called a vector realization of M. The infinite-dimensional analog of this statement is Mercer's theorem.

Uniqueness of vector realizations

If M is the Gram matrix of vectors v1,,vn in k then applying any rotation or reflection of k (any orthogonal transformation, that is, any Euclidean isometry preserving 0) to the sequence of vectors results in the same Gram matrix. That is, for any k×k orthogonal matrix Q, the Gram matrix of Qv1,,Qvn is also M. This is the only way in which two real vector realizations of M can differ: the vectors v1,,vn are unique up to orthogonal transformations. In other words, the dot products vivj and wiwj are equal if and only if some rigid transformation of k transforms the vectors v1,,vn to w1,,wn and 0 to 0. The same holds in the complex case, with unitary transformations in place of orthogonal ones. That is, if the Gram matrix of vectors v1,,vn is equal to the Gram matrix of vectors w1,,wn in k then there is a unitary k×k matrix U (meaning UU=I) such that vi=Uwi for i=1,,n.[3]

Other properties

  • Because G=G, it is necessarily the case that G and G commute. That is, a real or complex Gram matrix G is also a normal matrix.
  • The Gram matrix of any orthonormal basis is the identity matrix. Equivalently, the Gram matrix of the rows or the columns of a real rotation matrix is the identity matrix. Likewise, the Gram matrix of the rows or columns of a unitary matrix is the identity matrix.
  • The rank of the Gram matrix of vectors in k or k equals the dimension of the space spanned by these vectors.[1]

Gram determinant

The Gram determinant or Gramian is the determinant of the Gram matrix: |G(v1,,vn)|=|v1,v1v1,v2v1,vnv2,v1v2,v2v2,vnvn,v1vn,v2vn,vn|. If v1,,vn are vectors in m then it is the square of the n-dimensional volume of the parallelotope formed by the vectors. In particular, the vectors are linearly independent if and only if the parallelotope has nonzero n-dimensional volume, if and only if Gram determinant is nonzero, if and only if the Gram matrix is nonsingular. When n > m the determinant and volume are zero. When n = m, this reduces to the standard theorem that the absolute value of the determinant of n n-dimensional vectors is the n-dimensional volume. The Gram determinant is also useful for computing the volume of the simplex formed by the vectors; its volume is Volume(parallelotope) / n!. The Gram determinant can also be expressed in terms of the exterior product of vectors by

|G(v1,,vn)|=v1vn2.

When the vectors v1,,vnm are defined from the positions of points p1,,pn relative to some reference point pn+1,

(v1,v2,,vn)=(p1pn+1,p2pn+1,,pnpn+1),

then the Gram determinant can be written as the difference of two Gram determinants,

|G(v1,,vn)|=|G((p1,1),,(pn+1,1))||G(p1,,pn+1)|,

where each (pj,1) is the corresponding point pj supplemented with the coordinate value of 1 for an (m+1)-st dimension.[citation needed] Note that in the common case that n = m, the second term on the right-hand side will be zero.

Constructing an orthonormal basis

Given a set of linearly independent vectors {vi} with Gram matrix G defined by Gij:=vi,vj, one can construct an orthonormal basis

ui:=j(G1/2)jivj.

In matrix notation, U=VG1/2, where U has orthonormal basis vectors {ui} and the matrix V is composed of the given column vectors {vi}. The matrix G1/2 is guaranteed to exist. Indeed, G is Hermitian, and so can be decomposed as G=UDU with U a unitary matrix and D a real diagonal matrix. Additionally, the vi are linearly independent if and only if G is positive definite, which implies that the diagonal entries of D are positive. G1/2 is therefore uniquely defined by G1/2:=UD1/2U. One can check that these new vectors are orthonormal:

ui,uj=ij(G1/2)iivi,(G1/2)jjvj=ij(G1/2)iiGij(G1/2)jj=(G1/2GG1/2)ij=δij

where we used (G1/2)=G1/2.

See also

References

  1. 1.0 1.1 1.2 Horn & Johnson 2013, p. 441, p.441, Theorem 7.2.10
  2. Lanckriet, G. R. G.; Cristianini, N.; Bartlett, P.; Ghaoui, L. E.; Jordan, M. I. (2004). "Learning the kernel matrix with semidefinite programming". Journal of Machine Learning Research. 5: 27–72 [p. 29].
  3. Horn & Johnson (2013), p. 452, Theorem 7.3.11

External links

fr:Matrice de Gram