TOPICS
Search

Gram Matrix


The Gram matrix G of real vectors v_1, ..., v_m in R^n is the matrix of their inner products,

 g_(ij)=v_i^Tv_j,
(1)

where the superscript T denotes the transpose. If A has these vectors as its columns, then

 G=A^TA.
(2)

Consequently, G is a positive semidefinite matrix, its matrix rank is the dimension of the span of the vectors, and it is a positive definite matrix iff the vectors are linearly independent. The Gram matrix determines the vectors in R^n up to an orthogonal transformation.

Gram matrices also give a criterion for realizing prescribed distances in Euclidean space. Let d_(ij)=d_(ji)>=0 for i,j=0, ..., m, with d_(ii)=0, and form

 g_(ij)=(d_(0i)^2+d_(0j)^2-d_(ij)^2)/2,
(3)

where i,j=1, ..., m. The prescribed distances can be realized by points P_0, ..., P_m in a Euclidean space iff G is a positive semidefinite matrix. Its matrix rank is the smallest possible dimension of the affine hull of a realization (Young and Householder 1938). For a realization, this is the Gram matrix of P_i-P_0. Conversely, factoring G=A^TA with a real matrix A provides coordinates by taking P_0=0 and the columns of A as the other points.

For example, prescribe distances between five labels so that d_(12)=sqrt(3) and every other distance between distinct labels is 1. Every triple is realizable as either an equilateral triangle of side 1 or a triangle with sides of lengths 1, 1, sqrt(3). Both have area sqrt(3)/4. Nevertheless, the corresponding matrix is

 G=1/2[2 -1 1 1; -1 2 1 1; 1 1 2 1; 1 1 1 2],
(4)

and its determinant is -3/16. It is therefore not a positive semidefinite matrix, so no such five points exist in any Euclidean space. Trott (2006) considers systems prescribing equal triangle areas of a four-dimensional simplex. The example shows why solutions of such algebraic systems must also be tested for Euclidean realizability.


See also

Expansion Coefficient, Inner Product, Matrix Rank, Positive Semidefinite Matrix, Rayleigh-Ritz Variational Technique

Explore with Wolfram|Alpha

WolframAlpha

More things to try:

References

Trott, M. "Polynomials in Equations." §1.2.2 in The Mathematica GuideBook for Symbolics. New York: Springer-Verlag, 2006. https://doi.org/10.1007/0-387-28815-5. https://www.mathematicaguidebooks.org/.Young, G. and Householder, A. S. "Discussion of a Set of Points in Terms of Their Mutual Distances." Psychometrika 3, 19-22, 1938. https://doi.org/10.1007/BF02287916.

Referenced on Wolfram|Alpha

Gram Matrix

Cite this as:

Weisstein, Eric W. "Gram Matrix." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/GramMatrix.html

Subject classifications

⌂ Proxy