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
LatticePoset: bug in testing semidistributivity #21340
Comments
comment:2
Ready for review, but let's first wait if discussion at https://groups.google.com/forum/#!topic/sage-devel/ZtwUc5c4Js0 founds better solution. New commits:
|
Commit: |
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:4
Leif, can you check this basically one line patch? |
comment:5
This is a massive hack solution that comes from this behavior: sage: log(8, 2)
3
sage: log(8, int(2))
log(8)/log(2)
sage: log(int(8), int(2))
log(8)/log(2) If we are to accept this hack, we should well document it as such. |
comment:6
Well, of course right solution would be correcting
Should I just remove the quick test of non-semidistributivity then? Won't make much difference. |
comment:7
The biggest thing is just documenting why we are doing certain things, so when we go back and look again or someone else comes and looks at it, it is clear why things were done this way. One option would be wrapping the inequality test in
Again, there should be a comment. Another option would be to do |
comment:8
Replying to @tscrim:
Quoting from sage-devel:
So I'd suggest to rewrite the code, and/or call the proper |
comment:9
(The left side of the comparison doesn't matter here, but note that
and
give different results due to the behaviour of |
comment:10
Maybe I just wrote the
(On x86 one could use |
comment:11
See also the If you just want to know whether You could likewise use Python's |
comment:12
Replying to @nexttime:
Isn't there the same rounding problem with |
comment:13
Replying to @jm58660:
Probably not for true powers of 2; don't know why Sage's log() is so bad in that regard. (How large does FWIW, if you want to stay in the integer domain, you could as well use But that's perhaps already towards bike-shedding. Especially if you know But doesn't already using |
comment:14
Replying to @nexttime:
It should be safe up to at least 252+ (maybe even up to 21022+) because Python's |
comment:15
Distantly related: While we (you?) are at it, |
comment:16
Replying to @nexttime:
Other than But yes, you are right. Kevin said the same at #21002. Suggestion for better name? |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:18
OK, should work now. Also function name changed. |
comment:19
Replying to @jm58660:
Doesn't the latter require a deprecation of the old function first? |
comment:20
Replying to @jm58660:
Yes. The first (I think) being
(I guess you were referring to I'd rather keep the But then you'd have to first make the old behaviour the default, for backwards compatibility. |
comment:21
Perhaps a bit late, but did you look at |
comment:22
Replying to @nexttime:
I have thinked that |
comment:23
Replying to @nexttime:
I can think those later in another ticket. Actually there is more to think about in splitting code in But is there more to do for this ticket?
|
comment:24
Assuming that #21419 get accepted it offers a faster way to chech if a lattice is semidistributive. |
comment:25
Just a ping... Currently Sage says that a distributive lattice is not semidistributive, which is bad. There are more to add, but IMO bugs should be corrected first. Replying to @jm58660:
|
comment:26
ok, ok. It would have been better to put this log2 in some other place. |
Reviewer: Frédéric Chapoton |
comment:27
Replying to @fchapoton:
But I think that someone, "Frédéric" if I remember the name correctly, is converting SageMath to Python 3. |
Changed branch from u/jmantysalo/latticeposet__bug_in_testing_semidistributivity to |
Sage says that the Boolean lattice of
2^3=8
elements is not [meet|join]-semidistributive. This is due to comparison in logarithm of SageInteger
.CC: @nexttime
Component: combinatorics
Author: Jori Mäntysalo
Branch/Commit:
68419a4
Reviewer: Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/21340
The text was updated successfully, but these errors were encountered: