#11935: Make parent/element classes independent of base rings
---------------------------+------------------------------------------------
   Reporter:  SimonKing    |          Owner:  nthiery                           
   
       Type:  enhancement  |         Status:  needs_review                      
   
   Priority:  major        |      Milestone:  sage-4.8                          
   
  Component:  categories   |       Keywords:  parent class, element class, 
category
Work_issues:               |       Upstream:  N/A                               
   
   Reviewer:               |         Author:  Simon King                        
   
     Merged:               |   Dependencies:  #9138 #11900 #11943 #11999        
   
---------------------------+------------------------------------------------
Changes (by SimonKing):

  * status:  needs_work => needs_review
  * work_issues:  Fix doctest in covariant functorial construction =>


Comment:

 Done!

 The current patch preserves the default parent_class and element_class for
 categories. In particular, there is no problem with the covariant
 functorial constructions.

 According to Nicolas' idea, I added a _parent_class_from_bases and
 _element_class_from_bases. They use the "weak pickling-by-construction"
 approach discussed above, because that seems to minimize the probability
 of breaking new pickles in a distant future. Just to emphasize: Old
 pickles will still work.

 These two new lazy attributes override parent_class and element_class for
 `Category_over_base` (which was made possible by #11999). By consequence,
 the parent classes of all vector spaces (over different base fields)
 coincide. The parent classes of algebras over fields coincide, but differ
 from the parent class of algebras over a non-field.

 Moreover, the parent class of a join category only depends on the parent
 classes of its super categories. Here, I use the default pickling of
 dynamic classes.

 Rationale for using the default pickling in the case of join categories:

  * The creation of a dynamic class becomes slightly faster when you don't
 need to worry about pickling.
  * A join category is uniquely determined by its super categories. So, it
 is safe to make the parent class uniquely determined by the bases (which
 is precisely the default pickling of dynamic classes).

 With the new patch, all long tests pass. Moreover, I have the following
 timing:
 {{{
 sage: %time L = EllipticCurve('960d1').prove_BSD()
 CPU times: user 2.95 s, sys: 0.08 s, total: 3.03 s
 Wall time: 3.20 s
 }}}
 That is a speed-up of about 20% compared with unpatched sage-4.7.2.alpha2!

 Apply trac11935_weak_pickling_by_construction_rel11943.patch

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