Repository navigation
Conversation
|
Has a merge conflict now; maybe merge PR #203 before resolving the merge conflict? |
730e0e9 to
a6dbfae
Compare
|
Done! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #202 +/- ##
==========================================
+ Coverage 67.76% 68.71% +0.95%
==========================================
Files 88 88
Lines 12914 12913 -1
==========================================
+ Hits 8751 8873 +122
+ Misses 4163 4040 -123
🚀 New features to boost your workflow:
|
| # reset n, if the layer is finite, and compute divisors | ||
| if p > 0 then | ||
| m := Gcd( n, p^l ); | ||
| m := Gcd( n, p ); |
There was a problem hiding this comment.
Why is this correct? I would assume that if we hav a p-layer of length l, it means we can go up to p^l down, so Gcd(n, p^l) seems plausible, at least on the surface? Mind you, without having read or understood the rest of the PR.... I guess either comments or "speaking" variables names would help, I have no idea what m is supposed to be at this point.
Maybe it would be better to split this PR after all, as it is not completely clear to me which bits belong to which bugfix, and also I have different trust levels in different parts
There was a problem hiding this comment.
My understanding is this: we're looking for subgroups of
If my interpretation is correct, I don't see why one would take
Some comments explaining this would definitely help, I agree.
There was a problem hiding this comment.
That does sound plausible, I'll try to have another look at the code tonight to see if I can make sense of it with that idea in mind.
There was a problem hiding this comment.
This goes beyond this PR, but still want to ask: Doesn't this just mean m = 1 ? If so perhaps better to write it as such and move it before the computation of d?
There was a problem hiding this comment.
This also looks very similar to the two changes I commented on with "Looks good, makes sense" -- perhaps those two can go in their own PR, together with a change here (I imagine the code would look similar in all three places)?
There was a problem hiding this comment.
OK, here it takes about "normed bases in m^l" which could perhaps support the Gcd(n,p) vs. Gcd(n,p^l) bit above.
It also raises new questions, though, like, what does "in m^l" even mean 😂
There was a problem hiding this comment.
I interpreted
| dep := List( e, PositionNonZero ); | ||
| ind := List( [1..Length(e)], x -> e[x][dep[x]] ); | ||
| ind := Product( ind ) * m^(l - Length(e)); | ||
| if ind <= m then | ||
| if n mod ind = 0 then |
There was a problem hiding this comment.
OK, so dep contains the positions of the "lead terms" (pivots), while ind contains the values of said lead terms. Why it is called ind remains a mystery. sigh.
But then we compute the product of these values in ind, and multiply this by a power of m... WHAT? Comments would be sooooooo nice... sigh
I have absolutely no idea whether the change here is correct, neither the old nor the new code make sense to me at this point :-(.
There was a problem hiding this comment.
I think ind really stands for "index". This index is the product of the pivots, but some are missing because their vectors are trivial in the quotient
The function returns a list of records, each containing repr, which is a subgroup ind. And by working on the next layers we still need to find a subgroup n / ind, so that ind does not divide n, then
In particular, the old condition ind <= m also really required m to be either n or p^l, I think, now that m is either n or p this would give incomplete results when not erroring.
| if n = 1 then | ||
| return [rec( repr := G, norm := G, open := 1 )]; | ||
| elif IsTrivial(G) then | ||
| return []; | ||
| fi; |
| if n = 1 then | ||
| return [G]; | ||
| elif IsTrivial(G) then | ||
| return []; | ||
| fi; | ||
|
|
|
I added some explanations. If those make sense to you, I can add some comments to hopefully make it more clear what the function does. The two "trivial case handling" changes can easily be split off in a separate PR, if you want. The other two bugs would both need a change in the |
Ah, yes, that sounds like a good idea: what you write does sound sensible to me. So if you add some comments along those lines, I could then read it again, and see if it makes more sense and possible suggest further comment tweaks. Thank you! |
|
I've added (hopefully) more helpful comments. I'll try split off the "trivial cases" changes in a separate PR and then rebase this one on top of that one. |
efa5d23 to
a2247fe
Compare
Closes #201. Builds on top of #209.
AI Disclosure: bugs discovered by GPT-6 Astra during a package audit.