OPENF4
Library for Gröebner basis computations over finite fields.
 All Classes Namespaces Files Functions Variables Friends Pages
Tutorial for GF(2^n) finite fields with n<64

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

  1. In Sage (not yet available):
    1. F.<t>=GF(2)[]
    2. K.<t>=GF(2^31, name='t', modulus=t^31+t^3+1)
    3. R.<x0,x1,x2,x3,x4,x5> = K[]
    4. I = ideal((t+t^3)*x0+(t+t^3)*x1+(t+t^3)*x2+(t+t^3)*x3+(t+t^3)*x4+(t+t^3)*x5, (t+t^3)*x0*x1+(t+t^3)*x1*x2+(t+t^3)*x2*x3+(t+t^3)*x3*x4+(t+t^3)*x0*x5+(t+t^3)*x4*x5, (t+t^3)*x0*x1*x2+(t+t^3)*x1*x2*x3+(t+t^3)*x2*x3*x4+(t+t^3)*x0*x1*x5+(t+t^3)*x0*x4*x5+(t+t^3)*x3*x4*x5, (t+t^3)*x0*x1*x2*x3+(t+t^3)*x1*x2*x3*x4+(t+t^3)*x0*x1*x2*x5+(t+t^3)*x0*x1*x4*x5+(t+t^3)*x0*x3*x4*x5+(t+t^3)*x2*x3*x4*x5, (t+t^3)*x0*x1*x2*x3*x4+(t+t^3)*x0*x1*x2*x3*x5+(t+t^3)*x0*x1*x2*x4*x5+(t+t^3)*x0*x1*x3*x4*x5+(t+t^3)*x0*x2*x3*x4*x5+(t+t^3)*x1*x2*x3*x4*x5, (t+t^3)*x0*x1*x2*x3*x4*x5-1)
    5. 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 groebnerBasisGF2ExtensionF4(std::string modulo, int nbVariable, std::vector<std::string> variableName, std::string polyVarName, std::vector<std::string> polynomialList, int nbThread, int verbose);
    4. Look at the example tutorial-gf2-extension-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 degree < 16 use ElementGF2Extension<uint16_t>
      • If degree < 32 use ElementGF2Extension<uint32_t>
      • If degree < 64 use ElementGF2Extension<uint64_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:
      • -fopenmp to use parallelisation
    8. Look at the example tutorial-gf2-extension-method3.cpp into the section example.