Application of Groebner Bases
Problem
Let
Find a m and n (depending on the coefficients of p and q)
such that for the transformaton
it holds
Setup of the problem
fricas
---- Ordered variable lists.
Poly_to_Gauss:=[d,n,m]
Type: List(OrderedVariableList
?([d,
n,
m]))
fricas
Gauss_to_Poly:=[x,y,a,b,c]
Type: List(OrderedVariableList
?([x,
y,
a,
b,
c]))
fricas
----coefficient arrays.
corg := d* matrix [[c,b,a]]
Type: Matrix(Polynomial(Integer))
fricas
---- Explicit target
cgauss := matrix [[0, 1, -1]]
Type: Matrix(Integer)
fricas
---- Generalized target
ctar := matrix [[w,v,u]]
Type: Matrix(Polynomial(Integer))
fricas
---- polynomial basis arrays.
xorg := matrix ([[1, x, x^2]])
Type: Matrix(Polynomial(Integer))
fricas
xgauss := matrix([[1,y,y^2]])
Type: Matrix(Polynomial(Integer))
fricas
---- Example
row(corg * transpose(xorg),1)
Type: Vector(Polynomial(Integer))
fricas
---- Translation matrix Pascal Pa(n) for 3x3 case
---- see Aceto below for references.
Pa(n) == matrix [[1,0,0],[n,1,0],[n^2, 2*n,1]]
Type: Void
fricas
---- Scalar matrix
Sc(m) == diagonalMatrix [1,m,m^2]
Type: Void
fricas
---- Now define transform in matrix form
D := corg -(cgauss * Pa(n) * Sc(m))
fricas
Compiling function Pa with type Variable(n) -> Matrix(Polynomial(
Integer))
fricas
Compiling function Sc with type Variable(m) -> Matrix(Polynomial(
Integer))
Type: Matrix(Polynomial(Integer))
fricas
---- Now we do a more realistic solve in two steps
---- Step one disallow silly answers
E:=groebnerFactorize(row(D,1),[b*d,m,a,b^2-3*a*c],true)
we found a groebner basis and check whether it
contains reducible polynomials
[1]
factorGroebnerBasis: no reducible polynomials in this basis
we found a groebner basis and check whether it
contains reducible polynomials
2
[n - n + c d, 2m n - m + b d, 2b d n + (- 4c d + 1)m - b d, 2a n - b m - a,
2 2
m + a d, (4a c - b )d - a]
factorGroebnerBasis: no reducible polynomials in this basis
Type: List(List(Polynomial(Integer)))
fricas
---- and clean it up (a lot). I wish these two steps could be one!
solve(E.1,Poly_to_Gauss)
Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas
---- Now lets test the reasonableness the width to start with is
---- 2*sqrt(b^2-4*a*c)/(2*a) which the left hand term yields. There is a sign ambiguity
---- corresponding to whether the source quadratic is to the left or right.
---- I could swap n,m in solve() but then the n term (left hand one) is more obscure
---- Knowing the width m we can compute moving the center to 1/2 (for x*(1-x))
---- It should amount to -b/(2*a)+1/2
---- and in fact that is the answer n= m(scale factor)*(b/2a)+1/2
---- d is required and in English is a "normalizing factor"
----General formulation
Dorg := corg -(ctar * Pa(n) * Sc(m))
Type: Matrix(Polynomial(Integer))