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
Poset / LatticePoset: [meet|join]matrix algorithm #17216
Comments
Author: Jori Mäntysalo |
Commit: |
comment:2
A slightly better(?) version for It seems to already have a complexity on New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:6
Hello ! Thanks you for this branch, it is nice code. A couple of comments and it can go:
Nathann |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Reviewer: Nathann Cohen |
comment:8
|
comment:9
Yo !
Well. I just asked a friend, and as usual it depends on the definition that you prefer. He told me that a lattice should have a maximum and minimum element. The definition I prefer is that "any two guys have both a meet and a join", which hold for an empty set. I do not mind much to be honest, I always suspect other to use different conventions than I, so I usually do not trust softwares for that
Oh, I had not seen that the code was already like that before you modified it. Well, looks good to go ! Nathann |
comment:11
Has anyone checked that we do get speedups in meet/join matrix? For the definition of a lattice, I've also been told you want a unique meet and join. Otherwise just the existence is something like regular poset, sorry I forget the exact term right now. Also could you make the very minor change: - return matrix(ZZ, [[n-1-join[n-1-x][n-1-y] for y in range(n)] for
- x in range(n)])
+ return matrix(ZZ, [[n-1-join[n-1-x][n-1-y] for y in range(n)]
+ for x in range(n)]) IMO it makes the code easier to read, but feel free to disregard. |
comment:12
Actually, you can't remove that function from the category without deprecating it. |
comment:13
About speedup: For example after Suggestion of code formatting is good. When is |
comment:14
Look at the code, and you will see that the algorithm never changed. It is only code simplification. For instance a call to 'max' instead of computing the max by hand, for instance list-comprehension instead of successive calls to 'append'. And a copy of a matrix is avoided too.
Travis, please read the code for your question is answered there.
Please don't change the status of a ticket that has been reviewed unless you see something which is actually wrong. Something more important than moving a 'for' around. Nathann |
comment:15
If such an object exists somewhere in Sage then we should not move the function from the category file to the lattice file, for that would be a regression. If such an object does not exist there is no reason to add a deprecation. Bear in mind that an object that currently belongs to the category of Nathann |
comment:16
Here is the thing: some guys in Sage rewrote method inheritance and call that "categories". A Lattice belongs to several "categories" by default:
Now, you can create any class and make it belong to the category of Which means that if you want the And chances are that nobody ever did that, for removing that function from the category while re-implementing it in the poset files did not break any doctest. Nathann |
comment:17
First off, I changed the status because there was no evidence that people had run any timings. This is why I changed it to Categories also can carry mathematical information as well, in particular for morphisms. The issue I'm raising about why the method needs to be deprecated is this. Suppose I have some personal code for a finite poset that does not inherit from There is likely some duplication from things in |
comment:18
Replying to @nathanncohen:
But Travis had also other points. It does not bother me, because this is an enhancement, not a bug (and nothing like changing I don't quite get this category thing. For example there is no category for semilattices, but there is for lattices if I remember correctly. But anyways, I'll put a deprecation to categories code. |
comment:19
Replying to @jm58660:
Well, no one currently has a need for those categories, or at least could put any generic code in them.
I think you're better off removing the one in |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:21
Rollback done, Is it so that function on "real" class overrides function with same name in category? If so, then in principle there could be Anyways, this is now ready for review. Another thing is making documentation better. There is simply no point to make user to look different places for |
comment:22
Replying to @jm58660:
Thanks.
Yes, that's correct. Such a method would be a good benefit, although it might be good for it to also be an enumerated set. However a lattice morphism is stronger than a poset morphism, in that we must also have
How most (from my experience) people get documentation is interactively (i.e. |
Changed reviewer from Nathann Cohen to Nathann Cohen, Travis Scrimshaw |
Changed branch from u/jmantysalo/poset___latticeposet___meet_join_matrix_algorithm to |
Because
join()
andmeet()
are defined on [meet|join]lattices, not on posets, it is logical to also movejoin_matrix()
andmeet_matrix()
there.On
hasse_diagram.py
there is for exampleThis is unneeded, because
lequal_matrix()
already contains ones at diagonal. We can use_leq_matrix
directly. There are also few other places to small optimization.At the same time I suggesg moving
is_lattice()
toposets.py
from category code, becauseis_[meet|join]_semilattice()
already is there.CC: @nathanncohen
Component: combinatorics
Author: Jori Mäntysalo
Branch/Commit:
391c03b
Reviewer: Nathann Cohen, Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/17216
The text was updated successfully, but these errors were encountered: