"Source: Text/System/Par.text";
"Line: 740";
"Date: Thu Jul 13 10:19:10 2023";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/System/Par.text, line: 740
// Example: H5E6 ()
print "Example: H5E6";
ei := GetEchoInput();
SetEchoInput(true);
function RandomDenseSystem(K, n, m, d)
    P<[x]> := PolynomialRing(K, n, "grevlex");
    B := [
        &+[Random(K)*s: s in MonomialsOfDegree(P, k), k in [0 .. d]]:
            i in [1 .. m]
    ];
    sol := [Random(K): j in [1 .. n]];
    return [f - Evaluate(f, sol): f in B];
end function;
n := 27; B := RandomDenseSystem(GF(31), n, 2*n, 2);
// Single thread only
time G := GroebnerBasis(B, 6: Dense, PairsLimit := 5000);
G;
Variety(Ideal(G));
// 24 threads
SetNthreads(24);
time G := GroebnerBasis(B, 6: Dense, PairsLimit := 5000);
// GPU
SetNthreads(1); SetGPU(true);
time G := GroebnerBasis(B, 6: Dense, PairsLimit := 5000);
n := 32; B := RandomDenseSystem(GF(31), n, 2*n, 2);
// Single thread only
time G := GroebnerBasis(B, 6: Dense, PairsLimit := 10000);
Basis(I);
Variety(Ideal(G));
// 24 threads
SetNthreads(24);
I := Ideal(B); // Recreate ideal
time G := GroebnerBasis(B, 6: Dense, PairsLimit := 10000);
// GPU
SetNthreads(1); SetGPU(true);
I := Ideal(B); // Recreate ideal
time G := GroebnerBasis(B, 6: Dense, PairsLimit := 10000);
SetEchoInput(ei);
