|Version 6 (modified by nthiery, 4 years ago) (diff)|
#5891: Categories for the working mathematics programmer (status and roadmap)
This page describes the status and roadmap for the category patches. Please do not edit for the moment, as this is currently copy-pasted from the patch description on the sage-combinat patch server.
This (series of) patch(es) extends the Sage category framework as a design pattern for organizing generic code.
(with special thanks to Robert Bradshaw, Mike Hansen, Florent Hivert, David Roe, William Stein, ... for design discussions).
The latest version of the patches are available from: http://combinat.sagemath.org/patches/file/
- #5891: categories-nt.patch: the category framework itself + updates to the sage library (import fixes, ... see below) + updates to combinatorial free modules (will be split before submission)
Related patches (will need to be applied after to recover 100% doctest pass):
- categories-sf-nt.patch Symmetric functions
- #4326: root_systems-4326-nt.patch
Small technical patches the category patch depends on:
- #5449: cached_in_parent_method-5449-submitted.patch (positive review)
- #5783: lazy_attributes-fixes-5783-final.patch (closed)
- #5120: unique_representation-5120-submitted.patch (positive review)
- #5967: element_wrapper-5967-submitted.patch (positive review; parent as first argument?)
- #5979: parent-element_constructor-fix-5979-submitted.patch (robert)
- #5985: cPickle-5985-import-submitted.patch, cPickle-5985-copy_reg_classes-submitted.patch (positive review)
- #5986: cPickle-5986-nested-classes-submitted.patch (Craig)
- #5991: dynamic_class-5991-submitted.patch (David Roe)
- #5598: 5598-coerce-declare.patch
- #5483: explain-pickle-v1.patch (with patch, needs review)
- #6000: transitive_ideal-6000-submitted.patch (reviewer: Rob Beezer?)
- Almost all test pass (see below for three exceptions)
- sage.categories? Category quickref card
- sage.categories.primer? Element/Parent/Category? primer (in writing)
- Category? Technical background on categories
- Semigroups().example()?? A template of semigroup
- See also the discussion on sage-devel in November 2009: http://groups.google.com/group/sage-devel/msg/d4065154e2e8cbd9
- Real life applications:
- categories-ncsf-nt.patch Non commutative Symmetric Functions
- automatic monoids, ...
- sage.categories.category (500 lines of code)
- sage.structure.parent (100 lines of code)
- class manipulation: (25 lines of code)
- All the mathematical categories of Axiom and MuPAD (Courtesy of Teresa Gomez Diaz) (except *WithSeveralBases? which are not needed anymore; see .abstract_category())
- (Infinite/Finite?)EnumeratedSets? (with example) (Courtesy of Florent Hivert)
- Semigroups (with example, basic methods, subquotients)
- FiniteSemigroups? (with example, cayley graphs, basic representation theory, ...)
- ModulesWithBasis? (with example, morphisms)
- HopfAlgebras? & friends (with a couple examples)
- Have unique representation by default (no need to inherit from Category_uniq)
- Have construction / reduce by default
- Functorial constructions:
- cartesian product (todo)
- subquotient, subset, quotient (in progress)
- direct sum
- tensor product
- dual (very preliminary)
- isomorphism type (very preliminary)
- Integrates with current sage morphisms
- Adds morphisms for some categories
- Some general infrastructure
- Simplification of the logic. Hopefuly completely compatible.
- X._Hom_(Y, category) may now return NotImplemented?
- failed attempt at using cached_function (to be pursued)
- Systematic use of category = ... instead of cat = This may be backward incompatible.
- Generic test framework: Functional. See Todo's in Sets.Parent.check? for possible improvements
- Lazy attributes:
Non essential, and essentially invisible from the user interface
Powerful tool for:
- Conditionaly defined methods
- Enriched methods
- Pickling: Works; the strategy could be improved at some point; see also below
- Categories and Cython: Proof-of-concept for Cython classes to inherit code from categories See: sage.categories.examples.semigroups_cython
- Reorganization of the Sage library to start using the category framework:
- Combinatorial free modules
- Have unique representation, use coercion, are more robust
- Improved _repr_
- Handle combinatorial classes that can't be sorted as indices
- NumberFields?: bug fix (categories-numberfield_homset-nt.patch / needs review): Hom(SomeNumberField?,SomeVectorSpace?) returned a numberfield homset
- Fixed some import loops
- Added temporary list() methods to:
- Added sage.sets.finite_enumerated_set
- Added aliases one = one_element, zero = zero_element to start the transition (to be discussed)
- Combinatorial free modules
- Todo before integration of this patch:
- Naming cleanup:
- parent.product(x,y) parent.product
- parent.summation(x,y) parent.summation # risk of confusion with infinite summation / ...
- Naming cleanup:
- Use class.an_instance() whenever meaningful
- cat.example() cat.counter_example()
- parent.an_element() parent.some_elements(); possibly parent.example() parent.counterexample()
- A.one() A.zero() a.is_one() a.is_zero() A(1) A(0) when it makes sense A.one_element() A.zero_element() deprecated in the doc; fully deprecated later
- all_weakly_super_categories -> all_super_categories(proper=False)
- In the categories: Parent -> ParentMethods?, Element -> ElementMethods?
- move Element as a nested class of ParentMethods??
- abstract / isomorphism type / with_several_representations
- AbelianGroups?() / CommutativeGroups?()
- Get nice category graph pictures! HELP!
- Documentation cleanup (HELP!):
- Get to 100% doctests
- Fix ReST incorrectness
- Check and put appropriate entry points
- Add more examples of parents (HELP!):
Ultimately, this should be for all categories,
Those are needed urgently
- Modules (for doctests for mul / rmul / ...)
- Algebras (for doctests for mul / rmul / ...)
- AbelianSemigroups? (for doctesting add / sub / ...)
- sage -t "devel/sage/sage/structure/sage_object.pyx" Pickling from old sage: technically feasible. HELP!
- Make sure that ? and ?? on categories / examples / ... point to the right place e.g.: Semigroups??, Semigroups().example()?? Semigroups().parent_class?, Semigroups.element_class?
- Allow for super classes to also provide .Element
- Long run discussions:
- Writing and linking to generic documentation
- ToDedefined? code stubs
- Standardize the functorial constructions, and streamline with variants (finite / finite dimensional / graded / abstract / ...)
- Hom is *not* a functorial construction. This works for now, but the design and user interface needs to be discussed for the long run implementation.
- Support for multivariate morphims, i.e. morphisms (A x B) -> C where the specializations (A x b) -> C and and (a x B) -> C are morphisms for possibly different categories
- Defining new inline operators, at least within the sage interpreter
- Convention for the order in super_categories (see primer)
- Cythonification, and merging of the code with sage.structure.element.*Element?
- Inheritance from existing parents
- How to specify the category of a parent (overloading of method / argument to init)