annoyance with res

28 views
Skip to first unread message

David Eisenbud

unread,
May 3, 2026, 1:23:46 PMMay 3
to maca...@googlegroups.com
Is anyone else annoyed with having to type 
 LengthLimit => 
every time you compute a resolution over a factor ring of a polynomial ring? The following fixes the problem when executed within an M2 session, but causes a bug when it's in my init.m2 file. How can I fix this?

Res = method(Options => options res)
Res Ideal := o -> I -> if o.LengthLimit == infinity then 
    res(I, LengthLimit => numgens ring I) else res I
Res Module := o -> M -> if o.LengthLimit == infinity then 
    res(M, LengthLimit => numgens ring I) else res M

--
David Eisenbud
Professor of Mathematics
University of California Berkeley

Doug Torrance

unread,
May 3, 2026, 1:40:56 PMMay 3
to Macaulay2
Probably init.m2 is being loaded before Complexes (or OldChainComplexes, whichever you prefer), which defines res. So you could add an additional line right before:

needsPackage HomologicalAlgebraPackage
Res = ...

David Eisenbud

unread,
May 3, 2026, 2:37:55 PMMay 3
to maca...@googlegroups.com
That fixes it -- thanks!
David

--
David Eisenbud
Professor of Mathematics
University of California Berkeley

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/macaulay2/fcc29716-1274-427a-86d9-6be53e750298n%40googlegroups.com.

Mahrud Sayrafi

unread,
May 3, 2026, 4:05:06 PMMay 3
to maca...@googlegroups.com
My suggestion in #3166 was to make this essentially the default behavior, so that passing LengthLimit => infinity doesn't automatically produce an error (e.g. maybe compute up to numgens R + 1, as Devlin suggested in #3656, and if the last term is nonzero, print the first numgens R terms and change the printed result to explicitly indicate that the resolution continues). Locally, I've made a change similar to yours to avoid the headache, but it's very inconvenient when I switch to a server or send my scripts to someone else.

I would really prefer a global solution before Complexes becomes the default.

Mahrud

mike stillman

unread,
May 4, 2026, 4:21:22 PMMay 4
to Macaulay2
Would you be satisfied with a different solution?

Specifically, would the following functionality meet your needs?

res(Ideal, ZZ) would be the same as res(Ideal, LengthLimit => ZZ)? (Same with Module as well).

so one would do 
`res(I, 5) `
to get lengthlimit of 5.

-- Mike

On Sunday, May 3, 2026 at 1:23:46 PM UTC-4 d...@berkeley.edu wrote:

David Eisenbud

unread,
May 4, 2026, 5:06:23 PMMay 4
to maca...@googlegroups.com
My feeling is that Mahrud's solution (including the output that the resolution continues beyond the number of variables!) is the best; mine is second-best; and Mikes is an improvement over status quo, maybe sharing 2nd place...
David

--
David Eisenbud
Professor of Mathematics
University of California Berkeley

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages