Skip to content

conversion from SR[] to SR #20454

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

Open
rwst opened this issue Apr 17, 2016 · 2 comments
Open

conversion from SR[] to SR #20454

rwst opened this issue Apr 17, 2016 · 2 comments

Comments

@rwst
Copy link
Contributor

rwst commented Apr 17, 2016

Even if there are identical generator and variable names there should not be a problem to convert from a univariate polynomial with symbolic coefficients to a symbolic expression, but:

sage: S.<y> = PolynomialRing(SR)
sage: p = y^2 + pi*y + 1
sage: p.coefficients()
[1, pi, 1]
sage: ex = SR(p)
...
TypeError: not a constant polynomial

See #20453 and #20312 for motivation.

Component: symbolics

Issue created by migration from https://trac.sagemath.org/ticket/20454

@rwst rwst added this to the sage-7.2 milestone Apr 17, 2016
@nbruin
Copy link
Contributor

nbruin commented Apr 17, 2016

comment:1

You can get a morphism that does this:

sage: H=Hom(S,SR)(SR('y'))
sage: H(p)
(pi + y)*y + 1

I think we'll get more mileage out of educating users how to define the morphisms they need than trying to stuff every possible operation into conversion (although the one you propose here wouldn't necessarily be a problem by itself. You'll just have that S(SR(p)) != p, which will be a little surprising (and the fact that S(..) maps elements of SR to constants will be very hard to change, or at least cause big problems down the line if you do)

@rwst

This comment has been minimized.

@mkoeppe mkoeppe removed this from the sage-7.2 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants