Solving systems of polynomial equations with the Gröbner basis algorithm can often be very time consuming because, in general, the algorithm has exponential run-time. These systems, which often come from concrete applications, frequently have symmetries which are not taken advantage of by the algorithm. However, it often happens in this case that the polynomials which occur during the Gröbner calculations are reducible. Since FriCAS has an excellent polynomial factorization algorithm, it is very natural to combine the Gröbner and factorization algorithms.
GroebnerFactorizationPackage exports the groebnerFactorizegroebnerFactorizeGroebnerFactorizationPackage operation which implements a modified Gröbner basis algorithm. In this algorithm, each polynomial that is to be put into the partial list of the basis is first factored. The remaining calculation is split into as many parts as there are irreducible factors. Call these factors p1,…,pn. In the branches corresponding to p2,…,pn, the factor p1 can be divided out, and so on. This package also contains operations that allow you to specify the polynomials that are not zero on the common roots of the final Gröbner basis.
Here is an example from chemistry. In a theoretical model of cyclohexane, C6H12, the six carbon atoms each sit in the center of gravity of a tetrahedron that has two hydrogen atoms and two carbon atoms at its corners. We first normalize and set the length of each edge to 1. Hence, the distances of one fixed carbon atom to each of its immediate neighbours is 1. We will denote the distances to the other three carbon atoms by x, y and z.
A. Dress developed a theory to decide whether a set of points and distances between them can be realized in an n-dimensional space. Here, of course, we have n=3.
mfzn : SQMATRIX(6,DMP([x,y,z],Fraction INT)) := [ [0,1,1,1,1,1],
[1,0,1,8/3,x,8/3], [1,1,0,1,8/3,y], [1,8/3,1,0,1,8/3], [1,x,8/3,1,0,1], [1,8/3,y,8/3,1,0] ]
Type: SquareMatrix(6,DistributedMultivariatePolynomial([x,y,z],Fraction Integer))
For cyclohexane the distances have to satisfy this equation.
eq := determinant mfzn
Type: DistributedMultivariatePolynomial([x,y,z],Fraction Integer)
They also must satisfy the equations given by cyclic shifts of the indeterminates.
groebnerFactorize [eq, eval(eq, [x,y,z], [y,z,x]), eval(eq, [x,y,z],
Type: List List DistributedMultivariatePolynomial([x,y,z],Fraction Integer)
The union of the solutions of this list is the solution of our original problem. If we impose positivity conditions, we get two relevant ideals. One ideal is zero-dimensional, namely x=y=z=11/3, and this determines the boat form of cyclohexane. The other ideal is one-dimensional, which means that we have a solution space given by one parameter. This gives the chair form of cyclohexane. The parameter describes the angle of the back of the chair.
groebnerFactorizegroebnerFactorizeGroebnerFactorizationPackage has an optional Boolean-valued second argument. When it is true partial results are displayed, since it may happen that the calculation does not terminate in a reasonable time. See the source code for GroebnerFactorizationPackage in groebf.input for more details about the algorithms used.