HOME

TheInfoList



OR:

In
linear algebra Linear algebra is the branch of mathematics concerning linear equations such as :a_1x_1+\cdots +a_nx_n=b, linear maps such as :(x_1, \ldots, x_n) \mapsto a_1x_1+\cdots +a_nx_n, and their representations in vector spaces and through matrix (mathemat ...
, the Gram matrix (or Gramian matrix, Gramian) of a set of vectors v_1,\dots, v_n in an inner product space is the
Hermitian matrix In mathematics, a Hermitian matrix (or self-adjoint matrix) is a complex square matrix that is equal to its own conjugate transpose—that is, the element in the -th row and -th column is equal to the complex conjugate of the element in the ...
of
inner product In mathematics, an inner product space (or, rarely, a Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation called an inner product. The inner product of two vectors in the space is a scalar, ofte ...
s, whose entries are given by the
inner product In mathematics, an inner product space (or, rarely, a Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation called an inner product. The inner product of two vectors in the space is a scalar, ofte ...
G_ = \left\langle v_i, v_j \right\rangle., p.441, Theorem 7.2.10 If the vectors v_1,\dots, v_n are the columns of matrix X then the Gram matrix is X^\dagger X in the general case that the vector coordinates are complex numbers, which simplifies to X^\top X for the case that the vector coordinates are real numbers. An important application is to compute
linear independence In the theory of vector spaces, a set (mathematics), set of vector (mathematics), vectors is said to be if there exists no nontrivial linear combination of the vectors that equals the zero vector. If such a linear combination exists, then th ...
: a set of vectors are linearly independent if and only if the Gram determinant (the
determinant In mathematics, the determinant is a Scalar (mathematics), scalar-valued function (mathematics), function of the entries of a square matrix. The determinant of a matrix is commonly denoted , , or . Its value characterizes some properties of the ...
of the Gram matrix) is non-zero. It is named after Jørgen Pedersen Gram.


Examples

For finite-dimensional real vectors in \mathbb^n with the usual Euclidean
dot product In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a Scalar (mathematics), scalar as a result". It is also used for other symmetric bilinear forms, for example in a pseudo-Euclidean space. N ...
, the Gram matrix is G = V^\top V, where V is a matrix whose columns are the vectors v_k and V^\top is its
transpose In linear algebra, the transpose of a Matrix (mathematics), matrix is an operator which flips a matrix over its diagonal; that is, it switches the row and column indices of the matrix by producing another matrix, often denoted by (among other ...
whose rows are the vectors v_k^\top. For
complex Complex commonly refers to: * Complexity, the behaviour of a system whose components interact in multiple ways so possible interactions are difficult to describe ** Complex system, a system composed of many components which may interact with each ...
vectors in \mathbb^n, G = V^\dagger V, where V^\dagger is the conjugate transpose of V. Given square-integrable functions \ on the interval \left _0, t_f\right/math>, the Gram matrix G = \left _\right/math> is: : G_ = \int_^ \ell_i^*(\tau)\ell_j(\tau)\, d\tau. where \ell_i^*(\tau) is the complex conjugate of \ell_i(\tau). For any
bilinear form In mathematics, a bilinear form is a bilinear map on a vector space (the elements of which are called '' vectors'') over a field ''K'' (the elements of which are called '' scalars''). In other words, a bilinear form is a function that is linea ...
B on a
finite-dimensional In mathematics, the dimension of a vector space ''V'' is the cardinality (i.e., the number of vectors) of a basis of ''V'' over its base field. p. 44, §2.36 It is sometimes called Hamel dimension (after Georg Hamel) or algebraic dimension to d ...
vector space In mathematics and physics, a vector space (also called a linear space) is a set (mathematics), set whose elements, often called vector (mathematics and physics), ''vectors'', can be added together and multiplied ("scaled") by numbers called sc ...
over any field we can define a Gram matrix G attached to a set of vectors v_1, \dots, v_n by G_ = B\left(v_i, v_j\right). The matrix will be symmetric if the bilinear form B is symmetric.


Applications

* In
Riemannian geometry Riemannian geometry is the branch of differential geometry that studies Riemannian manifolds, defined as manifold, smooth manifolds with a ''Riemannian metric'' (an inner product on the tangent space at each point that varies smooth function, smo ...
, given an embedded k-dimensional
Riemannian manifold In differential geometry, a Riemannian manifold is a geometric space on which many geometric notions such as distance, angles, length, volume, and curvature are defined. Euclidean space, the N-sphere, n-sphere, hyperbolic space, and smooth surf ...
M\subset \mathbb^n and a parametrization \phi: U\to M for the volume form \omega on M induced by the embedding may be computed using the Gramian of the coordinate tangent vectors: \omega = \sqrt\ dx_1 \cdots dx_k,\quad G = \left left\langle \frac,\frac\right\rangle\right This generalizes the classical surface integral of a parametrized surface \phi:U\to S\subset \mathbb^3 for (x, y)\in U\subset\mathbb^2: \int_S f\ dA = \iint_U f(\phi(x, y))\, \left, \frac\,\,\frac\\, dx\, dy. * If the vectors are centered
random variable A random variable (also called random quantity, aleatory variable, or stochastic variable) is a Mathematics, mathematical formalization of a quantity or object which depends on randomness, random events. The term 'random variable' in its mathema ...
s, the Gramian is approximately proportional to the covariance matrix, with the scaling determined by the number of elements in the vector. * In
quantum chemistry Quantum chemistry, also called molecular quantum mechanics, is a branch of physical chemistry focused on the application of quantum mechanics to chemical systems, particularly towards the quantum-mechanical calculation of electronic contributions ...
, the Gram matrix of a set of basis vectors is the overlap matrix. * In
control theory Control theory is a field of control engineering and applied mathematics that deals with the control system, control of dynamical systems in engineered processes and machines. The objective is to develop a model or algorithm governing the applic ...
(or more generally
systems theory Systems theory is the Transdisciplinarity, transdisciplinary study of systems, i.e. cohesive groups of interrelated, interdependent components that can be natural or artificial. Every system has causal boundaries, is influenced by its context, de ...
), the controllability Gramian and observability Gramian determine properties of a linear system. * Gramian matrices arise in covariance structure model fitting (see e.g., Jamshidian and Bentler, 1993, Applied Psychological Measurement, Volume 18, pp. 79–94). * In the finite element method, the Gram matrix arises from approximating a function from a finite dimensional space; the Gram matrix entries are then the inner products of the basis functions of the finite dimensional subspace. * In
machine learning Machine learning (ML) is a field of study in artificial intelligence concerned with the development and study of Computational statistics, statistical algorithms that can learn from data and generalise to unseen data, and thus perform Task ( ...
, kernel functions are often represented as Gram matrices. (Also see kernel PCA) * Since the Gram matrix over the reals is a
symmetric matrix In linear algebra, a symmetric matrix is a square matrix that is equal to its transpose. Formally, Because equal matrices have equal dimensions, only square matrices can be symmetric. The entries of a symmetric matrix are symmetric with ...
, it is diagonalizable and its eigenvalues are non-negative. The diagonalization of the Gram matrix is the
singular value decomposition In linear algebra, the singular value decomposition (SVD) is a Matrix decomposition, factorization of a real number, real or complex number, complex matrix (mathematics), matrix into a rotation, followed by a rescaling followed by another rota ...
.


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 In mathematics, an inner product space (or, rarely, a Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation called an inner product. The inner product of two vectors in the space is a scalar, ofte ...
. 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: : x^\dagger \mathbf x = \sum_x_i^* x_j\left\langle v_i, v_j \right\rangle = \sum_\left\langle x_i v_i, x_j v_j \right\rangle = \biggl\langle \sum_i x_i v_i, \sum_j x_j v_j \biggr\rangle = \biggl\, \sum_i x_i v_i \biggr\, ^2 \geq 0 . 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 v_i are linearly independent (that is, \sum_i x_i v_i \neq 0 for all x).


Finding a vector realization

Given any positive semidefinite matrix M, one can decompose it as: : M = B^\dagger B, where B^\dagger is the conjugate transpose of B (or M = B^\textsf B in the real case). Here B is a k \times 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^, \dots, b^ of B can be seen as ''n'' vectors in \mathbb^k (or ''k''-dimensional Euclidean space \mathbb^k, in the real case). Then : M_ = b^ \cdot b^ where the
dot product In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a Scalar (mathematics), scalar as a result". It is also used for other symmetric bilinear forms, for example in a pseudo-Euclidean space. N ...
a \cdot b = \sum_^k a_\ell^* b_\ell is the usual inner product on \mathbb^k. Thus a
Hermitian matrix In mathematics, a Hermitian matrix (or self-adjoint matrix) is a complex square matrix that is equal to its own conjugate transpose—that is, the element in the -th row and -th column is equal to the complex conjugate of the element in the ...
M is positive semidefinite if and only if it is the Gram matrix of some vectors b^, \dots, b^. Such vectors are called a vector realization of The infinite-dimensional analog of this statement is
Mercer's theorem In mathematics, specifically functional analysis, Mercer's theorem is a representation of a symmetric positive-definite function on a square as a sum of a convergent sequence of product functions. This theorem, presented in , is one of the most ...
.


Uniqueness of vector realizations

If M is the Gram matrix of vectors v_1,\dots,v_n in \mathbb^k then applying any rotation or reflection of \mathbb^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 \times k orthogonal matrix Q, the Gram matrix of Q v_1,\dots, Q v_n is also This is the only way in which two real vector realizations of M can differ: the vectors v_1,\dots,v_n are unique up to orthogonal transformations. In other words, the dot products v_i \cdot v_j and w_i \cdot w_j are equal if and only if some rigid transformation of \mathbb^k transforms the vectors v_1,\dots,v_n to w_1, \dots, w_n 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 v_1, \dots, v_n is equal to the Gram matrix of vectors w_1, \dots, w_n in \mathbb^k then there is a unitary k \times k matrix U (meaning U^\dagger U = I) such that v_i = U w_i for i = 1, \dots, n.


Other properties

* Because G = G^\dagger, it is necessarily the case that G and G^\dagger commute. That is, a real or complex Gram matrix G is also a
normal matrix In mathematics, a complex square matrix is normal if it commutes with its conjugate transpose : :A \text \iff A^*A = AA^* . The concept of normal matrices can be extended to normal operators on infinite-dimensional normed spaces and to nor ...
. * The Gram matrix of any
orthonormal basis In mathematics, particularly linear algebra, an orthonormal basis for an inner product space V with finite Dimension (linear algebra), dimension is a Basis (linear algebra), basis for V whose vectors are orthonormal, that is, they are all unit vec ...
is the identity matrix. Equivalently, the Gram matrix of the rows or the columns of a real
rotation matrix In linear algebra, a rotation matrix is a transformation matrix that is used to perform a rotation (mathematics), rotation in Euclidean space. For example, using the convention below, the matrix :R = \begin \cos \theta & -\sin \theta \\ \sin \t ...
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 \mathbb^k or \mathbb^k equals the dimension of the space spanned by these vectors.


Gram determinant

The Gram determinant or Gramian is the determinant of the Gram matrix: \bigl, G(v_1, \dots, v_n)\bigr, = \begin \langle v_1,v_1\rangle & \langle v_1,v_2\rangle &\dots & \langle v_1,v_n\rangle \\ \langle v_2,v_1\rangle & \langle v_2,v_2\rangle &\dots & \langle v_2,v_n\rangle \\ \vdots & \vdots & \ddots & \vdots \\ \langle v_n,v_1\rangle & \langle v_n,v_2\rangle &\dots & \langle v_n,v_n\rangle \end. If v_1, \dots, v_n are vectors in \mathbb^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 In the theory of vector spaces, a set of vectors is said to be if there exists no nontrivial linear combination of the vectors that equals the zero vector. If such a linear combination exists, then the vectors are said to be . These concep ...
if and only if In logic and related fields such as mathematics and philosophy, "if and only if" (often shortened as "iff") is paraphrased by the biconditional, a logical connective between statements. The biconditional is true in two cases, where either bo ...
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 the determinant and volume are zero. When , this reduces to the standard theorem that the absolute value of the determinant of ''n'' ''n''-dimensional vectors is the ''n''-dimensional volume. The volume of the simplex formed by the vectors is . When v_1, \dots, v_n are linearly independent, the distance between a point x and the linear span of v_1, \dots, v_n is \sqrt. Consider the moment problem: given c_1, \dots, c_n \in \mathbb C, find a vector v such that \left\langle v, v_i\right\rangle=c_i, for all 1 \leqslant i \leqslant n. There exists a unique solution with minimal norm:v=-\frac \det \begin 0 & c_1 & c_2 & \cdots & c_n \\ v_1 & \left\langle v_1, v_1\right\rangle & \left\langle v_1, v_2\right\rangle & \cdots & \left\langle v_1, v_n\right\rangle \\ v_2 & \left\langle v_2, v_1\right\rangle & \left\langle v_2, v_2\right\rangle & \cdots & \left\langle v_2, v_n\right\rangle \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ v_n & \left\langle v_n, v_1\right\rangle & \left\langle v_n, v_2\right\rangle & \cdots & \left\langle v_n, v_n\right\rangle \endThe Gram determinant can also be expressed in terms of the
exterior product In mathematics, specifically in topology, the interior of a subset of a topological space is the union of all subsets of that are open in . A point that is in the interior of is an interior point of . The interior of is the complement of ...
of vectors by :\bigl, G(v_1, \dots, v_n)\bigr, = \, v_1 \wedge \cdots \wedge v_n\, ^2. The Gram determinant therefore supplies an
inner product In mathematics, an inner product space (or, rarely, a Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation called an inner product. The inner product of two vectors in the space is a scalar, ofte ...
for the space . If an
orthonormal basis In mathematics, particularly linear algebra, an orthonormal basis for an inner product space V with finite Dimension (linear algebra), dimension is a Basis (linear algebra), basis for V whose vectors are orthonormal, that is, they are all unit vec ...
''e''''i'', on is given, the vectors : e_ \wedge \cdots \wedge e_,\quad i_1 < \cdots < i_n, will constitute an orthonormal basis of ''n''-dimensional volumes on the space . Then the Gram determinant \bigl, G(v_1, \dots, v_n)\bigr, amounts to an ''n''-dimensional Pythagorean Theorem for the volume of the parallelotope formed by the vectors v_1 \wedge \cdots \wedge v_n in terms of its projections onto the basis volumes e_ \wedge \cdots \wedge e_. When the vectors v_1, \ldots, v_n \in \mathbb^m are defined from the positions of points p_1, \ldots, p_n relative to some reference point p_, :(v_1, v_2, \ldots, v_n) = (p_1 - p_, p_2 - p_, \ldots, p_n - p_)\,, then the Gram determinant can be written as the difference of two Gram determinants, : \bigl, G(v_1, \dots, v_n)\bigr, = \bigl, G((p_1, 1), \dots, (p_, 1))\bigr, - \bigl, G(p_1, \dots, p_)\bigr, \,, where each (p_j, 1) is the corresponding point p_j supplemented with the coordinate value of 1 for an (m+1)-st dimension. Note that in the common case that , the second term on the right-hand side will be zero.


Constructing an orthonormal basis

Given a set of linearly independent vectors \ with Gram matrix G defined by G_:= \langle v_i,v_j\rangle, one can construct an orthonormal basis :u_i := \sum_j \bigl(G^\bigr)_ v_j. In matrix notation, U = V G^ , where U has orthonormal basis vectors \ and the matrix V is composed of the given column vectors \. The matrix G^ is guaranteed to exist. Indeed, G is Hermitian, and so can be decomposed as G=UDU^\dagger with U a unitary matrix and D a real diagonal matrix. Additionally, the v_i are linearly independent if and only if G is positive definite, which implies that the diagonal entries of D are positive. G^ is therefore uniquely defined by G^:=UD^U^\dagger. One can check that these new vectors are orthonormal: :\begin \langle u_i,u_j \rangle &= \sum_ \sum_ \Bigl\langle \bigl(G^\bigr)_ v_,\bigl(G^\bigr)_ v_ \Bigr\rangle \\ 0mu&= \sum_ \sum_ \bigl(G^\bigr)_ G_ \bigl(G^\bigr)_ \\ mu&= \bigl(G^ G G^\bigr)_ = \delta_ \end where we used \bigl(G^\bigr)^\dagger=G^ .


See also

* Controllability Gramian * Observability Gramian


References

*


External links

* *
Volumes of parallelograms
' by Frank Jones {{Matrix classes Systems theory Matrices (mathematics) Determinants Analytic geometry Kernel methods for machine learning fr:Matrice de Gram