I.variety() : missing solution values
Hi there!
The following code:
sage: R.<x1,x2,x3,x4,x5> = PolynomialRing(RR,5,order='lex')
sage: f1=x1+x2+x3+x4+x5
sage: f2=x1*x2+x2*x3+x3*x4+x4*x5+x1*x5
sage: f3=x1*x2*x3+x2*x3*x4+x3*x4*x5+x4*x5*x1+x5*x1*x2
sage: f4=x1*x2*x3*x4+x2*x3*x4*x5+x3*x4*x5*x1+x4*x5*x1*x2+x5*x1*x2*x3
sage: f5=x1*x2*x3*x4*x5-1
sage: I = Ideal(f1,f2,f3,f4,f5)
sage: I.variety()
produces
verbose 0 (2403: multi_polynomial_ideal.py, variety) Warning: falling back to very slow toy implementation.
[{x5: -2.61803398874989}, {x5: -0.381966011250105}, {x5: 1.00000000000000}]
which seems to be missing a large number of solution values, and only producing values for x5 even in those solutions in reports on, for some reason. A similar problem occurs if I solve over CC rather than RR (but involves a lot more text, so this seemed nicer to copy/paste).
If I change the order from lex to degrevlex, I.variety() fails with the following error message:
verbose 0 (2403: multi_polynomial_ideal.py, variety) Warning: falling back to very slow toy implementation.
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-479-cb6d916bc8b3> in <module>()
----> 1 I.variety()
/Applications/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in __call__(self, *args, **kwds)
603 if not R.base_ring().is_field():
604 raise ValueError("Coefficient ring must be a field for function '%s'."%(self.f.__name__))
--> 605 return self.f(self._instance, *args, **kwds)
606
607 require_field = RequireField
/Applications/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in variety(self, ring)
2667 if self.ring().term_order().is_global():
2668 verbose("Warning: falling back to very slow toy implementation.", level=0)
-> 2669 T = toy_variety.triangular_factorization(self.groebner_basis())
2670 else:
2671 raise TypeError("Local/unknown orderings not supported by 'toy_buchberger' implementation.")
/Applications/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/toy_variety.pyc in triangular_factorization(B, n)
279 # recursively build the family,
280 # looping through the factors of p
--> 281 for (q,a) in p.factor():
282 # Construct an analog to I in (R.quotient(R.ideal(q)))[x_0,x_1,...x_{n-1}]
283 I = R.ideal([each.reduce([q]) for each in G])
/Applications/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_element.pyc in factor(self, proof)
1662 raise NotImplementedError("Factorization of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.")
1663 if proof:
-> 1664 raise NotImplementedError("proof = True factorization not implemented. Call factor with proof=False.")
1665
1666 R._singular_().set_ring()
which is kind've mystifying, since we're working over either RR or CC, both of which have characteristic 0, and neither of which is a prime field. I thought maybe this is related to I.variety()'s odd behavior under lex order somehow, though, so it'd be worth including here.
I know this system has 10 real solutions (it's an example from HOM4PS2's documentation, and ...