Number Field Lattices

Contents

Creation of Number Field Lattices

A lattice L over a number field K is a torsion-free ZK-module contained in Kn, together with an inner product having image in K. Note that the inner product is not required to be positive definite. Here n is the degree (of the vector space), and the rank of the module is referred to as the rank or dimension of the lattice.

Every such lattice admits a pseudobasis, which is an independent sequence of vectors vec bi and a sequence of nonzero fractional ideals Ji such that every element in L can be written as ∑i aivec bi where ai∈Ji. A simple lattice is one for which all the Ji=(1), and lattices over principal ideal domains are always free (and can be made simple by rescaling).

A number field lattice in Magma is specified by providing: a sequence of vectors; an optional sequence of fractional ideals; and an optional inner product, which can be given either on Kn or as Gram matrix on the given vectors.

The Handbook chapter Modules over Dedekind Domains (Section MODULES OVER DEDEKIND DOMAINS), is closely related and functionality exists for passing to and from such modules and number field lattices.

NumberFieldLattice(K, d) : FldNum, RngIntElt -> LatNF
    Gram: Mtrx                          Default: IdentityMatrix(K,d)
Given a number field K and a degree d, create the standard lattice (with the identity as the basis). The Gram vararg (which must be invertible) can be used to specify the inner product on the basis vectors.
NumberFieldLattice(S) : [ModTupFldElt] -> LatNF
    InnerProduct: Mtrx                  Default: 0
    Gram: Mtrx                          Default: 0
    Ideals: SeqEnum                     Default: []
    Independent: BoolElt                Default: false
Given a sequence of vectors S over a number field, return the number field lattice determined by them. The inner product matrix on the ambient space may be given, or alternatively a Gram matrix on the given vectors (a check is made if this is consistent if the vectors are dependent). In either case, the pseudoGram matrix on the resulting pseudobasis must be invertible. If neither is given, the trivial (identity) inner product is assumed. The vectors can be dependent, unless the Independent vararg is set to true.

The sequence of ideals can be used to specify a non-simple lattice, as indicated in the Introduction above.

Note that Magma attempts to retain the given basis vectors (unless they are dependent), and does not apply reduction (either echelonisation or LLL-reduction), as such algorithms may not be available.

NumberFieldLattice(D) : ModDed -> LatNF
Given a Dedekind module D over a number field, return the associated number field lattice, obtained by taking the PseudoMatrix containing its pseudobasis and fractional ideals. The module must not have a denominator (essentially meaning that it was not created by a quotient construction), so that it will be torsion-free. If the resulting lattice is free, it will be written in simple form.
NumberFieldLatticeWithGram(F) : Mtrx -> LatNF
Given a regular, symmetric matrix F over some number field K, create the free standard lattice (with the identity matrix as basis matrix) and Gram matrix F.
Module(L) : LatNF -> ModDed
    IP: BoolElt                         Default: true
The number field lattice L is turned into a Dedekind module, by taking as a pseudomatrix the lattice pseudobasis and the coefficient ideals. This requires the ambient inner product to be known, unless the IP vararg is false (when the resulting module has the trivial inner product on the ambient).
sub<L | RHS> : LatNF, Any -> LatNF, Map
Construct the sublattice S of a number field lattice L generated by RHS. The right hand side can consist of (sets, sequences, tuples and lists of) number field lattices, Dedekind modules or elements thereof; provided the elements (or their generators) can be coerced into L. The function also returns the inclusion map from S to L.
ext<L | RHS> : LatNF, Any -> LatNF, Map
Construct the lattice E generated by the number field lattice L and RHS. The right hand side can consist of (sets, sequences, tuples and lists of) number field lattices, Dedekind modules or elements thereof; provided the elements (or their generators) can be coerced into the embedding space of L. The function also returns the inclusion map from L to X.
A + B : LatNF, LatNF -> LatNF
Given two number field lattices A and B of the same degree over the same base ring, determine their join. If the pseudobasis vectors for A and B are independent, then the new lattice will have this union for its pseudobasis. The lattices must have the same inner product on the ambient space, and it must be known unless the K-span of either A and B contains the other (when the pseudoGram matrices are checked for consistency).
A meet B : LatNF, LatNF -> LatNF
Given two number field lattices A and B having the same degree over the same base ring, determine their intersection. The lattices must have the same inner product (if known) on the ambient space. If one lattice is contained in the other, then it will be returned in its original form.
r * L : RngElt, LatNF -> LatNF
L * r : Lat NF, LatNF -> LatNF
L / r : Lat NF, LatNF -> LatNF
BasisScaling(L, r) : LatNF, RngElt -> LatNF
Given a number field lattice L and a nonzero scalar r coercible into the number field, return the lattice obtained by multiplying (or dividing) the basis vectors by the scalar.
InnerProductScaling(L, r) : LatNF, RngElt -> LatNF
Given a number field lattice L and a nonzero scalar coercible r into the number field, return the lattice obtained by multiplying the inner product matrix (or Gram matrix if not available) by the scalar.
J * L : RngOrdFracIdl, LatNF -> LatNF
L * J: LatNF, RngOrdFracIdl -> LatNF
L / J: LatNF, RngOrdFracIdl -> LatNF
Given a number field lattice L and a nonzero fractional ideal J, return the number field lattice obtained by multiplying/dividing all the coefficient ideals by the given ideal.
T * L : Mtrx, LatNF -> LatNF
Given an invertible transformation matrix T of the same dimension as the given number field lattice L, return the lattice obtained by the given basis transformation. In other words, return the lattice {∑i ai T vec bi : ai∈Ji}. Note that T does not need to be integral.
TJ * L : PMat, LatNF -> LatNF
Given a pseudomatrix TJ with invertible transformation matrix T and nonzero coefficient ideals J, return the number field lattice obtained from number field lattice L by applying T to L`s pseudobasis and multiplying the coefficient ideals Ii of L accordingly. In other words the new lattice is {∑i ai T vec bi : ai∈IiJi}. Note that T does not need to be integral.
L * T : LatNF, Mtrx -> LatNF
Given an invertible transformation matrix T of the same degree as the given number field lattice L, return the lattice obtained by the given basis transformation on the ambient space. If the transformation does not map the pseudobasis span onto itself, the lattice must have an ambient inner product. Note that T does not need to be integral.
DirectSum(A, B) : LatNF, LatNF -> LatNF
Given two number field lattices A and B over the same base ring, determine their direct sum. The underlying basis vectors are retained. Also available on a nonempty sequence.
OrthogonalComplement(L, v) : LatNF, LatNFElt -> LatNF
OrthogonalComplement(L, S) : LatNF, LatNF -> LatNF
Given two number field lattices S⊂L, or a vector v in a lattice L, determine the orthogonal complement.
Dual(L) : LatNF -> LatNF
Given a number field lattice L, return its dual, given by the pseudobasis G - 1B where B and G are the pseudobasis and pseudoGram matrix for L, with coefficient ideals Ji - 1 for all i. The resulting pseudoGram matrix will be G - 1, while the inner product (if known) is preserved.
SimpleLattice(L) : LatNF -> LatNF
Given a number field lattice L all of whose coefficient ideals are principal, return the lattice obtained by multiplying the basis vectors by generators. Alternatively, if the lattice is free but not already in principal form, compute the SteinitzForm of the Dedekind module to get principal coefficient ideals, and then proceed as above. There will always be an ambiguity with choosing generators of the principal ideals.
MaximalSublattices(L, p) : LatNF, RngOrdIdl -> [LatNF], [RngIntElt]
MinimalSuperlattices(L, p) : LatNF, RngOrdIdl -> [LatNF], [RngIntElt]
    Limit: RngIntElt                    Default: Infinity()
    AutoOrbits: BoolElt                 Default: false
    CallBack: BoolElt                   Default: false
Given a number field lattice L and a prime ideal p, compute all sublattices (superlattices) of L of index p.

If Limit is set to some integer, the enumeration stops once Limit lattices have been found.

AutoOrbits can be set to a subgroup G of the automorphism group of L. Then only orbit representatives of the action under G are returned. A second return value then lists the sizes of the orbits. If L is totally positive definite, one can also set AutoOrbits to true. In this case G is taken to be the full automorphism group of L. Note that the function does not check whether G is a subgroup of the automorphism group of L.

The optional argument CallBack can be set to a function f which takes two arguments X and S and returns two booleans k and c. For each sub-/superlattice S, the above intrinsics then call f with the list X of the previously found lattices and the lattice S. If k is true, the lattice S is kept, i.e. appended to X. If c is true, the intrinsics continue, otherwise the enumeration stops immediately. (Note that the enumeration still stops once the list X contains Limit lattices.)

MaximalIntegralLattice(Q) : Mtrx -> LatNF
Given a non-degenerate symmetric matrix, the function returns a lattice L with inner product matrix Q such that the norm of L is integral and L is maximal with respect to this property.
MaximalIntegralLattice(L) : LatNF -> LatNF
MaximalIntegralLattice(L, p) : LatNF, RngOrdIdl -> LatNF
Given a number field lattice L with integral norm, compute some maximal overlattice M of L having integral norm.

If a prime ideal p is given, then the resulting lattice M agrees with L at all places different from p and Mp is maximal integral.

Example LatNF_creation-examples (H32E1)

We give some examples of lattice creation.
> K<s5> := NumberField(Polynomial([-5,0,1])); // Q(sqrt(5))
> L1 := NumberFieldLattice(K,3);
> G := Matrix(3,3,[K | 1,2,3, 2,s5,-1, 3,-1,0]);
> L2 := NumberFieldLattice(K,3 : Gram:=G); // with Gram matrix
> v1 := L1![1,2,3];
> v2 := L1![K.1,-1,2];
> L3 := NumberFieldLattice([Vector(v1),Vector(v2)]); // on vectors
> L4 := sub<L1|[v1,v2]>; // on LatNFElt's, same as L3
> M := Module(L3); // create the Dedekind module
> L5 := NumberFieldLattice(M); // and back to the NF lattice
> D := Dual(L3);
> L6 := D+L3;
> S := L3/K.1; // scaling
> L7 := S meet D; L7;
Number field lattice over Number Field with defining polynomial x^2 - 5
over the Rational Field with basis matrix
[-3*s5 + 2         7         0]
[  -s5 + 1         3         1]
> T3 := Matrix(3,3,[K | 1,2,3, 4,5,6, K.1,-1,-2]);
> L8 := L7*T3; // transform is same degree, operate on right
> T2 := Matrix(2,2,[K | 1,2, K.1,-1]);
> L9 := T2*L7; // lattice is 2-dim, operate on left (pseudobasis)
> assert Dimension(L9) eq 2 and Degree(L9) eq 3;
> DS := DirectSum(L2,L9); // 5-dimensional
> assert Dimension(DS) eq 3+2;
> O1 := OrthogonalComplement(L1,L3);
> O2 := OrthogonalComplement(L1,v1);
> O1;
Number field lattice over Number Field with defining polynomial x^2 - 5
over the Rational Field with basis matrix
[  1/2*(7*s5 + 7)    1/2*(s5 + 13) 1/2*(-3*s5 - 11)]
> O2;
Number field lattice over Number Field with defining polynomial x^2 - 5
over the Rational Field with basis matrix
[       -s5 - 1   1/2*(s5 + 1)              0]
[1/2*(3*s5 + 3)              0  1/2*(-s5 - 1)]

Attributes of Number Field Lattices

Basis(L) : LatNF -> [ModTupFldElt]
BasisMatrix(L) : LatNF -> Mtrx
Given the simple number field lattice L, return the basis, either as a sequence of vectors, or as a row matrix.
LocalBasis(L, p) : LatNF, RngOrdIdl -> [ModTupFldElt]
    Type: MonStgElt                     Default: ""
Returns a basis of a free lattice F in the quadratic space generated by L such that F agrees with L at the completion at p. If Type is specified, it must either be "Submodule" or "Supermodule". In which case F is either a sub- or supermodule of L.
PseudoBasis(L) : LatNF -> [ModTupFldElt]
PseudoBasisMatrix(L) : LatNF -> Mtrx
Given the number field lattice L, return the basis of its pseudobasis, either as a sequence of vectors, or as a row matrix.
PseudoMatrix(L) : LatNF -> PMat
Given the number field lattice L, return the pseudomatrix of its coefficient ideals and pseudobasis.
CoefficientIdeals(L) : LatNF -> SeqEnum
Given the number field lattice L, return its coefficient ideals.
Generators(L) : LatNF -> SeqEnum
GeneratorMatrix(L) : LatNF -> Mtrx
Given the number field lattice L, return a sequence of generators. If the lattice is simple, these are just the standard basis vectors.
InnerProductMatrix(L) : LatNF -> Mtrx
Given the number field lattice L, return its inner product matrix. An error occurs if this is not known (for instance, when the Gram matrix was prescribed instead).
MakeAmbientInnerProduct(~L, IP) : LatNF ->
Given the number field lattice L having no ambient inner product, attach the given matrix IP as the inner product matrix for L. The matrix IP is checked to be consistent with the given pseudobasis and pseudoGram matrices.
GramMatrix(L) : LatNF -> Mtrx
Given a simple number field lattice L, return its Gram matrix.
PseudoGramMatrix(L) : LatNF -> Mtrx
Given a number field lattice L, return the Gram matrix of its pseudobasis.
Rank(L) : LatNF -> RngIntElt
Dimension(L) : LatNF -> RngIntElt
The rank (or dimension) of the number field lattice L.
Degree(L) : LatNF -> RngIntElt
The degree (that is, dimension of the underlying ambient space) of the number field lattice L.
BaseRing(L) : LatNF -> FldNum
The number field over which the number field lattice L is defined.
Determinant(L) : LatNF -> FldNumElt
The determinant of the Gram matrix of the simple number field lattice L. The determinant is well-defined up to squares of units on free lattices by first applying SimpleLattice if necessary.
Discriminant(L) : LatNF -> RngOrdFracIdl
Volume(L) : LatNF -> RngOrdFracIdl
The volume of the number field lattice L, which is the ideal generated by the determinants of all free sublattices. It is defined by (det)(G)∏i Ji2 where G is the pseudoGram matrix.
Norm(L) : LatNF -> RngOrdFracIdl
The norm of the lattice L, which is the ideal generated by the norms of all lattice elements. It equals ∑i, j ηijGijJiJj where G is the pseudoGram matrix, and ηij is 1 if i=j and 2 otherwise.
Scale(L) : LatNF -> RngOrdFracIdl
The scale of the lattice L, which is the ideal generated by the inner products of pairs of lattice elements. It equals ∑i, j GijJiJj, where G is the pseudoGram matrix.
BadPrimes(L) : LatNF -> Set
    Even: BoolElt                       Default: false
The set of all maximal ideals of the base ring of L at which L is not unimodular. If Even is set, then the primes over 2 are included.
JordanDecomposition(L, p) : LatNF, RndOrdIdl -> List, List, SeqEnum
Given a number field lattice L over some field K and a prime ideal of ZK, a Jordan decomposition of Lp is an orthogonal decomposition of Lp into modular sublattices L1, ..., Lr such that the p-adic valuations of the scales of these sublattices are strictly increasing.

The first return value is a list of matrices B1, ..., Br over K. The row spans of these lattices over ZKp yield a Jordan decomposition of Lp. The second and third return value list the Gram matrices and the p-adic valuations of the scales of the Jordan blocks respectively.

MaximalNormSplitting(L, p) : LatNF, RngOrdIdl -> SeqEnum, List
A maximal norm splitting of a number field lattice L at some prime ideal p is an orthogonal decomposition of Lp into unary and binary sublattices L1, ..., Lr such that (scale)(Li) ⊇(scale)(Li + 1), (norm)(Li) ⊇(norm)(Li + 1) and (norm)(Li^#) ⊆(norm)(Li + 1^#) for all 1 ≤i < r. Here Li^# denotes the dual of Li.
GoodBasisOfNormGenerators(L, p) : LatNF, RngOrdIdl -> SeqEnum, SeqEnum
Let L be a number field lattice and let p be some prime ideal. A basis of norm generators is a tuple of vectors (x1, ..., xn) such that the norm of x1 generates the norm of Lp and (x2, ..., xn) is a basis of norm generators for L ∩< x >perp. It is called good if the p-adic valuation of (xi, xi) is no larger then the valuation of (xi + 2, xi + 2) for all 1 ≤i ≤r - 2. Note that a basis of norm generators does not need to generate Lp but only a proper sublattice.

The function returns such a good basis of norm generators lying in KL as well as the norms of the basis vectors.

GenusSymbol(L, p) : LatNF, RngOrdIdl -> SeqEnum, Any
    Uniformizer: RngElt                 Default: 
Let L1, ..., Lr be a Jordan decomposition of Lp.

Suppose first p does not divide 2. The Genus symbol of Lp is a sequence of triples < ri, si, di> where ri and si are the rank and the p-adic valuation of the scale of Li. Further, di is true if and only if det( π - si Li) is a square in Kp * for some uniformizer π ∈K of p. The genus symbol only depends on the genus of L and π. Hence the function returns π as a second argument. One can also specify which uniformizer to choose with the optional argument Uniformizer.

If p divides 2, the functions returns the fundamental invariants of Lp, see [O'M73, IX.93]. It is a sequence of quadruples < ri, si, wi, ai> where ri and si are as before. Further, wi and ai denote the p-adic valuation of the weight and a norm generator of L'i = L1 perp ... perp Li respectively. Note that in this case, the genus symbol does not only depend on the genus of L, but also on the chosen Jordan decomposition. Hence the function returns the sequence of Gram matrices for the lattices Li as a second argument.

HasseInvariant(L, p) : LatNF, RngOrdIdl -> RngIntElt
    AmbientSpace: BoolElt               Default: false
Computes the Hasse invariant of the quadratic space V generated by L at the maximal ideal p. It is defined as a product of Hilbert symbols ∏i<j (ai, aj)p where (a1, ..., an) denotes some orthogonal basis of V.

If AmbientSpace is set, the function takes V to be the ambient space of the lattice L, which might have a larger rank than L.

WittInvariant(L, p) : LatNF, RngOrdIdl -> RngIntElt
    AmbientSpace: BoolElt               Default: false
Let V be the quadratic space generated by L (or its ambient space if AmbientSpace is set). If the rank of V is odd (even) let C be the (even part of) the Clifford algebra of V. Then C is a tensor product of quaternion algebras over Kp and thus central simple. The Witt invariant of Lp is defined to be +1 is C is split and -1 otherwise.
SpinorNorm(L, p) : LatNF, RngOrdIdl -> ModTupFld, Map, BoolElt
Let L be a definite number field lattice and let p be some prime ideal. The quotient Kp * / (K * )2 is a vector space V over (GF)(2). Let g : V to Kp * / (K * )2 be an isomorphism of abelian groups. Let W be the subspace of V corresponding to the elements in Kp * / (K * )2 that are spinor norms of proper isometries of Lp. The intrinsic returns W, g as well as a boolean that is true if and only if W corresponds to the subgroup Op * (Kp * )2/ (Kp * )2. Note that the full space V can be recovered as Domain(g). The algorithm uses the results of M. Kneser [Kne57] and C. Beli [Bel03].
Mass(L) : LatNF -> FldRatElt
Mass(L) : Lat -> FldRatElt
LocalFactor(L, p) : LatNF, RngOrdIdl -> FldRatElt
Let L be a definite number field lattice of rank m over some totally real number field K of degree n. Then the genus of L decomposes into finitely many isometry classes, represented by L1, ..., Lh say. The mass of L is defined to be (Mass)(L) = ∑i=1h (1 /# (Aut)(Li) ) . By Siegel's celebrated mass formula [Sie35], the mass can be expressed as (Mass)(L) = 2^(-n ⌊(m /2) ⌋) ∏i=1^(⌊(m - 1 /2) ⌋) ζK(1 - 2i) .L(χ, 1 - m/2) .∏p λp(L) where the product runs over all maximal ideals p of the ring of integers of K. Here ζK denotes the usual Dedekind zeta function of K and L(χ, x) is only present if m is even, and in this case it is the L-series corresponding to χ. If the discriminant d = ( - 1)m/2 det(V) is a square, let χ=1. In all other cases, χ is the non-trivial character of (Gal)(K(Sqrt(d))/K).

The above functions return the mass of L and the local factor λp(L) respectively. The local factors are known in many but not all cases, for example:

For odd prime ideals p, see W.T. Gan, J.K. Yu [GY00].

For unramified even prime ideals p, see S. Cho [Cho15].

If Lp is maximal, see G. Shimura [Shi99] or W.T. Gan, J. Hanke, J.K. Yu [GHY01].

For modular lattices, see M. Kirschmer [Kir16].

If none of the above results is applicable, a slow brute force search will be used to work out the local factors at the even prime ideals.

Neighbours(L, p) : LatNF, RngOrdIdl -> [LatNF], [RngIntElt]
    Limit: RngIntElt                    Default: Infinity()
    AutoOrbits: BoolElt                 Default: false
    CallBack: BoolElt                   Default: false
Given a number field lattice L and some prime ideal p such that Lp is modular, compute the p-neighbours of L i.e. the set of lattices M in the space generated by L such that L ∩M has index p in both, M and L.

The automorphism group of L acts on L. If L is definite and AutoOrbits is set to true, the algorithm will only return orbit representatives of this action and the second return value gives the lengths of these orbits.

If Limit is set to some positive integer, the algorithm stops once it has found that many neighbours.

The optional argument CallBack can be set to a function f which takes two arguments (X, N) and returns two booleans (k, c). For each neighbour (or orbit representative) N the intrinsic encounters, it calls f with the list X of the previously found lattices and the lattice N. If k is true, the lattice N is kept, i.e. appended to X. If c is true, the intrinsic continues, otherwise the enumeration stops immediately. (Note that the enumeration still stops once the list X contains Limit lattices.)

IteratedNeighbours(L, p) : LatNF, RngOrdIdl -> [LatNF]
    Limit: RngIntElt                    Default: Infinity()
    UseAuto: BoolElt                    Default: true
Computes a system of representatives of the isometry classes of all lattices that can be reached from a definite number field lattice L by repeatedly applying the p-neighbour construction. The lattice Lp must be modular.

If UseAuto is set, the algorithm will make use of the automorphism groups of the lattices it encounters.

If Limit is set to some positive integer, the algorithm stops once it has found that many isometry classes.

GenusRepresentatives(L) : LatNF -> [LatNF]
    Limit: RngIntElt                    Default: Infinity()
    UseAuto: BoolElt                    Default: true
Returns a sequence fo representatives of the isometry classes in the genus of the number field lattice L. The lattice L is supposed to have rank at least 3. If Limit is set to some integer, the algorithm stops once it has enumerated that many lattices. In the definite case, the algorithm will make use of the automorphism groups of the representatives, unless UseAuto is set to false.

The algorithm consists of two steps:

1.
Enumerate all isometry classes in the spinor genus of L. For indefinite lattices, this step becomes void since spinor genus and isometry classes coincide thanks to Strong Approximation. In the definite case, iterated neighbours are computed at some suitable small prime ideal.

2.
Enumerate the spinor genera in the genus of L. This step is well understood in theory, see for example [O'M73, X.102]. Using a computationally more accessible variation of this description [Lor16], [Kir16], the algorithm then chooses several neighbours that are known to switch spinor genera.

Example LatNF_attr-examples (H32E2)

Here are examples of getting attributes of number field lattices.
> K := NumberField(Polynomial([5,0,1])); // Q(sqrt(-5))
> O := Integers(K);
> p2 := Factorization(2*O)[1][1]; // nonprincipal
> Js := [(2*O)/p2,2*O];
> v1 := Vector([K!1,0,0]);
> v2 := Vector([K!0,K.1,0]);
> L1 := NumberFieldLattice([v1,v2] : Ideals:=Js);
> assert not IsFree(L1); // not free
> assert not IsSimple(L1); // and not simple
> PseudoBasisMatrix(L1); // BasisMatrix does not work
[  1   0   0]
[  0 K.1   0]
> PseudoGramMatrix(L1);
[ 1  0]
[ 0 -5]
> CoefficientIdeals(L1);
[ Ideal of O Basis: [1 1]
                    [0 2],
  Principal Ideal of O, Generator: [2, 0] ]
> Generators(L1); // three of these, though L1 has dimension 2
[
    ( -3*$.1 - 7 -2*$.1 + 50           0),
    (  44*$.1 + 1100 1770*$.1 - 4130               0),
    ( 176*$.1 + 1628 2242*$.1 - 7080               0)
]
> assert #$1 eq 3 and Dimension(L1) eq 2;
> assert Degree(L1) eq 3 and Rank(L1) eq 2;
> assert BaseRing(L1) eq K;
> Discriminant(L1); // same as Volume
Principal Ideal Generator: [-40, 0]
> Norm(K.1*L1);
Principal Ideal of O, Generator: [10, 0]
> // now we take the direct sum of L1 with itself
> // which is free, and thus we can use other intrinsics
> D := DirectSum([L1,L1]);
> assert IsFree(D); // D itself is not in simple form
> Determinant(D); // works, as D is free
1600
> S := SimpleLattice(D);
> BasisMatrix(S); // works, while for D would not
[-3*K.1 - 5 -4*K.1 + 20 0 0 0 0]
[12*K.1 - 84 -100*K.1 - 20 0 5*K.1 - 1 0 0]
[-72*K.1 + 54 100*K.1 + 370 0 -7*K.1 - 17 -8*K.1 + 50 0]
[1080*K.1 - 864 -1560*K.1 - 5520 0 108*K.1 + 252 114*K.1 - 760 0]
> assert #Generators(S) eq 4; // same as the basis vectors

Predicates on Number Field Lattices

IsSimple(L) : LatNF -> BoolElt
Returns true when all the coefficient ideals of number field lattice L are trivial.
IsFree(L) : LatNF -> BoolElt
Returns true if the number field lattice L is free. Freeness is determined by determining whether the Steinitz class of the associated Dedekind module is principal.
IsZero(L) : LatNF -> BoolElt
Checks if the rank of L is 0.
IsTotallyPositiveDefinite(L) : LatNF -> BoolElt
Returns true if the number field lattice L is totally positive definite (which necessarily includes the base ring being totally real).
IsDefinite(L) : LatNF -> BoolElt, RngOrdElt
Returns true if the number field lattice L is definite and if so, and element a such that rescaling the inner produrct with a yields a totally positive definite lattice.
A eq B : LatNF, LatNF -> BoolElt
A ne B : LatNF, LatNF -> BoolElt
Return true (false) if the two number field lattices A and B are equal (not equal). Two number field lattices are said to be equal if they have the same degree, have compatible inner products and/or pseudoGram matrices, and are subsets of each other.
IsIdentical(A, B) : LatNF, LatNF -> BoolElt
Return true if the two number field lattices A and B are identical. Two number field lattices are said to be identical if they have the same degree, rank, basis matrix, Gram matrix, and inner product matrix if given.
IsSublattice(S, L) : LatNF, LatNF -> BoolElt, Mtrx
S subset L : LatNF, LatNF -> BoolElt
Given two lattices S and L of the same degree over the same number field and with the same ambient inner product (if given), determine whether the first is a sublattice of the second.
IsMaximal(L) : LatNF -> BoolElt, LatNF
IsMaximal(L, p): LatNF -> BoolElt, LatNF
Decide if L or Lp is maximal, i.e. no overlattice has the same norm. If not, a proper overlattice with the same norm is returned.
IsMaximalIntegral(L) : LatNF -> BoolElt, LatNF
IsMaximalIntegral(L, p): LatNF -> BoolElt, LatNF
Decide (1) if the norm of L or Lp is integral and (2) if the lattice is maximal. If condition (1) holds but (2) does not, then a proper overlattice with integral norm is also returned.
IsModular(L) : LatNF -> BoolElt, RngOrdFracIdl
Determine whether the Dual of the lattice L is a scaling of the original, and if so, return the scaling factor.
IsModular(L, p) : LatNF, RngOrdIdl -> BoolElt, RngIntElt
Determine if Lp is modular, i.e. the dual of Lp is equal to a scaling of Lp. If so, the valuation of the scaling factor is also returned.
IsIsotropic(L, p) : LatNF, RngOrdIdl -> BoolElt nosigIsIsotropic(L, p) : LatNF, PlcNumElt -> BoolElt
    AmbientSpace: BoolElt               Default: false
Checks if the completion of L (or its ambient space) at p is isotropic.
IsLocallyIsometric(L1, L2, p) : LatNF, LatNF, RngOrdIdl -> BoolElt
    CheckIsometricSpaces: BoolElt       Default: true
Check if the p-adic completions of L1 and L2 are isometric. The function first checks if the lattices generate isometric quadratic spaces. If this is already known to be the case one can suppress this check by setting CheckIsometricSpaces to false.
IsSameGenus(L1, L2) : LatNF, LatNF -> BoolElt
Check if the number field lattices L1 and L2 lie in the same genus, i.e. they are isometric locally everyhwere.
IsRationallyEquivalent(L1, L2, p) : LatNF, LatNF, RngOrdIdl -> BoolElt
IsRationallyEquivalent(L1, L2, p) : LatNF, LatNF, PlcNumElt -> BoolElt
    AmbientSpace: BoolElt               Default: false
Given two lattices over some number field K, check if the quadratic space generated by the lattices are isometric over the completion Kp.

If AmbientSpace is set, the function compares the ambient spaces of the lattices instead.

IsRationallyEquivalent(L1, L2) : LatNF, LatNF -> BoolElt
    AmbientSpace: BoolElt               Default: false
Given two lattices over some number field K, check if the quadratic space generated by the lattices are isometric.

If AmbientSpace is set, the function compares the ambient spaces of the lattices instead.

Totally Positive Definite Lattices

There is some additional functionality for totally positive definite lattices (which are necessarily over totally real fields).

AutomorphismGroup(L) : LatNF -> GrpMat
    NaturalAction: BoolElt              Default: false
    Check: BoolElt                      Default: true
Given a number field lattice L, determine its automorphism group (returned a matrix group which stabilizes the Gram matrix). This relies on vector enumeration and can be expensive to compute.

If the NaturalAction vararg is set, then the automorphisms returned act on the ambient space. Otherwise they act on the pseudobasis. When the rank is less than the degree, the pseudobasis will be artificially extended to full rank, and the automorphisms will fix each vector in the extended part.

If Check is true, then Magma checks that each automorphism group generator maps L to itself. The Rank must be positive unless NaturalAction is true, in which case the Degree of the lattice must be nonzero.

IsIsometric(A, B) : LatNF, LatNF -> BoolElt, Mtrx
    NaturalAction: BoolElt              Default: false
Given two totally positive definite number field lattices A and B over the same (totally real) number field, determine if they are isometric. If so, also return a transformation matrix on pseudobases, unless NaturalAction is set, in which case the transformation is on the ambient. This function can be costly to evaluate, as it relies on vector enumeration.
IsSimilar(A, B) : LatNF, LatNF -> BoolElt, Mtrx, FldNumElt
    NaturalAction: BoolElt              Default: false
Given two definite number field lattices A and B over the same (totally real) number field, determine if they are similar. If so, the function also returns a transformation T and a scalar a such that T induces an isometry betweem A and InnerProductScaling(B, a). As in the previous intrinsic, NaturalAction decides if T is with respect to the pseudobases of A and B or the standard bases of the ambient spaces.
Sphere(L, e) : LatNF, RngElt -> Setq
    Negatives: BoolElt                  Default: true
Given a definite number field lattice L and a field element e, determine the set of vectors having that norm. Unless Negatives is false, the returned set contains both an element and its negation.

Examples of these are given in the final section of this chapter.

IsRepresented(L::LatNF, e) : LatNF, RngElt -> BoolElt, LatNFElt
Given a definite number field lattice L and a field element e, determine if there is a vector in L of norm e. If so, such a vector is returned as a second return value.
V2.28, 13 July 2023