#9138: Categories for all rings
--------------------------+-------------------------------------------------
   Reporter:  jbandlow    |          Owner:  nthiery                            
           
       Type:  defect      |         Status:  needs_review                       
           
   Priority:  major       |      Milestone:  sage-4.7.1                         
           
  Component:  categories  |       Keywords:  introspection, categories for 
rings           
Work_issues:              |       Upstream:  N/A                                
           
   Reviewer:              |         Author:  Simon King                         
           
     Merged:              |   Dependencies:  sage-4.7, #11268, #11139, #9976, 
#9944, #11269
--------------------------+-------------------------------------------------
Changes (by SimonKing):

  * status:  needs_work => needs_review
  * work_issues:  doc test errors in sage/doc =>


Comment:

 At last it seems to work! With the new first patch together with the
 second patch, all doc tests (both sage/ and doc/) pass (at least for me)!

 Here is the problem and its solution.

 __First Problem__

 Hecke algebras: _lmul_ for its elements returns None. The previous patch
 version would thus register `from_base_ring` for coercion. However, in
 that case, a default implementation of `from_base_ring` would be used,
 which fails if _lmul_ returns None. Hence, it must not be registered as
 coercion.

 Solution: Use from_base_ring if it is a custom implementation , i.e., if
 `self.from_base_ring` is not obtained from
 `self.category().parent_class.from_base_ring`. If it is clear that the
 default implementation won't work, then do not register from_base_ring as
 coercion.

 Additional advantage: If the user provides a fast custom `from_base_ring`
 then it will be picked up.

 __Second problem__

 `SpecialCubicQuotientRing`: Here, self.one() had not been available during
 initialisation
 of coercion from the base ring. Hence, in the previous patch version,
 from_base_ring
 had been registered.

 However, _lmul_ is returning None, again. Additional complication:
 The initialisation of a `SpecialCubicQuotientRing` as a commutative
 algebra happened
 too early, namely ''before'' its hash was available. Hence, the attempt to
 construct
 a hom set containing the coercion from the base ring had failed.

 Solution: Move `CommutativeAlgebra.__init__` nearer to the end of
 `SpecialCubicQuotientRing.__init__`,
 namely to a point where both self.one() and the hash are available.

 __Conclusion__

 Ready for Review!

 Apply trac9138-categories_for_rings.patch
 trac9138_categories_for_more_rings.rebase4.7.1.a1.patch

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9138#comment:80>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to