Skip to content

Integer Lattices

An integer lattice is a finitely generated -submodule of a quadratic vector space over the rational numbers. Integer lattices are also known as quadratic forms over the integers. We will refer to them as -lattices.

A -lattice has the type ZLat. It is given in terms of its ambient quadratic space together with a basis matrix whose rows span , i.e. where is the (-module) rank of .

To access and see ambient_space(L::ZLat) and basis_matrix(L::ZLat).

Creation of integer lattices

From a gram matrix

# Zlattice — Method.

Zlattice([B::MatElem]; gram) -> ZLat

Return the Z-lattice with basis matrix inside the quadratic space with Gram matrix gram.

If the keyword gram is not specified, the Gram matrix is the identity matrix. If is not specified, the basis matrix is the identity matrix.

Examples

julia> L = Zlattice(matrix(QQ, 2, 2, [1//2, 0, 0, 2]));

julia> gram_matrix(L) == matrix(QQ, 2, 2, [1//4, 0, 0, 4])
true

julia> L = Zlattice(gram = matrix(ZZ, [2 -1; -1 2]));

julia> gram_matrix(L) == matrix(ZZ, [2 -1; -1 2])
true

source

In a quadratic space

# lattice — Method.

lattice(V::AbsSpace, basis::MatElem ; check::Bool = true) -> AbsLat

Given an ambient space V and a matrix basis, return the lattice spanned by the rows of basis inside V. If V is hermitian (resp. quadratic) then the output is a hermitian (resp. quadratic) lattice.

By default, basis is checked to be of full rank. This test can be disabled by setting check to false.

source

Special lattices

# root_lattice — Method.

root_lattice(R::Symbol, n::Int)

Return the root lattice of type R given by :A, :D or :E with parameter n.

source

# hyperbolic_plane_lattice — Method.

hyperbolic_plane_lattice(n::RationalUnion = 1)

Return the hyperbolic plane with intersection form of scale n, that is, the unique (up to isometry) even unimodular hyperbolic -lattice of rank 2, rescaled by n.

Examples

julia> L = hyperbolic_plane_lattice(6);

julia> gram_matrix(L)
[0   6]
[6   0]

julia> L = hyperbolic_plane_lattice(ZZ(-13));

julia> gram_matrix(L)
[  0   -13]
[-13     0]

source

# Zlattice — Method.

Zlattice(S::Symbol, n::RationalUnion = 1) -> Zlat

Given S = :H or S = :U, return a -lattice admitting as Gram matrix in some basis, where is the 2-by-2 matrix with 0's on the main diagonal and 1's elsewhere.

source

# leech_lattice — Function.

leech_lattice()

Return the Leech lattice.

source

leech_lattice(niemeier_lattice::ZLat) -> Leech, neighbor vector, index

Return a triple L, v, h where L is the Leech lattice.

L is an h-neighbor of the Niemeier lattice N with respect to v. This means that L / L ∩ N ≅ ℤ / h ℤ. Here h is the Coxeter number of the Niemeier lattice.

This implements the 23 holy constructions of the Leech lattice in J. H. Conway, N. J. A. Sloane (1999).

Examples

julia> R = Zlattice(gram=2 * identity_matrix(ZZ, 24));

julia> N = maximal_even_lattice(R) # Some Niemeier lattice
Quadratic lattice of rank 24 and degree 24 over the rationals

julia> minimum(N)
2

julia> det(N)
1

julia> L, v, h = leech_lattice(N);

julia> minimum(L)
4

julia> det(L)
1

julia> h == index(L, intersect(L, N))
true

We illustrate how the Leech lattice is constructed from N, h and v.

julia> Zmodh = ResidueRing(ZZ, h);

julia> V = ambient_space(N);

julia> vG = map_entries(x->Zmodh(ZZ(x)), inner_product(V, v, basis_matrix(N)));

julia> LN = transpose(lift(kernel(vG)[2]))*basis_matrix(N); # vectors whose inner product with `v` is divisible by `h`.

julia> lattice(V, LN) == intersect(L, N)
true

julia> gensL = vcat(LN, 1//h * v);

julia> lattice(V, gensL, isbasis=false) == L
true

source

From a genus

Integer lattices can be created as representatives of a genus. See (representative(L::ZGenus))

Rescaling the Quadratic Form

# rescale — Method.

rescale(L::ZLat, r::RationalUnion) -> ZLat

Return the lattice L in the quadratic space with form r \Phi.

Examples

This can be useful to apply methods intended for positive definite lattices.

julia> L = Zlattice(gram=ZZ[-1 0; 0 -1])
Quadratic lattice of rank 2 and degree 2 over the rationals

julia> shortest_vectors(rescale(L, -1))
2-element Vector{Vector{fmpz}}:
 [0, 1]
 [1, 0]

source

Attributes

# ambient_space — Method.

ambient_space(L::AbsLat) -> AbsSpace

Return the ambient space of the lattice L. If the ambient space is not known, an error is raised.

source

# basis_matrix — Method.

basis_matrix(L::ZLat)

Return the basis matrix of the integer lattice .

The lattice is given by the row span of seen inside of the ambient quadratic space of .

source

# gram_matrix — Method.

gram_matrix(L::ZLat) -> fmpq_mat

Return the gram matrix of .

Examples

julia> L = Zlattice(matrix(ZZ, [2 0; -1 2]));

julia> gram_matrix(L)
[ 4   -2]
[-2    5]

source

# rational_span — Method.

rational_span(L::ZLat) -> QuadSpace

Return the rational span of , which is the quadratic space with Gram matrix equal to gram_matrix(L).

Examples

julia> L = Zlattice(matrix(ZZ, [2 0; -1 2]));

julia> rational_span(L)
Quadratic space over
Rational Field
with Gram matrix
[4 -2; -2 5]

source

# base_ring — Method.

base_ring(M::PMat)

The PMat defines an -module for some maximal order . This function returns the that was used to defined .

source

base_ring(L::AbsLat) -> Ring

Return the order over which the lattice L is defined.

source

# base_field — Method.

base_field(E::EllCrv) -> Field

Return the base field over which E is defined.

source

base_field(C::HypellCrv) -> Field

Return the base field over which C is defined.

source

base_field(L::AbsLat) -> Field

Return the algebra over which the rational span of the lattice L is defined.

source

Invariants

# rank — Method.

rank(L::AbsLat) -> Int

Return the rank of the underlying module of the lattice L.

source

# det — Method.

det(L::ZLat) -> fmpq

Return the determinant of the gram matrix of L.

source

# scale — Method.

scale(L::ZLat) -> fmpq

Return the scale of L.

The scale of L is defined as the positive generator of the -ideal generated by .

source

# norm — Method.

norm(L::ZLat) -> fmpq

Return the norm of L.

The norm of L is defined as the positive generator of the - ideal generated by .

source

# iseven — Method.

iseven(L::ZLat) -> Bool

Return whether L is even.

An integer lattice L in the rational quadratic space is called even if for all .

source

# is_integral — Method.

is_integral(L::AbsLat) -> Bool

Return whether the lattice L is integral.

source

# is_primary_with_prime — Method.

is_primary_with_prime(L::ZLat) -> Bool, fmpz

Given a -lattice L, return whether L is primary, that is whether L is integral and its discriminant group (see discriminant_group) is a p-group for some prime number p. In case it is, p is also returned as second output.

Note that for unimodular lattices, this function returns (true, 1). If the lattice is not primary, the second return value is -1 by default.

source

# is_primary — Method.

is_primary(L::ZLat, p::Union{Integer, fmpz}) -> Bool

Given an integral -lattice L and a prime number p, return whether L is p-primary, that is whether its discriminant group (see discriminant_group) is a p-group.

source

# is_elementary_with_prime — Method.

is_elementary_with_prime(L::ZLat) -> Bool, fmpz

Given a -lattice L, return whether L is elementary, that is whether L is integral and its discriminant group (see discriminant_group) is an elemenentary p-group for some prime number p. In case it is, p is also returned as second output.

Note that for unimodular lattices, this function returns (true, 1). If the lattice is not elementary, the second return value is -1 by default.

source

# is_elementary — Method.

is_elementary(L::ZLat, p::Union{Integer, fmpz}) -> Bool

Given an integral -lattice L and a prime number p, return whether L is p-elementary, that is whether its discriminant group (see discriminant_group) is an elementary p-group.

source

The Genus

For an integral lattice The genus of an integer lattice collects its local invariants. genus(::ZLat)

# mass — Method.

mass(L::ZLat) -> fmpq

Return the mass of the genus of L.

source

# genus_representatives — Method.

genus_representatives(L::ZLat) -> Vector{ZLat}

Return representatives for the isometry classes in the genus of L.

source

Real invariants

# signature_tuple — Method.

signature_tuple(L::ZLat) -> Tuple{Int,Int,Int}

Return the number of (positive, zero, negative) inertia of L.

source

# is_positive_definite — Method.

is_positive_definite(L::AbsLat) -> Bool

Return whether the rational span of the lattice L is positive definite.

source

# is_negative_definite — Method.

is_negative_definite(L::AbsLat) -> Bool

Return whether the rational span of the lattice L is negative definite.

source

# is_definite — Method.

is_definite(L::AbsLat) -> Bool

Return whether the rational span of the lattice L is definite.

source

Isometries

# automorphism_group_generators — Method.

automorphism_group_generators(E::EllCrv) -> Vector{EllCrvIso}

Return generators of the automorphism group of .

source

automorphism_group_generators(L::AbsLat; ambient_representation::Bool = true)
                                                      -> Vector{MatElem}

Given a definite lattice L, return generators for the automorphism group of L. If ambient_representation == true (the default), the transformations are represented with respect to the ambient space of L. Otherwise, the transformations are represented with respect to the (pseudo-)basis of L.

source

# automorphism_group_order — Method.

automorphism_group_order(L::AbsLat) -> Int

Given a definite lattice L, return the order of the automorphism group of L.

source

# is_isometric — Method.

is_isometric(L::AbsLat, M::AbsLat) -> Bool

Return whether the lattices L and M are isometric.

source

# is_locally_isometric — Method.

is_locally_isometric(L::ZLat, M::ZLat, p::Int) -> Bool

Return whether L and M are isometric over the p-adic integers.

i.e. whether .

source

Root lattices

# root_lattice_recognition — Method.

root_lattice_recognition(L::ZLat)

Return the ADE type of the root sublattice of L.

Input:

L – a definite and integral -lattice.

Output:

Two lists, the first one conaining the ADE types and the second one the irreducible root sublattices.

For more recognizable gram matrices use root_lattice_recognition_fundamental.

Examples

julia> L = Zlattice(gram=ZZ[4  0 0  0 3  0 3  0;
                            0 16 8 12 2 12 6 10;
                            0  8 8  6 2  8 4  5;
                            0 12 6 10 2  9 5  8;
                            3  2 2  2 4  2 4  2;
                            0 12 8  9 2 12 6  9;
                            3  6 4  5 4  6 6  5;
                            0 10 5  8 2  9 5  8])
Quadratic lattice of rank 8 and degree 8 over the rationals

julia> R = root_lattice_recognition(L)
([(:A, 1), (:D, 6)], ZLat[Quadratic lattice of rank 1 and degree 8 over the rationals, Quadratic lattice of rank 6 and degree 8 over the rationals])

source

# root_lattice_recognition_fundamental — Method.

root_lattice_recognition_fundamental(L::ZLat)

Return the ADE type of the root sublattice of L as well as the corresponding irreducible root sublattices with basis given by a fundamental root system.

Input:

L – a definite and integral -lattice.

Output:

  • the root sublattice, with basis given by a fundamental root system
  • the ADE types
  • a Vector consisting of the irreducible root sublattices.

Examples

julia> L = Zlattice(gram=ZZ[4  0 0  0 3  0 3  0;
                            0 16 8 12 2 12 6 10;
                            0  8 8  6 2  8 4  5;
                            0 12 6 10 2  9 5  8;
                            3  2 2  2 4  2 4  2;
                            0 12 8  9 2 12 6  9;
                            3  6 4  5 4  6 6  5;
                            0 10 5  8 2  9 5  8])
Quadratic lattice of rank 8 and degree 8 over the rationals

julia> R = root_lattice_recognition_fundamental(L);

julia> gram_matrix(R[1])
[2    0    0    0    0    0    0]
[0    2    0   -1    0    0    0]
[0    0    2   -1    0    0    0]
[0   -1   -1    2   -1    0    0]
[0    0    0   -1    2   -1    0]
[0    0    0    0   -1    2   -1]
[0    0    0    0    0   -1    2]

source

# ADE_type — Method.

ADE_type(G::MatrixElem) -> Tuple{Symbol,Int64}

Return the type of the irreducible root lattice with gram matrix G.

See also root_lattice_recognition.

Examples

julia> Hecke.ADE_type(gram_matrix(root_lattice(:A,3)))
(:A, 3)

source

# coxeter_number — Method.

coxeter_number(ADE::Symbol, n)

Return the Coxeter number of the corresponding ADE root lattice.

If is a root lattice and its set of roots, then the Coxeter number is where n is the rank of .

julia> coxeter_number(:D, 4)
6

source

# highest_root — Method.

highest_root(ADE::Symbol, n) -> fmpz_mat

Return coordinates of the highest root of root_lattice(ADE, n).

julia> highest_root(:E, 6)
[1   2   3   2   1   2]

source

Module operations

Most module operations assume that the lattices live in the same ambient space. For instance only lattices in the same ambient space compare.

# == — Method.

Return true if both lattices have the same ambient quadratic space and the same underlying module.

source

# is_sublattice — Method.

is_sublattice(L::AbsLat, M::AbsLat) -> Bool

Return whether M is a sublattice of the lattice L.

source

# is_sublattice_with_relations — Method.

is_sublattice_with_relations(M::ZLat, N::ZLat) -> Bool, fmpq_mat

Returns whether is a sublattice of . In this case, the second return value is a matrix such that , where and are the basis matrices of and respectively.

source

# + — Method.

+(L::AbsLat, M::AbsLat) -> AbsLat

Return the sum of the lattices L and M.

The lattices L and M must have the same ambient space.

source

# * — Method.

*(a::RationalUnion, L::ZLat) -> ZLat

Returns the lattice inside the ambient space of .

source

# intersect — Method.

intersect(L::AbsLat, M::AbsLat) -> AbsLat

Return the intersection of the lattices L and M.

The lattices L and M must have the same ambient space.

source

# in — Method.

Base.in(v::Vector, L::ZLat) -> Bool

Return whether the vector v lies in the lattice L.

source

# in — Method.

Base.in(v::fmpq_mat, L::ZLat) -> Bool

Return whether the row span of v lies in the lattice L.

source

# primitive_closure — Method.

primitive_closure(M::ZLat, N::ZLat) -> ZLat

Given two -lattices M and N with , return the primitive closure of N in M.

Examples

julia> M = root_lattice(:D, 6);

julia> N = lattice_in_same_ambient_space(M, 3*basis_matrix(M)[1,:]);

julia> basis_matrix(N)
[3   0   0   0   0   0]

julia> N2 = primitive_closure(M, N)
Quadratic lattice of rank 1 and degree 6 over the rationals

julia> basis_matrix(N2)
[1   0   0   0   0   0]

julia> M2 = primitive_closure(dual(M), M);

julia> is_integral(M2)
false

source

# is_primitive — Method.

is_primitive(M::ZLat, N::ZLat) -> Bool

Given two -lattices , return whether N is a primitive sublattice of M.

Examples

julia> U = hyperbolic_plane_lattice(3);

julia> bU = basis_matrix(U);

julia> e1, e2 = bU[1,:], bU[2,:]
([1 0], [0 1])

julia> N = lattice_in_same_ambient_space(U, e1 + e2)
Quadratic lattice of rank 1 and degree 2 over the rationals

julia> is_primitive(U, N)
true

julia> M = root_lattice(:A, 3);

julia> f = matrix(QQ, 3, 3, [0 1 1; -1 -1 -1; 1 1 0]);

julia> N = kernel_lattice(M, f+1)
Quadratic lattice of rank 1 and degree 3 over the rationals

julia> is_primitive(M, N)
true

source

# is_primitive — Method.

is_primitive(L::ZLat, v::Union{Vector, fmpq_mat}) -> Bool

Return whether the vector v is primitive in L.

A vector v in a -lattice L is called primitive if for all w in L such that for some integer d, then .

source

# divisibility — Method.

divisibility(L::ZLat, v::Union{Vector, fmpq_mat}) -> fmpq

Return the divisibility of v with respect to L.

For a vector v in the ambient quadratic space of L, we call the divisibility of v with the respect to L the non-negative generator of the fractional -ideal .

source

Embeddings

Orthogonal sublattices

# orthogonal_sum — Method.

orthogonal_sum(L1::ZLat, L2::ZLat)

Return the orthogonal direct sum of the lattices L1 and L2.

It lives in the orthogonal direct sum of their ambient spaces.

source

# orthogonal_submodule — Method.

orthogonal_submodule(L::ZLat, S::ZLat) -> ZLat

Return the largest submodule of L orthogonal to S.

source

# direct_sum — Method.

direct_sum(x::Vararg{ZLat}) -> ZLat, Vector{AbsSpaceMor}, Vector{AbsSpaceMor}
direct_sum(x::Vector{ZLat}) -> ZLat, Vector{AbsSpaceMor}, Vector{AbsSpaceMor}

Given a collection of -lattices , return their complete direct sum , together with the injections and the projections (seen as maps between the corresponding ambient spaces).

source

# irreducible_components — Method.

irreducible_components(L::ZLat)

Return the irreducible components of the positive definite lattice .

This yields a maximal orthogonal splitting of L as

source

Dual lattice

# dual — Method.

dual(L::AbsLat) -> AbsLat

Return the dual lattice of the lattice L.

source

Discriminant group

See discriminant_group(L::ZLat).

Overlattices

# glue_map — Method.

glue_map(L::ZLat, S::ZLat, R::ZLat; check=true)
                       -> Tuple{TorQuadModMor, TorQuadModMor, TorQuadModMor}

Given three integral -lattices L, S and R, with S and R primitive sublattices of L and such that the sum of the ranks of S and R is equal to the rank of L, return the glue map of the primitive extension , as well as the inclusion maps of the domain and codomain of into the respective discriminant groups of S and R.

Example

julia> M = root_lattice(:E,8);

julia> f = matrix(QQ, 8, 8, [-1 -1  0  0  0  0  0  0;
                              1  0  0  0  0  0  0  0;
                              0  1  1  0  0  0  0  0;
                              0  0  0  1  0  0  0  0;
                              0  0  0  0  1  0  0  0;
                              0  0  0  0  0  1  1  0;
                             -2 -4 -6 -5 -4 -3 -2 -3;
                              0  0  0  0  0  0  0  1]);

julia> S = kernel_lattice(M ,f-1)
Quadratic lattice of rank 4 and degree 8 over the rationals

julia> R = kernel_lattice(M , f^2+f+1)
Quadratic lattice of rank 4 and degree 8 over the rationals

julia> glue, iS, iR = glue_map(M, S, R)
(Map with following data
Domain:
=======
TorQuadMod [4//3 0; 0 4//3]
Codomain:
=========
TorQuadMod [2//3 0; 0 2//3], Map with following data
Domain:
=======
TorQuadMod [4//3 0; 0 4//3]
Codomain:
=========
TorQuadMod [4//3 2//3; 2//3 2//3], Map with following data
Domain:
=======
TorQuadMod [2//3 0; 0 2//3]
Codomain:
=========
TorQuadMod [2//3 1//3; 1//3 4//3])

julia> is_bijective(glue)
true

source

# overlattice — Method.

overlattice(glue_map::TorQuadModMor) -> ZLat

Given the glue map of a primitive extension of -lattices , return L.

Example

julia> M = root_lattice(:E,8);

julia> f = matrix(QQ, 8, 8, [ 1  0  0  0  0  0  0  0;
                              0  1  0  0  0  0  0  0;
                              1  2  4  4  3  2  1  2;
                             -2 -4 -6 -5 -4 -3 -2 -3;
                              2  4  6  4  3  2  1  3;
                             -1 -2 -3 -2 -1  0  0 -2;
                              0  0  0  0  0 -1  0  0;
                             -1 -2 -3 -3 -2 -1  0 -1]);

julia> S = kernel_lattice(M ,f-1)
Quadratic lattice of rank 4 and degree 8 over the rationals

julia> R = kernel_lattice(M , f^4+f^3+f^2+f+1)
Quadratic lattice of rank 4 and degree 8 over the rationals

julia> glue, iS, iR = glue_map(M, S, R);

julia> overlattice(glue) == M
true

source

# local_modification — Method.

local_modification(M::ZLat, L::ZLat, p)

Return a local modification of M that matches L at p.

INPUT:

  • – a \mathbb{Z}_p-maximal lattice
  • – the a lattice isomorphic to M over \QQ_p
  • – a prime number

OUTPUT:

an integral lattice M' in the ambient space of M such that M and M' are locally equal at all completions except at p where M' is locally isometric to the lattice L.

source

# maximal_integral_lattice — Method.

maximal_integral_lattice(L::AbsLat) -> AbsLat

Given a lattice L, return a lattice M in the ambient space of L which is maximal integral and which contains L.

source

Sublattices defined by endomorphisms

# kernel_lattice — Method.

kernel_lattice(L::ZLat, f::MatElem;
               ambient_representation::Bool = true) -> ZLat

Given a -lattice and a matrix inducing an endomorphism of , return is a sublattice of .

If ambient_representation is true (the default), the endomorphism is represented with respect to the ambient space of . Otherwise, the endomorphism is represented with respect to the basis of .

source

<a id='invariant_lattice-Tuple{ZLat, Vector{<:MatElem}}' href='#invariant_lattice-Tuple{ZLat, Vector{<:MatElem}}'># invariant_lattice — Method.

invariant_lattice(L::ZLat, G::Vector{MatElem};
                  ambient_representation::Bool = true) -> ZLat

Given a -lattice and a list of matrices inducing endomorphisms of , return the lattice , consisting of elements fixed by .

If ambient_representation is true (the default), the endomorphism is represented with respect to the ambient space of . Otherwise, the endomorphism is represented with respect to the basis of .

source

Computing embeddings

# embed — Function.

embed(S::ZLat, G::Genus, primitive=true) -> Bool, embedding

Return a (primitive) embedding of the integral lattice S into some lattice in the genus of G.

julia> G = genera((8,0), 1, even=true)[1];

julia> L, S, i = embed(root_lattice(:A,5), G);

source

# embed_in_unimodular — Method.

embed_in_unimodular(S::ZLat, pos, neg, primitive=true, even=true) -> Bool, L, S', iS, iR

Return a (primitive) embedding of the integral lattice S into some (even) unimodular lattice of signature (pos, neg).

For now this works only for even lattices.

julia> NS = orthogonal_sum(Zlattice(:U), rescale(root_lattice(:A, 16), -1))[1];

julia> LK3, iNS, i = embed_in_unimodular(NS, 3, 19);

julia> genus(LK3)
ZGenus
Signature: (3, 19)
Genus symbol at 2:   1^22

julia> iNS
Quadratic lattice of rank 18 and degree 22 over the rationals

julia> is_primitive(LK3, iNS)
true

source

LLL, Short and Close Vectors

LLL and indefinite LLL

# lll — Method.

lll(L::ZLat, same_ambient::Bool = true) -> ZLat

Given an integral -lattice L with basis matrix B, compute a basis C of L such that the gram matrix of L with respect to C is LLL-reduced.

By default, it creates the lattice in the same ambient space as L. This can be disabled by setting same_ambient = false. Works with both definite and indefinite lattices.

source

Short Vectors

# short_vectors — Function.

short_vectors(L::ZLat, [lb = 0], ub, [elem_type = fmpz]; check::Bool = true)
                                   -> Vector{Tuple{Vector{elem_type}, fmpq}}

Returns all tuples (v, n) such that n = v G v^t satisfies lb <= n <= ub, where G is the Gram matrix of L and v is non-zero.

Note that the vectors are computed up to sign (so only one of v and -v appears).

It is assumed and checked that L is positive definite.

See also short_vectors_iterator for an iterator version.

source

# shortest_vectors — Function.

shortest_vectors(L::ZLat, [elem_type = fmpz]; check::Bool = true)
                                           -> fmpq, Vector{elem_type}, fmpq}

Returns the list of shortest non-zero vectors. Note that the vectors are computed up to sign (so only one of v and -v appears).

It is assumed and checked that L is positive definite.

See also minimum.

source

# short_vectors_iterator — Function.

short_vectors_iterator(L::ZLat, [lb = 0], ub,
                       [elem_type = fmpz]; check::Bool = true)
                                -> Tuple{Vector{elem_type}, fmpq} (iterator)

Returns an iterator for all tuples (v, n) such that n = v G v^t satisfies lb <= n <= ub, where G is the Gram matrix of L and v is non-zero.

Note that the vectors are computed up to sign (so only one of v and -v appears).

It is assumed and checked that L is positive definite.

See also short_vectors.

source

# minimum — Method.

minimum(L::ZLat)

Return the minimum squared length among the non-zero vectors in L.

source

# kissing_number — Method.

kissing_number(L::ZLat)

Return the Kissing number of the sphere packing defined by L.

This is the number of non-overlapping spheres touching any other given sphere.

source

Close Vectors

# close_vectors — Method.

close_vectors(L:ZLat, v:Vector, [lb,], ub; check::Bool = false)
                                        -> Vector{Tuple{Vector{Int}}, fmpq}

Return all tuples (x, d) where x is an element of L such that d = b(v - x, v - x) <= ub. If lb is provided, then also lb <= d.

If filter is not nothing, then only those x with filter(x) evaluating to true are returned.

By default, it will be checked whether L is positive definite. This can be disabled setting check = false.

Both input and output are with respect to the basis matrix of L.

Examples

julia> L = Zlattice(matrix(QQ, 2, 2, [1, 0, 0, 2]));

julia> close_vectors(L, [1, 1], 1)
3-element Vector{Tuple{Vector{fmpz}, fmpq}}:
 ([2, 1], 1)
 ([0, 1], 1)
 ([1, 1], 0)

julia> close_vectors(L, [1, 1], 1, 1)
2-element Vector{Tuple{Vector{fmpz}, fmpq}}:
 ([2, 1], 1)
 ([0, 1], 1)

source