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 xx, vv or bib_i, not in bold and not with an arrow. Its entries are listed in parentheses: x=(x1,…,xn)x = (x_1, \dots, x_n).

SymbolRead asMeaning on this siteExampleUsed in
bib_i“b sub i”The ii-th basis vector. Indices start at 1 in the articles; g6k-rs code starts at 0.b1,…,bnb_1, \dots, b_n1.5, 4.1, 4.2, 2.2, 1.2
xix_i“x sub i”The ii-th entry (coordinate) of the vector xx.x=(3,−4)x = (3, -4) has x2=−4x_2 = -47.1, 1.6
eie_i“e sub i”The ii-th standard unit vector: 1 in position ii, 0 elsewhere. In LWE and CVP chapters ee without an index is an error vector instead.e2=(0,1,0)e_2 = (0, 1, 0)7.2, 7.5
00, 1\mathbf{1}“zero”, “the all-ones vector”The zero vector, and the vector with every entry equal to 1.A1A\mathbf{1} is the vector of row sums of AA7.5
Zn\mathbb{Z}^n, Rn\mathbb{R}^n“Z to the n”, “R to the n”All vectors with nn integer (or real) entries. Zn\mathbb{Z}^n is also the simplest lattice.(2,−1)∈Z2(2, -1) \in \mathbb{Z}^21.6, 1.2, 1.3, 2.4, 6.2

Rows or columns: the two basis conventions

A basis b1,…,bnb_1, \dots, b_n is stored as one matrix BB. You can put the basis vectors in its columns or in its rows, and the site does both:

ConventionBasis vectors areLatticeChange of basisUsed in
Columncolumns of BBΛ(B)={Bx:x∈Zn}\Lambda(B) = \{ Bx : x \in \mathbb{Z}^n \}B′=BUB' = BU1.x, 2.x, 6.1
Rowrows of BBL(B)={xB:x∈Zn}L(B) = \{ xB : x \in \mathbb{Z}^n \}B′=UBB' = UB7.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 xx 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 B=[b1∣b2∣⋯∣bn]B = [b_1 \mid b_2 \mid \cdots \mid b_n], where the bars separate columns.

Worked example

Take b1=(2,0)b_1 = (2, 0) and b2=(1,3)b_2 = (1, 3), and the coefficients x=(2,−1)x = (2, -1), so the lattice point is 2b1−b2=(3,−3)2b_1 - b_2 = (3, -3).

column: B=(2103),Bx=(2103)(2−1)=(3−3)\text{column: } B = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}, \quad Bx = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix} \begin{pmatrix} 2 \\ -1 \end{pmatrix} = \begin{pmatrix} 3 \\ -3 \end{pmatrix}row: B=(2013),xB=(2, −1)(2013)=(3, −3)\text{row: } B = \begin{pmatrix} 2 & 0 \\ 1 & 3 \end{pmatrix}, \quad xB = (2,\ -1) \begin{pmatrix} 2 & 0 \\ 1 & 3 \end{pmatrix} = (3,\ -3)

Same point, same determinant (det⁡B=6\det B = 6 either way), transposed matrix. When you copy a formula from one section into code for another, transpose BB first.

Matrices

SymbolRead asMeaning on this siteExampleUsed in
Zm×n\mathbb{Z}^{m \times n}“m by n integer matrices”Matrices with mm rows and nn columns and integer entries (Rm×n\mathbb{R}^{m \times n} for real entries). Rows come first.A∈Zk×nA \in \mathbb{Z}^{k \times n}: kk equations in nn unknowns1.2, 2.1, 2.2, 7.4, 7.5
A⊤A^\top“A transpose”Rows and columns swapped. On a vector, a⊤sa^\top s is the inner product of aa and ss. Some sources write ATA^T; same thing.(2103) ⁣⊤=(2013)\begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}^{\!\top} = \begin{pmatrix} 2 & 0 \\ 1 & 3 \end{pmatrix}3.1, 7.5, 2.3, 1.2, 6.1
A−1A^{-1}“A inverse”The matrix with AA−1=IAA^{-1} = I. For a polynomial, f−1 mod qf^{-1} \bmod q is its inverse in the ring (see 2.6).(2103)−1=16(3−102)\begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}^{-1} = \tfrac16 \begin{pmatrix} 3 & -1 \\ 0 & 2 \end{pmatrix}6.1, 1.2
B−⊤B^{-\top}“B inverse transpose”(B−1)⊤(B^{-1})^\top. Its columns (column convention) or rows (row convention) are a basis of the dual lattice.For the column basis above: 16(30−12)\tfrac16 \begin{pmatrix} 3 & 0 \\ -1 & 2 \end{pmatrix}6.1, 1.2
InI_n, II“the n by n identity”1 on the diagonal, 0 elsewhere. qIqI is qq on the diagonal.I2=(1001)I_2 = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}7.5, 2.6, 1.6
diag⁡(d1,…,dn)\operatorname{diag}(d_1, \dots, d_n)“diagonal matrix”The matrix with d1,…,dnd_1, \dots, d_n on the diagonal and zeros elsewhere.diag⁡(2,3)=(2003)\operatorname{diag}(2,3) = \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix}6.1
(IH0qI)\begin{pmatrix} I & H \\ 0 & qI \end{pmatrix}“block matrix”A matrix assembled from smaller matrices. 00 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.47.1, 7.5, 2.2, 2.6, 7.4
[ A∣B ][\,A \mid B\,]“A next to B”Matrices placed side by side (same number of rows). [b1∣⋯∣bn][b_1 \mid \cdots \mid b_n] lists the columns of a basis.[ In∣Na ][\,I_n \mid N a\,] in the kernel embedding1.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 x=(3,−4)x = (3, -4) and y=(1,2)y = (1, 2).

SymbolRead asMeaning on this siteExampleUsed in
⟨x,y⟩\langle x, y \rangle“inner product of x and y”∑ixiyi\sum_i x_i y_i. Also written x⊤yx^\top y; in 7.1 as a⋅xa \cdot x.⟨x,y⟩=3−8=−5\langle x, y \rangle = 3 - 8 = -52.2, 1.2, 6.1, 3.4, 7.1
⋅\cdot“times” or “dot”Usually ordinary multiplication (20.292⋅n2^{0.292 \cdot n}, N⋅271N \cdot 271). Between two vectors, as in a⋅xa \cdot x, it is the inner product.(1,2)⋅(3,−4)=−5(1,2) \cdot (3,-4) = -53.4, 1.3, 7.1, 1.5, 3.2
∥x∥\|x\|“norm of x”, “length of x”Euclidean length ⟨x,x⟩\sqrt{\langle x, x \rangle}, the same as ∥x∥2\|x\|_2. Lattice reduction minimises this norm.∥x∥=9+16=5\|x\| = \sqrt{9 + 16} = 57.4, 1.5, 2.2, 1.4, 3.3
∥x∥2\|x\|^2“norm of x squared”The squared length ∑ixi2\sum_i x_i^2. Algorithms and code work with it to avoid square roots; g6k-rs norm_sq returns it.∥x∥2=25\|x\|^2 = 251.4, 7.5, 7.4, 1.5, 1.2
∥x∥∞\|x\|_\infty“infinity norm”, “max norm”The largest absolute entry, max⁡i∣xi∣\max_i |x_i|. Signature schemes bound this norm (“every coefficient is small”).∥x∥∞=4\|x\|_\infty = 43.3, 2.5, 2.2, 2.4, 2.6
∥x∥1\|x\|_1“one norm”The sum of absolute entries, ∑i∣xi∣\sum_i |x_i|. For a 0/1 vector it counts the ones.∥x∥1=7\|x\|_1 = 73.3
ℓ2\ell_2, ℓ∞\ell_\infty“ell two”, “ell infinity”Names for the norm a problem is measured in, as in “SVP in the ℓ∞\ell_\infty norm”.—2.1, 2.2
∣xi∣|x_i|, max⁡i\max_i“absolute value”, “max over i”Absolute value of a number, and the largest value of an expression as ii varies.max⁡i∣xi∣=4\max_i |x_i| = 47.3, 7.1
∥t−v∥\|t - v\|“distance from t to v”Euclidean distance between two points.∥x−y∥=∥(2,−6)∥=40\|x - y\| = \|(2, -6)\| = \sqrt{40}2.2, SVP & CVP, 1.4
dist(t,Λ)\mathrm{dist}(t, \Lambda)“distance from t to the lattice”min⁡v∈Λ∥t−v∥\min_{v \in \Lambda} \|t - v\|: how far tt is from the closest lattice point.dist((0.4,0.3),Z2)=0.5\mathrm{dist}((0.4, 0.3), \mathbb{Z}^2) = 0.52.2

Determinants, span and change of basis

SymbolRead asMeaning on this siteExampleUsed in
det⁡(B)\det(B)“determinant of B”The signed determinant of a square matrix. Applied to a lattice, det⁡(Λ)\det(\Lambda) means its volume, which is always positive (see 8.3 Lattice notation).det⁡(2103)=6\det \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix} = 61.3, 1.4, 1.6, 1.2, 7.5
∣det⁡(B)∣|\det(B)|“absolute determinant”The volume of the parallelepiped spanned by the basis. Swapping two basis vectors flips the sign of det⁡B\det B but not this.∣det⁡(b2,b1)∣=∣−6∣=6|\det(b_2, b_1)| = |-6| = 61.2, 4.6, 1.4, 1.3, 6.2
det⁡(BB⊤)\sqrt{\det(BB^\top)}“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 det⁡(B⊤B)\sqrt{\det(B^\top B)}.rows (1,0,5),(0,1,3)(1,0,5), (0,1,3): 35\sqrt{35}7.1, 7.2
span(b1,…,bk)\mathrm{span}(b_1, \dots, b_k)“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.span((1,0))\mathrm{span}((1,0)) is the xx-axis4.2, 1.3
dim⁡\dim, 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 a⋅x=0a \cdot x = 0 in Z3\mathbb{Z}^3 have rank 21.3, 7.5, 7.1
UU, det⁡(U)=±1\det(U) = \pm 1“a unimodular matrix”An integer matrix with determinant ±1\pm 1, so its inverse is also an integer matrix. Multiplying a basis by UU gives another basis of the same lattice.U=(1101)U = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} replaces b2b_2 by b1+b2b_1 + b_21.2, 6.1
GLn(Z)\mathrm{GL}_n(\mathbb{Z})“G L n over Z”The set (group) of all n×nn \times n unimodular matrices.U∈GL2(Z)U \in \mathrm{GL}_2(\mathbb{Z})1.2

