next | previous | forward | backward | up | top | index | toc | home
Macaulay2 > mathematical examples > Tutorial: Fano varieties

Tutorial: Fano varieties

Given a variety X in projective r-space Pr, the Fano scheme Fanok(X) is the natural parameter space for the linear k-planes lying on X. In this tutorial we explore the methods for computing it. The tutorial is in three parts

A. The twenty-seven lines

B. General methods

C. Surfaces of degree 4 in P5

In section A, we treat by hand the Fano variety of lines on a nonsingular cubic surface in P3, and find that there are indeed 27 lines lying on the surface.

In section B, we explain a general purpose function, written to compute Fano schemes.

There are (up to linear transformations) just 3 nondegenerate smooth surfaces of degree 4 in P5: the Veronese embedding of P2 and the rational normal scrolls S(1,3) and S(2,2). Can they be distinguished by their Fano varieties of lines? To find out, read section C!

A. Lines on the nonsingular cubic in ${\bf P}^3$

First make the homogeneous coordinate ring of the ambient projective 3-space
i1 : R = ZZ/32003[a,b,c,d]

o1 = R

o1 : PolynomialRing
and the ideal of a nonsingular cubic
i2 : X = ideal(a^3+b^3+c^3+d^3)

            3    3    3    3
o2 = ideal(a  + b  + c  + d )

o2 : Ideal of R
We make a parametrized indeterminate line in our projective space, adding parameters s,t for the line and two points p0..p3 and q0..q3 representing the points 0 and infinity on the line.
i3 : KK = coefficientRing R 

o3 = KK

o3 : QuotientRing
i4 : S = KK [s,t,p_0..p_3,q_0..q_3]

o4 = S

o4 : PolynomialRing
Then we make a map F from R to the new ring sending the variables to the coordinates of the general point on the line
i5 : F = map(S,R,
            s*matrix{{p_0..p_3}} +
            t*matrix{{q_0..q_3}}
            )

o5 = map(S,R,{s*p  + t*q , s*p  + t*q , s*p  + t*q , s*p  + t*q })
                 0      0     1      1     2      2     3      3

o5 : RingMap S <--- R
We now apply F to the ideal of X
i6 : FX = F X

            3 3    3 3    3 3    3 3     2   2         2   2    3 3  
o6 = ideal(s p  + s p  + s p  + s p  + 3s t*p q  + 3s*t p q  + t q  +
              0      1      2      3         0 0         0 0      0  
     ------------------------------------------------------------------------
       2   2         2   2    3 3     2   2         2   2    3 3     2   2  
     3s t*p q  + 3s*t p q  + t q  + 3s t*p q  + 3s*t p q  + t q  + 3s t*p q 
           1 1         1 1      1         2 2         2 2      2         3 3
     ------------------------------------------------------------------------
           2   2    3 3
     + 3s*t p q  + t q )
             3 3      3

o6 : Ideal of S
and the condition we want becomes the condition that FX vanishes identically in s,t. The following line produces the coefficients:
i7 : cFX = last coefficients(gens FX, Variables => {s,t})

o7 = {3} | p_0^3+p_1^3+p_2^3+p_3^3                 |
     {3} | 3p_0^2q_0+3p_1^2q_1+3p_2^2q_2+3p_3^2q_3 |
     {3} | 3p_0q_0^2+3p_1q_1^2+3p_2q_2^2+3p_3q_3^2 |
     {3} | q_0^3+q_1^3+q_2^3+q_3^3                 |

             4       1
o7 : Matrix S  <--- S
The interface to the coefficients routine is a bit baroque, and might change in the future. For now, the 0,1 says to find the coefficients of each column of the matrix, with respect to the first two variables. The routine returns a list of two matrices, the second one being the one we need (index 1, since all indices start at 0 in Macaulay2)

We can get rid of some of the variables of S, to ease the computation:

i8 : S1 = KK[p_0..p_3,q_0..q_3]

o8 = S1

o8 : PolynomialRing
i9 : cFX = substitute(cFX, S1)

o9 = {3} | p_0^3+p_1^3+p_2^3+p_3^3                 |
     {3} | 3p_0^2q_0+3p_1^2q_1+3p_2^2q_2+3p_3^2q_3 |
     {3} | 3p_0q_0^2+3p_1q_1^2+3p_2q_2^2+3p_3q_3^2 |
     {3} | q_0^3+q_1^3+q_2^3+q_3^3                 |

              4        1
