#30496 closed defect (fixed)

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

Reported by: dimpase Owned by:
Priority: critical Milestone: sage-9.2
Component: interfaces Keywords:
Cc: chapoton, tscrim Merged in:
Authors: Frédéric Chapoton Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: c582e80 (Commits, GitHub, GitLab) Commit: c582e80d55dbd0ba2fc4003a3e5cb2d8638621c4
Dependencies: Stopgaps:

Status badges

Description (last modified by dimpase)

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.

Change History (6)

comment:1 Changed 22 months ago by dimpase

discovered by chance, while working on #29314

comment:2 Changed 22 months ago by dimpase

  • Description modified (diff)

comment:3 Changed 22 months ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to u/chapoton/30496
  • Commit set to 82191ca6058fa0bf84eace353984c9b7c683b90b
  • Status changed from new to needs_review

here is a proposal


New commits:

82191cafix conversion from gap polynomial with valence > 0

comment:4 Changed 22 months ago by dimpase

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.

Last edited 22 months ago by dimpase (previous) (diff)

comment:5 Changed 22 months ago by dimpase

  • Branch changed from u/chapoton/30496 to public/packages/30496
  • Commit changed from 82191ca6058fa0bf84eace353984c9b7c683b90b to c582e80d55dbd0ba2fc4003a3e5cb2d8638621c4
  • Reviewers set to Dima Pasechnik
  • Status changed from needs_review to positive_review

OK, good.


New commits:

c582e80better syntax for libgap calls

comment:6 Changed 22 months ago by vbraun

  • Branch changed from public/packages/30496 to c582e80d55dbd0ba2fc4003a3e5cb2d8638621c4
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.