-
-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Categories for the working mathematics programmer #5891
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:8
Where is categories-nt.patch itself? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:11
Replying to @robertwb:
On the sage-combinat patch server. It changes too often to keep it updated on trac. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Attachment: categories-framework-nt.patch.gz |
Attachment: categories-categories-nt.patch.gz Attachment: categories-fixsagelib-nt.patch.gz |
Attachment: categories-enumeratedsets-nt.patch.gz |
Attachment: categories-combinat-nt.patch.gz |
Attachment: categories-numberfield_homset-nt.patch.gz |
comment:15
There are the patches. They are file-orthogonal, so they should apply in any order. |
comment:16
Note: to get the latest version, please use the patch server. |
comment:17
NOTES: (1) Post the latest version here -- I don't want to mess with the patch server. (2) It says "Experts: please redefine this properly and/or put CC/RR/... in NumberFields()". I number field is by definition a finite extension of QQ, but CC and RR are infinite extensions of QQ. So we can't put them in that category. Having a function is_NumberFieldHomsetCodomain does seem like a good workaround for now. (3) The function is_NumberFieldHomsetCodomain in the patch posted here doesn't have any documentation or doctests. Please add them. (4) I would change these two lines:
to the single line
which should be functionally the same, and clearer to read. (5) in a similar spirit, I would change
to just
which is again clearer and equivalent.
What is NotImplemented? It's not defined in the number_field_rel.py file in sage-4.2. |
This comment has been minimized.
This comment has been minimized.
Reviewer: Robert Bradshaw, Florent Hivert, David Kohel, David Roe, Anne Schilling, Javier Vengoroso |
comment:19
Replying to @williamstein:
I just added direct links in the description. I will post the patches shortly when they will be final.
Ok.
Oops. Will do.
Yes better. Will do.
It's a builtin python object. Anyway, the function now raises a TypeError, per the latest |
This comment has been minimized.
This comment has been minimized.
Author: Nicolas M. Thiéry |
comment:26
Merged the patches from changeset e70487186111. They'll be posted on here in a bit. |
Merged: sage-4.3.alpha0 |
Changed author from Nicolas M. Thiéry to Nicolas M. Thiéry, Teresa Gomez-Diaz |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:31
Does anybody here remember the reason for the def __make_element_class__(self, cls, name = None, inherit = None):
"""
A utility to construct classes for the elements of this
parent, with appropriate inheritance from the element class of
the category (only for pure python types so far).
"""
if name is None:
name = "%s_with_category"%cls.__name__
# By default, don't fiddle with extension types yet; inheritance from
# categories will probably be achieved in a different way
if inherit is None:
inherit = not is_extension_type(cls)
if inherit:
return dynamic_class(name, (cls, self.category().element_class))
else:
return cls I just tried replacing |
This (series of) patch(es) extends the Sage category framework as a
design pattern for organizing generic code.
Latest version of the patches:
updates to the sage library (import fixes, ...)
Status and roadmap: http://trac.sagemath.org/sage_trac/wiki/CategoriesRoadMap
Some of the things done in this ticket:
Categories:
(except *WithSeveralBases which are not needed anymore; see .abstract_category())
See the category graph: attachment: sage-category-graph.pdf
should be swapped.
Reorganization of the Sage library to start using the category framework:
(note: AbelianGroup are about commutative multiplicative groups)
Hom(SomeNumberField,SomeVectorSpace) returned a numberfield homset
They should eventually be inherited from the EnumeratedSets() category
parent.product(x,y) parent.product parent.product_on_basis
(was: multiply, _multiply, multiply_basis, _multiply_basis)
parent.summation(x,y) parent.summation # risk of confusion with infinite summation / ...
parent.sum ([x,y,z,y])
parent.prod([x,y,z,y])
parent.coproduct, parent.coproduct_on_basis, parent.coproduct_on_generators
parent.antipode, parent.antipode_on_basis, parent.antipode_on_generators
cat.example() cat.counter_example()
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
Transitional aliases one = one_element, zero = zero_element
Use class.an_instance() whenever meaningful
parent.an_element() parent.some_elements(); possibly parent.example() parent.counterexample()
all_weakly_super_categories -> all_super_categories(proper=False)
CC: @sagetrac-sage-combinat @roed314 @saliola
Component: categories
Keywords: categories parents
Author: Nicolas M. Thiéry, Teresa Gomez-Diaz
Reviewer: Robert Bradshaw, Craig Citro, Florent Hivert, David Kohel, David Roe, Anne Schilling, William Stein, Javier Vengoroso
Merged: sage-4.3.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/5891
The text was updated successfully, but these errors were encountered: