LIB "gfan.lib"; option(noredefine); // x, y, x^{-1}((t+1)^2*x + y - (t+1)), y^{-1}((t+1)*x - y - (t+1)^2), and // $x^{-1}((t+1)+(t+1)y-1) form a basis for the intrinsic torus. // this means in the ring r mod I that x, y, z, w can be expanded // to form a unit group basis. So, technically speaking, we are only // computing an affine transformation of the intrinsic tropicalization. // Happily, however, it is already a snowflake. ring r = 0,(h,t,x,y,z,w),dp; poly phi = (1 + t) * (x^2 + y^2 + 1) - (2 + 2*t + t^2) * (x + y + xy); poly f = xz - ((t+1)^2*x + y - (t+1)); poly g = y*w - ((t+1)*x - y - (t+1)^2); ideal I = phi, f, g; // Given a cone C in the "fake" tropical variety // returns a cone in the "proper" tropical variety, // where i is the index of the homogenization variable // and j is the index of the uniformizing parameter. // returns the zero cone if C does not intersect {j-th coordinate < 0} proc dehomogenizeCone(cone C, int i, int j) { // 1.0: get the inequalities of the "fake" cone bigintmat IneqC = inequalities(C); int k = nrows(IneqC); int n = ncols(IneqC); bigintmat IneqCD[k+1][n-1]; // 1.1: remove column i if (i1) { IneqCD[1..k,1..i-1] = IneqC[1..k,1..i-1]; } // 1.2: impose that old j-th entry negative, if it is non-zero if (j>0 && i1) { EqCD[1..k,1..i-1] = EqC[1..k,1..i-1]; } // 3.0: construct the "proper" cone and // check whether it intersects {j-th coordinate < 0} non-trivially // if it does not, replace it with the origin cone CD = coneViaInequalities(IneqCD,EqCD); bigintmat pCD = relativeInteriorPoint(CD); if (pCD[1,j]>=0) { CD = origin(ambientDimension(CD)); } return (CD); } // Compute the "proper" tropical variety of I, // where i is the index of the homogenization variable // and j is the index of the uniformizing parameter proc tropicalVarietyViaHomogenization(ideal I, int i, int j) { // homogenize I and compute the "fake" tropical variety ideal Ih = homog(I,var(i)); printlevel = 1; fan TIh = tropicalVariety(Ih); // initialize empty fan TI in one ambient dimension less // and run though all maximal cones of all dimensions // (the "1,1" arguments tell gfan only to go through maximal cones) fan TI = emptyFan(nvars(basering)-1); for (int d=1; d<=dimension(TIh); d++) { for (int k=1; k<=numberOfConesOfDimension(TIh,d,1,1); k++) { // apply the dehomogenization function // and insert the cone to TI // (if it is not the origin) cone CI = getCone(TIh,d,k,1,1); cone CId = dehomogenizeCone(CI,i,j); if (dimension(CId)>0) { insertCone(TI,CId); } } } return (TI); } fan TI = tropicalVarietyViaHomogenization(I,1,2); TI; // Output: // // AMBIENT_DIM // 5 // // DIM // 2 // // LINEALITY_DIM // 0 // // RAYS // -4 -13 0 4 0 # 0 // -4 -11 0 4 0 # 1 // -4 0 -11 -4 4 # 2 // -4 6 6 0 -3 # 3 // -3 -11 0 3 0 # 4 // -3 -10 0 3 0 # 5 // -3 -8 0 3 0 # 6 // -3 0 -10 -3 3 # 7 // -3 0 -8 -3 3 # 8 // -3 0 -2 -1 1 # 9 // -2 -7 0 2 0 # 10 // -2 -5 0 2 0 # 11 // -2 -2 0 1 0 # 12 // -2 0 -7 -2 2 # 13 // -2 0 -5 -2 2 # 14 // -2 2 2 0 -1 # 15 // -1 -5 0 1 0 # 16 // -1 -4 0 1 0 # 17 // -1 -3 0 1 0 # 18 // -1 -2 0 1 0 # 19 // -1 0 -4 -1 1 # 20 // -1 0 -3 -1 1 # 21 // -1 0 -2 -1 1 # 22 // -1 0 0 0 0 # 23 // -1 2 2 0 -1 # 24 // -1 4 4 0 -1 # 25 // -1 9 9 0 -1 # 26 // 0 -1 0 0 0 # 27 // 0 -1 0 1 0 # 28 // 0 0 -1 -1 1 # 29 // 0 0 -1 0 0 # 30 // 0 1 1 0 -1 # 31 // 0 1 1 0 0 # 32 // // N_RAYS // 33 // // LINEALITY_SPACE // // ORTH_LINEALITY_SPACE // -1 0 0 0 0 # 0 // 0 -1 0 0 0 # 1 // 0 0 -1 0 0 # 2 // 0 0 0 -1 0 # 3 // 0 0 0 0 -1 # 4 // // F_VECTOR // 1 33 31 // {0 5} # Dimension 2 // {1 6} // {2 8} // {3 15} // {4 10} // {5 10} // {0 18} // {1 18} // {6 11} // {7 13} // {2 21} // {8 14} // {3 24} // {4 17} // {7 21} // {9 22} // {9 23} // {11 19} // {12 19} // {12 23} // {13 20} // {14 22} // {15 23} // {16 17} // {24 25} // {16 27} // {19 28} // {20 30} // {22 29} // {24 31} // {26 32} // // MAXIMAL_CONES // {0 5} # Dimension 2 // {1 6} // {2 8} // {3 15} // {4 10} // {5 10} // {0 18} // {1 18} // {6 11} // {7 13} // {2 21} // {8 14} // {3 24} // {4 17} // {7 21} // {9 22} // {9 23} // {11 19} // {12 19} // {12 23} // {13 20} // {14 22} // {15 23} // {16 17} // {24 25} // {16 27} // {19 28} // {20 30} // {22 29} // {24 31} // {26 32}