-
-
Notifications
You must be signed in to change notification settings - Fork 517
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
Meta-ticket: Cleanup cartesian products #15425
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.
comment:4
Hello, +1 on that ticket! I cleaned a bit the description. I think it is bad to hide Vincent |
comment:5
We could mention it in the docstring of |
comment:6
Replying to @nathanncohen:
Sounds good to me, with 'list -> iterate through' |
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:13
Hello, I think that we should get rid of
Vincent |
comment:14
Shouldn't the two following commands give the same answer
|
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:20
Bugs 5 and 6 are still present in 9.7.beta8 |
comment:22
Bug 6 was fixed in #34652 |
Currently we have:
cartesian_product
,CartesianProduct
andcartesian_product_iterator
for constructing cartesian products.CartesianProduct
is an old simple parent that focuses on the"enumerated sets" aspect: providing counting and enumeration over
cartesian products of enumerated sets. It accepts any iterables as
input.
cartesian_product
is a "functorial construction". This meansthat it uses the categories to endow the resulting parent with as
much structure as it can lift from the input. E.g. the cartesian
product of two monoids is a monoid.
cartesian_product_iterator
is just a function that provides aniterator
To be done:
get rid of CartesianProduct #18411: Make
CartesianProduct
an alias forcartesian_product
, and possibly deprecated it. The missing features at this point are:them into parents (e.g. with
FiniteEnumeratedSet
). The overheadis probably negligible in most cases, but one would need to double
check that we don't have spots where
CartesianProduct
is usedintensively for very small calculations.
cartesian_product
AssertionError #14224 can be closed once this is fixed.CartesianProduct
still need to be lifted toSets.Finite.CartesianProducts
orEnumeratedSets.CartesianProducts
. Thecardinality
andis_finite
methods are taken care in enhanced sets and cartesian products #18290. Some otherare in get rid of CartesianProduct #18411.
CartesianProduct
inCombinatorialFreeModule
Deprecate sage.misc.mrange.*mrange* and cartesian_product_iterator #34337: Remove
cartesian_product_iterator
from the global name space, and deprecate it altogether if, after checking, it turns out to be really just a duplicated ofitertools.product
.Fix ZZ.cartesian_product(...) #16289: Fix bug in cartesian_product (reported by Vincent Delecroix in this thread):
This is a regression that is caused by a small change introduced by
Improvements to Sets.WithRealizations #12959 in
Sets.ParentMethods.CartesianProduct
:I (Nicolas) take a double blame for it: I was reviewer of this ticket
and did not notice this chunk (or don't remember why it was
introduced), and I had not written an appropriate test in the first
place. So this needs to be fixed too.
Cartesian Products of additive groups #16269: Fix bug reported by Nathann Cohen in this thread: when converting a
list to an element of a cartesian product:
The fix would be convert the operands of the list into the respective
parents in
sage.sets.cartesian_product.CartesianProduct._element_constructor
.Fix mixed cartesian products with modules and non modules:
This should instead detect that not all factors are modules, and
just use a plain cartesian product.
Also between modules on different ring, in particular Categories are wrong for Hom/cartesian products of vector spaces #18309.
Import NN directly rather than lazily throughout the Sage library #34652: Fix cartesian products involving
NN
:This is in fact a bug in the way
NN
is lazy imported in the globalname space:
Things works if one forces the import of
NN
:Make
_cartesian_product_of_elements
a public method?Add a tutorial in
Sets.SubcategoryMethods.CartesianProducts
describing the general scheme, possibly starting from the blurb there:
https://groups.google.com/d/msg/sage-combinat-devel/s_aPBD6BgOg/H1aJbCI1TYoJ
Tidy up the documentation of sage.sets.cartesian_products:
Return(s), the links to
Sets....
don't need to be prefixed withthe python module (Sets is found from the global name space), ...
Cartesian Products of additive groups #16269 and follow up Cartesian product of rings #16405 (depended on Axioms and more functorial constructions #10963): make the
cartesian product of an additive magma into an additive magma, and
so on; implement
Distributive.CartesianProducts
so that acartesian product of rings is a ring.
CC: @sagetrac-sage-combinat @nathanncohen @videlec @tscrim
Component: categories
Issue created by migration from https://trac.sagemath.org/ticket/15425
The text was updated successfully, but these errors were encountered: