Skip to content

PieriMaps: 2.0 overhaul#4246

Merged
d-torrance merged 4 commits intoMacaulay2:developmentfrom
kellerlv:pierimaps-overhaul
May 4, 2026
Merged

PieriMaps: 2.0 overhaul#4246
d-torrance merged 4 commits intoMacaulay2:developmentfrom
kellerlv:pierimaps-overhaul

Conversation

@kellerlv
Copy link
Copy Markdown
Contributor

@kellerlv kellerlv commented May 2, 2026

Adds projection-direction maps (dualPieri, dualPieriColumn, dualLR),
point evaluators (applyPieri, applyPieriColumn, applyLR, applyDualPieri,
applyDualLR, applyDualPieriColumn), three basis conventions
(Row / Filling / Weyl) with conversion utilities, GL_n equivariance
and well-definedness checkers (verifyEquivariant, verifyWellDefined),
and symbolic display of any constructed map (symbolicForm).

Adds projection-direction maps (dualPieri, dualPieriColumn, dualLR),
point evaluators (applyPieri, applyPieriColumn, applyLR, applyDualPieri,
applyDualLR, applyDualPieriColumn), three basis conventions
(Row / Filling / Weyl) with conversion utilities, GL_n equivariance
and well-definedness checkers (verifyEquivariant, verifyWellDefined),
and symbolic display of any constructed map (symbolicForm).
@kellerlv
Copy link
Copy Markdown
Contributor Author

kellerlv commented May 2, 2026

One comment about this: since version 1.0 was verified as a JSAG paper, the citation generator was automatically adding me as an author of the actual JSAG article, which isn't correct. So I manually removed the JSAG certification but kept a line in the documentation stating that 1.0 was certified. However, it seems like a small oversight that any authors added after JSAG certification are automatically added as authors of the actual JSAG article.

@d-torrance
Copy link
Copy Markdown
Member

Yeah -- that's definitely a minor bug with the PackageCitations package. But on the other hand, keeping track of two separate sets of authors in the package metadata doesn't seem great, either. The solution is to use a Citation key in the main doc node of the package, e.g.,:

Citation
@article{Galuppi_2025,
title={Geometry of First Nonempty Terracini Loci},
ISSN={1793-6683},
url={http://dx.doi.org/10.1142/S0219199725500531},
DOI={10.1142/s0219199725500531},
journal={Communications in Contemporary Mathematics},
publisher={World Scientific Pub Co Pte Ltd},
author={Galuppi, Francesco and Santarsiero, Pierpaola and Torrance, Douglas A. and Turatti, Ettore Teixeira},
year={2025},
month=apr }

Copy link
Copy Markdown
Member

@d-torrance d-torrance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I have a few comments

Comment thread M2/Macaulay2/packages/PieriMaps.m2
Comment thread M2/Macaulay2/packages/PieriMaps/doc.m2 Outdated
Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
Comment thread M2/Macaulay2/packages/PieriMaps.m2
Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
orderedCols := {};
for c in choice do (
totalSign = totalSign * (c#0);
orderedCols = append(orderedCols, c#1);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See append comment above

Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
- Bring back the Certification block; drop the manual JSAG paragraph
  in favor of a Citation key in the main doc node.
- error("...", x) instead of error("..." | toString x).
- Swap append-in-loop for `for ... list` / `apply` / MutableList
  (avoids O(n^2)).  Same trick for the offsets builds in pmGet*Blocks.
Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
Comment thread M2/Macaulay2/packages/PieriMaps.m2
Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
- ??= for memoize-or-compute (the *Cache helpers, the inner straighten
  memo, the symbolicForm cache slots).
- ?? for read-with-default (`if H#?k then H#k else d` -> `H#k ?? d`)
  and for accumulate-or-init (`H#k = (H#k ?? 0) + new`).
- Default symbolicForm basis labels are 0-indexed instead of 1-indexed.
Copy link
Copy Markdown
Member

@d-torrance d-torrance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates! Found one more append issue

Comment thread M2/Macaulay2/packages/PieriMaps.m2 Outdated
Same for-list idiom on the v1.0 leftovers.  Drops `when true` and a
dead `output := {}` in pieriHelper too.
@mahrud
Copy link
Copy Markdown
Member

mahrud commented May 3, 2026

@d-torrance this is a good suggestion to support: accumulate-or-init H#k = (H#k ?? 0) + new. Maybe H#k += new should do this automatically even if H#k doesn't exist yet?

Copy link
Copy Markdown
Member

@d-torrance d-torrance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again! Tentatively approving pending the Ubuntu builds finally working. (We're still recovering from a cyberattack on Canonical the other day, and fetching information from their servers keeps timing out...)

@d-torrance
Copy link
Copy Markdown
Member

this is a good suggestion to support: accumulate-or-init H#k = (H#k ?? 0) + new. Maybe H#k += new should do this automatically even if H#k doesn't exist yet?

This reminds me of Python's defaultdict class:

>>> import collections
>>> x = collections.defaultdict(lambda:0)
>>> x[0]
0
>>> x[1] += 1
>>> x[1]
1

We could do it all at top level if we use _ instead of #:

i1 : DefaultDict = new SelfInitializingType of MutableHashTable;

i2 : new DefaultDict from Function := (T, f) -> (
         d := new DefaultDict;
         d.DefaultFactory = f;
         d);

i3 : DefaultDict_Thing := (d, k) -> (
         if d#?k then d#k
         else d#k = d.DefaultFactory());

i4 : DefaultDict_Thing = (d, k, e) -> d#k = e;

i5 : x = DefaultDict(() -> 0)

o5 = DefaultDict{...1...}

o5 : DefaultDict

i6 : x_0

o6 = 0

i7 : x_1 += 1

o7 = 1

i8 : x_1

o8 = 1

@d-torrance d-torrance merged commit fa04171 into Macaulay2:development May 4, 2026
10 of 13 checks passed
@mahrud
Copy link
Copy Markdown
Member

mahrud commented May 4, 2026

That's way too complicated. I would prefer something simple and intuitive, e.g. maybe H#k op= x initialize H#k with the unit of op (so 0 for += and -= but 1 for *= and /=). Anyway, let's continue elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants