Lattices can be created in elementary ways whereby the basis matrix or a generating matrix and possibly also the inner product matrix are specified. Magma also provides functions for creating lattices from linear codes or algebraic number fields and for creating some special lattices.
This subsection describes the elementary ways of creating lattices by supplying the basis or the Gram matrix.
There are two ways of specifying the basis of a lattice at creation. First, a generating matrix can be specified whose rows need not be independent; the matrix is reduced to LLL-reduced form and zero rows are removed to yield a basis matrix. Secondly, a basis matrix (with independent rows) can be specified; this matrix is used for the basis matrix without any changes being made to it. As well as the basis, a particular inner product can also be specified by a symmetric positive definite matrix. By default (when a particular inner product matrix is not given), the inner product is taken to be the standard Euclidean product.
Instead of giving the basis one can also define a lattice by its Gram matrix F which prescribes the inner products of the basis vectors. The basis is taken to be the standard basis and the inner product matrix is taken as F so that the Gram matrix for the lattice is also F.
CheckPositive: BoolElt Default: true
Construct the lattice L specified by the given generating matrix and with inner product given by the n x n matrix M. The generating matrix can be specified by an r x n matrix X, an integer n with a sequence Q of ring elements of length rn (interpreted as a r x n matrix), or an R-space S of dimension r and degree n. In each case, the generating matrix need not have independent rows (though it always will in the R-space case). The matrix is reduced to LLL-reduced form and zero rows are removed to yield a basis matrix B of rank m (so m <= r). The lattice L is then constructed to have rank m, degree n, basis matrix B and inner product matrix M. By default Magma checks that M is positive definite but by setting CheckPositive := false this check will be suppressed. (Unpredictable behaviour will follow if unchecked incorrect input is given.)
Construct the lattice L specified by the given generating matrix and with standard Euclidean inner product. The generating matrix can be specified by an r x n matrix X, an integer n with a sequence Q of ring elements of length rn (interpreted as a r x n matrix), or an R-space S of dimension r and degree n. In each case, the generating matrix need not have independent rows (though it always will in the R-space case). The matrix is reduced to LLL-reduced form and zero rows are removed to yield a basis matrix B of rank m (so m <= r). The lattice L is then constructed to have rank m, degree n, basis matrix B and standard Euclidean inner product.
CheckIndependent: BoolElt Default: true
CheckPositive: BoolElt Default: true
Construct the lattice L with the specified m x n basis matrix and with inner product given by the n x n matrix M. The basis matrix B can be specified by an m x n matrix B, an integer n with a sequence Q of ring elements of length mn (interpreted as an m x n matrix B), or an R-space S of dimension m and degree n (whose basis matrix is taken to be B). The rows of B must be independent (i.e., form a basis). The lattice L is then constructed to have rank m, degree n, basis matrix B and inner product matrix M. (Note that the basis matrix B is not reduced to LLL-reduced form as in the Lattice function.) By default Magma checks that the rows of the matrix B specifying the basis are independent but by setting CheckIndependent := false this check will be suppressed. By default Magma also checks that M is positive definite but by setting CheckPositive := false this check will be suppressed. (Unpredictable behaviour will follow if unchecked incorrect input is given.)
CheckIndependent: BoolElt Default: true
Construct the lattice L with the specified m x n basis matrix and with standard Euclidean inner product. The basis matrix B can be specified by an m x n matrix B, an integer n with a sequence Q of ring elements of length mn (interpreted as an m x n matrix B), or an R-space S of dimension m and degree n (whose basis matrix is taken to be B). The rows of B must be independent (i.e., form a basis). The lattice L is then constructed to have rank m, degree n, basis matrix B and standard Euclidean product. (Note that the basis matrix B is not reduced to LLL-reduced form as in the Lattice function.) By default Magma checks that the rows of the matrix B specifying the basis are independent but by setting CheckIndependent := false this check will be suppressed. (Unpredictable behaviour will follow if unchecked incorrect input is given.)
CheckPositive: BoolElt Default: true
Construct a lattice with the given Gram matrix. The Gram matrix F can be specified as a symmetric n x n matrix F, or an integer n and a sequence Q of ring elements of length n^2 or n + 1 choose 2. In the latter case, a sequence of length n^2 is regarded as an n x n matrix and a sequence of length n + 1 choose 2 as a lower triangular matrix determining a symmetric matrix F.This function constructs the lattice L of degree n having the standard basis and inner product matrix F, therefore having Gram matrix F as well. By default Magma checks that F is positive definite but by setting CheckPositive := false this check will be suppressed. (Unpredictable behaviour will follow if unchecked incorrect input is given.)
Create the standard lattice Z^n with standard Euclidean inner product.
Constructs the lattice with the same Gram matrix as L, but with basis equal to the canonical basis of the free module of Rank(L) over the base ring of L. The identification of basis elements thus determines an isometry of lattices.
Constructs the coordinate lattice with Gram matrix equal to that of L scaled by the integer or rational n. The identification of basis elements thus determines an similitude of lattices.
> B := RMatrixSpace(IntegerRing(), 2, 3) ! [1,2,3, 3,2,1]; > B; [1 2 3] [3 2 1] > L1 := Lattice(B); > L1; Lattice of rank 2 and degree 3 Basis: ( 2 0 -2) ( 1 2 3) > L2 := Lattice(3, [1,2,3, 3,2,1]); > L2 eq L1; true > L3 := LatticeWithBasis(B); > L3; Lattice of rank 2 and degree 3 Basis: (1 2 3) (3 2 1) > L4 := LatticeWithBasis(3, [1,2,3, 3,2,1]); > L4 eq L3, L1 eq L3; true trueWe next create a 3 x 3 positive definite matrix M and create the lattice L with basis the same as above but also with inner product matrix M. We note the Gram matrix of the lattice which equals BMB^(tr) where B is the basis matrix.
> B := RMatrixSpace(IntegerRing(), 2, 3) ! [1,2,3, 3,2,1]; > M := MatrixRing(IntegerRing(), 3) ! [3,-1,1, -1,3,1, 1,1,3]; > M; [ 3 -1 1] [-1 3 1] [ 1 1 3] > IsPositiveDefinite(M); true > L := LatticeWithBasis(B, M); > L; Lattice of rank 2 and degree 3 Basis: (1 2 3) (3 2 1) Inner Product Matrix: [ 3 -1 1] [-1 3 1] [ 1 1 3] > GramMatrix(L); [56 40] [40 40]Finally, we create a lattice C with the same Gram matrix as the last lattice, but with standard basis. To do this we use the LatticeWithGram function. This lattice C is the coordinate lattice of L: it has the same Gram matrix as L but is not compatible with L since its inner product matrix is different to that of L.
> F := MatrixRing(IntegerRing(), 2) ! [56,40, 40,40]; > C := LatticeWithGram(F); > C; Standard Lattice of rank 2 and degree 2 Inner Product Matrix: [56 40] [40 40] > GramMatrix(C); [56 40] [40 40] > C eq CoordinateLattice(L); true > GramMatrix(C) eq GramMatrix(L); true
> C eq L; Runtime error in 'eq': Arguments are not compatible
This subsection presents some standard constructions (known as constructions `A' and `B') to obtain lattices from linear codes. In some cases the structural invariants of these lattices (e.g., minimum and kissing number, hence the centre density) can be deduced from invariants of the codes; in general one still gets estimates for the invariants of the lattices.
Let C be a linear code of length n over a prime field K := GF(p). Construct the lattice L subseteq Z^n which is the full preimage of C under the natural epimorphism from Z^n onto K^n.
Let C be a linear code of length n over a prime field K := GF(p) such that all code words have coordinate sum 0. Construct the lattice L subseteq Z^n which consists of all vectors reducing modulo p to a code word in C and whose coordinate sum is 0 modulo p^2. The inner product matrix is set to the appropriate scalar matrix so that the Gram matrix is integral and primitive (its entries are coprime).
> C := ReedMullerCode(1, 4); > C: Minimal; [16, 5, 8] Reed-Muller Code (r = 1, m = 4) over GF(2) > L := Lattice(C, "B"); > L; Lattice of rank 16 and degree 16 Basis: (1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1) (0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1) (0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1) (0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 2) (0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1) (0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 2) (0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 2) (0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 2) (0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1) (0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 2) (0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 2) (0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 2) (0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 2) (0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 2) (0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2) (0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4) Inner Product denominator: 2
Let K be an algebraic number field of degree n over Q. Then K has n embeddings into the complex numbers, denoted by sigma_1, ..., sigma_n. By convention the first s of these are embeddings into the real numbers and the last 2t are pairs of complex embeddings such that sigma_(s + t + i) = /line(sigma_(s + i)) for 1 <= i <= t. The T_2-norm K -> R: alpha |-> sum_(i=1)^n |sigma_i(alpha)|^2 defines a positive definite norm on K in which an order or ideal is a positive definite lattice. We restrict to the r real embeddings and the first s complex embeddings to obtain an embedding of a rank n order or ideal R^s x C^s = R^n. By rescaling the complex coordinates by Sqrt(2), we recover the T_2-norm of the element as its Euclidean norm under the embedding in R^n. This embedding, given by
alpha |-> ( sigma_1(alpha), ..., sigma_s(alpha), Sqrt(2) ( Re)( sigma_(s + 1)(alpha) ), Sqrt(2) ( Im)( sigma_(s + 1)(alpha) ), ..., Sqrt(2) ( Im)( sigma_(s + t)(alpha) ) ),
is called the Minkowski map on K.
Given an order O in a number field of degree n, create the lattice L in R^n generated by the images of the basis of O under the Minkowski map, followed by the isomorphism O -> L.
Given an ideal I of an order O in a number field of degree n, create the lattice in R^n generated by the images of the basis of I under the Minkowski map, followed by the isomorphism O -> L.
Construct the real inner product space V defined with respect to the inner product matrix of the T_2-norm on the number field K, followed by the Minkowski map K -> V.
> P<x> := PolynomialRing(Integers());
> R := EquationOrder(NumberField(x^3-15));
> w := R![0,1,0];
> L, f := MinkowskiLattice(R);
> L;
Lattice of rank 3 and degree 3 over Real Field
Basis:
(1.00000000000000000000000000000000000000000000000000000000
1.41421356237309504880168872420969807856967187537700000000 0.E-57)
(2.46621207433047010149161132315458904273548448662799999999
-1.74387528160321720079629694215855485415010470144700000000
3.02048058980025565688335869988153194870973205405200000000)
(6.08220199557340018489844499773780241987767071050999999999
-4.30076627561630297914843739811833631417036498439600000001
-7.44914570084621027635727295139129854849076360057700000001)
> B := Basis(R);
> f(B[2]);
(2.46621207433047010149161132315458904273548448662799999999
-1.74387528160321720079629694215855485415010470144700000000
3.02048058980025565688335869988153194870973205405200000000)
Similarly, we create the lattice defined by the ideal generated by
w^2 + 1, and verify the that the T_2-norm, given by Length
on the number field, agrees with the norm of the lattice image.
> I := ideal< R | w^2+1 >; > L, f := Lattice(I); > [ Length(B[k]) : k in [1..3] ]; [ 113.979543344871154567122509541956506923096801898278999999, 693.246605986720200554695334993213407259633012131571999999, 4216.46589035691627937357288301497314034052453149271199999 ] > [ Norm(f(B[k])) : k in [1..3] ]; [ 113.979543344871154567122509541956506923096801898274193556, 693.246605986720200554695334993213407259633012131555440665, 4216.46589035691627937357288301497314034052453149273498706 ]
This subsection presents functions to construct some special lattices, namely root lattices, laminated lattices and Kappa-lattices.
A much wider variety of lattices can be found in a database provided by G. Nebe and N.J.A. Sloane at the web-site [NS01a]. These lattices can easily be made accessible to Magma by a conversion script also available at this web-site. The database currently contains (at least):
Given a family name X as a string which is one of "A", "B", "C", "D", "E", "F", "G", "Kappa" or "Lambda", together with an integer n, construct a lattice subject to the following specifications:[Next][Prev] [Right] [Left] [Up] [Index] [Root]To avoid irrational entries, each lattice is presented with inner product matrix taken to be the identity matrix divided by a suitable scale factor so that the Gram matrix is integral and primitive (its entries are coprime).
- The root lattice A_n which is the zero-sum lattice in Q^(n + 1).
- n >= 2: The root lattice B_n which is the standard lattice of dimension n.
- n >= 3: The root lattice C_n which is the even sublattice of Z^n and is equal to D_n.
- n >= 3: The root lattice D_n which is the even sublattice of Z^n, also called the checkerboard lattice.
- 6 <= n <= 8: The root lattice E_n, also called Gosset lattice.
- n = 4: The root lattice F_4 which is equal to D_4.
- n = 2: The root lattice G_2 which is equal to A_2.
- 1 <= n <= 13: The Kappa-lattice K_n. For n = 12 this is the Coxeter-Todd lattice.
- 1 <= n <= 31: The laminated lattice Lambda_n. For n = 16 this is the Barnes-Wall lattice, for n = 24 the Leech lattice.