Repository navigation
Center of skew rings and kernel of RingMap to skew rings - #4485
Conversation
bugs/dan/1-jacobian through 1-loadPackage. Six fixed, two duplicates, two wontfix, two filed. Filed: * Macaulay2#4589 1-join-hash -- the guess in the file is right and the saving is real. Every List construction folds the whole list (basic.d:114-117 does r.hash = hash(r); the fold is at :82-85), so join of two 200k lists costs 11.2ms of which 7.5-8.5ms is hashing -- measurable because a Sequence's hash is not cached and refolds on demand. The fold is combinable: h(L++M) = 1299833^#M * (hash L - c) + hash M mod 2^64, c = hash class L + 23407, verified on seven cases. My first attempt used the Sequence constants and failed all five, which is how the two folds turned out to differ. * Macaulay2#4590 1-kernel-ringmap -- Mike's 2008 recipe, unevenly landed. The Hilbert hint is implemented for degree-preserving maps (ringmap.m2:320-332, verified live: gb records rawGBSetHilbertFunction log), the inhomogeneous case it was written for is skipped because canUseHilbertHint requires isHomogeneous (gb.m2:271), and the recipe's forceGB step is Macaulay2#686. PR Macaulay2#4485 is adding another strategy to the same table. Duplicates, both with comments posted: 1-kernel-ringmap-ZZ -> Macaulay2#1518 (the message moved to methods.m2:695, and ringmap.m2:336's ZZ strategy only fires when the source is ZZ itself), 1-line-wrapping-with-negative-numbers -> Macaulay2#4149 (the same splitcolumn gap one character class over; three lines still end in a bare hyphen). Fixed: 1-leadTerm-crash.m2 (the ignored engine error is propagated, so enginering.m2:496 errors instead of smoking), 1-lift-RR-CC (both spellings return precision 53), 1-lift-modules (lift((QQ[x])^3, QQ) is QQ^3), 1-lifting (.3 * id_(QQ^3) is over RR_53 now, and promote(.3, QQ) errors -- the direction PR Macaulay2#62 on MichaelABurr/M2 is formalising), 1-lcm-needed (implemented, gcd compiled at 14.3us on 700-digit inputs, and the Binary ask declined on measurement: 9.7ms through Binary against 13.8ms for a hand fold), 1-loadPackage (PR Macaulay2#3852's warning meets the need; the file's own example is invalid today for a rank reason and fails identically with no reload). Wontfix: 1-jacobian (the intrinsic object is one line away, and jacobian-doc documents the present behaviour as "identical to jacobian generators I"), 1-list-of-ideals-of-R (asked and declined in PR Macaulay2#3328). dan/1 todo 154 -> 142, settled 351 -> 363.
|
@MichaelABurr @ggsmith any progress reviewing this? |
| Z.formation = FunctionApplication {centerRing, R}; | ||
|
|
||
| map(R, Z, phi^-1 matrix {ximages | yimages}) | ||
| )) No newline at end of file |
There was a problem hiding this comment.
Please add a newline at the end of the file.
MichaelABurr
left a comment
There was a problem hiding this comment.
This looks good to me for the most part. There are a few stylistic changes that should be made. It includes some tests and has documentation.
| "capture", | ||
| "catch", | ||
| "ceiling", | ||
| "centerRing", |
There was a problem hiding this comment.
changing to 4 spaces instead of 8. the formatting of this file looks crazy to me in vscode so it was hard to tell what the right indentation was.
| (F',r) := flattenRing(F, CoefficientRing => k); | ||
| if R' === R and F' === F then return null; | ||
| p^-1 kernel (r * f * p^-1) | ||
| ) |
There was a problem hiding this comment.
Is the only difference here the removal of the final comma?
There was a problem hiding this comment.
That's right. Outside of the addition of the new hook method, the only non-ws change to this file is the removal of this final comma in the definition.
| ) | ||
| ) | ||
| ), | ||
| (F, R) := (target f, source f); |
There was a problem hiding this comment.
It looks like there wasn't a change here - perhaps only a change to spacing.
There was a problem hiding this comment.
Indeed, as i said in the pr description:
Note while editing ringmap.m2 I took the opportunity to clean up ws formatting in the block declaring different kernel strategies for RingMap. Consider toggling the "hide whitespace" option while reviewing this PR.
| assert (not chh or G#?"rawGBSetHilbertFunction log"); -- ensure the Hilbert function hint was actually used in gb.m2 | ||
| ideal mapback selectInSubring(1,generators G) | ||
| ), | ||
| (F, R) := (target f, source f); |
There was a problem hiding this comment.
I'm also not seeing a change in this section either - again, it might be due to a spacing change.
| if R' === R and F' === F then return null; | ||
| p^-1 kernel (r * f * p^-1) | ||
| ), | ||
| (F, R) := (target f, source f); |
There was a problem hiding this comment.
I think that the only change here was the removal of a comma.
| assert(map(kk, kk) === centerRing kk) | ||
|
|
||
| R = kk[a..c] / ideal {a^2 + b, b^2 + c^3, c^2 - a*b^2} | ||
| assert(map(R, R) === centerRing R) No newline at end of file |
There was a problem hiding this comment.
Missing newline at end of file
|
|
||
| -- inhomogeneous | ||
| g = map(R, S, {a*b*c*d + 2*a*b, c*d + 1}) | ||
| assert(ker g == ideal(t^2-2*t+1,s^2)) No newline at end of file |
There was a problem hiding this comment.
Missing newline at end of file
| SeeAlso | ||
| isCommutative | ||
| isSkewAffineRing | ||
| /// No newline at end of file |
There was a problem hiding this comment.
Missing newline at end of file
There was a problem hiding this comment.
i missed that it is standard to have a newline at the end of files. Is this part of a style guide somewhere?
|
@MichaelABurr ty so much for review and I am sorry for the confusion about the whitespace changes! I think I have responded to all of the stylistic changes you requested. I did ask one question about whether is a style guide of some sort that I have not seen. ty again! |
I didn't know that you could view the changes without the whitespace, I really appreciate knowing about that option! The newline at the end of a file isn't strictly necessary/part of our style guide, but it is part of the POSIX style. My understanding is that some software expects newlines at the ends of files (and, without it, unexpected behaviors can occur). |
|
@MichaelABurr one thing that I fussed with a bit in putting this together was whether to call the method in their own package. I guess that if multiple of these were used at once there would be problems wiht redefinition of the global symbol Do you have any thoughts about these problems and concerns? |
|
I think |
|
@d-torrance awesome. I am very happy to rebase this on top of your change when it is merged and rename |
|
Any idea what is going on here with this failure @d-torrance? I see something in my local diff against |
|
Yeah, it looks like you accidentally committed a change to the mathic submodule, rewinding it to an earlier commit that's missing the fix from Macaulay2/mathic#28 |
|
ugh got it ty so much for your help! |
Add
centerRingmethod to compute the center of a ring. Currently supports skew polynomial rings (and commutative rings 😂 ).Then adds a new strategy for computing the kernel of a RingMap whose target is SkewCommutative by reducing to a map to the center of the target.
This requires some awkward packaging since
kernelis in the core and the strategy for computing the center of a skew commutative ring depends on the PushForward package. We rely here on the "hack" of callingneedsPackageinside the hook only when needed although @d-torrance says "I'm not sure if this is a very elegant solution" and I am inclined to agree.Note while editing ringmap.m2 I took the opportunity to clean up ws formatting in the block declaring different kernel strategies for RingMap. Consider toggling the "hide whitespace" option while reviewing this PR.