o9 : Matrix S1  <--- S1
The ring we want is the quotient
i10 : S1bar = S1/ideal cFX

o10 = S1bar

o10 : QuotientRing
Now we want to move to the Grassmannian, so we take a new polynomial ring in 6 variables that will correspond to the minors of the matrix with rows p0..p3 and q0..q3,
i11 : GR = coefficientRing R[x_0..x_5]

o11 = GR

o11 : PolynomialRing
We define a map sending the xi to the minors, regarded as elements of S1bar
i12 : M = substitute(
          exteriorPower(2, matrix{{p_0..p_3},{q_0..q_3}}),
          S1bar)

o12 = | -p_1q_0+p_0q_1 -p_2q_0+p_0q_2 -p_2q_1+p_1q_2 -p_3q_0+p_0q_3
      -----------------------------------------------------------------------
      -p_3q_1+p_1q_3 -p_3q_2+p_2q_3 |

                  1           6
o12 : Matrix S1bar  <--- S1bar
i13 : gr = map (S1bar, GR, M)

o13 = map(S1bar,GR,{- p q  + p q , - p q  + p q , - p q  + p q , - p q  +
                       1 0    0 1     2 0    0 2     2 1    1 2     3 0  
      -----------------------------------------------------------------------
      p q , - p q  + p q , - p q  + p q })
       0 3     3 1    1 3     3 2    2 3

o13 : RingMap S1bar <--- GR
i14 : fano = trim ker gr

                                                    2      2           2    
o14 = ideal (x x  - x x  + x x , x x x , x x x , x x  + x x , x x x , x x  +
              2 3    1 4    0 5   3 4 5   1 2 5   0 4    1 5   0 2 4   0 4  
      -----------------------------------------------------------------------
       2     3    3    3     2      2     2      2   2      2             2  
      x x , x  + x  + x , x x  + x x , x x  - x x , x x  + x x , x x x , x x 
       1 5   3    4    5   1 3    2 4   0 3    2 5   1 3    2 4   0 1 3   0 3
      -----------------------------------------------------------------------
         2       2      2     2      2   2      2     2      2     3    3  
      + x x , x x  + x x , x x  + x x , x x  + x x , x x  - x x , x  + x  -
         2 5   1 2    3 4   0 2    3 5   1 2    3 4   0 2    3 5   1    2  
      -----------------------------------------------------------------------
       3     2      2   2      2     3    3    3
      x , x x  - x x , x x  - x x , x  - x  - x )
       5   0 1    4 5   0 1    4 5   0    2    4

o14 : Ideal of GR
trim replaces the given set of generators with a minimal set of generators. We get an ideal representing points:
i15 : codim fano

o15 = 5
and the number of these points -- the number of the corresponding lines - is 27:
i16 : degree fano

o16 = 27
It is interesting to note that the ideal of the Fano scheme that we have produced is NOT saturated, as the number (25) of cubics it contains is less than 56 - 27 = 29:
i17 : betti fano

             0  1
o17 = total: 1 20
          0: 1  .
          1: .  1
          2: . 19

o17 : BettiTally
Possible next steps in this computation would be to compute the Jacobian ideal of Fano to show that we really got 27 distinct lines, etc.

B. General methods

The first step in writing a program is to decide what the program should do, and it is just as well to write the documentation at this point .

The documentation has the following form:

i18 : document {
           Key => Fano2, 
              TT "Fano2(k,X,GR) or  Fano2(k,X)", " -- computes 
              the ideal of a Fano scheme in the Grassmannian.",
              PARA{},
              "Given an ideal X representing a projective variety 
              in P^r, a positive integer k<r, and optionally a 
              ring GR with (exactly) r+1 choose k+1 variables, 
              representing the ambient space of the Grassmannian of 
              k-planes in P^r, this routine returns the ideal in
              GR of the Fano scheme that parametrizes the k-planes 
              lying on X. If the optional third argument is not 
              present, the routine fabricates its own local ring, 
              and returns an ideal over it."
              }
