{ "cells": [ { "cell_type": "markdown", "id": "9fcb21bf", "metadata": {}, "source": [ "Welcome to *IntersectionTheory*!\n", "\n", "Run the cell below to load the package. You should see the banners of Singular and GAP." ] }, { "cell_type": "code", "execution_count": 1, "id": "3ff6c1c2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " ┌───────┐ GAP 4.11.1 of 2021-03-02\n", " │ GAP │ https://www.gap-system.org\n", " └───────┘ Architecture: x86_64-pc-linux-gnu-julia64-kv7\n", " Configuration: gmp 6.2.1, Julia GC, Julia 1.6.2, readline\n", " Loading the library and packages ...\n", " Packages: AClib 1.3.2, Alnuth 3.1.2, AtlasRep 2.1.0, AutoDoc 2019.09.04, \n", " AutPGrp 1.10.2, CRISP 1.4.5, Cryst 4.1.23, CrystCat 1.1.9, \n", " CTblLib 1.2.2, FactInt 1.6.3, FGA 1.4.0, GAPDoc 1.6.3, \n", " IRREDSOL 1.4, JuliaInterface 0.5.2, LAGUNA 3.9.3, Polenta 1.3.9, \n", " Polycyclic 2.15.1, PrimGrp 3.4.0, RadiRoot 2.8, ResClasses 4.7.2, \n", " SmallGrp 1.4.1, Sophus 1.24, SpinSym 1.5.2, TomLib 1.2.9, \n", " TransGrp 2.0.5, utils 0.69\n", " Try '??help' for help. See also '?copyright', '?cite' and '?authors'\n", "Singular.jl, based on\n", " SINGULAR /\n", " A Computer Algebra System for Polynomial Computations / Singular.jl: 0.5.7\n", " 0< Singular : 4.2.0p1\n", " by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann \\\n", "FB Mathematik der Universitaet, D-67653 Kaiserslautern \\\n", " \n" ] } ], "source": [ "using IntersectionTheory" ] }, { "cell_type": "markdown", "id": "33308b1b", "metadata": {}, "source": [ "Julia needs to \"warm up\" on startup, so the first run usually takes longer. The second time it will be much faster, and then one can take on larger examples." ] }, { "cell_type": "code", "execution_count": 2, "id": "dcfb6774", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 2.279994 seconds (2.99 M allocations: 179.489 MiB, 3.12% gc time, 28.02% compilation time)\n" ] }, { "data": { "text/html": [ "$3$" ], "text/latex": [ "3" ], "text/plain": [ "3" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "@time euler(proj(2))" ] }, { "cell_type": "code", "execution_count": 4, "id": "462b8834", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.000618 seconds (935 allocations: 31.156 KiB)\n" ] }, { "data": { "text/html": [ "$3$" ], "text/latex": [ "3" ], "text/plain": [ "3" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "@time euler(proj(2))" ] }, { "cell_type": "code", "execution_count": 5, "id": "aab8b381", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.373980 seconds (2.28 M allocations: 130.774 MiB, 16.03% gc time, 5.53% compilation time)\n" ] }, { "data": { "text/html": [ "$501$" ], "text/latex": [ "501" ], "text/plain": [ "501" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "@time euler(proj(500))" ] }, { "cell_type": "markdown", "id": "38c96ae6", "metadata": {}, "source": [ "Here we showcase some of the functions one can apply to a variety:\n", "* total Chern class and Todd class;\n", "* additive basis of the Chow ring and the intersection matrix;\n", "* Hilbert polynomial;\n", "* [A-🎩 genus](https://en.wikipedia.org/wiki/Genus_of_a_multiplicative_sequence#%C3%82_genus) :)" ] }, { "cell_type": "code", "execution_count": 6, "id": "851886ab", "metadata": {}, "outputs": [ { "data": { "text/html": [ "(AbsVariety of dim 2, $1 + 3 h + 3 h^{2}$, $1 + \\frac{3}{2} h + h^{2}$, [[$1$], [$h$], [$h^{2}$]], $\\left[\\begin{array}{ccc}\n", "0 & 0 & 1 \\\\\n", "0 & 1 & 0 \\\\\n", "1 & 0 & 0\n", "\\end{array}\\right]$, $\\frac{1}{2} t^{2} + \\frac{3}{2} t + 1$, $-\\frac{1}{8}$)" ], "text/plain": [ "(AbsVariety of dim 2, 1 + 3*h + 3*h^2, 1 + 3//2*h + h^2, Vector{IntersectionTheory.ChRingElem}[[1], [h], [h^2]], [0 0 1; 0 1 0; 1 0 0], 1//2*t^2 + 3//2*t + 1, -1//8)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P2 = proj(2)\n", "P2, chern(P2), todd(P2), basis(P2), intersection_matrix(P2), hilbert_polynomial(P2), a_hat_genus(P2)" ] }, { "cell_type": "markdown", "id": "20a51468", "metadata": {}, "source": [ "We can use the argument `param` to introduce parameters. As an example we compute the [genus formula](https://en.wikipedia.org/wiki/Genus%E2%80%93degree_formula) for a plane curve." ] }, { "cell_type": "code", "execution_count": 7, "id": "23563acb", "metadata": {}, "outputs": [ { "data": { "text/html": [ "(true, $1 + d h$, $\\frac{d^{2} - 3 d + 2}{2}$)" ], "text/plain": [ "(true, 1 + d*h, (d^2 - 3*d + 2)//2)" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P2, d = proj(2, param = \"d\")\n", "arithmetic_genus = X -> (-1)^dim(X) * (chi(OO(X)) - 1)\n", "symmetric_power(d, OO(P2, 1)) == OO(P2, d), chern(OO(P2, d)), arithmetic_genus(complete_intersection(P2, d))" ] }, { "cell_type": "markdown", "id": "f7369aaa", "metadata": {}, "source": [ "Next we compute the number of lines on a cubic surface. By default it uses the Chow ring computation. Using the argument `bott = true` will switch to Bott's formula." ] }, { "cell_type": "code", "execution_count": 8, "id": "f8dd6279", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$27$" ], "text/latex": [ "27" ], "text/plain": [ "27" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "G = grassmannian(2, 4, bott = false)\n", "S, Q = bundles(G)\n", "integral(chern(symmetric_power(3, dual(S))))" ] }, { "cell_type": "markdown", "id": "e656f53e", "metadata": {}, "source": [ "Here is another non-trivial computation (the Noether--Lefschetz number of discriminant 28 for a generic pencil of Debarre--Voisin fourfolds). The same computation in Schubert2 takes about a minute." ] }, { "cell_type": "code", "execution_count": 10, "id": "18e9c1d5", "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 1.327079 seconds (12.14 M allocations: 673.788 MiB, 24.87% gc time)\n" ] }, { "data": { "text/html": [ "$5500$" ], "text/latex": [ "5500" ], "text/plain": [ "5500" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "G = flag(4,7,10, bott = true)\n", "A,B,C = bundles(G)\n", "@time integral(chern(dual(exterior_power(3,A) + exterior_power(2,A)*B + A*exterior_power(2,B))))" ] }, { "cell_type": "markdown", "id": "90169d19", "metadata": {}, "source": [ "And the mandatory [3264](https://en.wikipedia.org/wiki/Steiner's_conic_problem)." ] }, { "cell_type": "code", "execution_count": 11, "id": "60e55326", "metadata": {}, "outputs": [ { "data": { "text/html": [ "$3264$" ], "text/latex": [ "3264" ], "text/plain": [ "3264" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P2, P5 = proj(2), proj(5)\n", "v = hom(P2, P5, [2P2.O1]) # the Veronese embedding\n", "Bl, E = blowup(v) # the blowup and the exceptional divisor\n", "h = pullback(Bl → P5, P5.O1)\n", "e = pushforward(E → Bl, E(1))\n", "integral((6h - 2e)^5)" ] }, { "cell_type": "markdown", "id": "ded126dd", "metadata": {}, "source": [ "For certain numerical invariants it is not necessary to know the Chow ring. We compute the Chern numbers of the Hilbert scheme of points on a K3 surface." ] }, { "cell_type": "code", "execution_count": 12, "id": "344224e5", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Dict{AbstractAlgebra.Generic.Partition{Int64}, Nemo.fmpq} with 7 entries: 2₅ $\\Rightarrow$ $126867456$