8.2 Vectors and matrices
Bases, transposes, norms, inner products and determinants, as they are written on this site.
Almost every formula on lattices.io is built from a handful of linear-algebra symbols. This page lists them with how to read them aloud, what they mean here, a small example, and the chapters that use them. The one thing to check before reading any formula is the basis convention: the site uses two, depending on the section.
Vectors
A vector is written as a plain lowercase letter such as , or , not in bold and not with an arrow. Its entries are listed in parentheses: .
| Symbol | Read as | Meaning on this site | Example | Used in |
|---|---|---|---|---|
| “b sub i” | The -th basis vector. Indices start at 1 in the articles; g6k-rs code starts at 0. | 1.5, 4.1, 4.2, 2.2, 1.2 | ||
| “x sub i” | The -th entry (coordinate) of the vector . | has | 7.1, 1.6 | |
| “e sub i” | The -th standard unit vector: 1 in position , 0 elsewhere. In LWE and CVP chapters without an index is an error vector instead. | 7.2, 7.5 | ||
| , | “zero”, “the all-ones vector” | The zero vector, and the vector with every entry equal to 1. | is the vector of row sums of | 7.5 |
| , | “Z to the n”, “R to the n” | All vectors with integer (or real) entries. is also the simplest lattice. | 1.6, 1.2, 1.3, 2.4, 6.2 |
Rows or columns: the two basis conventions
A basis is stored as one matrix . You can put the basis vectors in its columns or in its rows, and the site does both:
| Convention | Basis vectors are | Lattice | Change of basis | Used in |
|---|---|---|---|---|
| Column | columns of | 1.x, 2.x, 6.1 | ||
| Row | rows of | 7.x, 4.6 (g6k-rs, fplll) |
The two matrices are transposes of each other, and the lattice is the same set of points. In the column convention the integer coefficients form a column vector multiplied on the right; in the row convention they form a row vector multiplied on the left. The column chapters also write , where the bars separate columns.
Worked example
Take and , and the coefficients , so the lattice point is .
Same point, same determinant ( either way), transposed matrix. When you copy a formula from one section into code for another, transpose first.
Matrices
| Symbol | Read as | Meaning on this site | Example | Used in |
|---|---|---|---|---|
| “m by n integer matrices” | Matrices with rows and columns and integer entries ( for real entries). Rows come first. | : equations in unknowns | 1.2, 2.1, 2.2, 7.4, 7.5 | |
| “A transpose” | Rows and columns swapped. On a vector, is the inner product of and . Some sources write ; same thing. | 3.1, 7.5, 2.3, 1.2, 6.1 | ||
| “A inverse” | The matrix with . For a polynomial, is its inverse in the ring (see 2.6). | 6.1, 1.2 | ||
| “B inverse transpose” | . Its columns (column convention) or rows (row convention) are a basis of the dual lattice. | For the column basis above: | 6.1, 1.2 | |
| , | “the n by n identity” | 1 on the diagonal, 0 elsewhere. is on the diagonal. | 7.5, 2.6, 1.6 | |
| “diagonal matrix” | The matrix with on the diagonal and zeros elsewhere. | 6.1 | ||
| “block matrix” | A matrix assembled from smaller matrices. stands for a block of zeros of whatever size fits. Embeddings are almost always written this way. | NTRU basis in 2.6; Kannan embedding in 7.4 | 7.1, 7.5, 2.2, 2.6, 7.4 | |
| “A next to B” | Matrices placed side by side (same number of rows). lists the columns of a basis. | in the kernel embedding | 1.1, 1.2, 4.1 |
Inner products, norms and distances
All lengths on the site are Euclidean unless a subscript says otherwise. The examples use and .
| Symbol | Read as | Meaning on this site | Example | Used in |
|---|---|---|---|---|
| “inner product of x and y” | . Also written ; in 7.1 as . | 2.2, 1.2, 6.1, 3.4, 7.1 | ||
| “times” or “dot” | Usually ordinary multiplication (, ). Between two vectors, as in , it is the inner product. | 3.4, 1.3, 7.1, 1.5, 3.2 | ||
| “norm of x”, “length of x” | Euclidean length , the same as . Lattice reduction minimises this norm. | 7.4, 1.5, 2.2, 1.4, 3.3 | ||
| “norm of x squared” | The squared length . Algorithms and code work with it to avoid square roots; g6k-rs norm_sq returns it. | 1.4, 7.5, 7.4, 1.5, 1.2 | ||
| “infinity norm”, “max norm” | The largest absolute entry, . Signature schemes bound this norm (“every coefficient is small”). | 3.3, 2.5, 2.2, 2.4, 2.6 | ||
| “one norm” | The sum of absolute entries, . For a 0/1 vector it counts the ones. | 3.3 | ||
| , | “ell two”, “ell infinity” | Names for the norm a problem is measured in, as in “SVP in the norm”. | — | 2.1, 2.2 |
| , | “absolute value”, “max over i” | Absolute value of a number, and the largest value of an expression as varies. | 7.3, 7.1 | |
| “distance from t to v” | Euclidean distance between two points. | 2.2, SVP & CVP, 1.4 | ||
| “distance from t to the lattice” | : how far is from the closest lattice point. | 2.2 |
Determinants, span and change of basis
| Symbol | Read as | Meaning on this site | Example | Used in |
|---|---|---|---|---|
| “determinant of B” | The signed determinant of a square matrix. Applied to a lattice, means its volume, which is always positive (see 8.3 Lattice notation). | 1.3, 1.4, 1.6, 1.2, 7.5 | ||
| “absolute determinant” | The volume of the parallelepiped spanned by the basis. Swapping two basis vectors flips the sign of but not this. | 1.2, 4.6, 1.4, 1.3, 6.2 | ||
| “root of det B B transpose” | Volume of a lattice given by a non-square row basis (fewer vectors than coordinates). With a column basis the same quantity is . | rows : | 7.1, 7.2 | |
| “span of b one to b k” | All real combinations of the vectors: a line, plane or subspace. The lattice is only the integer combinations. | is the -axis | 4.2, 1.3 | |
| , rank | “dimension”, “rank” | The number of linearly independent vectors in a span or lattice. A lattice is full-rank when this equals the number of coordinates. | the solutions of in have rank 2 | 1.3, 7.5, 7.1 |
| , | “a unimodular matrix” | An integer matrix with determinant , so its inverse is also an integer matrix. Multiplying a basis by gives another basis of the same lattice. | replaces by | 1.2, 6.1 |
| “G L n over Z” | The set (group) of all unimodular matrices. | 1.2 |
Gram matrices and projections
| Symbol | Read as | Meaning on this site | Example | Used in |
|---|---|---|---|---|
| “the Gram matrix” | All pairwise inner products of the basis vectors: . With columns it is ; with rows it is . The matrix is the same. | for , : | 1.2, 1.4 | |
| “pi i of v” | Orthogonal projection of away from : keep only the part of perpendicular to the first basis vectors. is the projected lattice BKZ works in. | when | 4.2, 4.4 | |
| “b i tilde” | The -th Gram–Schmidt vector, . Many papers write ; this site always uses the tilde. | in the example | 2.2, 4.1, 1.5, 4.2, 1.2 |
The Gram–Schmidt coefficients and the quantities built from them are covered in 8.3 Lattice notation.
Same symbol, different meaning
| Symbol | Meaning | Where |
|---|---|---|
| star on a lattice, | The dual lattice. Some papers write . | 6.1, 1.2, 4.4 |
| star on a matrix, | Conjugate transpose (adjoint), as in the Falcon Gram matrix | 3.6 |
| star on a point, | The closest lattice vector found by a CVP algorithm | 2.2 |
| error or noise vector (LWE, CVP); with an index, is a unit vector | 2.3, 7.4; 7.2 | |
| , | homomorphic addition and multiplication of ciphertexts, not direct sum or tensor product | 3.2 |
| Gram matrix in lattice chapters; a hash function in 3.1; an elliptic-curve generator point in 6.4 | — |
Converting between conventions
When a formula comes from a column-convention chapter and your code (g6k-rs, fplll, the 7.x guides) stores bases as rows, rewrite it with this table. Here is the column basis and the row basis of the same lattice.
| Quantity | Column convention | Row convention |
|---|---|---|
| Lattice point | , a column | , a row |
| Change of basis | (any unimodular on the left) | |
| Gram matrix | ||
| Volume, full rank | ||
| Volume, any rank | ||
| Dual basis | columns of | rows of |
| Kannan embedding of target | (2.2) | (7.4) |
| -th basis vector | column | row (index in g6k-rs) |
With the example basis, has columns and , and has the same two vectors as rows. Each has inner product 1 with its partner basis vector and 0 with the other.
Conventions we follow
- Vectors are plain lowercase letters, matrices plain uppercase letters; no bold, no arrows.
- Chapters 1–2 and the dual-lattice guide put basis vectors in columns; chapter 4.6 and the embedding guides put them in rows. Each page says which it uses.
- without a subscript is always the Euclidean norm.
- Indices in formulas start at 1; indices in Rust and Python code start at 0.
- of a matrix is signed; of a lattice is its positive volume.
Further reading
Gilbert Strang, Introduction to Linear Algebra, covers transposes, determinants and projections. Daniele Micciancio and Shafi Goldwasser, Complexity of Lattice Problems (Springer, 2002), chapter 1, fixes the lattice notation most papers follow (column convention). Both are cited from memory.