Open dkrenn opened 9 years ago
I've narrowed the search: It works in 6.3.beta5, but not anymore in 6.3.beta6.
Hi,
I would not say this is a bug. If you want to use the function solve
, you need to feed it with symbolic polynomials
sage: R.<x,y> = QQ[]
sage: Sx, Sy = var('x,y')
sage: I = R.ideal(y^2 - 2*y + 1, x + 1/4*y - 5/4)
sage: f0,f1 = I.gens()
sage: f0 = f0.subs(x=Sx, y=Sy); f1 = f1.subs(x=Sx, y=Sy)
sage: solve([f0,f1], [Sx,Sy], solution_dict=true)
[{x: 1, y: 1}]
The "bug" comes from solve
which does not type check the input as it should. Note that when the input is one polynomial the check is done
sage: f0,f1 = I.gens()
sage: solve(f0, [Sx,Sy])
Traceback (most recent call last):
...
TypeError: The first argument must be a symbolic expression or a list of symbolic expressions.
Vincent
See also #13360 automatically coercing from polynomials to symbolics can cause unexpected problems. So, while I acknowledge that this ugly and unconvenient I am more inclined to get used to write
sage: R.<x,y> = QQ[]
sage: I = R.ideal(y^2 - 2*y + 1, x + 1/4*y - 5/4)
sage: solve(map(SR,I.gens()), map(SR,R.gens()), solution_dict=true)
[{y: 1, x: 1}]
Replying to @lftabera:
See also #13360 automatically coercing from polynomials to symbolics can cause unexpected problems. So, while I acknowledge that this ugly and unconvenient I am more inclined to get used to write
sage: R.<x,y> = QQ[] sage: I = R.ideal(y^2 - 2*y + 1, x + 1/4*y - 5/4) sage: solve(map(SR,I.gens()), map(SR,R.gens()), solution_dict=true) [{y: 1, x: 1}]
Ok, this is definitly a workaround and maybe should be mentioned somewhere. Anyhow, I do not like that solve as in the original problem accepts polynomials but then does not give a solution (while it did some versions ago)
In Sage 6.3 we have
But in 6.1.1 we got
which was the correct solution.
Component: algebra
Issue created by migration from https://trac.sagemath.org/ticket/16848