OPENF4
Library for Gröebner basis computations over finite fields.
 All Classes Namespaces Files Functions Variables Friends Pages
Tutorial for prime finite fields with modulo < 2^32

There are three main ways to use the openf4 library (from the simplest to the most involved):

  1. In Sage (not yet available):
    1. R.<x0,x1,x2,x3,x4,x5> = Zmod(65521)[]
    2. I = sage.rings.ideal.Cyclic(R,6)
    3. I.groebner_basis('openf4')
  2. As a C++ library:
    1. Include the library header: libopenf4.h.
    2. Link with the library during the compilation: -lopenf4
    3. Use the function groebnerBasisF4(int64_t modulo, int nbVariable, std::vector<std::string> variableName, std::vector<std::string> polynomialList, int nbThread, int verbose);
    4. Look at the example tutorial-method2.cpp into the section example.
  3. As a template library:
    1. Include the header openf4.h.
    2. Create and configure the element type with your modulo:
      • If modulo < 2^8 use ElementPrime<int16_t>
      • If modulo < 2^16 use ElementPrime<int32_t>
      • If modulo < 2^32 use ElementPrime<int64_t>
    3. Configure the class monomial with the number of variables and an initial degree for the monomial precomputation.
    4. Create an ideal with a vector of polynomials and others informations: F4::Ideal::Ideal(std::vector<Polynomial<Element>> & polynomialArray, int nbVariable, int capacity, int degree);
    5. Call the method f4: F4::Ideal::f4();
    6. Compile with:
      • -std=c++11 to enable c++11 support
      • -DNDEBUG to disable assertion
      • -fopenmp to use parallelisation
      • -march=native to use vectorisation (if your system support SSE instructions).
      • -03 -funroll-loops -ftree-vectorize (for fast)
      • -Wall -Wno-strict-overflow to enable useful warning.
    7. Link with:
      • -lgmp for big number.
      • -lgmpxx for big number.
      • -lgivaro for prime field based on GMP.
      • -fopenmp to use parallelisation
      • -lopenblas (to use fflas-ffpack with OpenBlas) or -lcblas -latlas (to use fflas-ffpack with Atlas).
    8. Look at the example tutorial-method3.cpp into the section example.