Changes between Initial Version and Version 5 of Ticket #19945


Ignore:
Timestamp:
01/08/18 09:08:44 (3 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19945

    • Property Dependencies changed from to #24247
    • Property Component changed from asymptotic expansions to basic arithmetic
    • Property Summary changed from Asymptotic Ring: cannot construct (1/2)^n to Fix Rational.__pow__
  • Ticket #19945 – Description

    initial v5  
    11The following is unexpected:
    22{{{
    3 sage: A.<n> = AsymptoticRing('QQ^n * n^QQ', ZZ)
    4 sage: (1/2)^n
    5 Traceback (most recent call last):
    6 ...
    7 ValueError: 1/2 is not in Exact Term Monoid QQ^n * n^QQ
    8 with coefficients in Integer Ring.
    9 > *previous* ValueError: Factor 1/2 of 1/2 is neither
    10 a coefficient (in Integer Ring) nor growth
    11 (in Growth Group QQ^n * n^QQ).
    12 sage: 1/2^n
    13 (1/2)^n
     3sage: A.<n> = AsymptoticRing('QQ^n * n^QQ', ZZ); (1/2)^n
     4---------------------------------------------------------------------------
     5ValueError                                Traceback (most recent call last)
     6<ipython-input-18-784db7f7676d> in <module>()
     7----> 1 A = AsymptoticRing('QQ^n * n^QQ', ZZ, names=('n',)); (n,) = A._first_ngens(1); (Integer(1)/Integer(2))**n
     8
     9/usr/local/src/sage-config/src/sage/rings/rational.pyx in sage.rings.rational.Rational.__pow__ (build/cythonized/sage/rings/rational.c:23638)()
     10   2549
     11   2550             if isinstance(n, Element):
     12-> 2551                 return (<Element>n)._parent(self)**n
     13   2552             try:
     14   2553                 return n.parent()(self)**n
     15
     16/usr/local/src/sage-config/src/sage/structure/parent.pyx in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9529)()
     17    916         if mor is not None:
     18    917             if no_extra_args:
     19--> 918                 return mor._call_(x)
     20    919             else:
     21    920                 return mor._call_with_args(x, args, kwds)
     22
     23/usr/local/src/sage-config/src/sage/structure/coerce_maps.pyx in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4978)()
     24    153                 print(type(C), C)
     25    154                 print(type(C._element_constructor), C._element_constructor)
     26--> 155             raise
     27    156
     28    157     cpdef Element _call_with_args(self, x, args=(), kwds={}):
     29
     30/usr/local/src/sage-config/src/sage/structure/coerce_maps.pyx in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4846)()
     31    148         cdef Parent C = self._codomain
     32    149         try:
     33--> 150             return C._element_constructor(x)
     34    151         except Exception:
     35    152             if print_warnings:
     36
     37/usr/local/src/sage-config/local/lib/python2.7/site-packages/sage/rings/asymptotic/asymptotic_ring.pyc in _element_constructor_(self, data, simplify, convert)
     38   3891             return result
     39   3892
     40-> 3893         return self.create_summand('exact', data)
     41   3894
     42   3895
     43
     44/usr/local/src/sage-config/local/lib/python2.7/site-packages/sage/rings/asymptotic/asymptotic_ring.pyc in create_summand(self, type, data, **kwds)
     45   4335
     46   4336         try:
     47-> 4337             return self(TM(data, **kwds), simplify=False, convert=False)
     48   4338         except ZeroCoefficientError:
     49   4339             return self.zero()
     50
     51/usr/local/src/sage-config/src/sage/structure/parent.pyx in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9529)()
     52    916         if mor is not None:
     53    917             if no_extra_args:
     54--> 918                 return mor._call_(x)
     55    919             else:
     56    920                 return mor._call_with_args(x, args, kwds)
     57
     58/usr/local/src/sage-config/src/sage/structure/coerce_maps.pyx in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4978)()
     59    153                 print(type(C), C)
     60    154                 print(type(C._element_constructor), C._element_constructor)
     61--> 155             raise
     62    156
     63    157     cpdef Element _call_with_args(self, x, args=(), kwds={}):
     64
     65/usr/local/src/sage-config/src/sage/structure/coerce_maps.pyx in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4846)()
     66    148         cdef Parent C = self._codomain
     67    149         try:
     68--> 150             return C._element_constructor(x)
     69    151         except Exception:
     70    152             if print_warnings:
     71
     72/usr/local/src/sage-config/local/lib/python2.7/site-packages/sage/rings/asymptotic/term_monoid.pyc in _element_constructor_(self, data, coefficient)
     73   1670         except ValueError as e:
     74   1671             raise combine_exceptions(
     75-> 1672                 ValueError('%s is not in %s.' % (data, self)), e)
     76   1673
     77   1674         return self._create_element_(growth, coefficient)
     78
     79ValueError: 1/2 is not in Exact Term Monoid QQ^n * n^QQ with coefficients in Integer Ring.
     80> *previous* ValueError: Factor 1/2 of 1/2 is neither a coefficient (in Integer Ring) nor growth (in Growth Group QQ^n * n^QQ).
    1481}}}