Gram matrices and projections

SymbolRead asMeaning on this siteExampleUsed in
G=B⊤BG = B^\top B“the Gram matrix”All pairwise inner products of the basis vectors: Gij=⟨bi,bj⟩G_{ij} = \langle b_i, b_j \rangle. With columns it is B⊤BB^\top B; with rows it is BB⊤BB^\top. The matrix is the same.for b1=(2,0)b_1 = (2,0), b2=(1,3)b_2 = (1,3): G=(42210)G = \begin{pmatrix} 4 & 2 \\ 2 & 10 \end{pmatrix}1.2, 1.4
πi(v)\pi_i(v)“pi i of v”Orthogonal projection of vv away from span(b1,…,bi−1)\mathrm{span}(b_1, \dots, b_{i-1}): keep only the part of vv perpendicular to the first i−1i-1 basis vectors. πi(Λ)\pi_i(\Lambda) is the projected lattice BKZ works in.π2((1,3))=(0,3)\pi_2((1,3)) = (0,3) when b1=(2,0)b_1 = (2,0)4.2, 4.4
b~i\tilde b_i“b i tilde”The ii-th Gram–Schmidt vector, πi(bi)\pi_i(b_i). Many papers write bi∗b_i^*; this site always uses the tilde.b~2=(0,3)\tilde b_2 = (0, 3) in the example2.2, 4.1, 1.5, 4.2, 1.2

The Gram–Schmidt coefficients μij\mu_{ij} and the quantities built from them are covered in 8.3 Lattice notation.

Same symbol, different meaning

SymbolMeaningWhere
star on a lattice, Λ∗\Lambda^*The dual lattice. Some papers write Λ∨\Lambda^\vee.6.1, 1.2, 4.4
star on a matrix, B∗B^*Conjugate transpose (adjoint), as in the Falcon Gram matrix G=BB∗G = BB^*3.6
star on a point, v∗v^*The closest lattice vector found by a CVP algorithm2.2
eeerror or noise vector (LWE, CVP); with an index, eie_i is a unit vector2.3, 7.4; 7.2
⊕\oplus, ⊗\otimeshomomorphic addition and multiplication of ciphertexts, not direct sum or tensor product3.2
GGGram 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 BcB_{\mathrm{c}} is the column basis and Br=Bc⊤B_{\mathrm{r}} = B_{\mathrm{c}}^\top the row basis of the same lattice.

QuantityColumn conventionRow convention
Lattice pointBc xB_{\mathrm{c}}\, x, xx a columnx Brx\, B_{\mathrm{r}}, xx a row
Change of basisBcUB_{\mathrm{c}} UU⊤BrU^\top B_{\mathrm{r}} (any unimodular UU on the left)
Gram matrixBc⊤BcB_{\mathrm{c}}^\top B_{\mathrm{c}}BrBr⊤B_{\mathrm{r}} B_{\mathrm{r}}^\top
Volume, full rank∣det⁡Bc∣|\det B_{\mathrm{c}}|∣det⁡Br∣|\det B_{\mathrm{r}}|
Volume, any rankdet⁡(Bc⊤Bc)\sqrt{\det(B_{\mathrm{c}}^\top B_{\mathrm{c}})}det⁡(BrBr⊤)\sqrt{\det(B_{\mathrm{r}} B_{\mathrm{r}}^\top)}
Dual basiscolumns of Bc−⊤B_{\mathrm{c}}^{-\top}rows of Br−⊤B_{\mathrm{r}}^{-\top}
Kannan embedding of target tt(Bct0M)\begin{pmatrix} B_{\mathrm{c}} & t \\ 0 & M \end{pmatrix} (2.2)(Br0tM)\begin{pmatrix} B_{\mathrm{r}} & 0 \\ t & M \end{pmatrix} (7.4)
ii-th basis vectorcolumn iirow ii (index i−1i-1 in g6k-rs)

With the example basis, Bc−⊤=16(30−12)B_{\mathrm{c}}^{-\top} = \tfrac16 \begin{pmatrix} 3 & 0 \\ -1 & 2 \end{pmatrix} has columns (1/2,−1/6)(1/2, -1/6) and (0,1/3)(0, 1/3), and Br−⊤B_{\mathrm{r}}^{-\top} 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

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.