  
  [1m[4m[31m4. Toric varieties X(Delta)[0m
  
  This  chapter  concerns  [1mtoric[0m  commands  which  deal  with  certain objects
  associated to the (non-affine) toric varieties X(Delta).
  
  
  [1m[4m[31m4.1 Riemann-Roch spaces[0m
  
  Let Delta denote a complete nonsingular fan.
  
  [1m[4m[31m4.1-1 DivisorPolytope[0m
  
  [1m[34m> DivisorPolytope( [0m[22m[34mD, Rays[0m[1m[34m ) _______________________________________[0mfunction
  
  [22m[36mInput[0m:  [22m[34mRays[0m is the list of smallest integer vectors in the rays for the fan
  Delta which determine the Weil divisors of X(Delta).
  [22m[34mD[0m is the list of coefficients for the a Weil divisor.
  [22m[36mOutput[0m: the linear expressions in the affine coordinates of the space of the
  cone which must be positive for a point to be in the desired polytope.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> DivisorPolytope([6,6,0],[[2,-1],[-1,2],[-1,-1]]);[0m
    [22m[35m[ 2*x_1-x_2+6, -x_1+2*x_2+6, -x_1-x_2 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  See also Example 6.13 in [JV02].
  
  [1m[4m[31m4.1-2 DivisorPolytopeLatticePoints[0m
  
  [1m[34m> DivisorPolytopeLatticePoints( [0m[22m[34mD, Delta, Rays[0m[1m[34m ) ___________________[0mfunction
  
  [22m[36mInput[0m: [22m[34mDelta[0m is the fan
  [22m[34mRays[0m is the [22m[36mordered[0m list of rays for [22m[34mDelta[0m
  [22m[34mD[0m is the list of coefficients for a Weil divisor.
  [22m[36mOutput[0m:  the list of points in P_D cap L_0^* which parameterize the elements
  in  the Riemann-Roch space L(D), where P_D is the polytope associated to the
  divisor D (see [22m[32mDivisorPolytope[0m).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> Div:=[6,6,0];; Rays:=[[2,-1],[-1,2],[-1,-1]];;[0m
    [22m[35mgap> Delta0:=[[[2,-1],[-1,2]],[[-1,2],[-1,-1]],[[-1,-1],[2,-1]]];;[0m
    [22m[35mgap> P_Div:=DivisorPolytopeLatticePoints(Div,Delta0,Rays);[0m
    [22m[35m[ [ -6, -6 ], [ -5, -5 ], [ -5, -4 ], [ -4, -5 ], [ -4, -4 ], [ -4, -3 ],[0m
    [22m[35m  [ -4, -2 ], [ -3, -4 ], [ -3, -3 ], [ -3, -2 ], [ -3, -1 ], [ -3, 0 ],[0m
    [22m[35m  [ -2, -4 ], [ -2, -3 ], [ -2, -2 ], [ -2, -1 ], [ -2, 0 ], [ -2, 1 ],[0m
    [22m[35m  [ -2, 2 ], [ -1, -3 ], [ -1, -2 ], [ -1, -1 ], [ -1, 0 ], [ -1, 1 ],[0m
    [22m[35m  [ 0, -3 ], [ 0, -2 ], [ 0, -1 ], [ 0, 0 ], [ 1, -2 ], [ 1, -1 ], [ 2, -2 ] ][0m
    [22m[35mgap>[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m4.1-3 RiemannRochBasis[0m
  
  [1m[34m> RiemannRochBasis( [0m[22m[34mD, Delta, Rays[0m[1m[34m ) _______________________________[0mfunction
  
  [22m[36mInput[0m: [22m[34mDelta[0m is a complete and nonsingular fan
  [22m[34mD[0m is the list of coefficients for the Weil divisor
  [22m[34mRays[0m is a list of rays for the fan used to describe the Weil divisors.
  [22m[36mOutput[0m:  A  basis  (a  list  of monomials) for the Riemann-Roch space of the
  divisor represented by [22m[34mD[0m.
  
  For  details  on how the Weil divisors can be expressed in terms of the rays
  of  the  fan, please see section 3.3 in [F93]. This procedure does not check
  if the fan is complete and nonsingular.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> Div:=[6,6,0];; Rays:=[[2,-1],[-1,2],[-1,-1]];;[0m
    [22m[35mgap> Delta:=[[[2,-1],[-1,2]],[[-1,2],[-1,-1]],[[-1,-1],[2,-1]]];;[0m
    [22m[35mgap> RiemannRochBasis(Div,Delta,Rays);[0m
    [22m[35m[ 1/(x_1^6*x_2^6), 1/(x_1^5*x_2^5), 1/(x_1^5*x_2^4), 1/(x_1^4*x_2^5),[0m
    [22m[35m  1/(x_1^4*x_2^4), 1/(x_1^4*x_2^3), 1/(x_1^4*x_2^2), 1/(x_1^3*x_2^4),[0m
    [22m[35m  1/(x_1^3*x_2^3), 1/(x_1^3*x_2^2), 1/(x_1^3*x_2), 1/x_1^3, 1/(x_1^2*x_2^4),[0m
    [22m[35m  1/(x_1^2*x_2^3), 1/(x_1^2*x_2^2), 1/(x_1^2*x_2), 1/x_1^2, x_2/x_1^2,[0m
    [22m[35m  x_2^2/x_1^2, 1/(x_1*x_2^3), 1/(x_1*x_2^2), 1/(x_1*x_2), 1/x_1, x_2/x_1,[0m
    [22m[35m  1/x_2^3, 1/x_2^2, 1/x_2, 1, x_1/x_2^2, x_1/x_2, x_1^2/x_2^2 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.2 Topological invariants[0m
  
  Throughout this section, X(Delta) [22m[36mmust be non-singular[0m.
  
  [1m[4m[31m4.2-1 EulerCharacteristic[0m
  
  [1m[34m> EulerCharacteristic( [0m[22m[34mDelta[0m[1m[34m ) _____________________________________[0mfunction
  
  [22m[36mInput[0m:  [22m[34mDelta[0m  is  a  nonsingular  fan  of cones, represented by its list of
  maximal cones.
  [22m[36mOutput[0m:  the Euler characteristic of the toric variety X(Delta), where Delta
  is a fan determined by [22m[34mDelta[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> Cones:=[[[2,-1],[-1,2]],[[-1,2],[-1,-1]],[[-1,-1],[2,-1]]];;[0m
    [22m[35mgap> EulerCharacteristic(Cones);[0m
    [22m[35m3[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Note: X(Delta) [22m[36mmust be non-singular[0m here.
  
  [1m[4m[31m4.2-2 BettiNumberToric[0m
  
  [1m[34m> BettiNumberToric( [0m[22m[34mDelta, k[0m[1m[34m ) _____________________________________[0mfunction
  
  [22m[36mInput[0m:  [22m[34mDelta[0m  represents  a  nonsingular  fan Delta (represented by maximal
  cones),
  [22m[34mk[0m is an integer.
  [22m[36mOutput[0m: the [22m[34mk[0m-th Betti number of the toric variety X(Delta).
  
  The [22m[32mBettiNumberToric[0m procedure does not check if [22m[34mDelta[0m is nonsingular. It is
  possible  that this procedure outputs nonsense when [22m[34mDelta[0m is not represented
  by maximal cones or is nonsingular.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> Cones:=[[[2,-1],[-1,2]],[[-1,2],[-1,-1]],[[-1,-1],[2,-1]]];;[0m
    [22m[35mgap> BettiNumberToric(Cones,1);[0m
    [22m[35m0[0m
    [22m[35mgap> BettiNumberToric(Cones,2);[0m
    [22m[35m1[0m
    [22m[35mgap> Cones:=[[[2,-1],[-1,1]],[[-1,1],[-1,0]],[[-1,0],[2,-1]]];;[0m
    [22m[35mgap> BettiNumberToric(Cones,1);[0m
    [22m[35m0[0m
    [22m[35mgap> BettiNumberToric(Cones,2);[0m
    [22m[35m1[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Not  to  be  confused  with  the  Betti number of a polycyclically presented
  torsion free group, already available in [1mGAP[0m.
  
  
  [1m[4m[31m4.3 Points over a finite field[0m
  
  [1m[4m[31m4.3-1 CardinalityOfToricVariety[0m
  
  [1m[34m> CardinalityOfToricVariety( [0m[22m[34mCones, q[0m[1m[34m ) ____________________________[0mfunction
  
  [22m[36mInput[0m:  [22m[34mCones[0m  is  the  list  of  maximal cones of a fan Delta, [22m[34mq[0m is a prime
  power.
  [22m[36mOutput[0m:  The  size  of the set of GF(q)-rational points of the toric variety
  X(Delta).
  
  Note: X(Delta) [22m[36mmust be non-singular[0m here.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> Cones:=[[[2,-1],[-1,2]],[[-1,2],[-1,-1]],[[-1,-1],[2,-1]]];;[0m
    [22m[35mgap> CardinalityOfToricVariety(Cones,3);[0m
    [22m[35m13[0m
    [22m[35mgap> CardinalityOfToricVariety(Cones,4);[0m
    [22m[35m21[0m
    [22m[35mgap> CardinalityOfToricVariety(Cones,5);[0m
    [22m[35m31[0m
    [22m[35mgap> CardinalityOfToricVariety(Cones,7);[0m
    [22m[35m57[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
