Changeset 8aa664 in git for Singular/LIB/tropical.lib
- Timestamp:
- Aug 7, 2008, 5:52:58 PM (16 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 21ab56d767a9243f4aace178658aacf6c566ce1f
- Parents:
- b546c03ad846aa2512dc30210191605ce1f3de85
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/tropical.lib
rb546c0 r8aa664 1 version="$Id: tropical.lib,v 1. 4 2008-08-07 15:02:54keilen Exp $";1 version="$Id: tropical.lib,v 1.5 2008-08-07 15:52:58 keilen Exp $"; 2 2 category="Tropical Geometry"; 3 3 info=" 4 LIBRARY: tropical.lib Interface to gfan4 LIBRARY: tropical.lib Computations in Tropical Geometry 5 5 6 6 AUTHORS: Anders Jensen Needergard, email: jensen@math.tu-berlin.de … … 10 10 WARNING: 11 11 - tropicalLifting will only work under LINUX and if in addition gfan is installed. 12 12 @* - drawTropicalCurve and drawTropicalNewtonSubdivision will only display the tropical 13 13 curve under LINUX and if in addition latex and kghostview are installed. 14 14 @* - In tropicalLifting the basering needs the parameter t as a variable, while otherwise 15 15 it needs it as a parameter. 16 16 … … 42 42 i.e. we replace C{{t}} by Q(t), or sometimes even by Q[t]. Note, that this in particular 43 43 forbits rational exponents for the t's. 44 44 45 Moreover, in Singular no negative exponents of monomials are allowed, so that the integer vectors 45 46 vi will have to have non-negative entries. Shifting all exponents by a fixed integer vector does not … … 53 54 54 55 The main tools provided in this library are as follows: 55 56 @* - tropicalLifting implements the constructive proof of the Theorem of Newton-Kapranov and constructs 56 57 a point in the variety over C{{t}} corresponding to a given point in the 57 58 corresponding tropical variety associated to an ideal I; the generators of … … 60 61 several field extensions of Q might be necessary thoughout the intermediate 61 62 computations; the procedures uses the external program gfan 62 63 @* - drawTropicalCurve visualises a tropical plane curve either given by a polynomial in Q(t)[x,y] 63 64 or by a list of linear polynomials of the form ax+by+c with a,b in Z and c in Q; 64 65 latex must be installed on your computer 65 66 67 66 @* - tropicalJInvariant computes the tropical j-invaiant of a tropical elliptic curve 67 @* - jInvariant computes the j-invariant of an elliptic curve 68 @* - weierstrassFom computes the Weierstrass form of an elliptic curve 68 69 69 70 PROCEDURES CONCERNED WITH TROPICAL LIFTING: … … 193 194 and ord is the order up to which a point in V(i) over Q{{t}} lying over 194 195 (w_1/w_0,...,w_n/w_0) shall be computed; w_0 may NOT be ZERO 195 - the basering should not have any parameters on its own 196 and it should have a global monomial ordering -- 197 e.g. ring r=0,(t,x(1..n)),dp; 198 - the first variable of the basering will be treated as the parameter t 196 @* - the basering should not have any parameters on its own 197 and it should have a global monomial ordering, e.g. ring r=0,(t,x(1..n)),dp; 198 @* - the first variable of the basering will be treated as the parameter t 199 199 in the Puiseux series field !!!! 200 201 202 203 204 205 206 207 200 @* - the optional parameter opt should be one or more strings among the following: 201 @* 'isZeroDimensional' : the dimension i is zero (not to be checked); 202 @* 'isPrime' : the ideal is prime over Q(t)[x_1,...,x_n] (not to be checked); 203 @* 'isInTrop' : (w_1/w_0,...,w_n/w_0) is in the tropical variety (not to be checked); 204 @* 'oldGfan' : uses gfan version 0.2.1 or less 205 @* 'findAll' : find all solutions of a zero-dimensional ideal over (w_1/w_0,...,w_n/w_0) 206 @* 'noAbs' : do NOT use absolute primary decomposition 207 @* 'noResubst' : avoids computing the resubstitution 208 208 RETURN: IF THE OPTION 'findAll' WAS NOT SET THEN: 209 209 @* list, containing one lifting of the given point (w_1/w_0,...,w_n/w_0) 210 210 in the tropical variety of i to a point in V(i) over Puiseux series field up to 211 211 the first ord terms; more precisely: 212 213 214 215 216 217 218 219 220 221 222 223 224 212 @* IF THE OPTION 'noAbs' WAS NOT SET THEN: 213 @* l[1] = ring Q[a]/m[[t]] 214 @* l[2] = int 215 @* l[3] = intvec 216 @* l[4] = list 217 @* IF THE OPTION 'noAbs' WAS SET THEN: 218 @* l[1] = ring Q[X(1),...,X(k)]/m[[t]] 219 @* l[2] = int 220 @* l[3] = intvec 221 @* l[4] = list 222 @* l[5] = string 223 @* IF THE OPITON 'findAll' WAS NOT SET THEN: 224 @* list, containing ALL liftings of the given point ((w_1/w_0,...,w_n/w_0) 225 225 in the tropical variety of i to a point in V(i) over Puiseux series field up to 226 226 the first ord terms, if the ideal is zero-dimensional over Q{{t}}; 227 227 more precisely, each entry of the list is a list l as computed if 228 228 'find_all' was NOT set 229 230 229 @* WE NOW DESCRIBE THE LIST ENTRIES IF 'findAll' WAS NOT SET: 230 @* - the ring l[1] contains an ideal LIFT, which contains 231 231 a point in V(i) lying over w up to the first ord terms; 232 232 @* - and if the integer l[2] is N then t has to be replaced by t^1/N in the 233 233 lift, or alternatively replace t by t^N in the defining ideal 234 234 @* - if the k+1st entry of l[3] is non-zero, then the kth component of LIFT has to 235 235 be multiplied t^(-l[3][k]/l[3][1]) AFTER substituting t by t^1/N 236 236 @* - unless the option 'noResubst' was set, the kth entry of list l[4] 237 237 is a string which represents the kth generator of 238 238 the ideal i where the coordinates have been replaced by the result of the lift; 239 239 the t-order of the kth entry should in principle be larger than the t-degree of LIFT 240 240 @* - if the option 'noAbs' was set, then the string in l[5] defines a maximal ideal in the 241 241 field Q[X(1),...,X(k)], where X(1),...,X(k) are the parameters of the ring in l[1]; 242 242 the basefield of the ring in l[1] should be considered modulo this ideal 243 243 REMARK: - it is best to use the procedure displayTropicalLifting to display the result 244 245 244 @* - the option 'findAll' cannot be used if 'noAbs' is set 245 @* - if the parameter 'findAll' is set AND the ideal i is zero-dimensional in Q{{t}}[x_1,...,x_n] 246 246 then ALL points in V(i) lying over w are computed up to order ord; if the ideal 247 247 is not-zero dimenisonal, then only all points in the ideal after cutting down 248 248 to dimension zero will be computed 249 249 @* - the procedure REQUIRES that the program GFAN is installed on your computer; 250 250 if you have GFAN version less than 0.3.0 then you MUST use the optional 251 251 parameter 'oldGfan' 252 252 @* - the procedure requires the Singular procedure absPrimdecGTZ to be present in 253 253 the package primdec.lib, unless the option 'noAbs' is set; but even if absPrimdecGTZ 254 254 is present it might be necessary to set the option 'noAbs' in order to avoid … … 256 256 extension which is computed throughout the recursion might need more only one 257 257 parameter to be described 258 259 258 @* - since Q is infinite, the procedure finishes with probability one 259 @* - you can call the procedure with Z/pZ as base field instead of Q, but there 260 260 are some problems you should be aware of: 261 -the Puiseux series field over the algebraic closure of Z/pZ is NOT algebraicall closed,261 @* + the Puiseux series field over the algebraic closure of Z/pZ is NOT algebraicall closed, 262 262 and thus there may not exist a point in V(i) over the Puiseux series field 263 263 with the desired valuation; so there is no chance that the procedure produced 264 264 a sensible output - e.g. if i=tx^p-tx-1 265 -if the dimension of i over Z/pZ(t) is not zero the process of reduction to265 @* + if the dimension of i over Z/pZ(t) is not zero the process of reduction to 266 266 zero might not work if the characteristic is small and you are unlucky 267 -the option 'noAbs' has to be used since absolute primary decomposition in267 @* + the option 'noAbs' has to be used since absolute primary decomposition in 268 268 Singular only works in characteristic zero 269 269 @* - the basefield should either be Q or Z/pZ for some prime p; field extensions 270 270 will be computed where necessary; if you need parameters or field extensions 271 271 from the beginning they should rather be simulated as variables possibly adding … … 717 717 RETURN: none 718 718 NOTE: - the procedure displays the output of the procedure tropicalLifting 719 719 @* - if the optional parameter 'subst' is given, then the lifting is 720 720 substituted into the ideal and the result is displayed 721 721 EXAMPLE: example displayTropicalLifting; shows an example" … … 1148 1148 // the coordinates of the first vertex are graph[1][1],graph[1][2]; 1149 1149 graph[1][1],graph[1][2]; 1150 // the first vertex is connected to the vertices graph[1][3][1,1..ncols(graph[1][3])] 1150 // the first vertex is connected to the vertices 1151 // graph[1][3][1,1..ncols(graph[1][3])] 1151 1152 intmat M=graph[1][3]; 1152 1153 M[1,1..ncols(graph[1][3])]; 1153 // the weights of the edges to these vertices are graph[1][3][2,1..ncols(graph[1][3])] 1154 // the weights of the edges to these vertices are 1155 // graph[1][3][2,1..ncols(graph[1][3])] 1154 1156 M[2,1..ncols(graph[1][3])]; 1155 1157 // from the first vertex emerge size(graph[1][4]) unbounded edges 1156 1158 size(graph[1][4]); 1157 // the primitive integral direction vector of the first unbounded edge of the first vertex 1159 // the primitive integral direction vector of the first unbounded edge 1160 // of the first vertex 1158 1161 graph[1][4][1][1]; 1159 1162 // the weight of the first unbounded edge of the first vertex 1160 1163 graph[1][4][1][2]; 1161 // the monomials in fwhich are part of the Newton subdivision of the first vertex1164 // the monomials which are part of the Newton subdivision of the first vertex 1162 1165 graph[1][5]; 1163 // connecting the points in graph[size(graph)][1] we get the boundary of the Newton polytope 1166 // connecting the points in graph[size(graph)][1] we get 1167 // the boundary of the Newton polytope 1164 1168 graph[size(graph)][1]; 1165 // an entry in graph[size(graph)][2] is a pair of points in the Newton polytope bounding an inner edge 1169 // an entry in graph[size(graph)][2] is a pair of points 1170 // in the Newton polytope bounding an inner edge 1166 1171 graph[size(graph)][2][1]; 1167 1172 } … … 1178 1183 /tmp/tropicalcurveNUMBER.ps, where NUMBER is a random four digit integer; 1179 1184 moreover it displays the tropical curve defined by f via kghostview; 1180 1181 1185 @* - edges with multiplicity greater than one carry this multiplicity 1186 @* - if # is empty, then the tropical curve is computed w.r.t. minimum, if #[1] is the 1182 1187 string 'max', then it is computed w.r.t. maximum 1183 1188 @* - if the last optional argument is 'onlytexfile' then only the latex file 1184 1189 is produced; this option should be used if kghostview is not installed on 1185 1190 your system 1186 1191 @* - note that lattice points in the Newton subdivision which are black correspond to markings 1187 1192 of the marked subdivision, while lattice points in grey are not marked 1188 1193 EXAMPLE: example drawTropicalCurve shows an example" … … 1334 1339 where NUMBER is a random four digit integer; 1335 1340 moreover it desplays the tropical curve defined by f via kghostview; 1336 1341 @* if # is empty, then the tropical curve is computed w.r.t. minimum, if #[1] is the 1337 1342 string 'max', then it is computed w.r.t. maximum 1338 1343 @* - note that lattice points in the Newton subdivision which are black correspond to markings 1339 1344 of the marked subdivision, while lattice points in grey are not marked 1340 1345 EXAMPLE: example drawNewtonSubdivision; shows an example" … … 1419 1424 alternatively f can be a polynomial in Q(t)[x,y] defining a tropical plane curve 1420 1425 via the valuation map; 1421 1426 @* the basering must have a global monomial ordering, two variables and up to one parameter! 1422 1427 RETURN: number, if the graph underlying the tropical curve has precisely one loop then its weighted 1423 1428 lattice length is returned, otherwise the result will be -1 1424 1429 NOTE: - if the tropical curve is elliptic and its embedded graph has precisely one loop, 1425 1430 then the weigthed lattice length of the loop is its tropical j-invariant 1426 1431 @* - the procedure checks if the embedded graph of the tropical curve has genus one, 1427 1432 but it does NOT check if the loop can be resolved, so that the curve is not 1428 1433 a proper tropical elliptic curve 1429 1434 @* - if the embedded graph of a tropical elliptic curve has more than one loop, then 1430 1435 all but one can be resolved, but this is not observed by this procedure, so it 1431 1436 will not compute the j-invariant 1432 1437 @* - if # is empty, then the tropical curve is computed w.r.t. minimum, if #[1] is the 1433 1438 string 'max', then it is computed w.r.t. maximum 1434 1439 @* - the tropicalJInvariant of a plane tropical cubic is the 'cycle length' of the 1435 1440 cubic as introduced in the paper: 1436 1441 Erik Katz, Hannah Markwig, Thomas Markwig: The j-invariant of a cubic tropical plane curve. … … 1578 1583 echo=2; 1579 1584 ring r=(0,t),(x,y),dp; 1580 // tropcial _j_invariant computes the tropical j-invariant of the elliptic curve f1585 // tropcialJInvariant computes the tropical j-invariant of an elliptic curve 1581 1586 tropicalJInvariant(t*(x3+y3+1)+1/t*(x2+y2+x+y+x2y+xy2)+1/t2*xy); 1582 1587 // the Newton polygone need not be the standard simplex … … 1584 1589 // the curve can have arbitrary degree 1585 1590 tropicalJInvariant(t*(x7+y7+1)+1/t*(x4+y4+x2+y2+x3y+xy3)+1/t7*x2y2); 1586 // the procedure does not realise, if the embedded graph of the tropical curve has1587 // a loop that can be resolved1591 // the procedure does not realise, if the embedded graph of the tropical 1592 // curve has a loop that can be resolved 1588 1593 tropicalJInvariant(1+x+y+xy+tx2y+txy2); 1589 1594 // but it does realise, if the curve has no loop at all ... 1590 1595 tropicalJInvariant(x+y+1); 1591 // or if the embedded graph has more than one loop - even if only one cannot be resolved 1596 // or if the embedded graph has more than one loop - even if only one 1597 // cannot be resolved 1592 1598 tropicalJInvariant(1+x+y+xy+tx2y+txy2+t3x5+t3y5+tx2y2+t2xy4+t2yx4); 1593 1599 } … … 1601 1607 NOTE: - the algorithm for the coefficients of the Weierstrass form is due to 1602 1608 Fernando Rodriguez Villegas, villegas@math.utexas.edu 1603 1604 1609 @* - the characteristic of the base field should not be 2 or 3 1610 @* - if an additional argument # is given, a simplified Weierstrass form 1605 1611 is computed 1606 1612 EXAMPLE: example weierstrassForm; shows an example" … … 1647 1653 poly wg=weierstrassForm(g); 1648 1654 wg; 1649 // ...but it is not yet a simple, since it still has an xy-term, unlike swg1655 // but it is not yet a simple, since it still has an xy-term, unlike swg 1650 1656 poly swg=weierstrassForm(g,1); 1651 1657 swg; 1652 // the j-invariants of all three polynomials coincide ...1658 // the j-invariants of all three polynomials coincide 1653 1659 jInvariant(g); 1654 1660 jInvariant(wg); … … 1665 1671 point, so that it defines an elliptic curve on the toric surface corresponding 1666 1672 to the Newton polygon 1667 1673 @* - it the optional argument # is present the base field should be Q(t) and 1668 1674 the optional argument should be one of the following strings: 1669 1670 1675 @* 'ord' : then the return value is of type integer, namely the order of the j-invariant 1676 @* 'split' : then the return value is a list of two polynomials, such that the quotient 1671 1677 of these two is the j-invariant 1672 1678 RETURN: poly, the j-invariant of the elliptic curve defined by poly … … 1696 1702 echo=2; 1697 1703 ring r=(0,t),(x,y),dp; 1698 // jInvariant computes the j-invariant of a cubic independent of the ground field1704 // jInvariant computes the j-invariant of a cubic 1699 1705 jInvariant(x+y+x2y+y3+1/t*xy); 1700 // if the ground field has one parameter t, then we can instead compute the order of the j-invariant 1706 // if the ground field has one parameter t, then we can instead 1707 // compute the order of the j-invariant 1701 1708 jInvariant(x+y+x2y+y3+1/t*xy,"ord"); 1702 1709 // one can compare the order of the j-invariant to the tropical j-invariant … … 1718 1725 ASSUME: points is a list of five points in the plane over K(t) 1719 1726 RETURN: list, l[1] = the list points of the five given points 1720 1721 1722 1723 1724 1725 1726 1727 @* l[2] = the conic f passing through the five points 1728 @* l[3] = list of equations of the tangents to f in the given points 1729 @* l[4] = ideal, the tropicalisation of f (i.e. a list of linear forms) 1730 @* l[5] = a list of the tropicalisation of the tangents 1731 @* l[6] = a list containing the vertices of the tropical conic f 1732 @* l[7] = a list containing lists with the vertices of the tangents 1733 @* l[8] = a string which contains the latex-code to draw the tropical 1727 1734 conic and its tropicalised tangents 1728 1735 @* l[9] = if # is non-empty, this is the same data for the dual conic 1729 1736 and the points dual to the computed tangents 1730 1737 NOTE: the points must be generic, i.e. no three on a line … … 1911 1918 // conic[2] is the equation of the conic f passing through the five points 1912 1919 conic[2]; 1913 // conic[3] is a list containing the equations of the tangents through the five points 1920 // conic[3] is a list containing the equations of the tangents 1921 // through the five points 1914 1922 conic[3]; 1915 1923 // conic[4] is an ideal representing the tropicalisation of the conic f 1916 1924 conic[4]; 1917 // conic[5] is a list containing the tropicalisation of the five tangents in conic[3] 1925 // conic[5] is a list containing the tropicalisation 1926 // of the five tangents in conic[3] 1918 1927 conic[5]; 1919 // conic[6] is a list containing the vertices of the tropical conic defined by f1928 // conic[6] is a list containing the vertices of the tropical conic 1920 1929 conic[6]; 1921 1930 // conic[7] is a list containing the vertices of the five tangents 1922 1931 conic[7]; 1923 // conic[8] contains the latex code to draw the tropical conic and its tropicalised tangents; 1924 // it can written in a file, processed and displayed via kghostview -- to do so hit the return button 1932 // conic[8] contains the latex code to draw the tropical conic and 1933 // its tropicalised tangents; it can written in a file, processed and 1934 // displayed via kghostview 1925 1935 write(":w /tmp/conic.tex",conic[8]); 1926 system("sh","cd /tmp; latex /tmp/conic.tex; dvips /tmp/conic.dvi -o; kghostview conic.ps &"); 1927 // with an optional argument the same information for the dual conic is computed and saved in conic[9] 1936 system("sh","cd /tmp; latex /tmp/conic.tex; dvips /tmp/conic.dvi -o; 1937 kghostview conic.ps &"); 1938 // with an optional argument the same information for the dual conic is computed 1939 // and saved in conic[9] 1928 1940 conic=conicWithTangents(points,1); 1929 1941 conic[9][2]; // the equation of the dual conic … … 1939 1951 RETURN: list, the linear forms of the tropicalisation of f 1940 1952 NOTE: if # is empty, then the valuation of t will be 1, 1941 if # is the string 'max' it will be -1; the latter 1942 1953 @* if # is the string 'max' it will be -1; 1954 @* the latter supposes that we consider the maximum of the the computed 1943 1955 linear forms, the former that we consider their minimum 1944 1956 EXAMPLE: example tropicalise; shows an example" … … 2369 2381 insert further texdraw commands (e.g. to have a lighter image as when called 2370 2382 from inside conicWithTangents); 2371 2383 @* - the procedure computes a scalefactor for the texdraw command which should 2372 2384 help to display the curve in the right way; this may, however, be a bad idea 2373 2385 if several texDrawTropical outputs are put together to form one image; the 2374 2386 scalefactor can be prescribed by a second optional entry of type poly 2375 2387 @* - the list # is optional and may as well be empty 2376 2388 EXAMPLE: example texDrawTropical; shows an example" 2377 2389 { … … 2534 2546 insert further texdraw commands (e.g. to have a lighter image as when called 2535 2547 from inside conicWithTangents); the list # is optional and may as well be empty 2536 2548 @* - note that lattice points in the Newton subdivision which are black correspond to markings 2537 2549 of the marked subdivision, while lattice points in grey are not marked 2538 2550 EXAMPLE: example texDrawNewtonSubdivision; shows an example" … … 2666 2678 poly f=x+y+x2y+xy2+1/t*xy; 2667 2679 list graph=tropicalCurve(f); 2668 // compute the texdraw code of the Newton subdivision of the tropical curve defined by f2680 // compute the texdraw code of the Newton subdivision of the tropical curve 2669 2681 texDrawNewtonSubdivision(graph); 2670 2682 } … … 2751 2763 // the lattice polygon spanned by the points (0,0), (3,0) and (0,3) 2752 2764 // with all integer points as markings 2753 list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),intvec(0,2),intvec(0,3); 2754 // define a triangulation by connecting the only interior point with the vertices 2765 list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),intvec(0,0), 2766 intvec(2,1),intvec(0,1),intvec(1,2),intvec(0,2),intvec(0,3); 2767 // define a triangulation by connecting the only interior point 2768 // with the vertices 2755 2769 list triang=intvec(1,2,5),intvec(1,5,10),intvec(1,2,10); 2756 2770 // produce the texdraw output of the triangulation triang
Note: See TracChangeset
for help on using the changeset viewer.