Examples from Schubert2

This page collects examples translated from the Schubert2 package for Macaulay2 into OSCAR's intersection theory module. Each section corresponds to one example page from the Schubert2 documentation.

Lines on hypersurfaces

The number of lines on a cubic surface is a classical result: there are 27. In Schubert2, this is computed using the Grassmannian $\mathrm{Gr}(2,4)$ and the third symmetric power of the quotient bundle.

julia> G = abstract_grassmannian(2, 4);

julia> S, Q = tautological_bundles(G);

julia> B = symmetric_power(Q, 3);

julia> integral(top_chern_class(B))
27

More generally, linear_subspaces_on_hypersurface(1, d) counts lines on a degree-$d$ hypersurface in $\mathbb{P}^n$ where $n = (d+3)/2$:

julia> linear_subspaces_on_hypersurface(1, 3)
27

julia> linear_subspaces_on_hypersurface(1, 5)
2875

Conics on a quintic threefold

The number of conics on a generic quintic threefold in $\mathbb{P}^4$ is 609250. This computation uses a projective bundle over the Grassmannian.

julia> G = abstract_grassmannian(3, 5);

julia> USBd = dual(tautological_bundles(G)[1]);

julia> F = symmetric_power(USBd, 2);

julia> PF = projective_bundle(F);

julia> A = symmetric_power(USBd, 5) - symmetric_power(USBd, 3) * OO(PF, -1);

julia> integral(top_chern_class(A))
609250

The Horrocks–Mumford bundle

The Horrocks–Mumford bundle is a rank-2 vector bundle on $\mathbb{P}^4$ with Chern class $1 + 5h + 10h^2$. It is the cohomology bundle of its Beilinson monad:

\[0 \rightarrow \mathcal{O}_{\mathbb{P}^4}^5(2) \rightarrow \bigwedge^2\mathrm{T}^*_{\mathbb{P}^4}(5) \rightarrow \mathcal{O}_{\mathbb{P}^4}^5(3) \rightarrow 0.\]

julia> P4 = abstract_projective_space(4);

julia> h = gens(P4)[1];

julia> F = abstract_bundle(P4, 2, 10*h^2 + 5*h + 1);

julia> rank(F)
2

julia> hilbert_polynomial(F)
1//12*t^4 + 5//3*t^3 + 125//12*t^2 + 125//6*t + 2

julia> 2*exterior_power(cotangent_bundle(P4), 2)*OO(P4, 5) - 5*OO(P4, 2) - 5*OO(P4, 3) == F
true

Riemann–Roch on a surface

The Todd class and arithmetic genus of $\mathbb{P}^2$:

julia> P2 = abstract_projective_space(2);

julia> euler_characteristic(OO(P2))
1

Schubert calculus on Grassmannians

The Grassmannian $\mathrm{Gr}(2,4)$ parametrizes lines in $\mathbb{P}^3$.

julia> G = abstract_grassmannian(2, 4);

julia> S, Q = tautological_bundles(G);

julia> total_chern_class(S * Q)
c[1]^2 + 2*c[2]^2 + 1

julia> total_chern_class(dual(S) * Q)
7*c[1]^2 - 12*c[1]*c[2] - 4*c[1] + 6*c[2]^2 + 1

julia> total_chern_class(dual(S) * Q) == total_chern_class(tangent_bundle(G))
true

Lines on a quintic threefold via Schubert calculus on $\mathrm{Gr}(2,5)$:

julia> G = abstract_grassmannian(2, 5);

julia> S, Q = tautological_bundles(G);

julia> integral(top_chern_class(symmetric_power(dual(S), 5)))
2875

Space conics meeting 8 lines

The number of space conics (conics in $\mathbb{P}^3$) meeting 8 given lines is 92. This is computed on the projective bundle of symmetric squares over $\mathrm{Gr}(3,4)$.

julia> G = abstract_grassmannian(3, 4);

julia> S, Q = tautological_bundles(G);

julia> PF = projective_bundle(symmetric_power(dual(S), 2));

julia> p = structure_map(PF);

julia> d1 = pullback(p, -chern_class(S, 1));

julia> z = polarization(PF);

julia> integral((2*d1 + z)^8)
92

Elliptic cubics on a sextic fourfold

The number of elliptic cubics on a generic sextic fourfold in $\mathbb{P}^5$:

julia> G = abstract_grassmannian(3, 6);

julia> S, Q = tautological_bundles(G);

julia> USBd = dual(S);

julia> B = symmetric_power(USBd, 3);

julia> PF = projective_bundle(B);

julia> A = symmetric_power(USBd, 6) - symmetric_power(USBd, 3) * OO(PF, -1);

julia> integral(top_chern_class(A))
2734099200

Correspondence with Schubert2

The following table shows the naming correspondence between Schubert2 (Macaulay2) and OSCAR's IntersectionTheory module.

Schubert2 (M2)IntersectionTheory (OSCAR)
flagBundle({k,n-k})abstract_grassmannian(k, n)
abstractProjectiveSpace'abstract_projective_space
bundles Gtautological_bundles(G)
symmetricPower(k, F)symmetric_power(F, k)
exteriorPower(k, F)exterior_power(F, k)
integral chern(r, F)integral(top_chern_class(F))
chi Feuler_characteristic(F)
todd Xtodd_class(X)
chern Ftotal_chern_class(F)
OO_X(n)OO(X, n)
projectiveBundle'(F)projective_bundle(F)
abstractSheaf(X, ...)abstract_bundle(X, r, c)
degeneracyLocus(k,F,G)degeneracy_locus(F, G, k)
degeneracyLocus2(k,F,G)degeneracy_locus(F, G, k; class=true)

Schubert2 code snippets (for direct comparison)

27 lines on a cubic surface

G = flagBundle({2,2})
bundles G
integral chern(4, symmetricPower(3, QQ_G))

2875 lines on a quintic threefold

G = flagBundle({2,3})
bundles G
integral chern(6, symmetricPower(5, dual SS_G))

609250 conics on a quintic threefold

G = flagBundle({3,2})
S = dual (bundles G)#0
X = projectiveBundle'(symmetricPower(2,S))
integral chern(11, symmetricPower(5,S) - symmetricPower(3,S)*OO_X(-1))

92 conics in space meeting 8 lines

G = flagBundle({3,1})
S = dual (bundles G)#0
X = projectiveBundle'(symmetricPower(2,S))
integral((2 * pullback chern(1,(bundles G)#1) + chern(1,OO_X(1)))^8)