LatNet Builder Manual  2.0.1-11
Software Package for Constructing Highly Uniform Point Sets
Lattice Types and Definitions

LatBuilder supports two types of lattices: ordinary lattices and polynomial lattices.

One has also the choice between simple (unilevel) lattices and embedded (multilevel) lattices. The first choice corresponds to the LatticeType enumeration and the second to the EmbeddingType enumeration. These two enumerations are used across all the library as non-type template parameters to implement different policies accordingly with the type of lattices.

Their representation in LatBuilder differs by the type of their size parameter. The SizeParam class accounts for this differences. A lattice of either type can be defined by its size parameter(s), together with its dimension \(s\) and the components of its generating vector \(\boldsymbol a = (a_1, \dots, a_s)\). The LatDef class can be used for this purpose, as in tutorial/LatDef.cc.

The following function calls some members of LatDef:

template <LatticeType LA, EmbeddingType L>
void printLatDef(const LatDef<LA, L>& def)
{
std::cout << "dimension: " << def.dimension() << std::endl;
std::cout << "size parameter: " << def.sizeParam() << std::endl;
std::cout << "generating vector: " << def.gen() << std::endl;
std::cout << "definition: " << std::endl << def << std::endl;
}

The following examples show how to use LatDef to construct the different lattice types and print some basic information about the constructed lattices:

  • simple ordinary lattice: A simple ordinary lattice can be instantiated by passing to the LatDef constructor a size parameter, here \(n=31\), and a generating vector, here \(\boldsymbol a = (1,12,3)\):

    auto ordinary = createLatDef(SizeParam<LatticeType::ORDINARY, EmbeddingType::UNILEVEL>(31), {1, 12, 3});
    std::cout << "ordinary - simple lattice:" << std::endl;
    printLatDef(ordinary);

    This outputs:

    ordinary - simple lattice:
    dimension:         3
    size parameter:    31
    generating vector: [1, 12, 3]
    definition:        
    Ordinary Lattice - Modulus = 31 - Generating vector = [1, 12, 3]
    
  • embedded ordinary lattice:

    Embedded ordinary lattices with \(n=b^\ell\) for \(\ell=0,\dots,m\) can be instantiated by passing the LatDef constructor a size parameter \((b,m)\), here \((b,m)=(2,5)\), and a generating vector, here \(\boldsymbol a = (1,7,9)\):

    auto embedded = createLatDef(SizeParam<LatticeType::ORDINARY, EmbeddingType::MULTILEVEL>(2, 5), {1, 7, 9});
    std::cout << "ordinary - embedded lattice:" << std::endl;
    printLatDef(embedded);

    This outputs:

    ordinary - embedded lattice:
    dimension:         3
    size parameter:    2^5
    generating vector: [1, 7, 9]
    definition:        
    Ordinary Lattice - Modulus = 2^5 - Generating vector = [1, 7, 9]
    
  • simple polynomial lattice:

    Simple polynomial lattices can be instantiated by passing the LatDef constructor a size parameter, here \(P = 1 + z^2 + z^3\), and a generating vector, here \(\boldsymbol q = (1,1+z^2,1+z)\):

    Polynomial P = PolynomialFromInt(13); // P = 1 + z^2 + z^3
    auto pordinary = createLatDef(
    SizeParam<LatticeType::POLYNOMIAL, EmbeddingType::UNILEVEL>(P),
    );
    std::cout << "polynomial - simple lattice:" << std::endl;
    printLatDef(pordinary);

    This outputs:

    polynomial - simple lattice:
    dimension:         3
    size parameter:    [1 0 1 1]
    generating vector: [[1], [1 0 1], [1 1]]
    definition:        
    Polynomial Lattice - Modulus = [1 0 1 1] - Generating vector = 
      1
      1 0 1
      1 1
    
  • embedded polynomial lattice:

    Embedded polynomial lattices with \(P=b^\ell\) for \(\ell=0,\dots,m\) can be instantiated by passing the LatDef constructor a size parameter \((b,m)\), here \((b,m)=(z,5)\), and a generating vector, here \(\boldsymbol q = (1,z+z^3,1+z)\):

    auto pembedded = createLatDef(
    SizeParam<LatticeType::POLYNOMIAL, EmbeddingType::MULTILEVEL>(PolynomialFromInt(2), 5),
    );
    std::cout << "polynomial - embedded lattice:" << std::endl;
    printLatDef(pembedded);

    This outputs:

    polynomial - embedded lattice:
    dimension:         3
    size parameter:    [0 1]^5
    generating vector: [[1], [0 1 0 1], [1 1]]
    definition:        
    Polynomial Lattice - Modulus = [0 1]^5 - Generating vector = 
      1
      0 1 0 1
      1 1
    
See also
EmbeddingType LatDef