Skip to content

Update SpecialFanoFourfolds - #4665

Open
giovannistagliano wants to merge 6 commits into
Macaulay2:developmentfrom
giovannistagliano:development
Open

Update SpecialFanoFourfolds#4665
giovannistagliano wants to merge 6 commits into
Macaulay2:developmentfrom
giovannistagliano:development

Conversation

@giovannistagliano

Copy link
Copy Markdown
Contributor

No description provided.

@d-torrance d-torrance left a comment

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.

Thanks for the update!

I have a few comments. Also, should the new features be documented?

);

-- consider implementing image(MultihomogeneousRationalMap,String) in Cremona.m2
image (WeightedRationalMap,String) := (Phi,alg) -> (

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.

Should this new method be documented?

Also, should the MultiprojectiveVarieties package also get a version bump since it's getting this new method?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, this is a very minor update. The functionality is already documented via image(MultirationalMap, String). This change simply avoids a "not implemented yet" error by automatically redirecting the call to the existing implementation.

local L; local C;
if member(recognizeDSCF X, {"DSCF-V1-31", "DSCF-V1-34"}) then (
-- last(U.cache#"exceptionalCurves") determines a conic curve on the surface U'' corresponding to another fourfold X''
assert(U.cache#?"special curves on U" and #(U.cache#"special curves on U") == 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.

I'd recommend calling error with an informative error messages so we don't just get a cryptic "assertion failed" message:

Suggested change
assert(U.cache#?"special curves on U" and #(U.cache#"special curves on U") == 1);
if not U.cache#?"special curves on U" or #(U.cache#"special curves on U") != 1
then error "informative error message";

Same comment for the other assert statements below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I replaced a few asserts with informative error messages. The remaining ones are just sanity checks for situations that should never occur, so users should never see those messages.

if o.Verbose then << "-- upper bound for the dimension of the family of reducible surfaces S ∪ P in X: " << dimFamReducSurfInX << endl;
z := 54 - (dimFamReducSurf + b - dimFamReducSurfInX);
if o.Verbose then << "-- codim. in C_8 of {[X] : S ∪ P ⊂ X} ≤ " << 54 << " - (" << dimFamReducSurf + b << " - " << dimFamReducSurfInX << ") = " << z << emo(z == 1) << endl;
return X.cache#(S,P,"parameterCount") = (z, (b+1, dimFamReducSurf, dimFamReducSurfInX));

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.

return isn't necessary on the last line of a function (if you remove the ;)

if isFanoMapStandard X and recognizeDSCF X === "DSCF-V1-20" then return (true, (sectionalGenus U)+2);
<< "-- warning: expected invariants of the K3 surface unavailable; unverified values may be used" << endl;
if isFanoMapStandard X and member(recognizeDSCF X,{"DSCF-V1-5","DSCF-V1-14"}) then return (false, (sectionalGenus U)+1);
if isFanoMapStandard X and recognizeDSCF X === "DSCF-V1-16" then (false, sectionalGenus U);

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.

The DSCF-V1-16 case is getting skipped with no return:

Suggested change
if isFanoMapStandard X and recognizeDSCF X === "DSCF-V1-16" then (false, sectionalGenus U);
if isFanoMapStandard X and recognizeDSCF X === "DSCF-V1-16" then return (false, sectionalGenus U);

G := groebnerBasis(V,Strategy=>alg);
G' := ideal sub(selectInSubring(1,G),K[x_0..x_m]);
Z := projectiveVariety(sub(G',vars ring ambient target Phi),MinimalGenerators=>false,Saturate=>false);
forceImage(Phi,Z);

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.

I'm getting an error here with this example (discovered by Claude):

i3 : kk = ZZ/101; Q = PP_kk^4; P = PP_kk(1, 1, 1, 3); R = ring Q;

o4 : ProjectiveVariety, PP^4

o5 : ProjectiveVariety, PP(1,1,1,3)

i7 : phi = (Hom(Q, P)) {random(R^1, R^{-1,-1,-1,-3})};

o7 : WeightedRationalMap (rational map from Q to P)

i8 : image(phi, "F4")
../../../../M2/M2/Macaulay2/packages/MultiprojectiveVarieties.m2:1599:10:(2):[3]: error: assertion failed
../../../../M2/M2/Macaulay2/packages/MultiprojectiveVarieties.m2:1599:10:(2): entering debugger (enter 'help' to see commands)
../../../../M2/M2/Macaulay2/packages/MultiprojectiveVarieties.m2:1599:4-1599:53: --source code:
    assert(Phi#"image" =!= null and Phi#"image" == X);

ii9 : Phi#"image" === null

oo9 = true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the example. I've fixed it.

(mu,U,exC,f) := building Utilde;
(L,C) := toSequence exC;
X := recoverFourfold Utilde;
(woWarn,g') := unverifiedExpectedGenusOfK3FromExceptionalCurves(X,U,L,C);

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.

It would be good to only run these computations if we're using one of the two new strategies


building EmbeddedK3SurfaceFromDoublySpecialCubicFourfold := E -> (
(mu,U,LC,f) := building E#"ParentK3Surface";
(mu,U,LC,toSequence prepend(f,E#"MapFromParentK3Surface"))

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.

The other building methods all return a sequence whose 4th element is a rational map. Maybe it would be good to have another way to get this map from the parent surface for consistency?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see the consistency issue. However, for this subtype, the 4th component would be the composition of all those rational maps, so achieving the same consistency would require additional computation. Also, building is mainly intended for internal use.

recoverFourfold EmbeddedK3SurfaceFromDoublySpecialCubicFourfold := E -> recoverFourfold E#"ParentK3Surface";

K3SurfaceFromDoublySpecialCubicFourfold Sequence := (E,ab) -> (
Verb := true;

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.

Is thie Verb := true still supposed to be here? It looks like maybe an artifact from debugging the code

if degree D != a*M_(0,1) + b*M_(1,1) then error "failed to obtain polarization: divisor curve has unexpected degree";
A = matrix {{2*g-2, degree D}, {degree D, M_(1,1)}};
);
if det A != det M then << ("-- incorrect lattice discriminant on the genus "|(toString g)|" K3 surface: "|(toString det A)) << endl;

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.

Should this be an error?

S := L#"UnderlyingSurface";
H := S * random(1,0_S);
C := L#"specialCurve";
assert(dim H == 1 and dim 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.

A more descriptive error message would be good here rather than assert. Also, what if C is null? Claude found the following example:

i2 : X = specialFourfold surface((2,0,0),(1,0,0),ZZ/61001);

o2 : ProjectiveVariety, cubic fourfold in C_8 containing a surface of degree 4 and sectional genus 0 and a plane

i3 : T = polarizedK3surface polarizedK3surface(X,Verbose=>false);

o3 : Lattice-polarized K3 surface associated to X — K3 status: [▓▓▓▓▓ / ▓▓▓▓▓]

i4 : T' = polarizedK3surface(T,Strategy=>"MapFromU-Virtual",Verbose=>false);

o4 : Lattice-polarized K3 surface associated to X — K3 status: [▓▓▓▓░ / ▓▓▓▓▓]

i5 : L = T'(1,1);
-- (▫) constructing K3 surface of genus 12 in PP^12
  -- using divisor D = aH+bC, with D^2=22=2*12-2, where (a,b) = (1,1)
-- warning: lattice polarization is virtual; rerun polarizedK3surface with an appropriate option, e.g. Strategy=>"SpecialCurve"

o5 : Virtual lattice-polarization on K3 surface associated to X

i6 : basis L
stdio:6:5:(3):[1]: error: no method found for applying dim to:
     argument   :  null (of class Nothing)

@giovannistagliano

Copy link
Copy Markdown
Contributor Author

Thank you for the many suggestions. I'll address them soon.

@giovannistagliano

Copy link
Copy Markdown
Contributor Author

I think I've addressed all or almost all of the requested changes. Thanks a lot for the comments. I might still make a few small updates over the next few days.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants