Hi, I'm trying to port a Mathematica project to sympy. Therefore, I would like to use an algorithm to decompose an expression using Gröbner Bases as described in
8.3 Algebraic Relations, Gröbner Bases: A Short Introduction for Systems Theorists ( http://people.reed.edu/~davidp/pcmi/buchberger.pdf ) I already figured out, that sympy offers a function to compute Gröbner Bases. However, what could a solution, similar to what Mathematica's PolynomialReduce does in this case, look like in sympy? Alternatively, I could for now solve my problem with simple variables instead of polynomials and use something similar to Mathematica's Coefficient[] to pull out the according coefficients from the expression. This is my Mathematica code for the example: --------------------------------------------------------------------------- pv = {x1^2 + x2^2, x]^2*x2^2, x1^3*x2 - x1*x2^3} tau1 = x1^7*x2 - x1*x2^7 Vars = {x1, x2, Subscript[j, 3], Subscript[j, 2], Subscript[j, 1]}; Table[-Subscript[j, i] + pv[[i]], {i, Length[pv]}] G = FullSimplify[ GroebnerBasis[ Table[-Subscript[j, i] + pv[[i]], {i, Length[pv]}], Vars] ]; MatrixForm[G] {Cf, mRest} = PolynomialReduce[tau1, G, Vars]; Cf mRest -------------------------------------------------------------------------- -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
