# Code samples from tropical discussion session on 18 August 2020 ## Tropical Hypersurface in Polymake application 'tropical'; \$H = new Hypersurface( POLYNOMIAL=>toTropicalPolynomial("min(x1,x2,x3)") ); \$H -> VISUAL; \$V = new Hypersurface( POLYNOMIAL=>toTropicalPolynomial( "min(12+3*x0,-131+2*x0+x1, -67+2*x0+x2,-9+2*x0+x3,-131+x0+2*x1,-129+x0+x1+x2, -131+x0+x1+x3,-116+x0+2*x2, -76+x0+x2+x3,-24+x0+2*x3,-95+3*x1, -108+2*x1+x2,-92+2*x1+x3,-115+x1+2*x2,-117+x1+x2+x3, -83+x1+2*x3,-119+3*x2,-119+2*x2+x3,-82+x2+2*x3,-36+3*x3)" ) ); \$V -> VISUAL; ## Exercise 3 in Polymake ### a) Regular Subdivision of the Newton Polytope (Figure 1.3.3. left) application 'tropical'; \$M1 = new Matrix([[1,0,0],[1,1,0],[1,2,0],[1,0,1],[1,1,1],[1,2,1],[1,0,2],[1,1,2],[1,2,2]]); \$w1 = new Vector([3,1,3,1,0,1,3,1,1]); \$S1 = new fan::SubdivisionOfPoints(POINTS=>\$M1,WEIGHTS=>\$w1); \$S1 -> VISUAL; ### a) Tropical Hypersurface (Figure 1.3.4 left) application 'tropical'; \$K1 = new Hypersurface( POLYNOMIAL=>toTropicalPolynomial( "min(3+4*z,1+x+3*z,3+2*x+2*z, 1+y+3*z, x+y+2*z, 1+x+2*y+z, 3+2*x+2*z, 1+2*x+y+z, 1+2*x+2*y)" ) ); \$K1->VISUAL; ### b) Regular Subdivision of the Newton Polytope (Figure 1.3.3 right) application 'tropical'; \$M2 = new Matrix([[1,0,0],[1,1,0],[1,2,0],[1,0,1],[1,1,1],[1,2,1],[1,0,2],[1,1,2],[1,2,2]]); \$w2 = new Vector([0,0,3,0,0,2,2,1,2]); \$S2 = new fan::SubdivisionOfPoints(POINTS=>\$M2,WEIGHTS=>\$w2); \$S2 -> VISUAL; ### b) Tropical Hypersurface (Figure 1.3.4 right) application 'tropical'; \$K2 = new Hypersurface( POLYNOMIAL=>toTropicalPolynomial( "min(4*z,0+x+3*z,3+2*x+2*z, 0+y+3*z, x+y+2*z, 2+x+2*y+z, 2+2*x+2*z, 1+2*x+y+z, 2+2*x+2*y)" ) ); \$K2 -> VISUAL; ## Tropicalization with M2 R = QQ[x1,x2,x3]; I = ideal( x1 + x2 + x3, x2^2 + x3) needsPackage("Tropical"); tropV = tropicalVariety I; rays tropV maxCones tropV linealitySpace tropV multiplicities tropV #drawing tropical curves in Singular (draws solutions for exercises 1 + 2) LIB "tropical.lib"; ring r=(0,t),(x,y),dp; poly f=t3+t*x+t3*x2+t*y+x*y+t*x*y2+t3*y2+t*x2*y+t*x2*y2; drawTropicalCurve(f); poly f=1+x+t3*y2+y+x*y+t2*y*x2+t2*t2*x2+t*y2*x+t2*x2*y2; drawTropicalCurve(f); ## Exercise Sheet and References for M2, Polymake and Singular http://userpage.fu-berlin.de/mbrandenburg/Discussion_Session_Tropical_Geometry.pdf