If we take the variety that is the whole of Pr, we get the Grassmannian. It is useful to be able to make the ring representing the ambient space of the Grassmannian beforehand by hand, so the ideals of several Fano varieties can be compared. But often we won’t need this. Thus we make the function capable of accepting this ambient ring as an argument, or of fending for itself if no ambient ring is given.
i19 : document {
           Key => symbol Grassmannian2, 
          TT "Grassmannian2(k,r,R) or 
              Grassmannian2(k,r)",
             "-- Given natural numbers k <= r,
              and optionally a ring R with at least binomial(r+1,k+1)
              variables, the routine defines the ideal of the 
              Grassmannian of projective k-planes in P^r, using 
              the first binomial(r+1,k+1) variables of R. 
              If R is not given, the routine makes and uses
              ZZ/31991[vars(0..binomial(r+1,k+1)-1]."
              }
In order to make Fano2 handle an optional number of arguments, we make it a method instead of a function, as follows
i20 : Fano2 = method()

o20 = Fano2

o20 : MethodFunction
Here is the code for the first case, with comments interspersed:
i21 : Fano2(ZZ,Ideal,Ring) := (k,X,GR) -> (
        -- Get info about the base ring of X:
        -- The coefficient ring (to make new rings of
        -- the same characteristic, for example)
        -- and the number of variables
        KK:=coefficientRing ring X;
        r := (numgens ring X) - 1;
        -- Next make private variables for our 
        -- intermediate rings, to avoid interfering
        -- with something outside:
        t:=symbol t;
        p:=symbol p;
        -- And rings
        S1 := KK[t_0..t_k];
        S2 := KK[p_0..p_(k*r+k+r)];
        S := tensor(S1,S2);
        -- Over S we have a generic point of a generic
        -- line, represented by a row vector, which
        -- we use to define a map from the base ring
        -- of X
        F := map(S,ring X,
                genericMatrix(S,S_0,1,k+1)*
                genericMatrix(S,S_(k+1),k+1,r+1)
                );
        -- We now apply F to the ideal of X
        FX := F X;
        -- and the condition we want becomes the condition
        -- that FX vanishes identically in the t_i.
        -- The following line produces the matrix of
        -- coefficients of the monomials in the 
        -- variables labelled 0..k:
        cFX := last coefficients (gens FX, Variables => toList apply(0..k, i -> S_i));
        -- We can get rid of the variables t_i
        -- to ease the computation:
        cFX = substitute(cFX, S2);
        -- The ring we want is the quotient
        S2bar := S2/ideal cFX;
        -- Now we want to move to the Grassmannian,
        -- represented by the ring GR
        -- We define a map sending the variables of GR
        -- to the minors of the generic matrix in the
        -- p_i regarded as elements of S1bar
        gr := map(S2bar,GR,
                  exteriorPower(k+1, 
                  genericMatrix(S2bar,S2bar_0,k+1,r+1)
                  )
                 );
        -- and the defining ideal of the Fano variety is
        ker gr
      )

o21 = --Function[stdio:51:33-99:6]--

o21 : FunctionClosure
The second case reduces to the first:
i22 : Fano2(ZZ, Ideal) := (k,X) -> (
        KK:=coefficientRing ring X;
        r := (numgens ring X) - 1;
        -- We can specify a private ring with binomial(r+1,k+1)
        -- variables as follows
        GR := KK[Variables => binomial(r+1,k+1)];
        -- the work is done by
        Fano2(k,X,GR)
      )

o22 = --Function[stdio:101:26-108:12]--

o22 : FunctionClosure
With the 0 ideal we get the Grassmannian of projective k-planes in Pr:
i23 : Grassmannian2 = method()

o23 = Grassmannian2

o23 : MethodFunction
i24 : Grassmannian2(ZZ,ZZ,Ring) := (k,r,R) ->( 
              KK := coefficientRing R;
              RPr := KK[Variables => r+1];
              Pr := ideal(0_RPr);
              Fano2(k,Pr)
           )

o24 = --Function[stdio:111:37-115:16]--

o24 : FunctionClosure
i25 : Grassmannian2(ZZ,ZZ) := (r,k) -> (
              R := ZZ/31991[
                     vars(0..(binomial(r+1,k+1)-1))
                          ];
              Grassmannian2(k,r,R)
                           )

o25 = --Function[stdio:117:30-121:26]--

o25 : FunctionClosure
As a first example we can try the Fano of lines on the nonsingular quadric in P3
i26 : KK = ZZ/31991

o26 = KK

o26 : QuotientRing
i27 : R = KK[a,b,c,d]

o27 = R

o27 : PolynomialRing
i28 : X = ideal(a*b-c*d)

o28 = ideal(a*b - c*d)

o28 : Ideal of R
i29 : I = Fano2(1,X)

                                                  2                     
o29 = ideal (x x , x x , x x  + 15995x x  - 15995x , x x  + x x , x x  -
              3 4   2 4   1 4         0 5         5   0 4    4 5   2 3  
      -----------------------------------------------------------------------
                        2                                                    
      15995x x  - 15995x , x x , x x  - x x , x x , x x  - x x , x x  + x x ,
            0 5         5   1 3   0 3    3 5   1 2   0 2    2 5   0 1    1 5 
      -----------------------------------------------------------------------
       2    2
      x  - x )
       0    5

                 ZZ
o29 : Ideal of ----- [x , x , x , x , x , x ]
               31991   0   1   2   3   4   5
we investigate by checking its dimension and degree
i30 : dim I

o30 = 2
The answer “2” means that I is the ideal of a curve in P5, the ambient space of the Grassmannian of lines.
i31 : degree I

o31 = 4
The answer is 4. In fact, the ideal I represents the union of two conics.

C. Surfaces of degree $4$ in ${\bf P}^5$

We now turn to the three surfaces of degree 4 in P5, and make their ideals:

The ring of P5

i32 : KK = ZZ/31991

o32 = KK

o32 : QuotientRing
i33 : P5 = KK[a..f]

o33 = P5

o33 : PolynomialRing
It happens that the ideals of all three surfaces are generated by minors of suitable matrices:

The Veronese embedding of P2:

i34 : MVero = genericSymmetricMatrix(P5,a,3)

o34 = | a b c |
      | b d e |
      | c e f |

               3        3
o34 : Matrix P5  <--- P5
i35 : Vero = minors(2,MVero)

                2                                                  2         
o35 = ideal (- b  + a*d, - b*c + a*e, - c*d + b*e, - b*c + a*e, - c  + a*f, -
      -----------------------------------------------------------------------
                                              2
      c*e + b*f, - c*d + b*e, - c*e + b*f, - e  + d*f)

o35 : Ideal of P5
The other scrolls are defined by the minors of matrices that are made from “catalecticant” blocks, that is, from matrices such as

b c d e
c d e f

which are manufactured by
i36 : catalecticant = (R,v,m,n) -> 
              map(R^m,n,(i,j)-> R_(i+j+v))

o36 = catalecticant

o36 : FunctionClosure
for example
i37 : catalecticant(P5,1,2,4)

o37 = | b c d e |
      | c d e f |

               2        4
o37 : Matrix P5  <--- P5
produces the example above. The rational normal scroll S13, which is the union of lines joining a line with the corresponding points of a twisted cubic in a disjoint subspace of P5
i38 : M13 = catalecticant(P5,0,2,1) |
                 catalecticant(P5,2,2,3)

o38 = | a c d e |
      | b d e f |

               2        4
o38 : Matrix P5  <--- P5
i39 : S13 = minors(2,M13)

                                          2                                 
o39 = ideal (- b*c + a*d, - b*d + a*e, - d  + c*e, - b*e + a*f, - d*e + c*f,
      -----------------------------------------------------------------------
         2
      - e  + d*f)

o39 : Ideal of P5
Finally, the rational normal scroll S22, which is made by a similar construction starting with two conics in P5

i40 : M22 = catalecticant(P5,0,2,2) | catalecticant(P5,3,2,2)

o40 = | a b d e |
      | b c e f |

               2        4
o40 : Matrix P5  <--- P5

i41 : S22 = minors(2, M22)

                2                                                           
o41 = ideal (- b  + a*c, - b*d + a*e, - c*d + b*e, - b*e + a*f, - c*e + b*f,
      -----------------------------------------------------------------------
         2
      - e  + d*f)

o41 : Ideal of P5
It is interesting to note that the numerical invariants of these surfaces are very hard to distinguish. In particular, the graded betti numbers
i42 : Verores = res coker gens Vero

        1       6       8       3
o42 = P5  <-- P5  <-- P5  <-- P5  <-- 0
                                       
      0       1       2       3       4

o42 : ChainComplex
i43 : S22res = res coker gens S22

        1       6       8       3
o43 = P5  <-- P5  <-- P5  <-- P5  <-- 0
                                       
      0       1       2       3       4

o43 : ChainComplex
i44 : S13res = res coker gens S13

        1       6       8       3
o44 = P5  <-- P5  <-- P5  <-- P5  <-- 0
                                       
      0       1       2       3       4

o44 : ChainComplex
i45 : betti Verores

             0 1 2 3
o45 = total: 1 6 8 3
          0: 1 . . .
          1: . 6 8 3

o45 : BettiTally
i46 : betti S22res

             0 1 2 3
o46 = total: 1 6 8 3
          0: 1 . . .
          1: . 6 8 3

o46 : BettiTally
i47 : betti S13res

             0 1 2 3
o47 = total: 1 6 8 3
          0: 1 . . .
          1: . 6 8 3

o47 : BettiTally
coincide, so the three cannot be distinguished on the basis of these or on the basis of the (weaker) invariants the Hilbert series or Hilbert polynomials. But the Fano varieties are more obviously different:

We compute the Fano varieties of lines on each of our surfaces.

i48 : FVero = Fano2(1, Vero)

              2                                                              
o48 = ideal (x  , x  x  , x  x  , x  x  , x  x  , x x  , x x  , x x  , x x  ,
              14   13 14   12 14   11 14   10 14   9 14   8 14   7 14   6 14 
      -----------------------------------------------------------------------
                                                 2                          
      x x  , x x  , x x  , x x  , x x  , x x  , x  , x  x  , x  x  , x  x  ,
       5 14   4 14   3 14   2 14   1 14   0 14   13   12 13   11 13   10 13 
      -----------------------------------------------------------------------
                                                                           
      x x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  ,
       9 13   8 13   7 13   6 13   5 13   4 13   3 13   2 13   1 13   0 13 
      -----------------------------------------------------------------------
       2                                                                   
      x  , x  x  , x  x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  ,
       12   11 12   10 12   9 12   8 12   7 12   6 12   5 12   4 12   3 12 
      -----------------------------------------------------------------------
                            2                                             
      x x  , x x  , x x  , x  , x  x  , x x  , x x  , x x  , x x  , x x  ,
       2 12   1 12   0 12   11   10 11   9 11   8 11   7 11   6 11   5 11 
      -----------------------------------------------------------------------
                                          2                              
      x x  , x x  , x x  , x x  , x x  , x  , x x  , x x  , x x  , x x  ,
       4 11   3 11   2 11   1 11   0 11   10   9 10   8 10   7 10   6 10 
      -----------------------------------------------------------------------
                                                 2                         
      x x  , x x  , x x  , x x  , x x  , x x  , x , x x , x x , x x , x x ,
       5 10   4 10   3 10   2 10   1 10   0 10   9   8 9   7 9   6 9   5 9 
      -----------------------------------------------------------------------
                                     2                                     
      x x , x x , x x , x x , x x , x , x x , x x , x x , x x , x x , x x ,
       4 9   3 9   2 9   1 9   0 9   8   7 8   6 8   5 8   4 8   3 8   2 8 
      -----------------------------------------------------------------------
                   2                                             2       
      x x , x x , x , x x , x x , x x , x x , x x , x x , x x , x , x x ,
       1 8   0 8   7   6 7   5 7   4 7   3 7   2 7   1 7   0 7   6   5 6 
      -----------------------------------------------------------------------
                                     2                                 2 
      x x , x x , x x , x x , x x , x , x x , x x , x x , x x , x x , x ,
       4 6   3 6   2 6   1 6   0 6   5   4 5   3 5   2 5   1 5   0 5   4 
      -----------------------------------------------------------------------
                               2                     2               2       
      x x , x x , x x , x x , x , x x , x x , x x , x , x x , x x , x , x x ,
       3 4   2 4   1 4   0 4   3   2 3   1 3   0 3   2   1 2   0 2   1   0 1 
      -----------------------------------------------------------------------
       2
      x )
       0

                 ZZ
o48 : Ideal of ----- [x , x , x , x , x , x , x , x , x , x , x  , x  , x  , x  , x  ]
               31991   0   1   2   3   4   5   6   7   8   9   10   11   12   13   14
i49 : betti gens FVero

             0   1
o49 = total: 1 120
          0: 1   .
          1: . 120

o49 : BettiTally
The ideal contains all 120 quadrics, and represents the empty set: The Veronese surface contains no lines!
i50 : FS13 = Fano2(1, S13)

              2                                                              
o50 = ideal (x  , x  x  , x  x  , x  x  , x  x  , x x  , x x  , x x  , x x  ,
              14   13 14   12 14   11 14   10 14   9 14   8 14   7 14   6 14 
      -----------------------------------------------------------------------
                                                 2                          
      x x  , x x  , x x  , x x  , x x  , x x  , x  , x  x  , x  x  , x  x  ,
       5 14   4 14   3 14   2 14   1 14   0 14   13   12 13   11 13   10 13 
      -----------------------------------------------------------------------
                                                                           
      x x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  ,
       9 13   8 13   7 13   6 13   5 13   4 13   3 13   2 13   1 13   0 13 
      -----------------------------------------------------------------------
       2                                                                   
      x  , x  x  , x  x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  ,
       12   11 12   10 12   9 12   8 12   7 12   6 12   5 12   4 12   3 12 
      -----------------------------------------------------------------------
                                                                       
      x x  , x x  , x x  , x x  , x x  , x x   - x  x  , x x  , x x   -
       2 12   1 12   0 12   9 11   8 11   7 11    10 11   5 11   4 11  
      -----------------------------------------------------------------------
                                    2                                       
      x x  , x x   - x x  , x x  , x   - x x  , x x  , x x  , x x   - x x  ,
       6 11   2 11    3 11   0 11   10    6 11   9 10   8 10   7 10    6 11 
      -----------------------------------------------------------------------
                                                                        
      x x   - x x  , x x  , x x   - x x  , x x   - x x  , x x   - x x  ,
       6 10    3 11   5 10   4 10    3 11   3 10    1 11   2 10    1 11 
      -----------------------------------------------------------------------
              2                                                         2 
      x x  , x , x x , x x , x x , x x , x x , x x , x x , x x , x x , x ,
       0 10   9   8 9   7 9   6 9   5 9   4 9   3 9   2 9   1 9   0 9   8 
      -----------------------------------------------------------------------
                                                       2                
      x x , x x , x x , x x , x x , x x , x x , x x , x  - x x  , x x  -
       7 8   6 8   5 8   4 8   3 8   2 8   1 8   0 8   7    6 11   6 7  
      -----------------------------------------------------------------------
                                                                          
      x x  , x x , x x  - x x  , x x  - x x  , x x  - x x  , x x  - x x  ,
       3 11   5 7   4 7    3 11   3 7    1 11   2 7    1 11   1 7    1 10 
      -----------------------------------------------------------------------
             2                                                               
      x x , x  - x x  , x x , x x  - x x  , x x  - x x  , x x  - x x  , x x ,
       0 7   6    1 11   5 6   4 6    1 11   3 6    1 10   2 6    1 10   0 6 
      -----------------------------------------------------------------------
       2                                 2                              
      x , x x , x x , x x , x x , x x , x  - x x  , x x  - x x  , x x  -
       5   4 5   3 5   2 5   1 5   0 5   4    1 11   3 4    1 10   2 4  
      -----------------------------------------------------------------------
                                 2                             2
      x x  , x x  - x x , x x , x  - x x , x x  - x x , x x , x  - x x , x x 
       1 10   1 4    1 6   0 4   3    1 6   2 3    1 6   0 3   2    1 6   1 2
      -----------------------------------------------------------------------
      - x x , x x , x x )
         1 3   0 2   0 1

                 ZZ
o50 : Ideal of ----- [x , x , x , x , x , x , x , x , x , x , x  , x  , x  , x  , x  ]
               31991   0   1   2   3   4   5   6   7   8   9   10   11   12   13   14
It turns out that the dimension (1) and degree (4) of these varieties coincide! Moreover, since the ideals are not saturated, one cannot directly compare the Hilbert series or free resolutions (of course one could first compute a saturation). But there is the arithmetic genus, that is, 1-H(0), where H is the Hilbert polynomial.
i51 : hilbertPolynomial coker gens FS13

o51 = - 2*P  + 4*P
           0      1

o51 : ProjectiveHilbertPolynomial
The output, 4 P1 - 2 P0, means “four times the Hilbert polynomial of the projective line minus 2”; that is, the polynomial is H(d) = 4d + 2; so arithmetic genus is -1.
i52 : FS22 = Fano2(1, S22)

              2                                                              
o52 = ideal (x  , x  x  , x  x  , x  x  , x  x  , x x  , x x  , x x  , x x  ,
              14   13 14   12 14   11 14   10 14   9 14   8 14   7 14   6 14 
      -----------------------------------------------------------------------
                                                 2                          
      x x  , x x  , x x  , x x  , x x  , x x  , x  , x  x  , x  x  , x  x  ,
       5 14   4 14   3 14   2 14   1 14   0 14   13   12 13   11 13   10 13 
      -----------------------------------------------------------------------
                                                                           
      x x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  , x x  ,
       9 13   8 13   7 13   6 13   5 13   4 13   3 13   2 13   1 13   0 13 
      -----------------------------------------------------------------------
                                                                           
      x x  , x x   - x  x  , x x   - x  x  , x x   - x  x  , x x   - x x  ,
       9 12   8 12    11 12   7 12    10 12   5 12    10 12   4 12    6 12 
      -----------------------------------------------------------------------
                            2                                          
      x x  , x x  , x x  , x   - x  x  , x  x   - x x  , x x  , x x   -
       2 12   1 12   0 12   11    10 12   10 11    6 12   9 11   8 11  
      -----------------------------------------------------------------------
                                                                         
      x  x  , x x   - x x  , x x   - x x  , x x   - x x  , x x   - x x  ,
       10 12   7 11    6 12   6 11    3 12   5 11    6 12   4 11    3 12 
      -----------------------------------------------------------------------
                            2                                               
      x x  , x x  , x x  , x   - x x  , x x  , x x   - x x  , x x   - x x  ,
       2 11   1 11   0 11   10    3 12   9 10   8 10    6 12   7 10    3 12 
      -----------------------------------------------------------------------
                                                                         2 
      x x   - x x  , x x   - x x  , x x   - x x  , x x  , x x  , x x  , x ,
       6 10    3 11   5 10    3 12   4 10    3 11   2 10   1 10   0 10   9 
      -----------------------------------------------------------------------
                                                             2               
      x x , x x , x x , x x , x x , x x , x x , x x , x x , x  - x  x  , x x 
       8 9   7 9   6 9   5 9   4 9   3 9   2 9   1 9   0 9   8    10 12   7 8
      -----------------------------------------------------------------------
                                                                            
      - x x  , x x  - x x  , x x  - x x  , x x  - x x  , x x  - x x  , x x ,
         6 12   6 8    3 12   5 8    6 12   4 8    3 12   3 8    3 11   2 8 
      -----------------------------------------------------------------------
                   2                                                        
      x x , x x , x  - x x  , x x  - x x  , x x  - x x  , x x  - x x  , x x 
       1 8   0 8   7    3 12   6 7    3 11   5 7    3 12   4 7    3 11   3 7
      -----------------------------------------------------------------------
                                  2                                     
      - x x  , x x , x x , x x , x  - x x  , x x  - x x  , x x  - x x  ,
         3 10   2 7   1 7   0 7   6    3 10   5 6    3 11   4 6    3 10 
      -----------------------------------------------------------------------
                         2                                                 
      x x , x x , x x , x  - x x  , x x  - x x  , x x  - x x  , x x , x x ,
       2 6   1 6   0 6   5    3 12   4 5    3 11   3 5    3 10   2 5   1 5 
      -----------------------------------------------------------------------
             2                                                            2 
      x x , x  - x x  , x x  - x x , x x , x x , x x , x x , x x , x x , x ,
       0 5   4    3 10   3 4    3 6   2 4   1 4   0 4   2 3   1 3   0 3   2 
      -----------------------------------------------------------------------
                   2         2
      x x , x x , x , x x , x )
       1 2   0 2   1   0 1   0

                 ZZ
o52 : Ideal of ----- [x , x , x , x , x , x , x , x , x , x , x  , x  , x  , x  , x  ]
               31991   0   1   2   3   4   5   6   7   8   9   10   11   12   13   14
i53 : hilbertPolynomial coker gens FS22

o53 = - 3*P  + 4*P
           0      1

o53 : ProjectiveHilbertPolynomial
The output, 4 P1 - 3 P0, means H(d) = 4d + 1, arithmetic genus -1. In fact, the Fano variety of S22 consists of a projective line, embedded as a smooth rational quartic; while the Fano variety of S13 consists of a smooth rational quartic (corresponding to the rulings of the surface S13 and an isolated point, corresponding to the section of negative self-intersection on the surface).