Skip to content
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

small NormalToricVarieties fix to retain CoefficientRing and Variable #3442

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions M2/Macaulay2/packages/NormalToricVarieties/ToricVarieties.m2
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ regularSubdivisionLocal (NormalToricVariety, List, List) := (X,s,w) -> (
coneList = drop (coneList,{k,k}) | coneList')
);
if coneList == max X then return X;
Y := normalToricVariety (rayList, coneList);
Y := normalToricVariety (rayList, coneList, CoefficientRing => X.cache.CoefficientRing, Variable => X.cache.Variable);
Y.cache.Weights = apply (#rayList, i -> wtg i);
Y
);
Expand Down Expand Up @@ -693,13 +693,13 @@ toricBlowup (List, NormalToricVariety, List) := NormalToricVariety => (s, X, v)
if member (s#0,t) then continue
else sort (t | s)
);
return normalToricVariety (rays X, coneList | coneList')
return normalToricVariety (rays X, coneList | coneList', CoefficientRing => X.cache.CoefficientRing, Variable => X.cache.Variable)
);
coneList' = for t in clStar list (
if all (s, i -> member (i,t)) then continue
else t | {n}
);
Z := normalToricVariety (rays X | {v}, coneList | coneList');
Z := normalToricVariety (rays X | {v}, coneList | coneList', CoefficientRing => X.cache.CoefficientRing, Variable => X.cache.Variable);
Z.cache.toricBlowup = X;
Copy link
Member

Choose a reason for hiding this comment

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

Do you know why the base X is cached here but not above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure I understand the question - where above would/should X be cached?

Copy link
Member

Choose a reason for hiding this comment

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

Like 5 lines above, the other case where a toric variety is constructed and returned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see now - I'm not sure why that differs. I could add the base into the cache, unless @ggsmith or anyone else has objections?

Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency, I think that the base toric variety should also be cached in the #s === 1 case. @Devlin-Mallory can you also make this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Contributor

Choose a reason for hiding this comment

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

These changes look good to me.

Z
);
Expand Down
Loading