Differences
This shows you the differences between two versions of the page.
— | user_guide:tutorials:latest:apps_fulton [2023/11/06 10:57] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Toric polymake tutorial ====== | ||
+ | |||
+ | This tutorial will go over the basics of polymake and then focus on the '' | ||
+ | |||
+ | ===== Quick start ===== | ||
+ | |||
+ | Below you see a small sample session. First switch to the application with the following command. | ||
+ | |||
+ | <code perl> | ||
+ | > application " | ||
+ | </ | ||
+ | Start by creating a cone. | ||
+ | |||
+ | <code perl> | ||
+ | > $c = new Cone(INPUT_RAYS=> | ||
+ | > print $c-> | ||
+ | </ | ||
+ | You can ask for the binomials generating the associated toric ideal in two ways: The first gives a matrix of the binomial exponents, the second gives you the actual binomials. | ||
+ | |||
+ | <code perl> | ||
+ | > $toric = $c-> | ||
+ | > print $toric-> | ||
+ | > print join(" | ||
+ | </ | ||
+ | Asking for properties of the toric variety is done in the same manner as for polytopes. | ||
+ | |||
+ | <code perl> | ||
+ | > $tv = new NormalToricVariety($c); | ||
+ | > print "Is smooth? ", $tv-> | ||
+ | > print "Is affine? ", $tv-> | ||
+ | > print "Is orbifold? ", $tv-> | ||
+ | > print "Is complete? ", $tv-> | ||
+ | > $tv-> | ||
+ | </ | ||
+ | ===== Affine toric varieties ===== | ||
+ | |||
+ | Affine toric varieties arise from cones. To dualize a (pointed) cone just construct a new cone switching facets and rays. | ||
+ | |||
+ | <code perl> | ||
+ | > $sigma = new Cone(INPUT_RAYS=> | ||
+ | > $sigmad = polarize($sigma); | ||
+ | > print $sigmad-> | ||
+ | > print $sigmad-> | ||
+ | > print $sigmad-> | ||
+ | </ | ||
+ | The exponent vectors of the binomials generate the lattice of relations of the Hilbert basis of the dual cone. In particular we have | ||
+ | |||
+ | <code perl> | ||
+ | > $hb = $sigmad-> | ||
+ | > $binomials = $sigmad-> | ||
+ | > print $binomials * $hb; | ||
+ | </ | ||
+ | === Cyclic quotient singularities === | ||
+ | |||
+ | Two-dimensional pointed cones in two-dimensional space can always be generated by two rays in the standard form '' | ||
+ | |||
+ | <code perl> | ||
+ | > $N7Q3 = new CyclicQuotient(N=> | ||
+ | > print primitive($N7Q3-> | ||
+ | </ | ||
+ | CQS are deeply connected with the associated continued fractions. | ||
+ | |||
+ | <code perl> | ||
+ | > $cf = new Vector< | ||
+ | > print $cf, " | ||
+ | > print $cf->[0] -1/( $cf->[1] -1/ $cf-> | ||
+ | > $dcf = new Vector< | ||
+ | > print $dcf, " | ||
+ | > print $dcf-> | ||
+ | </ | ||
+ | If we start with the Hilbert basis of the dual cone, sorted by first coordinate: | ||
+ | |||
+ | <code perl> | ||
+ | > print $N7Q3-> | ||
+ | > $sorted = new Matrix(sort(@{$N7Q3-> | ||
+ | > print $sorted; | ||
+ | </ | ||
+ | Then the dual continued fraction expansion of '' | ||
+ | |||
+ | <code perl> | ||
+ | > print $sorted-> | ||
+ | > print $sorted-> | ||
+ | </ | ||
+ | Q: Derive and prove the general relation formula. | ||
+ | |||
+ | ==== Projective varieties ==== | ||
+ | |||
+ | Projective toric varieties arise from polytopes. Normal projective toric varieties arise from fans. To construct a projective toric variety, simply take the normal fan of a polytope and give it to the '' | ||
+ | |||
+ | <code perl> | ||
+ | > $PP2 = new NormalToricVariety(normal_fan(simplex(2))); | ||
+ | > print $PP2-> | ||
+ | > print $PP2-> | ||
+ | > $PP2-> | ||
+ | </ | ||
+ | The Hasse diagram looks as follows: | ||
+ | |||
+ | <code perl> | ||
+ | > $PP2-> | ||
+ | </ | ||
+ | Now consider the following two cones: | ||
+ | |||
+ | <code perl> | ||
+ | > $c1 = new Cone(simplex(2)); | ||
+ | > print $c1-> | ||
+ | > $c2 = new Cone(simplex(2, | ||
+ | > print $c2-> | ||
+ | </ | ||
+ | Lets look at the associated toric ideals: | ||
+ | |||
+ | <code perl> | ||
+ | > print "C1: ", join(" | ||
+ | > print "C2: ", join(" | ||
+ | </ | ||
+ | The first ideal is actually '' | ||
+ | |||
+ | Q: What are these projective varieties? | ||
+ | |||
+ | === A non-projective toric variety === | ||
+ | |||
+ | Not every fan is the normal fan of a polytope. Here we give an example. | ||
+ | |||
+ | <code perl> | ||
+ | > $f = new PolyhedralFan(INPUT_RAYS=> | ||
+ | > [[1, | ||
+ | > [0, | ||
+ | > INPUT_CONES=> | ||
+ | > [1, | ||
+ | > [0, | ||
+ | > ); | ||
+ | > $tv = new NormalToricVariety($f); | ||
+ | > print " | ||
+ | > print " | ||
+ | > print " | ||
+ | > $tv-> | ||
+ | </ | ||
+ | === Hirzebruch surfaces === | ||
+ | |||
+ | Hirzebruch surfaces come from two-dimensional complete fans with exactly four rays. Smoothness makes it possible to bring these fans into a standard form such that we arrive at a one-parameter family. | ||
+ | |||
+ | <code perl> | ||
+ | > $h1 = hirzebruch_surface(1); | ||
+ | > print $h1-> | ||
+ | > $h1-> | ||
+ | > $h2 = hirzebruch_surface(2); | ||
+ | > print $h2-> | ||
+ | > $h2-> | ||
+ | </ | ||
+ | Q: Construct the/an associated polytope. | ||
+ | |||
+ | Q: Prove the standard form for complete smooth fans in two dimensions with exactly four rays. | ||
+ | |||
+ | polymake has a method to reconstruct a polytope from a regular fan / projective toric variety. | ||
+ | |||
+ | <code perl> | ||
+ | > $A = generating_polyhedron_facets($h2); | ||
+ | > print $A; | ||
+ | </ | ||
+ | This polytope has the given fan as a normal fan. | ||
+ | |||
+ | <code perl> | ||
+ | > $P = new Polytope(INEQUALITIES=> | ||
+ | > $FF = normal_fan($P); | ||
+ | > print $FF-> | ||
+ | > print $FF-> | ||
+ | </ | ||
+ | The polytope we just constructed looks like: | ||
+ | |||
+ | <code perl> | ||
+ | > $P-> | ||
+ | </ | ||
+ | The polytope is not unique. Any polytope with the same facet vectors and combinatorics will have the same normal fan. | ||
+ | |||
+ | Its normal fan is exactly the fan we started with. | ||
+ | |||
+ | <code perl> | ||
+ | > $FF-> | ||
+ | </ | ||
+ | === Simple, not smooth === | ||
+ | |||
+ | <code perl> | ||
+ | > $p = new Polytope(POINTS=> | ||
+ | > [1, 0, 0, 0], | ||
+ | > [1, 1, 1, 0], | ||
+ | > [1, 1, 0, 1], | ||
+ | > [1, 0, 1, 1]]); | ||
+ | > print " | ||
+ | > print " | ||
+ | </ | ||
+ | ==== Non-normal toric varieties ==== | ||
+ | |||
+ | polymake only handles normal toric varieties. Nevertheless we can use it to get at the toric ideal of a non-normal toric variety by giving the semigroup generators directly as a mock Hilbert basis. For example for the Neil parabola use: | ||
+ | |||
+ | <code perl> | ||
+ | > $c = new Cone(HILBERT_BASIS_GENERATORS=> | ||
+ | > print $c-> | ||
+ | > print $c-> | ||
+ | </ | ||
+ | If we build a new cone from this semigroup, we see that it was not saturated. The semigroup generated by 2 and 3 does not come from a cone. | ||
+ | |||
+ | <code perl> | ||
+ | > $cc = new Cone(INPUT_RAYS=> | ||
+ | > print $cc-> | ||
+ | > print $cc-> | ||
+ | </ | ||
+ | Q: What are necessary conditions for a semigroup to come from a cone? | ||
+ | |||
+ | === Smooth vs normal === | ||
+ | |||
+ | It is an open question by Oda whether smoothness and normality of polytopes are equivalent. | ||
+ | |||
+ | <code perl> | ||
+ | > print $p-> | ||
+ | > print " | ||
+ | > print " | ||
+ | > help " | ||
+ | > help " | ||
+ | > print $p-> | ||
+ | </ | ||
+ | ===== Dealing with torus invariant divisors ===== | ||
+ | |||
+ | The application '' | ||
+ | |||
+ | <code perl> | ||
+ | > $tv = hirzebruch_surface(4); | ||
+ | > $d = $tv-> | ||
+ | </ | ||
+ | Then treat them like any polymake object. | ||
+ | |||
+ | <code perl> | ||
+ | > print " | ||
+ | > print " | ||
+ | > print " | ||
+ | > print "Nef? ", $d->NEF, " | ||
+ | > print " | ||
+ | </ | ||
+ | The following code produces the vertices of the polytope of global sections. | ||
+ | |||
+ | <code perl> | ||
+ | > $pd = $d-> | ||
+ | > print $pd-> | ||
+ | </ | ||
+ | Furthermore one can deal with rational divisor classes, rather than divisors, using the class group exact sequence. Its projection matrix can be produced as follows. | ||
+ | |||
+ | <code perl> | ||
+ | > print $tv-> | ||
+ | </ | ||
+ | Then one can access the nef cone, effective cone and Mori cone of the toric variety: | ||
+ | |||
+ | <code perl> | ||
+ | > print "Nef cone: | ||
+ | > print " | ||
+ | > print "Mori cone: | ||
+ | </ | ||
+ | ===== Accessing Singular ===== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | <code perl> | ||
+ | > application " | ||
+ | > $c = new Cone(INPUT_RAYS=> | ||
+ | > $tv = new NormalToricVariety($c); | ||
+ | > $toric = $c-> | ||
+ | > singular_eval(" | ||
+ | > $radical = $toric-> | ||
+ | > print join(" | ||
+ | > singular_eval(" | ||
+ | > $ideal = $tv-> | ||
+ | > print $ideal; | ||
+ | </ | ||
+ | It is possible to execute arbitrary Singular commands from polymake using the '' | ||
+ | |||
+ | <code perl> | ||
+ | > $cmd = "ring r = 0, | ||
+ | > print $cmd; | ||
+ | </ | ||
+ | Then hand this string to '' | ||
+ | |||
+ | <code perl> | ||
+ | > singular_eval($cmd); | ||
+ | > singular_eval(" | ||
+ | </ | ||
+ | One can also retrieve variables from Singular to polymake using the '' | ||
+ | |||
+ | <code perl> | ||
+ | > singular_eval(" | ||
+ | > $n = singular_get_var(" | ||
+ | > print $n," | ||
+ | </ | ||
+ | It is possible to retrieve the following datatypes from Singular: '' | ||
+ | |||
+ | <code perl> | ||
+ | > singular_eval(" | ||
+ | > $p = singular_get_var(" | ||
+ | > print $p," | ||
+ | </ | ||
+ | To load a Singular library, you can use the '' | ||
+ | |||
+ | <code perl> | ||
+ | > load_singular_library(" | ||
+ | > singular_eval(" | ||
+ | > singular_eval(" | ||
+ | > singular_eval(" | ||
+ | </ | ||