Skip to content
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

Conversion from pari to sage #14194

Open
roed314 opened this issue Feb 27, 2013 · 2 comments
Open

Conversion from pari to sage #14194

roed314 opened this issue Feb 27, 2013 · 2 comments

Comments

@roed314
Copy link
Contributor

roed314 commented Feb 27, 2013

Conversion from pari to Sage uses the global namespace:

sage: QQ['s'].gen()._pari_().sage()
Traceback (most recent call last):
...
NameError: name 's' is not defined
sage: GF(9, 'a').gen()._pari_().sage()
Traceback (most recent call last):
...
NameError: name 'a' is not defined

We can do better.

Component: interfaces

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

@jdemeyer
Copy link

comment:1

What's the problem? I don't really see how you want to fix this.

@jdemeyer jdemeyer removed this from the sage-5.9 milestone Apr 10, 2013
@kedlaya
Copy link
Sponsor Contributor

kedlaya commented Apr 5, 2016

comment:3

I'm sure roed knows this, but the correct call syntax here is:

sage: sage: R = QQ['s']
sage: sage: t = R.gen()._pari_()
sage: sage: R(t)
s
sage: F = GF(9, 'a')
sage: t = F.gen()._pari_()
sage: F(t)
a

After all, PARI has no class hierarchy, so why should a PARI univariate polynomial be expected to know which Sage polynomial ring it should convert back to?

If I were feeling provocative, I might go further and propose that the sage method of a PARI object should be deprecated in favor of the constructor syntax shown above, even for PARI types where there isn't any ambiguity about the Sage parent (e.g., integers).

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

4 participants