1 | initial version |
The algorithms behind ideal membership testing cannot work reliably over inexact fields such as CC
. For a simple example that goes wrong over CC
, consider
sage: CC(1/10) + CC(2/10) - CC(3/10)
5.55111512312578e-17
which is not exactly zero.
Instead, work with polynomials over an exact field such as QQ
, QQbar
or a number field. Over QQ
, one gets:
sage: vars=var("a11 a12 a13 b11 b12 b13 c11 c12 c13 a21 a22 a23 b21 b22 b23 c21 c22 c23")
sage: equations_pairs = [a11*b11*c11+a21*b21*c21-1,a12*b12*c12+a22*b22*c22-1,a13*b13*c13+a23*b23*c23-1,a11*b11*c12+a21*b21*c22,a12*b12*c11+a22*b22*c21
....: ,a12*b12*c13+a22*b22*c23,a13*b13*c12+a23*b23*c22,a13*b13*c11+a23*b23*c21,a11*b11*c13+a21*b21*c23]
sage: R = PolynomialRing(QQ, names=vars)
sage: J_pairs = R.ideal(equations_pairs)
sage: One = R.one()
sage: One in J_pairs
True
sage: One.lift(J_pairs)
[-a13*b13*c13*a22*b22*c22 + 3/2*a12*b12*c13*a23*b23*c22 - a12*b12*c12*a23*b23*c23 - 1/2*a13*b13*c13*a23*b23*c23, 1/2*a11*b11*c13*a23*b23*c21 + 1/2*a13*b13*c13*a23*b23*c23 - a13*b13*c13 - a23*b23*c23, -1/2*a11*b11*c13*a23*b23*c21 + 1/2*a12*b12*c13*a23*b23*c22 - 1, a13*b13*c13*a22*b22*c21 - 3/2*a12*b12*c13*a23*b23*c21 + a12*b12*c11*a23*b23*c23, -1/2*a11*b11*c13*a23*b23*c22, -1/2*a13*b13*c13*a23*b23*c22 - a13*b13*c12, -a11*b11*c13*a22*b22*c21 - 1/2*a12*b12*c13*a23*b23*c23 + 2*a12*b12*c13 + a22*b22*c23, a11*b11*c13*a22*b22*c22 + 1/2*a11*b11*c13*a23*b23*c23, a12*b12*c12*a23*b23*c21 + 1/2*a13*b13*c13*a23*b23*c21 - a12*b12*c11*a23*b23*c22]