#11368: can't coerce pari to rational function field
-------------------------------------------------+-------------------------
       Reporter:  katestange                     |        Owner:  robertwb
           Type:  defect                         |       Status:  new
       Priority:  minor                          |    Milestone:  sage-6.1
      Component:  coercion                       |   Resolution:
       Keywords:  coercion pari rational         |    Merged in:
  fraction_field string                          |    Reviewers:
        Authors:                                 |  Work issues:
Report Upstream:  N/A                            |       Commit:
         Branch:                                 |     Stopgaps:
   Dependencies:                                 |
-------------------------------------------------+-------------------------

Comment (by pbruin):

 The problem seems to be this:
 {{{
 sage: R.<x,y> = PolynomialRing(QQ)
 sage: a=pari((x+y)/y); a
 1/y*x + 1
 sage: a.numerator()
 1/y*x + 1
 sage: a.denominator()
 1
 }}}
 Note that the following does work:
 {{{
 sage: b=pari((x+y)/x); b
 (x + y)/x
 sage: b.numerator()
 x + y
 sage: b.denominator()
 x
 }}}
 Note also that the PARI types are different:
 {{{
 sage: a.type()
 't_POL'
 sage: b.type()
 't_RFRAC'
 }}}
 This difference arises because PARI treats multivariate polynomials as
 iterated univariate polynomials.  To PARI, ''a'' lives in
 '''Q'''(''y'')[''x''], and ''b'' in Frac('''Q'''[''y''][''x'']).

 The solution is probably to convert PARI elements of type `t_POL`
 coefficientwise into ''S''.

--
Ticket URL: <http://trac.sagemath.org/ticket/11368#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to