New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong conversion from symbolic to SR[] #20453
Comments
comment:1
I don't think you'll be able to reasonably code this. It will be too much of an exception. Base rings coerce into polynomial rings over them, by mapping them to constant polynomials. Conversions use coercion if available. The behaviour you're proposing is so deeply against the general rules that even if you get this particular case to work, I expect the exceptional behaviour will be causing problems in all kinds of other situations. With the following you should be able to do what you want:
The map you want, while reasonable and useful, doesn't fit with the generic rules that exist about conversion maps. That's not a problem. Just don't insist that every useful map needs to be a conversion map, define the map you do want, and use that. Perhaps we need better tools/documentation on how to conveniently define useful maps and homomorphisms? Note that applying the map is not actually require longer syntax than conversion, so calling the map is already very convenient. Getting the map in the first place is perhaps a little more challenging and a little less discoverable presently. |
comment:2
Thanks. That code looks useful and, indeed, could be advertised more widely. I expect this ticket to at least document which "problems in all kinds of other situations" this "exceptional behaviour will be causing", for demonstration purposes. That SR (i.e., reality) breaks all algebraist's rules is not new. For context, the bigger problem this ticket is trying to help with is #20312. |
comment:3
As far as I understand, |
comment:4
Replying to @mezzarobba:
Or even into a multivariate. That is true. Where is my head? So the difficult part of #20312 is done. |
As long as generator and variable names can be associated there should not be a problem to convert from a symbolic expression to a univariate polynomial with symbolic coefficients, but:
(Should be
[1, pi, 1]
).Component: symbolics
Issue created by migration from https://trac.sagemath.org/ticket/20453
The text was updated successfully, but these errors were encountered: