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

fix conversion of GAP univariate rat functions, which are polynomial with valuation>0 #30496

Closed
dimpase opened this issue Sep 2, 2020 · 12 comments

Comments

@dimpase
Copy link
Member

dimpase commented Sep 2, 2020

sage: x = libgap.Indeterminate(libgap.Integers, "x")                                                              
sage: x.sage()                                                                                                    
1

oops. This is due to

sage: (2*x).CoefficientsOfUnivariateRationalFunction()                                                                
[ [ 2 ], [ 1 ], 1 ]

where 3rd 1 is valuation v, so that the function is xv(2/1)=2x.
But the corresponding code added in #21020

if self.IsUnivariatePolynomial():
    from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
    R = PolynomialRing(base_ring, var)
    return R(num)

forgets about the case of valuation>0.

CC: @fchapoton @tscrim

Component: interfaces

Author: Frédéric Chapoton

Branch/Commit: c582e80

Reviewer: Dima Pasechnik

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

@dimpase dimpase added this to the sage-9.2 milestone Sep 2, 2020
@dimpase
Copy link
Member Author

dimpase commented Sep 2, 2020

comment:1

discovered by chance, while working on #29314

@dimpase

This comment has been minimized.

@fchapoton
Copy link
Contributor

Branch: u/chapoton/30496

@fchapoton
Copy link
Contributor

Author: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:3

here is a proposal


New commits:

82191cafix conversion from gap polynomial with valence > 0

@fchapoton
Copy link
Contributor

Commit: 82191ca

@dimpase
Copy link
Member Author

dimpase commented Sep 2, 2020

comment:4

could you write this x = libgap.eval('Indeterminate(Integers, "x")') (and the other place there where x is set) as

sage: x = libgap.Integers.Indeterminate('x')

This is less ugly.

@dimpase
Copy link
Member Author

dimpase commented Sep 2, 2020

Changed branch from u/chapoton/30496 to public/packages/30496

@dimpase
Copy link
Member Author

dimpase commented Sep 2, 2020

Changed commit from 82191ca to c582e80

@dimpase
Copy link
Member Author

dimpase commented Sep 2, 2020

comment:5

OK, good.


New commits:

c582e80better syntax for libgap calls

@dimpase
Copy link
Member Author

dimpase commented Sep 2, 2020

Reviewer: Dima Pasechnik

@vbraun
Copy link
Member

vbraun commented Sep 6, 2020

Changed branch from public/packages/30496 to c582e80

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