Skip to content

Gram Matrix

Tabulate the pairwise inner products of a finite vector family in one square matrix, preserving its relative geometry and dependence.

Version
v1 · 2026-10-03 · History
Domain-specific #
13285
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomains
Linear Algebra, Inner Product Spaces → Mathematics

Core Idea

For a finite family \(v_1,\ldots,v_n\) in a real or complex inner-product space, the Gram matrix records \(G_{ij}=\langle v_i,v_j\rangle\). With vectors as columns under the standard inner product, \(G=X^*X\). It is symmetric over the reals, Hermitian over the complexes, and always positive semidefinite: \(c^*Gc=\|\sum_i c_i v_i\|^2\geq0\). It is positive definite exactly when the family is linearly independent.[ref-4ea485df8dbf][ref-73a2bef16a9d]

Its rank equals the span dimension. Its determinant is zero precisely when the family is dependent; for independent real vectors it gives squared Euclidean parallelotope volume (with a Hermitian exterior-product analogue over the complexes). These are inner-product consequences, not properties of an arbitrary bilinear-form table. The Gram matrix preserves relative lengths and angles, but a common orthogonal or unitary change of the original vectors leaves it unchanged, so absolute orientation is not recovered.[^ref-4ea485df8dbf]

Scope of Application

For real coordinate vectors, \(G=X^TX\) exposes dependence and appears in least-squares normal equations \(Gc=X^Tb\). Full column rank gives unique coefficients. If columns are dependent, \(G\) is singular and coefficients for the same projected vector may be nonunique; one cannot invert it as if full rank.[ref-4ea485df8dbf][ref-866f268e4a64]

For functions under an integral inner product, Elkies's monomials \(1,x,x^2\) on \([0,1]\) yield \(G_{ij}=\int_0^1x^{i+j-2}dx=1/(i+j-1)\), a positive-definite Hilbert matrix. In kernel methods, a finite sample has \(K_{ij}=k(x_i,x_j)=\langle\phi(x_i),\phi(x_j)\rangle\) for an appropriate feature map. The kernel function is a different object: positivity must hold over every finite sample, not just one matrix.[ref-4ea485df8dbf][ref-3ae915936b6d]

Clarity

The defining condition is pairwise inner products of one indexed family under a genuine positive-definite inner product. A table from an indefinite form may not be PSD and need not carry the same dependence or volume information. A distance matrix records distances, while a cross-covariance matrix records cross-variable moments; neither is automatically a Gram matrix.[^ref-73a2bef16a9d]

The frozen requested title Gramian matrix is retained as a lexical hold rather than a global alias. In some linear-algebra usage it names a Gram table, but control theory also uses controllability and observability Gramians for dynamics-derived constructions. Shared wording is not enough to merge those identities.

Manages Complexity

One square table holds all pairwise inner products and supports rank, determinant and projection calculations without repeatedly comparing the original family. With feature-space kernels, the table can be computed even when vectors are not explicitly constructed in a possibly infinite-dimensional space. That efficiency has a limit: the table loses absolute embedding orientation and cannot recover information that inner products do not encode.[ref-4ea485df8dbf][ref-3ae915936b6d]

In least squares, the same Gram is a normal-equation coefficient matrix. Redundant columns may preserve useful named variables but make the coefficients nonunique; reducing to an independent basis restores invertibility yet removes some original labels.[^ref-866f268e4a64]

Abstract Reasoning

State the scalar field, inner-product convention and finite family; calculate every \(G_{ij}\). Prove PSD by \(c^*Gc=\|\sum_i c_i v_i\|^2\), then test independence to decide strict positivity and invertibility. In \(\mathbb R^2\), vectors \((1,0)\), \((0,1)\) and \((1,1)\) give \(G=\begin{pmatrix}1&0&1\\0&1&1\\1&1&2\end{pmatrix}\): rank $2\(, determinant \$0\), and nonunique coefficients along \((-1,-1,1)\). For functions \(1,x,x^2\), the integral gives an invertible \(3\times3\) Hilbert matrix because those functions are independent.[^ref-4ea485df8dbf]

If solving \(Gc=X^*b\), do not infer uniqueness from the equation alone. Full column rank is the relevant extra condition. For an implicit kernel, one favorable Gram table also does not prove the kernel globally positive definite.[ref-866f268e4a64][ref-3ae915936b6d]

Knowledge Transfer

The inner-product table transfers literally between coordinate vectors, polynomial functions and kernel feature vectors. Live Matrix is the proposed strict parent because a Gram matrix is a square scalar array with an additional entry rule. Live Positive Definite Kernel is a neighboring function that generates Gram matrices on finite samples, not a strict genus of one such matrix. Distance Matrix, Cross-covariance Matrix and Rank are similarly distinct.[ref-4ea485df8dbf][ref-3ae915936b6d]

The broader idea of pairwise relation tabulation could be a future-prime question. Gram Matrix itself remains an inner-product and linear-algebra identity; removing those requirements removes the reason its PSD, rank and determinant conclusions hold.[^ref-73a2bef16a9d]

[^ref-4ea485df8dbf]: Noam Elkies, Math 55a Honors Abstract Algebra course notes, original Harvard lecture page, positive-definiteness and Gram paragraphs with Hilbert matrix and determinant growth, inspected 2026-10-01. [^ref-73a2bef16a9d]: David Bindel, CS 6210 Matrix Computations lecture slides, 25 August 2025, original Cornell notes, “Inner products” and “Gram matrices,” inspected 2026-10-01. [^ref-3ae915936b6d]: Thomas Hofmann, Bernhard Schölkopf and Alexander J. Smola, “Kernel Methods in Machine Learning”, original author-hosted Annals of Statistics 36 (2008), §2.1–2.2 Definitions 1–3, inspected 2026-10-01. [^ref-866f268e4a64]: David Bindel, CS 6210 Matrix Computations lecture slides, 24 September 2025, original Cornell notes, normal equations and full-rank uniqueness, inspected 2026-10-01.

Relationships to Other Abstractions

Local relationship map for Gram MatrixParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Gram MatrixDOMAINDomain-specific abstraction: Matrix — is a kind ofMatrixDOMAIN

Current abstraction Gram Matrix Domain-specific

Parents (1) — more general patterns this builds on

  • Gram Matrix is a kind of Matrix Domain-specific

    A Gram matrix is a square matrix of pairwise inner products from one finite family.

Hierarchy paths (5) — routes to 5 parentless roots

Neighborhood in Abstraction Space

Gram Matrix sits in a moderately populated region (58th percentile for distinctiveness): it has near-neighbors but no dense thicket of look-alikes.

Family — Codes, Matrices & Combinatorial Problems (30 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-08