#13215: Skew polynomials
-------------------------------------+-------------------------------------
       Reporter:  caruso             |        Owner:  tbd
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-7.3
      Component:  algebra            |   Resolution:
       Keywords:  skew polynomials   |    Merged in:
        Authors:  Xavier Caruso      |    Reviewers:  Burcin Erocal
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/arpitdm/skew_polynomials         |  e189fec13d005a7fba39a429876c501fe95c05da
   Dependencies:  #13214, #13303,    |     Stopgaps:
  #13640, #13641, #13642             |
-------------------------------------+-------------------------------------

Comment (by tscrim):

 Replying to [comment:76 jsrn]:
 > Replying to [comment:75 tscrim]:
 > > - You seem to be using the exact same format of polynomials, which
 contains a lot of old code. For example, don't implement a `_repr_()` that
 just calls (a ''Python'' function) `_repr()`. This is useless (even in the
 usual polynomial ring code it seems); instead just implement `_repr_()`.
 Similarly, there are a number of methods you could simply `cpdef`.
 >
 > That would be great. Can you give us the full list of the methods for
 which we can do this, or point us to how we can figure it out?

 Anything python method (a `def`) which only calls a `cdef` method. Another
 example is `list` calling `_list_c`. IIRC, you can't do this for
 `__hash__` because this is a Python special method. I think `_list_c` is
 the only other one (and you can replace this by just calling the attribute
 `__coeffs`).

 > > - You can use
 > >   {{{
 > > self._no_generic_basering_coercion = True
 > >   }}}
 > >   to avoid constructing the coercion from the base ring when
 initializing the skew polynomial ring.
 >
 > To be precise, do you mean that can insert the above line in
 `SkewPolynomialRing_general.__init__` just before the call to
 `Algebra.__init__`, and then remove the call to
 `self._unset_coercions_used()`? Or is there more to it?

 Yes, exactly.

 > > - `_cmp_` is planned to be removed. Use `_richcmp_` instead.
 >
 > Are you talking about `SkewPolynomial._cmp_`? We spent many hours
 debugging the comparison code because it threw strange errors and
 segfaults. To avoid me spending many more hours, could I ask you to tell
 us exactly how to write the correct comparison code then?

 You can look at `src/sage/rings/real_arb.pyx` or
 `src/sage/rings/real_double.pyx` for example. We can include the `_cmp_`
 as it is now, but it means some more hardship when we finally start
 converting.

 > Simon King's tutorial on implementing algebraic structures should be
 updated to be more informative on this, I think.

 Yes, it should be. It was written before we really had to worry about
 going to Python3.

 > > - You should lazy import the ring constructor.
 >
 > Do you mean `sage.rings.ring` in `skew_polynomial_ring.py`? Why is
 exactly that one important to lazily import?

 It is the thing which imports the rest of the code (once the `is_*`
 functions are gone). So all of the other files are not imported on
 startup, which helps keep that down because this is not a "common" object
 that the average user will use (IMO).

 > Thanks for the help!

 Thank you for the good discussions and work.

--
Ticket URL: <https://trac.sagemath.org/ticket/13215#comment:79>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to