#15437: Add basic ideals to Laurent Polynomials
-----------------------------------------------+-------------------------
       Reporter:  mmarco                       |        Owner:  mmarco
           Type:  enhancement                  |       Status:  new
       Priority:  major                        |    Milestone:  sage-5.13
      Component:  commutative algebra          |   Resolution:
       Keywords:  Laurent polynomials, ideals  |    Merged in:
        Authors:  mmarco                       |    Reviewers:
Report Upstream:  N/A                          |  Work issues:
         Branch:                               |       Commit:
   Dependencies:                               |     Stopgaps:
-----------------------------------------------+-------------------------

Comment (by mmarco):

 Another issue is that, if we define a quotient ring, the elements fail to
 be respresented. I think it is because, somehow, the __init__ method is
 not properly run, and then they don't get the __rep atribute:

 {{{
 sage: L=LaurentPolynomialRing(QQ,3,'t')
 sage: L.inject_variables()
 Defining t0, t1, t2
 sage: I=L.ideal([t0*t1-t2**(-2),t1*t2-3*t0**2+1,t1*t2-t0**(-3)])
 sage: RB=sage.rings.quotient_ring.QuotientRing(L,I)
 sage: RB
 Quotient of Multivariate Laurent Polynomial Ring in t0, t1, t2 over
 Rational Field by the ideal (t0*t1 - t2^-2, -3*t0^2 + t1*t2 + 1, t1*t2 -
 t0^-3)
 sage: RB(t0)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-31-84ddc2a90887> in <module>()
 ----> 1 RB(t0)

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-
 packages/IPython/core/displayhook.pyc in __call__(self, result)
     236             self.start_displayhook()
     237             self.write_output_prompt()
 --> 238             format_dict = self.compute_format_data(result)
     239             self.write_format_data(format_dict)
     240             self.update_user_ns(result)

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-
 packages/IPython/core/displayhook.pyc in compute_format_data(self, result)
     148             MIME type representation of the object.
     149         """
 --> 150         return self.shell.display_formatter.format(result)
     151
     152     def write_format_data(self, format_dict):

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-packages/IPython/core/formatters.pyc
 in format(self, obj, include, exclude)
     124                     continue
     125             try:
 --> 126                 data = formatter(obj)
     127             except:
     128                 # FIXME: log the exception

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc
 in __call__(self, obj)
     508         s = self.try_format_obj(obj)
     509         if s is None:
 --> 510             s = super(SagePlainTextFormatter, self).__call__(obj)
     511         return s
     512

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-packages/IPython/core/formatters.pyc
 in __call__(self, obj)
     445                 type_pprinters=self.type_printers,
     446                 deferred_pprinters=self.deferred_printers)
 --> 447             printer.pretty(obj)
     448             printer.flush()
     449             return stream.getvalue()

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in
 pretty(self, obj)
     358                             if callable(meth):
     359                                 return meth(obj, self, cycle)
 --> 360             return _default_pprint(obj, self, cycle)
     361         finally:
     362             self.end_group()

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in
 _default_pprint(obj, p, cycle)
     478     if getattr(klass, '__repr__', None) not in _baseclass_reprs:
     479         # A user-provided repr.
 --> 480         p.text(repr(obj))
     481         return
     482     p.begin_group(1, '<')

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-
 packages/sage/structure/sage_object.so in
 sage.structure.sage_object.SageObject.__repr__
 (sage/structure/sage_object.c:1
 921)()

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-
 packages/sage/rings/quotient_ring_element.pyc in _repr_(self)
     218             return str(self.__rep)
     219         with localvars(R, P.variable_names(), normalize=False):
 --> 220             return str(self.__rep)
     221
     222     def _pari_(self):

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-
 packages/sage/structure/sage_object.so in
 sage.structure.sage_object.SageObject.__repr__
 (sage/structure/sage_object.c:1
 921)()

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-
 packages/sage/rings/polynomial/laurent_polynomial.so in
 sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_mpair
 ._repr_ (sage/rings/polynomial/laurent_polynomial.c:4464)()

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-
 packages/sage/rings/polynomial/laurent_polynomial.so in
 sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_mpair
 ._compute_polydict (sage/rings/polynomial/laurent_polynomial.c:4366)()

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-
 packages/sage/rings/polynomial/laurent_polynomial.so in
 sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_mpair
 ._dict (sage/rings/polynomial/laurent_polynomial.c:4165)()

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-
 packages/sage/rings/polynomial/multi_polynomial.so in
 sage.rings.polynomial.multi_polynomial.MPolynomial._mpoly_dict_rec
 ursive (sage/rings/polynomial/multi_polynomial.c:6415)()

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-packages/sage/structure/parent.so in
 sage.structure.parent.Parent.__call__ (sage/structure/parent.c:8372)()

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-
 packages/sage/rings/polynomial/polynomial_element.so in
 sage.rings.polynomial.polynomial_element.ConstantPolynomialSecti
 on._call_ (sage/rings/polynomial/polynomial_element.c:49290)()

 TypeError: not a constant polynomial
 sage: a=RB(t0)
 sage: a.__rep
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 <ipython-input-33-ce9f756d0b3b> in <module>()
 ----> 1 a.__rep

 /mnt/home/njsgxy8n/sage-5.12-linux-64bit-ubuntu_12.04.3_lts-
 x86_64-Linux/local/lib/python2.7/site-packages/sage/structure/element.so
 in sage.structure.element.Element.__getattr__
 (sage/structure/element.c:3761)()

 AttributeError: 'QuotientRing_generic_with_category.element_class' object
 has no attribute '__rep'
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/15437#comment:3>
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