################################################################################ ################################################################################ ################################################################################ #### #### #### GAP-Program #### #### #### #### `SEIFERT' #### #### #### #### by Frank H. Lutz, TU Berlin, Germany #### #### #### #### Version Nov/2003 available at #### #### #### #### http://www.math.TU-Berlin.de/diskregeom/stellar/ #### #### #### ################################################################################ ################################################################################ ################################################################################ ################################################################################ # # # This program produces triangulations of all orientable Seifert manifolds # # # # {Oo,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}, # # {On,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]} # # # # and of all non-orientable Seifert manifolds # # # # {No,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}, # # {NnI,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}, # # {NnII,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}, # # {NnIII,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}. # # # # The classifying spaces {Oo,g} respectively {NnI,g} # # are product spaces of the (punctured) orientable / non-orientable # # orbit surface (o,g) / (n,g) of genus g with a circle S^1. # # {Oo,g} and {NnI,g} are 3-manifolds with toroidal boundary # # and are closed by filling in a torus with parameter b. # # The resulting class spaces {Oo,g|b;--} respectively {NnI,g|b;--} # # are Seifert manifolds without exceptional fibres. # # The insertion of exceptional fibres defined by the parameters # # [alpha_1,beta_1],...,[alpha_r,beta_r] yields the Seifert manifolds # # # # {Oo,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]} # # {NnI,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}. # # # # For an explicit description of the other types of Seifert manifolds see # # # # U. Brehm, F.H. Lutz. # # Triangulations of Seifert manifolds. In Preparation. # # # # F.H. Lutz. # # Triangulated Manifolds with Few Vertices: Geometric 3-Manifolds. # # arXiv:math.GT/0311116, 2003, 48 pages. # # # # and # # # # P. Orlik. # # Seifert Manifolds. # # Lecture Notes in Mathematics 291. # # Berlin: Springer-Verlag, 1972. # # # # P. Scott. # # The geometries of 3-manifolds. # # Bull. Lond. Math. Soc., 15, (401-487) 1983. # # # # H. Seifert. # # Topologie dreidimensionaler gefaserter Räume. # # Acta Math. 60, (147-238) 1933. # # # ################################################################################ ################################################################################ # # # How to use the program? # # # # (A) Install GAP. # # # # The GAP Group. # # GAP -- Groups, Algorithms, and Programming, Version 4.3, 2002. # # (http://www.gap-system.org) # # # # (B) Modify this progam as described below, save it, # # start GAP, and call SEIFERT by the command # # # # gap> Read("SEIFERT"); # # # # (C) The facets of the produced manifold will be printed to a file # # SEIFERT.out # # # # (D) gap> quit; # # # ################################################################################ ################################################################################ # # # There are different choices available. You can either compose general # # Seifert manifolds or you can produce particular examples such as # # lens spaces, prism spaces, other spherical 3-manifolds, flat spaces, # # Seifert homology spheres, etc. # # # # For the selection of the examples: # # # # - choose the object_type first, # # - then fix the necessary parameters below # # at the positions marked with an arrow <--- # # # ################################################################################ object_type:=1; # <<<========= # # General Seifert manifold: # # 1 = general # # Spherical spaces: # # 2 = lens space L(p,1), # 3 = lens space L(p,q), # 4 = prism space P(r), # 5 = generalized prism space, # 6 = octahedron space S^3/T^*, # 7 = generalized octahedron space, # 8 = truncated cube space S^3/O^*, # 9 = generalized truncated cube space, # 10 = Poincaré homology 3-sphere S^3/I^*, # 11 = generalized spherical dodecahedron space # # Orientable flat spaces: # # 12 = S^1xS^1xS^1 # 13 = G_2 # 14 = G_3 # 15 = G_4 # 16 = G_5 # 17 = G_6 # # Non-orientable flat spaces: # # 18 = KxS^1 # 19 = B_2 # 20 = B_3 # 21 = B_4 # # S^2xR-spaces: # # 22 = S^2xS^1 # 23 = RP^3#RP^3 # 24 = S^2 twist S^1 # 25 = RP^2xS^1 # # Seifert homology spheres: # # 26 = homology spheres # # T^2 bundles over S^1: # # 27 = {Oo,1|b} with {Oo,1|0} = S^1xS^1xS^1 # and {Oo,1|b} is of Nil geometry for b > 0 # 28 = {On,2|b} with {On,2|0} = G_2 # and {On,2|b} is of Nil geometry for b > 0 ##### 1 = general Seifert manifold with invariants: ##### ## {Oo,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}, ## {On,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}, ## {No,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}, ## {NnI,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}, ## {NnII,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]}, ## {NnIII,g|b;[alpha_1,beta_1],...,[alpha_r,beta_r]} ## if object_type = 1 then total_orientation:=1; # <--- 1 = orientable total space # 0 = non-orientable total space # surface_orientation:=1; # <--- 1 = orientable orbit surface # 0 = non-orientable orbit surface # g:=0; # <--- 0,1,2,3,... genus of the surface (o,g) / (n,g) # (Remark: 0 is anly possible for type Oo) # Nn_type:=3; # <--- Only for non-orientable total spaces # with non-orientable orbit surface, i.e., # determines the types NnI, NnII, NnIII. # 1 for g = 1 # 1,2 for g = 2 # 1,2,3 for g > 2 # b:=5; # <--- ...,-2,-1,0,1,2,... if total_orientation = 1 # 0,1 if total_orientation = 0 # and alpha_i > 2 # 0 if total_orientation = 0 # and some alpha_i = 2 # (class space fibre) # exceptional_fibres:=[[2,3],[5,7]]; # <--- exceptional fibres: [[alpha_1,beta_1],..,[alpha_r,beta_r]] # with pairs of relatively prime integers alpha_i and beta_i # where alpha_i >= 2 and # 0 < beta_i < alpha_i (i = 1,...,r) # if the total space is orientable and # 0 < beta_i <= 1/2 alpha_i (i = 1,...,r) # if the total space is non-orientable # (Remark: [] gives spaces without exceptional fibres.) fi; ## ##### ##### ##### 2 = lens space L(p,1) = {Oo,0|p;--} for any integer p ##### = -L(-p,1) ## with special cases: S^3 = L(1,1) = -L(-1,1) ## S^2xS^1 = L(0,1) if object_type = 2 then p:=3; # <--- fi; ## ##### ##### ##### 3 = lens space L(p,q) ={Oo,0|0;[p+q,p]} for p >= 2, 1 <= q <= p/2 ##### ## if object_type = 3 then p:=9; q:=2; # <--- fi; ## ##### ##### ##### 4 = prism space P(r) = {Oo,0|-1;[2,1],[2,1],[r,1]} for r >= 2 ##### ## if object_type = 4 then r:=1; # <--- fi; ## ##### ##### ##### 5 = generalized prism space {Oo,0|b;[2,1],[2,1],[alpha_3,beta_3]} ##### ## if object_type = 5 then b:=4; # <--- ...,-2,-1,0,1,2,... class space fibre alpha_3:=3; # <--- alpha_3 >= 2 beta_3:=1; # <--- 0 < beta_3 < alpha_3 fi; ## ##### ##### ##### 6 = octahedron space S^3/T^* = {Oo,0|-1;[2,1],[3,1],[3,1]} ##### ##### ##### 7 = generalized octahedron space {Oo,0|b;[2,1],[3,beta_2],[3,beta_3]} ##### ## if object_type = 7 then b:=9; # <--- ...,-2,-1,0,1,2,... class space fibre beta_2:=1; # <--- 0 < beta_2 < 3 beta_3:=1; # <--- 0 < beta_3 < 3 fi; ## ##### ##### ##### 8 = truncated cube space S^3/O^* = {Oo,0|-1;[2,1],[3,1],[4,1]} ##### ##### ##### 9 = generalized truncated cube space {Oo,0|b;[2,1],[3,beta_2],[4,beta_3]} ##### ## if object_type = 9 then b:=-6; # <--- ...,-2,-1,0,1,2,... class space fibre beta_2:=1; # <--- 0 < beta_2 < 3 beta_3:=3; # <--- 0 < beta_3 < 4 fi; ## ##### ##### ##### 10 = Poincare sphere S^3/I^* = Sigma(2,3,5) ##### = {Oo,0|-1;[2,1],[3,1],[5,1]} ##### ##### 11 = generalized spherical dodecahedron space {Oo,0|b;[2,1],[3,beta_2],[5,beta_3]} ##### ## if object_type = 11 then b:=100; # <--- ...,-2,-1,0,1,2,... class space fibre beta_2:=2; # <--- 0 < beta_2 < 3 beta_3:=4; # <--- 0 < beta_3 < 5 fi; ## ##### ##### ##### 12 = S^1xS^1xS^1 {Oo,1|0} ##### ##### ##### 13 = G_2 {Oo,0|-2;[2,1],[2,1],[2,1],[2,1]} ##### ={On,2|0} ##### ##### 14 = G_3 {Oo,0|-1;[3,1],[3,1],[3,1]} ##### ##### ##### 15 = G_4 {Oo,0|-1;[2,1],[4,1],[4,1]} ##### ##### ##### 16 = G_5 {Oo,0|-1;[2,1],[3,1],[6,1]} ##### ##### ##### 17 = G_6 {On,1|-1;[2,1],[2,1]} ##### ##### ##### 18 = KxS^1 {NnI,2|0} ##### ##### ##### 19 = B_2 {NnI,2|1} ##### ##### ##### 20 = B_3 {NnII,2|0} ##### ##### ##### 21 = B_4 {NnII,2|1} ##### ##### ##### 22 = S^2xS^1 {Oo,0|0} ##### ##### ##### 23 = RP^3#RP^3 {On,1|0} ##### ##### ##### 24 = S^2 twist S^1 {NnI,1|1} ##### ##### ##### 25 = RP^2xS^1 {NnI,1|0} ##### ##### ##### 26 = homology sphere Sigma(alpha_1,...,alpha_r) ##### with r >= 3 and alpha_i pairwise prime ## if object_type = 26 then alpha:=[2,3,5,7]; # <--- [alpha_1,alpha_2,...,alpha_r] fi; ## ##### ##### ##### 27 = T^2 bundles over S^1 {Oo,1|b} ##### ## if object_type = 27 then b:=5; # <--- ...,-2,-1,0,1,2,... class space fibre fi; ## ##### ##### ##### 28 = T^2 bundles over S^1 {On,2|b} ##### ## if object_type = 28 then b:=1; # <--- ...,-2,-1,0,1,2,... class space fibre fi; ## ##### ##### ################################################################################ ################################################################################ ##### Variables, Functions, and Objects ##### ################################################################################ ################################################################################ a0:=0; a1:=0; a2:=0; a3:=0; b0:=0; b1:=0; b2:=0; b3:=0; c0:=0; c1:=0; c2:=0; c3:=0; expansion:=[]; flag_stop:=0; torus:=[]; f1:=0; f2:=0; ggt:=0; if not object_type in [1,5,7,9,11,27,28] then b:=0; fi; if not object_type = 1 then exceptional_fibres:=[]; fi; if not object_type = 26 then alpha:=[]; fi; ##################### ### Compose_Torus ### ##################### Compose_Torus := function(aa1,aa2,aa3,bb1,bb2,bb3,cc1,cc2,cc3,mm1,mm2,mm3,mm4) AddSet(torus,Set([aa2,cc2,cc3,mm3])); AddSet(torus,Set([bb2,cc2,cc3,mm3])); AddSet(torus,Set([bb2,cc3,mm2,mm3])); AddSet(torus,Set([bb2,bb3,cc3,mm2])); AddSet(torus,Set([aa2,bb2,bb3,mm2])); AddSet(torus,Set([aa2,bb3,mm1,mm2])); AddSet(torus,Set([aa2,aa3,bb3,mm1])); AddSet(torus,Set([aa2,aa3,cc3,mm3])); AddSet(torus,Set([aa2,aa3,mm1,mm3])); AddSet(torus,Set([aa1,cc1,mm1,mm3])); AddSet(torus,Set([bb1,cc1,mm1,mm3])); AddSet(torus,Set([bb3,cc3,mm1,mm2])); AddSet(torus,Set([bb1,bb3,cc3,mm1])); AddSet(torus,Set([bb1,cc1,cc3,mm1])); AddSet(torus,Set([aa1,cc1,mm1,mm2])); AddSet(torus,Set([cc1,cc3,mm1,mm2])); AddSet(torus,Set([aa3,bb3,mm1,mm3])); AddSet(torus,Set([bb1,bb3,mm1,mm3])); AddSet(torus,Set([aa1,cc1,cc3,mm2])); AddSet(torus,Set([aa1,aa3,bb3,mm4])); AddSet(torus,Set([aa1,aa3,cc3,mm4])); AddSet(torus,Set([aa1,bb1,bb3,mm4])); AddSet(torus,Set([aa1,bb1,mm2,mm4])); AddSet(torus,Set([aa3,bb3,mm3,mm4])); AddSet(torus,Set([aa3,cc3,mm3,mm4])); AddSet(torus,Set([bb1,mm2,mm3,mm4])); AddSet(torus,Set([cc3,mm2,mm3,mm4])); AddSet(torus,Set([aa1,cc3,mm2,mm4])); AddSet(torus,Set([bb1,bb3,mm3,mm4])); end; ############################# ### Compose_Torus_Inverse ### ############################# Compose_Torus_Inverse := function(aa1,aa2,aa3,bb1,bb2,bb3,cc1,cc2,cc3,mm1,mm2,mm3) AddSet(torus,Set([aa1,bb1,bb2,mm2])); AddSet(torus,Set([bb1,bb2,mm2,mm3])); AddSet(torus,Set([aa1,aa2,bb2,mm2])); AddSet(torus,Set([aa2,bb2,mm2,mm3])); AddSet(torus,Set([aa2,cc3,mm2,mm3])); AddSet(torus,Set([aa2,cc2,cc3,mm2])); AddSet(torus,Set([aa1,aa2,cc2,mm2])); AddSet(torus,Set([bb3,cc2,cc3,mm2])); AddSet(torus,Set([bb3,cc2,mm1,mm2])); AddSet(torus,Set([aa1,cc2,mm1,mm2])); AddSet(torus,Set([bb2,bb3,cc2,cc3])); AddSet(torus,Set([aa1,cc2,mm1,mm3])); AddSet(torus,Set([aa1,cc1,cc2,mm3])); AddSet(torus,Set([bb1,cc1,cc2,mm3])); AddSet(torus,Set([bb1,bb2,cc2,mm3])); AddSet(torus,Set([bb2,cc2,mm1,mm3])); AddSet(torus,Set([bb2,bb3,cc2,mm1])); AddSet(torus,Set([aa2,bb2,bb3,mm1])); AddSet(torus,Set([aa2,aa3,bb3,mm1])); AddSet(torus,Set([aa2,aa3,cc3,mm1])); AddSet(torus,Set([aa2,cc3,mm1,mm3])); AddSet(torus,Set([aa2,bb2,mm1,mm3])); end; ################## ### Flip_Torus ### ################## Flip_Torus := function(aa1,aa2,aa3,bb1,bb2,bb3,cc1,cc2,cc3) a2:=bb1; a3:=cc1; b1:=aa2; b3:=cc2; c1:=aa3; c2:=bb3; end; ################################## ### Compute_Continued_Fraction ### ################################## Compute_Continued_Fraction := function(uu,vv) local flag_expansion, a_or_b, ww; flag_expansion:=0; a_or_b:=1; while flag_expansion = 0 do #Print(uu," ",vv,"\n"); if uu = 0 then flag_expansion:=1; elif uu >= vv then uu:=uu-vv; Add(expansion,a_or_b); else if a_or_b = 1 then a_or_b:=0; else a_or_b:=1; fi; ww:=uu; uu:=vv; vv:=ww; fi; od; end; ######################### ### Compute_Cofactors ### ######################### Compute_Cofactors := function(uu,vv) local a, q, flag_stop_euclid, k, m, n, i, flag_twist; a:=[]; if uu > vv then a[1]:=uu; a[2]:=vv; flag_twist:=0; else a[1]:=vv; a[2]:=uu; flag_twist:=1; fi; q:=[]; flag_stop_euclid:=0; k:=1; while flag_stop_euclid = 0 do q[k]:=Int(a[k]/a[k+1]); a[k+2]:=a[k]-q[k]*a[k+1]; if a[k+2] = 0 then flag_stop_euclid:=1; else k:=k+1; fi; od; m:=[]; m[1]:=q[1]; m[2]:=1; m[3]:=1; m[4]:=0; n:=[]; for i in [2..k] do n[1]:=m[1]*q[i]+m[3]; n[2]:=m[2]*q[i]+m[4]; n[3]:=m[1]; n[4]:=m[2]; m[1]:=n[1]; m[2]:=n[2]; m[3]:=n[3]; m[4]:=n[4]; od; ggt:=a[k+1]; if flag_twist = 0 then f1:=m[4]/(m[1]*m[4]-m[2]*m[3]); f2:=-m[3]/(m[1]*m[4]-m[2]*m[3]); else f2:=m[4]/(m[1]*m[4]-m[2]*m[3]); f1:=-m[3]/(m[1]*m[4]-m[2]*m[3]); fi; end; ######################## ### Compute_Solution ### ######################## Compute_Solution := function() local factors, ggts, beta, j, solution, f, t, r, list, k, product; if IsList(alpha) = false then flag_stop:=1; Print("Error: Homology spheres have to be specified by a list [alpha_1,...,alpha_r]!\n"); else r:=Length(alpha); if r < 3 then Print("Error: Homology spheres have at least three exceptional fibers!\n"); flag_stop:=1; fi; if flag_stop = 0 then for j in [1..r] do if flag_stop = 0 and not (IsInt(alpha[j]) and alpha[j] > 0) then flag_stop:=1; Print("Error: alpha_[",j,"] has to be an integer > 0!\n"); fi; od; fi; fi; if flag_stop = 0 then for j in [1..r] do for k in [1..r] do if not k = j then if flag_stop = 0 and not Gcd(alpha[j],alpha[k]) = 1 then flag_stop:=1; Print("Error: alpha_[",j,"] and alpha_[",k,"] have to be coprime!\n"); fi; fi; od; od; fi; if flag_stop = 0 then list:=[]; for j in [1..r] do product:=1; for k in [1..r] do if not k = j then product:=product*alpha[k]; fi; od; list[j]:=product; od; Compute_Cofactors(list[1],list[2]); factors:=[]; factors[1]:=f1; factors[2]:=f2; ggts:=[]; ggts[1]:=ggt; for j in [3..r] do Compute_Cofactors(ggts[j-2],list[j]); factors[2*(j-2)+1]:=f1; factors[2*(j-2)+2]:=f2; ggts[j-1]:=ggt; od; solution:=[]; solution[r]:=factors[2*(r-2)+2]; f:=factors[2*(r-2)+1]; for j in [1..(r-2)] do solution[r-j]:=f*factors[2*(r-2)+2-2*j]; f:=f*factors[2*(r-2)+1-2*j]; od; solution[1]:=f; Print(solution,"\n"); for j in [1..r] do beta:=solution[j]; if beta < 0 then t:=Int(-beta/alpha[j])+1; Add(exceptional_fibres,[alpha[j],beta+t*alpha[j]]); b:=b-t; elif beta < alpha[j] then Add(exceptional_fibres,[alpha[j],beta]); else t:=Int(beta/alpha[j]); Add(exceptional_fibres,[alpha[j],beta-t*alpha[j]]); b:=b+t; fi; od; fi; end; #################################################### ### available minimal triangulations of surfaces ### #################################################### sphere:=[[1,2,3],[1,2,4],[1,3,4],[2,3,4]]; ### available_orientable_surfaces:=[1,2,3]; orientable_surfaces:=[]; orientable_surfaces[1]:=[ [ 1, 2, 4 ], [ 1, 2, 6 ], [ 1, 3, 4 ], [ 1, 3, 7 ], [ 1, 5, 6 ], [ 1, 5, 7 ], [ 2, 3, 5 ], [ 2, 3, 7 ], [ 2, 4, 5 ], [ 2, 6, 7 ], [ 3, 4, 6 ], [ 3, 5, 6 ], [ 4, 5, 7 ], [ 4, 6, 7 ] ]; orientable_surfaces[2]:=[ [ 1, 2, 7 ], [ 1, 2, 8 ], [ 1, 4, 8 ], [ 1, 4, 9 ], [ 1, 7, 10 ], [ 1, 9, 10 ], [ 2, 3, 5 ], [ 2, 3, 9 ], [ 2, 4, 6 ], [ 2, 4, 10 ], [ 2, 5, 7 ], [ 2, 6, 9 ], [ 2, 8, 10 ], [ 3, 4, 5 ], [ 3, 4, 6 ], [ 3, 6, 7 ], [ 3, 7, 8 ], [ 3, 8, 9 ], [ 4, 5, 9 ], [ 4, 7, 8 ], [ 4, 7, 10 ], [ 5, 7, 9 ], [ 6, 7, 9 ], [ 8, 9, 10 ] ]; orientable_surfaces[3]:=[ [ 1, 2, 9 ], [ 1, 2, 10 ], [ 1, 3, 6 ], [ 1, 3, 10 ], [ 1, 4, 8 ], [ 1, 4, 9 ], [ 1, 5, 6 ], [ 1, 5, 7 ], [ 1, 7, 8 ], [ 2, 3, 5 ], [ 2, 3, 7 ], [ 2, 4, 6 ], [ 2, 4, 10 ], [ 2, 5, 9 ], [ 2, 6, 7 ], [ 3, 4, 6 ], [ 3, 4, 9 ], [ 3, 5, 8 ], [ 3, 7, 10 ], [ 3, 8, 9 ], [ 4, 5, 8 ], [ 4, 5, 10 ], [ 5, 6, 10 ], [ 5, 7, 9 ], [ 6, 7, 9 ], [ 6, 8, 9 ], [ 6, 8, 10 ], [ 7, 8, 10 ] ]; ### available_non_orientable_surfaces:=[1,2,3]; non_orientable_surfaces:=[]; non_orientable_surfaces[1]:=[ [ 1, 2, 3 ], [ 1, 2, 6 ], [ 1, 3, 5 ], [ 1, 4, 5 ], [ 1, 4, 6 ], [ 2, 3, 4 ], [ 2, 4, 5 ], [ 2, 5, 6 ], [ 3, 4, 6 ], [ 3, 5, 6 ] ]; non_orientable_surfaces[2]:=[ [ 1, 2, 4 ], [ 1, 2, 6 ], [ 1, 4, 7 ], [ 1, 5, 6 ], [ 1, 5, 8 ], [ 1, 7, 8 ], [ 2, 3, 6 ], [ 2, 3, 7 ], [ 2, 4, 5 ], [ 2, 5, 7 ], [ 3, 4, 7 ], [ 3, 4, 8 ], [ 3, 6, 8 ], [ 4, 5, 8 ], [ 5, 6, 7 ], [ 6, 7, 8 ] ]; non_orientable_surfaces[3]:=[ [ 1, 2, 5 ], [ 1, 2, 8 ], [ 1, 3, 4 ], [ 1, 3, 9 ], [ 1, 4, 8 ], [ 1, 5, 9 ], [ 2, 4, 5 ], [ 2, 4, 7 ], [ 2, 7, 9 ], [ 2, 8, 9 ], [ 3, 4, 6 ], [ 3, 5, 7 ], [ 3, 5, 8 ], [ 3, 6, 8 ], [ 3, 7, 9 ], [ 4, 5, 8 ], [ 4, 6, 7 ], [ 5, 6, 7 ], [ 5, 6, 9 ], [ 6, 8, 9 ] ]; ################################################################################ ################################################################################ ##### Main Part ##### ################################################################################ ################################################################################ ################################## ### Compute Seifert invariants ### ################################## ### Spherical spaces: ### if object_type = 2 then total_orientation:=1; surface_orientation:=1; g:=0; b:=p; exceptional_fibres:=[]; elif object_type = 3 then if q = 1 then # L(p,q) = L(b,1) total_orientation:=1; surface_orientation:=1; g:=0; b:=p; exceptional_fibres:=[]; else total_orientation:=1; surface_orientation:=1; g:=0; b:=0; exceptional_fibres:=[[p+q,p]]; fi; elif object_type = 4 then total_orientation:=1; surface_orientation:=1; g:=0; b:=-1; exceptional_fibres:=[[2,1],[2,1],[r,1]]; elif object_type = 5 then total_orientation:=1; surface_orientation:=1; g:=0; exceptional_fibres:=[[2,1],[2,1],[alpha_3,beta_3]]; elif object_type = 6 then total_orientation:=1; surface_orientation:=1; g:=0; b:=-1; exceptional_fibres:=[[2,1],[3,1],[3,1]]; elif object_type = 7 then total_orientation:=1; surface_orientation:=1; g:=0; exceptional_fibres:=[[2,1],[3,beta_2],[3,beta_3]]; elif object_type = 8 then total_orientation:=1; surface_orientation:=1; g:=0; b:=-1; exceptional_fibres:=[[2,1],[3,1],[4,1]]; elif object_type = 9 then total_orientation:=1; surface_orientation:=1; g:=0; exceptional_fibres:=[[2,1],[3,beta_2],[4,beta_3]]; elif object_type = 10 then total_orientation:=1; surface_orientation:=1; g:=0; b:=-1; exceptional_fibres:=[[2,1],[3,1],[5,1]]; elif object_type = 11 then total_orientation:=1; surface_orientation:=1; g:=0; exceptional_fibres:=[[2,1],[3,beta_2],[5,beta_3]]; ### Orientable flat spaces: ### elif object_type = 12 then total_orientation:=1; surface_orientation:=1; g:=1; b:=0; exceptional_fibres:=[]; elif object_type = 13 then total_orientation:=1; surface_orientation:=1; g:=0; b:=-2; exceptional_fibres:=[[2,1],[2,1],[2,1],[2,1]]; elif object_type = 14 then total_orientation:=1; surface_orientation:=1; g:=0; b:=-1; exceptional_fibres:=[[3,1],[3,1],[3,1]]; elif object_type = 15 then total_orientation:=1; surface_orientation:=1; g:=0; b:=-1; exceptional_fibres:=[[2,1],[4,1],[4,1]]; elif object_type = 16 then total_orientation:=1; surface_orientation:=1; g:=0; b:=-1; exceptional_fibres:=[[2,1],[3,1],[6,1]]; elif object_type = 17 then total_orientation:=1; surface_orientation:=0; g:=1; b:=-1; exceptional_fibres:=[[2,1],[2,1]]; ### Non-orientable flat spaces: ### elif object_type = 18 then total_orientation:=0; surface_orientation:=0; Nn_type:=1; g:=2; b:=0; exceptional_fibres:=[]; elif object_type = 19 then total_orientation:=0; surface_orientation:=0; Nn_type:=1; g:=2; b:=1; exceptional_fibres:=[]; elif object_type = 20 then total_orientation:=0; surface_orientation:=0; Nn_type:=2; g:=2; b:=0; exceptional_fibres:=[]; elif object_type = 21 then total_orientation:=0; surface_orientation:=0; Nn_type:=2; g:=2; b:=1; exceptional_fibres:=[]; ### S^2xR-spaces: ### elif object_type = 22 then total_orientation:=1; surface_orientation:=1; g:=0; b:=0; exceptional_fibres:=[]; elif object_type = 23 then total_orientation:=1; surface_orientation:=0; g:=1; b:=0; exceptional_fibres:=[]; elif object_type = 24 then total_orientation:=0; surface_orientation:=0; Nn_type:=1; g:=1; b:=1; exceptional_fibres:=[]; elif object_type = 25 then total_orientation:=0; surface_orientation:=0; Nn_type:=1; g:=1; b:=0; exceptional_fibres:=[]; ### Seifert homology spheres: ### elif object_type = 26 then total_orientation:=1; surface_orientation:=1; g:=0; b:=0; exceptional_fibres:=[]; Compute_Solution(); ### T^2-bundles over S^1 of Nil geometry (for b>0): ### elif object_type = 27 then total_orientation:=1; surface_orientation:=1; g:=1; exceptional_fibres:=[]; elif object_type = 28 then total_orientation:=1; surface_orientation:=0; g:=2; exceptional_fibres:=[]; fi; ######################### ### consistency check ### ######################### if not object_type in [1..28] then Print("Error: The variable 'object_type' should be in the range 1,...,28!\n"); flag_stop:=1; fi; if flag_stop = 0 then if not total_orientation in [0,1] then Print("Error: The variable 'total_orientation' should be 0 or 1!\n"); flag_stop:=1; fi; if not surface_orientation in [0,1] then Print("Error: The variable 'surface_orientation' should be 0 or 1!\n"); flag_stop:=1; fi; fi; if flag_stop = 0 then if IsInt(g) = false then Print("Error: The genus 'g' should to be an integer!\n"); flag_stop:=1; elif surface_orientation = 1 and g < 0 then Print("Error: The genus 'g' of an orientable surface has to be >= 0!\n"); flag_stop:=1; elif surface_orientation = 1 and g = 0 and total_orientation = 0 then Print("Error: Spaces with orbit surface S^2 are orientable!\n"); flag_stop:=1; elif surface_orientation = 0 and g <= 0 then Print("Error: The genus 'g' of a non-orientable surface has to be at least 1!\n"); flag_stop:=1; fi; fi; if flag_stop = 0 then if total_orientation = 0 and surface_orientation = 0 then if g = 1 and not Nn_type = 1 then Print("Error: The variable 'Nn_type' should be 1 for a non-orientable total space\n", " with non-orientable orbit surface of genus 1!\n"); flag_stop:=1; elif g = 2 and not Nn_type in [1,2] then Print("Error: The variable 'Nn_type' should be 1 or 2 for a non-orientable total space\n", " with non-orientable orbit surface of genus 2!\n"); flag_stop:=1; elif not Nn_type in [1,2,3] then Print("Error: The variable 'Nn_type' should be 1,2, or 3 for a non-orientable total space\n", " with non-orientable orbit surface of genus > 2!\n"); flag_stop:=1; fi; else Nn_type:=0; fi; fi; if flag_stop = 0 then if IsInt(b) = false then Print("Error: The variable 'b' should be an integer!\n"); flag_stop:=1; fi; fi; if object_type = 3 and p = 0 and q = 0 then Print("Error: The parameters p = 0 and q = 0 are not admissible for L(p,q)!\n"); flag_stop:=1; fi; if flag_stop = 0 then if IsList(exceptional_fibres) = false then Print("Error: The list 'exceptional_fibres' can be empty\n", " ( exceptional_fibres:=[]; ) or should contain\n", " the invariants for the exceptional fibres\n", " in the format:\n", " exceptional_fibres:=[[2,1],[2,1],[5,2]]; !\n"); flag_stop:=1; elif not exceptional_fibres = [] then for element in exceptional_fibres do if flag_stop = 0 and IsList(element) = false then Print("Error: The list 'exceptional_fibres' can be empty\n", " ( exceptional_fibres:=[]; ) or should contain\n", " the invariants for the exceptional fibres\n", " in the format:\n", " exceptional_fibres:=[[2,1],[2,1],[5,2]]; !\n"); flag_stop:=1; fi; od; for element in exceptional_fibres do if flag_stop = 0 and not Length(element) = 2 then Print("Error: The exceptional fibres should be described by integers\n", " alpha_i and beta_i in the format:\n", " exceptional_fibres:=[[alpha_1,beta_1],[alpha_2,beta_2],[alpha_3,beta_3]]; !\n"); flag_stop:=1; fi; if flag_stop = 0 and ((IsInt(element[1]) = false) or (IsInt(element[2]) = false)) then Print("Error: The exceptional fibres should be described by integers\n", " alpha_i and beta_i in the format:\n", " exceptional_fibres:=[[alpha_1,beta_1],[alpha_2,beta_2],[alpha_3,beta_3]]; !\n"); flag_stop:=1; fi; if flag_stop = 0 and (element[1] < 0 or element[2] < 0) then Print("Error: Exceptional fibres [alpha_i,beta_i] with negative\n", " alpha_i or beta_i are not admissible!\n"); flag_stop:=1; fi; if flag_stop = 0 and element[1] = 0 and element[2] = 0 then Print("Error: Exceptional fibres [0,0] are not admissible!\n"); flag_stop:=1; fi; od; fi; fi; if flag_stop = 0 then ###################### ### select surface ### ###################### surface:=[]; if total_orientation = 1 then if surface_orientation = 1 then if g = 0 then surface:=ShallowCopy(sphere); elif g in available_orientable_surfaces then surface:=ShallowCopy(orientable_surfaces[g]); else ### connected sum ### current_facets:=ShallowCopy(orientable_surfaces[1]); vertices_A:=[]; for element in orientable_surfaces[1] do UniteSet(vertices_A,element); od; for k in [1..(g-1)] do vertices_current:=[]; for element in current_facets do UniteSet(vertices_current,element); od; copy_current_facets:=[]; for element in current_facets do new_element:=[]; for l in element do AddSet(new_element,Position(vertices_current,l)); od; AddSet(copy_current_facets,new_element); od; copy_facets:=[]; for element in orientable_surfaces[1] do new_element:=[]; for l in element do AddSet(new_element,Position(vertices_A,l)+Length(vertices_current)); od; AddSet(copy_facets,new_element); od; intersection_facet:=ShallowCopy(copy_current_facets[1]); for element in copy_facets do new_element:=[]; for l in element do if l = copy_facets[1][1] then AddSet(new_element,copy_current_facets[1][1]); elif l = copy_facets[1][2] then AddSet(new_element,copy_current_facets[1][2]); elif l = copy_facets[1][3] then AddSet(new_element,copy_current_facets[1][3]); else AddSet(new_element,l); fi; od; AddSet(copy_current_facets,new_element); od; RemoveSet(copy_current_facets,intersection_facet); current_facets:=ShallowCopy(copy_current_facets); od; surface:=ShallowCopy(current_facets); fi; elif surface_orientation = 0 then if g = 1 then surface:=[[1,2,3],[1,2,6],[1,3,4],[1,4,12],[1,5,6],[1,5,12], [2,3,8],[2,6,7],[2,7,8], [3,4,10],[3,8,9],[3,9,10], [4,10,11],[4,11,12]]; elif g > 1 then surface:=[]; for k in [1..(2*g-2)] do AddSet(surface,[1,k+1,k+2]); od; for k in [1..g] do for i in [1..5] do AddSet(surface,[2*k-1,2*g+6*(k-1)+i,2*g+6*(k-1)+i+1]); od; od; for k in [1..(g-1)] do AddSet(surface,[2*k-1,2*k,2*g+6*k]); AddSet(surface,[2*k,2*g+6*k,2*g+6*k+1]); AddSet(surface,[2*k,2*k+1,2*g+6*k+1]); od; AddSet(surface,[2*g-1,2*g,8*g]); AddSet(surface,[2*g,2*g+1,8*g]); AddSet(surface,[1,2*g,2*g+1]); fi; fi; elif total_orientation = 0 then if surface_orientation = 0 then if Nn_type = 1 then if g in available_non_orientable_surfaces then surface:=ShallowCopy(non_orientable_surfaces[g]); else ### connected sum ### current_facets:=ShallowCopy(non_orientable_surfaces[1]); vertices_A:=[]; for element in non_orientable_surfaces[1] do UniteSet(vertices_A,element); od; for k in [1..(g-1)] do vertices_current:=[]; for element in current_facets do UniteSet(vertices_current,element); od; copy_current_facets:=[]; for element in current_facets do new_element:=[]; for l in element do AddSet(new_element,Position(vertices_current,l)); od; AddSet(copy_current_facets,new_element); od; copy_facets:=[]; for element in non_orientable_surfaces[1] do new_element:=[]; for l in element do AddSet(new_element,Position(vertices_A,l)+Length(vertices_current)); od; AddSet(copy_facets,new_element); od; intersection_facet:=ShallowCopy(copy_current_facets[1]); for element in copy_facets do new_element:=[]; for l in element do if l = copy_facets[1][1] then AddSet(new_element,copy_current_facets[1][1]); elif l = copy_facets[1][2] then AddSet(new_element,copy_current_facets[1][2]); elif l = copy_facets[1][3] then AddSet(new_element,copy_current_facets[1][3]); else AddSet(new_element,l); fi; od; AddSet(copy_current_facets,new_element); od; RemoveSet(copy_current_facets,intersection_facet); current_facets:=ShallowCopy(copy_current_facets); od; surface:=ShallowCopy(current_facets); fi; elif Nn_type in [2,3] then surface:=[]; for k in [1..(2*g-2)] do AddSet(surface,[1,k+1,k+2]); od; for k in [1..g] do for i in [1..5] do AddSet(surface,[2*k-1,2*g+6*(k-1)+i,2*g+6*(k-1)+i+1]); od; od; for k in [1..(g-1)] do AddSet(surface,[2*k-1,2*k,2*g+6*k]); AddSet(surface,[2*k,2*g+6*k,2*g+6*k+1]); AddSet(surface,[2*k,2*k+1,2*g+6*k+1]); od; AddSet(surface,[2*g-1,2*g,8*g]); AddSet(surface,[2*g,2*g+1,8*g]); AddSet(surface,[1,2*g,2*g+1]); fi; elif surface_orientation = 1 then if g = 1 then surface:=[[1,2,3],[1,2,8],[1,3,4],[1,4,5],[1,5,6],[1,6,7], [1,7,8],[2,3,9],[2,8,9], [3,4,12],[3,9,10],[3,10,11], [3,11,12],[4,5,12]]; elif g > 1 then surface:=[]; for k in [1..(2*g-2)] do AddSet(surface,[1,k+1,k+2]); od; for k in [1..g] do for i in [1..7] do AddSet(surface,[2*k-1,2*g+8*(k-1)+i,2*g+8*(k-1)+i+1]); od; od; for k in [1..(g-1)] do AddSet(surface,[2*k-1,2*k,2*g+8*k]); AddSet(surface,[2*k,2*g+8*k,2*g+8*k+1]); AddSet(surface,[2*k,2*k+1,2*g+8*k+1]); od; AddSet(surface,[2*g-1,2*g,10*g]); AddSet(surface,[2*g,2*g+1,10*g]); AddSet(surface,[1,2*g,2*g+1]); fi; fi; fi; ####################### ### relabel surface ### ####################### if (total_orientation = 1 and surface_orientation = 1) or (total_orientation = 0 and surface_orientation = 0 and Nn_type = 1) then vertices:=[]; for element in surface do UniteSet(vertices,element); od; n_start:=Length(vertices); new_surface:=[]; for element in surface do new_element:=[]; for k in element do AddSet(new_element,Position(vertices,k)); od; AddSet(new_surface,new_element); od; facets_A:=[]; if not new_surface[1] = [1,2,3] then for element in new_surface do new_element:=[]; for k in element do if k = new_surface[1][2] then AddSet(new_element,2); elif k = new_surface[1][3] then AddSet(new_element,3); elif k = 2 then AddSet(new_element,new_surface[1][2]); elif k = 3 then AddSet(new_element,new_surface[1][3]); else AddSet(new_element,k); fi; od; AddSet(facets_A,new_element); od; else facets_A:=ShallowCopy(new_surface); fi; elif (total_orientation = 1 and surface_orientation = 0) or (total_orientation = 0 and surface_orientation = 0 and Nn_type in [2,3]) then if g = 1 then n_start:=12; else n_start:=8*g; fi; facets_A:=ShallowCopy(surface); elif (total_orientation = 0 and surface_orientation = 1) then if g = 1 then n_start:=12; else n_start:=10*g; fi; facets_A:=ShallowCopy(surface); fi; facets_B:=[[1,2],[1,3],[2,3]]; ######################################################## ### holes for class space fibre + exceptional fibres ### ######################################################## if (total_orientation = 1 and surface_orientation = 1 and not b = 0) or (total_orientation = 0 and surface_orientation = 0 and Nn_type = 1 and not b = 0) then flag_b:=1; else flag_b:=0; fi; number_exceptional_fibres:=Length(exceptional_fibres); n:=n_start; for r in [1..(number_exceptional_fibres+flag_b)] do if number_exceptional_fibres+flag_b = 1 then RemoveSet(facets_A,[1,2,3]); else if r = 1 then RemoveSet(facets_A,[1,2,3]); UniteSet(facets_A,[[1,2,n+1],[2,n+1,n+3], [1,3,n+2],[3,n+2,n+3], [n+1,n+2,n+3],[2,3,n+3]]); elif r < number_exceptional_fibres+flag_b then RemoveSet(facets_A,[2,3,n+(r-1)*3]); UniteSet(facets_A,[[2,n+(r-1)*3,n+1+(r-1)*3],[2,n+1+(r-1)*3,n+3+(r-1)*3], [3,n+(r-1)*3,n+2+(r-1)*3],[3,n+2+(r-1)*3,n+3+(r-1)*3], [n+1+(r-1)*3,n+2+(r-1)*3,n+3+(r-1)*3],[2,3,n+3+(r-1)*3]]); else RemoveSet(facets_A,[2,3,n+(r-1)*3]); UniteSet(facets_A,[[2,n+(r-1)*3,n+1+(r-1)*3],[2,3,n+1+(r-1)*3], [3,n+(r-1)*3,n+2+(r-1)*3],[3,n+1+(r-1)*3,n+2+(r-1)*3]]); fi; fi; od; ##################### ### cross product ### ##################### vertex_set_A:=[]; for element in facets_A do UniteSet(vertex_set_A,element); od; A:=Length(vertex_set_A); vertex_set_B:=[]; for element in facets_B do UniteSet(vertex_set_B,element); od; B:=Length(vertex_set_B); copy_facets_A:=ShallowCopy(facets_A); copy_facets_B:=ShallowCopy(facets_B); facets_A:=[]; facets_B:=[]; for copy_facet_A in copy_facets_A do facet_A:=[]; for k in copy_facet_A do AddSet(facet_A,Position(vertex_set_A,k)); od; AddSet(facets_A,facet_A); od; for copy_facet_B in copy_facets_B do facet_B:=[]; for k in copy_facet_B do AddSet(facet_B,Position(vertex_set_B,k)+A); od; AddSet(facets_B,facet_B); od; vertex_set_A:=[]; for element in facets_A do UniteSet(vertex_set_A,element); od; vertex_set_B:=[]; for element in facets_B do UniteSet(vertex_set_B,element); od; vertexpairs:=[]; for vertex_a in vertex_set_A do for vertex_b in vertex_set_B do Add(vertexpairs,[vertex_a,vertex_b]); od; od; facetpairs:=[]; for facet_a in facets_A do for facet_b in facets_B do Add(facetpairs,[facet_a,facet_b]); od; od; n:=Length(facets_A[1]); m:=Length(facets_B[1]); paths:=[]; paths[1]:=[[[1,1]]]; for i in [2..(n+m-1)] do paths[i]:=[]; for elm in paths[i-1] do if elm[i-1][2] < m then copy_elm:=[]; for tuple in elm do Add(copy_elm,tuple); od; new_tuple:=[elm[i-1][1],elm[i-1][2]+1]; Add(copy_elm,new_tuple); Add(paths[i],copy_elm); fi; if elm[i-1][1] < n then copy_elm:=[]; for tuple in elm do Add(copy_elm,tuple); od; new_tuple:=[elm[i-1][1]+1,elm[i-1][2]]; Add(copy_elm,new_tuple); Add(paths[i],copy_elm); fi; od; od; facets:=[]; for element in facetpairs do for path in paths[n+m-1] do new_facet:=[]; for k in [1..(n+m-1)] do AddSet(new_facet,Position(vertexpairs,[element[1][path[k][1]],element[2][path[k][2]]])); od; AddSet(facets,new_facet); od; od; ########################################################## ### identify boundary and transition to 9-vertex torus ### ########################################################## if number_exceptional_fibres+flag_b in [0,1] then m_additional:=0; else m_additional:=9*(number_exceptional_fibres+flag_b-1)+6; fi; m:=3*n_start+m_additional; if (total_orientation = 1 and surface_orientation = 0) or (total_orientation = 0 and surface_orientation = 0 and Nn_type in [2..3]) then if Nn_type = 3 then NnIII_flag:=1; else NnIII_flag:=0; fi; if g > 1 then ### identify boundary ### for k in [1..(g-1-NnIII_flag)] do new_facets:=[]; for facet in facets do new_facet:=[]; for j in facet do if j = 3*2*g+3*6*k+1 then AddSet(new_facet,3*2*g+9+3*6*(k-1)+1); elif j = 3*2*g+3*6*k+4 then AddSet(new_facet,3*2*g+9+3*6*(k-1)+4); elif j = 3*2*g+3*6*k+7 then AddSet(new_facet,3*2*g+9+3*6*(k-1)+7); elif j = 3*2*g+3*6*k+2 then AddSet(new_facet,3*2*g+9+3*6*(k-1)+3); elif j = 3*2*g+3*6*k+5 then AddSet(new_facet,3*2*g+9+3*6*(k-1)+6); elif j = 3*2*g+3*6*k+8 then AddSet(new_facet,3*2*g+9+3*6*(k-1)+9); elif j = 3*2*g+3*6*k+3 then AddSet(new_facet,3*2*g+9+3*6*(k-1)+2); elif j = 3*2*g+3*6*k+6 then AddSet(new_facet,3*2*g+9+3*6*(k-1)+5); elif j = 3*2*g+3*6*k+9 then AddSet(new_facet,3*2*g+9+3*6*(k-1)+8); else AddSet(new_facet,j); fi; od; AddSet(new_facets,new_facet); od; facets:=ShallowCopy(new_facets); AddSet(facets,[3*2*g+9+3*6*(k-1)+2,3*2*g+9+3*6*(k-1)+3,3*2*g+9+3*6*(k-1)+5,3*2*g+9+3*6*(k-1)+6]); AddSet(facets,[3*2*g+9+3*6*(k-1)+5,3*2*g+9+3*6*(k-1)+6,3*2*g+9+3*6*(k-1)+8,3*2*g+9+3*6*(k-1)+9]); od; if Nn_type = 3 then new_facets:=[]; for facet in facets do new_facet:=[]; for j in facet do if j = 3*2*g+3*6*(g-1)+1 then AddSet(new_facet,3*2*g+9+3*6*(g-1-1)+1); elif j = 3*2*g+3*6*(g-1)+4 then AddSet(new_facet,3*2*g+9+3*6*(g-1-1)+4); elif j = 3*2*g+3*6*(g-1)+7 then AddSet(new_facet,3*2*g+9+3*6*(g-1-1)+7); elif j = 3*2*g+3*6*(g-1)+2 then AddSet(new_facet,3*2*g+9+3*6*(g-1-1)+2); elif j = 3*2*g+3*6*(g-1)+5 then AddSet(new_facet,3*2*g+9+3*6*(g-1-1)+5); elif j = 3*2*g+3*6*(g-1)+8 then AddSet(new_facet,3*2*g+9+3*6*(g-1-1)+8); elif j = 3*2*g+3*6*(g-1)+3 then AddSet(new_facet,3*2*g+9+3*6*(g-1-1)+3); elif j = 3*2*g+3*6*(g-1)+6 then AddSet(new_facet,3*2*g+9+3*6*(g-1-1)+6); elif j = 3*2*g+3*6*(g-1)+9 then AddSet(new_facet,3*2*g+9+3*6*(g-1-1)+9); else AddSet(new_facet,j); fi; od; AddSet(new_facets,new_facet); od; facets:=ShallowCopy(new_facets); fi; if total_orientation = 1 then new_facets:=[]; for facet in facets do new_facet:=[]; for j in facet do if j = 3*2*g+1 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+1); elif j = 3*2*g+4 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+4); elif j = 3*2*g+7 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+7); elif j = 3*2*g+2 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+3); elif j = 3*2*g+5 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+6); elif j = 3*2*g+8 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+9); elif j = 3*2*g+3 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+2); elif j = 3*2*g+6 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+5); elif j = 3*2*g+9 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+8); else AddSet(new_facet,j); fi; od; AddSet(new_facets,new_facet); od; facets:=ShallowCopy(new_facets); AddSet(facets,[3*2*g+9+3*6*(g-1)+2,3*2*g+9+3*6*(g-1)+3,3*2*g+9+3*6*(g-1)+5,3*2*g+9+3*6*(g-1)+6]); AddSet(facets,[3*2*g+9+3*6*(g-1)+5,3*2*g+9+3*6*(g-1)+6,3*2*g+9+3*6*(g-1)+8,3*2*g+9+3*6*(g-1)+9]); elif Nn_type in [2..3] then new_facets:=[]; for facet in facets do new_facet:=[]; for j in facet do if j = 3*2*g+1 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+1); elif j = 3*2*g+4 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+4); elif j = 3*2*g+7 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+7); elif j = 3*2*g+2 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+2); elif j = 3*2*g+5 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+5); elif j = 3*2*g+8 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+8); elif j = 3*2*g+3 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+3); elif j = 3*2*g+6 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+6); elif j = 3*2*g+9 then AddSet(new_facet,3*2*g+9+3*6*(g-1)+9); else AddSet(new_facet,j); fi; od; AddSet(new_facets,new_facet); od; facets:=ShallowCopy(new_facets); fi; ### transition to 9-vertex torus ### for k in [1..(g-1-NnIII_flag)] do # first row # AddSet(facets,[3*2*g+9+3*6*(k-1)+1,3*2*g+9+3*6*(k-1)+3,3*2*g+9+3*6*(k-1)+7,m+1]); AddSet(facets,[3*2*g+9+3*6*(k-1)+3,3*2*g+9+3*6*(k-1)+7,3*2*g+9+3*6*(k-1)+8,m+1]); AddSet(facets,[3*2*g+9+3*6*(k-1)+7,3*2*g+9+3*6*(k-1)+8,3*2*g+9+3*6*k+3,m+1]); AddSet(facets,[3*2*g+9+3*6*(k-1)+7,3*2*g+9+3*6*k+1,3*2*g+9+3*6*k+3,m+1]); AddSet(facets,[3*2*g+9+3*6*(k-1)+3,3*2*g+9+3*6*(k-1)+8,m+1,m+2]); AddSet(facets,[3*2*g+9+3*6*(k-1)+8,3*2*g+9+3*6*k+3,m+1,m+2]); # second row # AddSet(facets,[3*2*g+9+3*6*(k-1)+2,3*2*g+9+3*6*(k-1)+3,3*2*g+9+3*6*(k-1)+8,m+2]); AddSet(facets,[3*2*g+9+3*6*(k-1)+2,3*2*g+9+3*6*(k-1)+8,3*2*g+9+3*6*(k-1)+9,m+2]); AddSet(facets,[3*2*g+9+3*6*(k-1)+8,3*2*g+9+3*6*(k-1)+9,3*2*g+9+3*6*k+3,m+2]); AddSet(facets,[3*2*g+9+3*6*(k-1)+9,3*2*g+9+3*6*k+2,3*2*g+9+3*6*k+3,m+2]); AddSet(facets,[3*2*g+9+3*6*(k-1)+2,3*2*g+9+3*6*(k-1)+9,m+2,m+3]); AddSet(facets,[3*2*g+9+3*6*(k-1)+9,3*2*g+9+3*6*k+2,m+2,m+3]); # third row # AddSet(facets,[3*2*g+9+3*6*(k-1)+1,3*2*g+9+3*6*(k-1)+2,3*2*g+9+3*6*(k-1)+7,m+3]); AddSet(facets,[3*2*g+9+3*6*(k-1)+2,3*2*g+9+3*6*(k-1)+7,3*2*g+9+3*6*(k-1)+9,m+3]); AddSet(facets,[3*2*g+9+3*6*(k-1)+7,3*2*g+9+3*6*(k-1)+9,3*2*g+9+3*6*k+2,m+3]); AddSet(facets,[3*2*g+9+3*6*(k-1)+7,3*2*g+9+3*6*k+1,3*2*g+9+3*6*k+2,m+3]); AddSet(facets,[3*2*g+9+3*6*(k-1)+1,3*2*g+9+3*6*(k-1)+7,m+1,m+3]); AddSet(facets,[3*2*g+9+3*6*(k-1)+7,3*2*g+9+3*6*k+1,m+1,m+3]); od; if Nn_type = 3 then # first row # AddSet(facets,[3*2*g+9+3*6*(g-1-1)+1,3*2*g+9+3*6*(g-1-1)+3,3*2*g+9+3*6*(g-1-1)+7,m+1]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+3,3*2*g+9+3*6*(g-1-1)+7,3*2*g+9+3*6*(g-1-1)+9,m+1]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+7,3*2*g+9+3*6*(g-1-1)+9,3*2*g+9+3*6*(g-1)+3,m+1]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+7,3*2*g+9+3*6*(g-1)+1,3*2*g+9+3*6*(g-1)+3,m+1]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+3,3*2*g+9+3*6*(g-1-1)+9,m+1,m+2]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+9,3*2*g+9+3*6*(g-1)+3,m+1,m+2]); # second row # AddSet(facets,[3*2*g+9+3*6*(g-1-1)+2,3*2*g+9+3*6*(g-1-1)+3,3*2*g+9+3*6*(g-1-1)+8,m+2]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+3,3*2*g+9+3*6*(g-1-1)+8,3*2*g+9+3*6*(g-1-1)+9,m+2]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+8,3*2*g+9+3*6*(g-1-1)+9,3*2*g+9+3*6*(g-1)+3,m+2]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+8,3*2*g+9+3*6*(g-1)+2,3*2*g+9+3*6*(g-1)+3,m+2]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+2,3*2*g+9+3*6*(g-1-1)+8,m+2,m+3]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+8,3*2*g+9+3*6*(g-1)+2,m+2,m+3]); # third row # AddSet(facets,[3*2*g+9+3*6*(g-1-1)+1,3*2*g+9+3*6*(g-1-1)+2,3*2*g+9+3*6*(g-1-1)+7,m+3]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+2,3*2*g+9+3*6*(g-1-1)+7,3*2*g+9+3*6*(g-1-1)+8,m+3]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+7,3*2*g+9+3*6*(g-1-1)+8,3*2*g+9+3*6*(g-1)+2,m+3]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+7,3*2*g+9+3*6*(g-1)+1,3*2*g+9+3*6*(g-1)+2,m+3]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+1,3*2*g+9+3*6*(g-1-1)+7,m+1,m+3]); AddSet(facets,[3*2*g+9+3*6*(g-1-1)+7,3*2*g+9+3*6*(g-1)+1,m+1,m+3]); fi; if total_orientation = 1 then # first row # AddSet(facets,[3*2*g+9+1,3*2*g+9+3,3*2*g+9+3*6*(g-1)+6+1,m+1]); AddSet(facets,[3*2*g+9+3,3*2*g+9+3*6*(g-1)+6+1,3*2*g+9+3*6*(g-1)+6+2,m+1]); AddSet(facets,[3*2*g+9+3,3*2*g+9+3*6*(g-1)+6+2,m+1,m+2]); # second row # AddSet(facets,[3*2*g+9+2,3*2*g+9+3,3*2*g+9+3*6*(g-1)+6+3,m+2]); AddSet(facets,[3*2*g+9+3,3*2*g+9+3*6*(g-1)+6+2,3*2*g+9+3*6*(g-1)+6+3,m+2]); AddSet(facets,[3*2*g+9+2,3*2*g+9+3*6*(g-1)+6+3,m+2,m+3]); # third row # AddSet(facets,[3*2*g+9+1,3*2*g+9+2,3*2*g+9+3*6*(g-1)+6+1,m+3]); AddSet(facets,[3*2*g+9+2,3*2*g+9+3*6*(g-1)+6+1,3*2*g+9+3*6*(g-1)+6+3,m+3]); AddSet(facets,[3*2*g+9+1,3*2*g+9+3*6*(g-1)+6+1,m+1,m+3]); # flip diagonals # AddSet(facets,[3*2*g+9+3*6*(g-1)+6+1,3*2*g+9+3*6*(g-1)+6+3,m+1,m+3]); AddSet(facets,[3*2*g+3+3*6*(g-1)+6+1,3*2*g+3+3*6*(g-1)+6+2,m+1,m+3]); m:=m+3; elif Nn_type in [2,3] then # first row # AddSet(facets,[3*2*g+9+1,3*2*g+9+3,3*2*g+9+3*6*(g-1)+6+1,m+1]); AddSet(facets,[3*2*g+9+3,3*2*g+9+3*6*(g-1)+6+1,3*2*g+9+3*6*(g-1)+6+3,m+1]); AddSet(facets,[3*2*g+9+3,3*2*g+9+3*6*(g-1)+6+3,m+1,m+2]); # second row # AddSet(facets,[3*2*g+9+2,3*2*g+9+3,3*2*g+9+3*6*(g-1)+6+2,m+2]); AddSet(facets,[3*2*g+9+3,3*2*g+9+3*6*(g-1)+6+2,3*2*g+9+3*6*(g-1)+6+3,m+2]); AddSet(facets,[3*2*g+9+2,3*2*g+9+3*6*(g-1)+6+2,m+2,m+3]); # third row # AddSet(facets,[3*2*g+9+1,3*2*g+9+2,3*2*g+9+3*6*(g-1)+6+1,m+3]); AddSet(facets,[3*2*g+9+2,3*2*g+9+3*6*(g-1)+6+1,3*2*g+9+3*6*(g-1)+6+2,m+3]); AddSet(facets,[3*2*g+9+1,3*2*g+9+3*6*(g-1)+6+1,m+1,m+3]); # flip diagonals # AddSet(facets,[3*2*g+9+3*6*(g-1)+6+1,3*2*g+9+3*6*(g-1)+6+2,m+1,m+3]); AddSet(facets,[3*2*g+3+3*6*(g-1)+6+1,3*2*g+3+3*6*(g-1)+6+2,m+1,m+3]); AddSet(facets,[3*2*g+3+3*6*(g-1)+6+2,3*2*g+3+3*6*(g-1)+6+3,3*2*g+3+3*6*(g-1)+6+8,3*2*g+3+3*6*(g-1)+6+9]); m:=m+3; fi; elif g = 1 then ### identify boundary ### new_facets:=[]; for facet in facets do new_facet:=[]; for j in facet do if j = 25 then AddSet(new_facet,13); elif j = 28 then AddSet(new_facet,16); elif j = 31 then AddSet(new_facet,19); elif j = 26 then AddSet(new_facet,15); elif j = 29 then AddSet(new_facet,18); elif j = 32 then AddSet(new_facet,21); elif j = 27 then AddSet(new_facet,14); elif j = 30 then AddSet(new_facet,17); elif j = 33 then AddSet(new_facet,20); else AddSet(new_facet,j); fi; od; AddSet(new_facets,new_facet); od; facets:=ShallowCopy(new_facets); AddSet(facets,[14,15,17,18]); AddSet(facets,[17,18,20,21]); ### transition to 9-vertex torus ### m1:=m+1; m2:=m+2; m3:=m+3; # first row # AddSet(facets,[14,22,24,m1]); AddSet(facets,[13,14,22,m1]); AddSet(facets,[13,14,35,m1]); AddSet(facets,[13,34,35,m1]); AddSet(facets,[19,22,24,m1]); AddSet(facets,[19,21,24,m1]); AddSet(facets,[21,24,m1,m2]); AddSet(facets,[14,24,m1,m2]); AddSet(facets,[14,35,m1,m2]); # second row # AddSet(facets,[14,23,24,m2]); AddSet(facets,[14,15,23,m2]); AddSet(facets,[14,15,36,m2]); AddSet(facets,[14,35,36,m2]); AddSet(facets,[20,23,24,m2]); AddSet(facets,[20,21,24,m2]); AddSet(facets,[20,23,m2,m3]); AddSet(facets,[15,23,m2,m3]); AddSet(facets,[15,36,m2,m3]); # third row # AddSet(facets,[15,22,23,m3]); AddSet(facets,[13,15,22,m3]); AddSet(facets,[13,15,36,m3]); AddSet(facets,[13,34,36,m3]); AddSet(facets,[19,22,23,m3]); AddSet(facets,[19,20,23,m3]); AddSet(facets,[19,22,m1,m3]); AddSet(facets,[13,22,m1,m3]); AddSet(facets,[13,34,m1,m3]); # flip diagonals # AddSet(facets,[34,36,m1,m3]); AddSet(facets,[20,21,m2,m3]); AddSet(facets,[19,21,m1,m2]); m:=m+3; fi; elif (total_orientation = 0 and surface_orientation = 1) then if g > 1 then ### identify boundary ### for k in [1..(g-1)] do new_facets:=[]; for facet in facets do new_facet:=[]; for j in facet do if j = 3*2*g+3*8*k+1 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+4); elif j = 3*2*g+3*8*k+4 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+1); elif j = 3*2*g+3*8*k+7 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+10); elif j = 3*2*g+3*8*k+10 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+7); elif j = 3*2*g+3*8*k+2 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+6); elif j = 3*2*g+3*8*k+5 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+3); elif j = 3*2*g+3*8*k+8 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+12); elif j = 3*2*g+3*8*k+11 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+9); elif j = 3*2*g+3*8*k+3 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+5); elif j = 3*2*g+3*8*k+6 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+2); elif j = 3*2*g+3*8*k+9 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+11); elif j = 3*2*g+3*8*k+12 then AddSet(new_facet,3*2*g+12+3*8*(k-1)+8); else AddSet(new_facet,j); fi; od; AddSet(new_facets,new_facet); od; facets:=ShallowCopy(new_facets); AddSet(facets,[3*2*g+12+3*8*(k-1)+1,3*2*g+12+3*8*(k-1)+2,3*2*g+12+3*8*(k-1)+4,3*2*g+12+3*8*(k-1)+5]); AddSet(facets,[3*2*g+12+3*8*(k-1)+1,3*2*g+12+3*8*(k-1)+3,3*2*g+12+3*8*(k-1)+4,3*2*g+12+3*8*(k-1)+6]); AddSet(facets,[3*2*g+12+3*8*(k-1)+7,3*2*g+12+3*8*(k-1)+8,3*2*g+12+3*8*(k-1)+10,3*2*g+12+3*8*(k-1)+11]); AddSet(facets,[3*2*g+12+3*8*(k-1)+7,3*2*g+12+3*8*(k-1)+9,3*2*g+12+3*8*(k-1)+10,3*2*g+12+3*8*(k-1)+12]); od; new_facets:=[]; for facet in facets do new_facet:=[]; for j in facet do if j = 3*2*g+1 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+4); elif j = 3*2*g+4 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+1); elif j = 3*2*g+7 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+10); elif j = 3*2*g+10 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+7); elif j = 3*2*g+2 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+6); elif j = 3*2*g+5 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+3); elif j = 3*2*g+8 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+12); elif j = 3*2*g+11 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+9); elif j = 3*2*g+3 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+5); elif j = 3*2*g+6 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+2); elif j = 3*2*g+9 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+11); elif j = 3*2*g+12 then AddSet(new_facet,3*2*g+12+3*8*(g-1)+8); else AddSet(new_facet,j); fi; od; AddSet(new_facets,new_facet); od; facets:=ShallowCopy(new_facets); AddSet(facets,[3*2*g+12+3*8*(g-1)+1,3*2*g+12+3*8*(g-1)+2,3*2*g+12+3*8*(g-1)+4,3*2*g+12+3*8*(g-1)+5]); AddSet(facets,[3*2*g+12+3*8*(g-1)+1,3*2*g+12+3*8*(g-1)+3,3*2*g+12+3*8*(g-1)+4,3*2*g+12+3*8*(g-1)+6]); AddSet(facets,[3*2*g+12+3*8*(g-1)+7,3*2*g+12+3*8*(g-1)+8,3*2*g+12+3*8*(g-1)+10,3*2*g+12+3*8*(g-1)+11]); AddSet(facets,[3*2*g+12+3*8*(g-1)+7,3*2*g+12+3*8*(g-1)+9,3*2*g+12+3*8*(g-1)+10,3*2*g+12+3*8*(g-1)+12]); ### transition to 9-vertex torus ### for k in [1..(g-1)] do # first row # AddSet(facets,[3*2*g+12+3*8*(k-1)+1,3*2*g+12+3*8*(k-1)+3,3*2*g+12+3*8*(k-1)+12,m+1]); AddSet(facets,[3*2*g+12+3*8*(k-1)+1,3*2*g+12+3*8*(k-1)+10,3*2*g+12+3*8*(k-1)+12,m+1]); AddSet(facets,[3*2*g+12+3*8*(k-1)+4,3*2*g+12+3*8*(k-1)+5,3*2*g+12+3*8*(k-1)+10,m+1]); AddSet(facets,[3*2*g+12+3*8*(k-1)+5,3*2*g+12+3*8*(k-1)+10,3*2*g+12+3*8*(k-1)+12,m+1]); AddSet(facets,[3*2*g+12+3*8*(k-1)+4,3*2*g+12+3*8*(k-1)+5,3*2*g+12+3*8*(k-1)+8,m+1]); AddSet(facets,[3*2*g+12+3*8*(k-1)+4,3*2*g+12+3*8*(k-1)+7,3*2*g+12+3*8*(k-1)+8,m+1]); AddSet(facets,[3*2*g+12+3*8*(k-1)+7,3*2*g+12+3*8*(k-1)+8,3*2*g+12+3*8*k+3,m+1]); AddSet(facets,[3*2*g+12+3*8*(k-1)+7,3*2*g+12+3*8*k+1,3*2*g+12+3*8*k+3,m+1]); AddSet(facets,[3*2*g+12+3*8*(k-1)+3,3*2*g+12+3*8*(k-1)+12,m+1,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+5,3*2*g+12+3*8*(k-1)+12,m+1,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+5,3*2*g+12+3*8*(k-1)+8,m+1,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+8,3*2*g+12+3*8*k+3,m+1,m+2]); # second row # AddSet(facets,[3*2*g+12+3*8*(k-1)+2,3*2*g+12+3*8*(k-1)+3,3*2*g+12+3*8*(k-1)+11,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+3,3*2*g+12+3*8*(k-1)+11,3*2*g+12+3*8*(k-1)+12,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+5,3*2*g+12+3*8*(k-1)+11,3*2*g+12+3*8*(k-1)+12,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+5,3*2*g+12+3*8*(k-1)+6,3*2*g+12+3*8*(k-1)+11,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+5,3*2*g+12+3*8*(k-1)+6,3*2*g+12+3*8*(k-1)+9,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+5,3*2*g+12+3*8*(k-1)+8,3*2*g+12+3*8*(k-1)+9,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+8,3*2*g+12+3*8*(k-1)+9,3*2*g+12+3*8*k+3,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+9,3*2*g+12+3*8*k+2,3*2*g+12+3*8*k+3,m+2]); AddSet(facets,[3*2*g+12+3*8*(k-1)+2,3*2*g+12+3*8*(k-1)+11,m+2,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+6,3*2*g+12+3*8*(k-1)+11,m+2,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+6,3*2*g+12+3*8*(k-1)+9,m+2,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+9,3*2*g+12+3*8*k+2,m+2,m+3]); # third row # AddSet(facets,[3*2*g+12+3*8*(k-1)+1,3*2*g+12+3*8*(k-1)+2,3*2*g+12+3*8*(k-1)+11,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+1,3*2*g+12+3*8*(k-1)+10,3*2*g+12+3*8*(k-1)+11,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+6,3*2*g+12+3*8*(k-1)+10,3*2*g+12+3*8*(k-1)+11,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+4,3*2*g+12+3*8*(k-1)+6,3*2*g+12+3*8*(k-1)+10,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+4,3*2*g+12+3*8*(k-1)+6,3*2*g+12+3*8*(k-1)+9,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+4,3*2*g+12+3*8*(k-1)+7,3*2*g+12+3*8*(k-1)+9,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+7,3*2*g+12+3*8*(k-1)+9,3*2*g+12+3*8*k+2,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+7,3*2*g+12+3*8*k+1,3*2*g+12+3*8*k+2,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+1,3*2*g+12+3*8*(k-1)+10,m+1,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+4,3*2*g+12+3*8*(k-1)+10,m+1,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+4,3*2*g+12+3*8*(k-1)+7,m+1,m+3]); AddSet(facets,[3*2*g+12+3*8*(k-1)+7,3*2*g+12+3*8*k+1,m+1,m+3]); od; # first row # AddSet(facets,[3*2*g+12+1,3*2*g+12+3,3*2*g+12+3*8*(g-1)+7,m+1]); AddSet(facets,[3*2*g+12+3,3*2*g+12+3*8*(g-1)+7,3*2*g+12+3*8*(g-1)+8,m+1]); AddSet(facets,[3*2*g+12+3*8*(g-1)+4,3*2*g+12+3*8*(g-1)+7,3*2*g+12+3*8*(g-1)+8,m+1]); AddSet(facets,[3*2*g+12+3*8*(g-1)+4,3*2*g+12+3*8*(g-1)+5,3*2*g+12+3*8*(g-1)+8,m+1]); AddSet(facets,[3*2*g+12+3*8*(g-1)+1,3*2*g+12+3*8*(g-1)+10,3*2*g+12+3*8*(g-1)+12,m+1]); AddSet(facets,[3*2*g+12+3*8*(g-1)+1,3*2*g+12+3*8*(g-1)+3,3*2*g+12+3*8*(g-1)+12,m+1]); AddSet(facets,[3*2*g+12+3,3*2*g+12+3*8*(g-1)+8,m+1,m+2]); AddSet(facets,[3*2*g+12+3*8*(g-1)+5,3*2*g+12+3*8*(g-1)+8,m+1,m+2]); AddSet(facets,[3*2*g+12+3*8*(g-1)+3,3*2*g+12+3*8*(g-1)+12,m+1,m+2]); # second row # AddSet(facets,[3*2*g+12+2,3*2*g+12+3,3*2*g+12+3*8*(g-1)+9,m+2]); AddSet(facets,[3*2*g+12+3,3*2*g+12+3*8*(g-1)+8,3*2*g+12+3*8*(g-1)+9,m+2]); AddSet(facets,[3*2*g+12+3*8*(g-1)+5,3*2*g+12+3*8*(g-1)+8,3*2*g+12+3*8*(g-1)+9,m+2]); AddSet(facets,[3*2*g+12+3*8*(g-1)+5,3*2*g+12+3*8*(g-1)+6,3*2*g+12+3*8*(g-1)+9,m+2]); AddSet(facets,[3*2*g+12+3*8*(g-1)+2,3*2*g+12+3*8*(g-1)+3,3*2*g+12+3*8*(g-1)+11,m+2]); AddSet(facets,[3*2*g+12+3*8*(g-1)+3,3*2*g+12+3*8*(g-1)+11,3*2*g+12+3*8*(g-1)+12,m+2]); AddSet(facets,[3*2*g+12+2,3*2*g+12+3*8*(g-1)+9,m+2,m+3]); AddSet(facets,[3*2*g+12+3*8*(g-1)+6,3*2*g+12+3*8*(g-1)+9,m+2,m+3]); AddSet(facets,[3*2*g+12+3*8*(g-1)+2,3*2*g+12+3*8*(g-1)+11,m+2,m+3]); # second row # AddSet(facets,[3*2*g+12+1,3*2*g+12+2,3*2*g+12+3*8*(g-1)+7,m+3]); AddSet(facets,[3*2*g+12+2,3*2*g+12+3*8*(g-1)+7,3*2*g+12+3*8*(g-1)+9,m+3]); AddSet(facets,[3*2*g+12+3*8*(g-1)+4,3*2*g+12+3*8*(g-1)+7,3*2*g+12+3*8*(g-1)+9,m+3]); AddSet(facets,[3*2*g+12+3*8*(g-1)+4,3*2*g+12+3*8*(g-1)+6,3*2*g+12+3*8*(g-1)+9,m+3]); AddSet(facets,[3*2*g+12+3*8*(g-1)+1,3*2*g+12+3*8*(g-1)+2,3*2*g+12+3*8*(g-1)+11,m+3]); AddSet(facets,[3*2*g+12+3*8*(g-1)+1,3*2*g+12+3*8*(g-1)+10,3*2*g+12+3*8*(g-1)+11,m+3]); AddSet(facets,[3*2*g+12+1,3*2*g+12+3*8*(g-1)+7,m+1,m+3]); AddSet(facets,[3*2*g+12+3*8*(g-1)+4,3*2*g+12+3*8*(g-1)+7,m+1,m+3]); AddSet(facets,[3*2*g+12+3*8*(g-1)+1,3*2*g+12+3*8*(g-1)+10,m+1,m+3]); # flip diagonals # AddSet(facets,[3*2*g+12+3*8*(g-1)+10,3*2*g+12+3*8*(g-1)+11,m+1,m+3]); AddSet(facets,[3*2*g+12+3*8*(g-1)+4,3*2*g+12+3*8*(g-1)+6,m+1,m+3]); AddSet(facets,[3*2*g+12+3*8*(g-1)+4,3*2*g+12+3*8*(g-1)+5,3*2*g+12+3*8*(g-1)+10,3*2*g+12+3*8*(g-1)+12]); AddSet(facets,[3*2*g+12+3*8*(g-1)+4,3*2*g+12+3*8*(g-1)+6,3*2*g+12+3*8*(g-1)+10,3*2*g+12+3*8*(g-1)+11]); m:=m+3; elif g = 1 then ### identify boundary ### new_facets:=[]; for facet in facets do new_facet:=[]; for j in facet do if j = 25 then AddSet(new_facet,16); elif j = 26 then AddSet(new_facet,18); elif j = 27 then AddSet(new_facet,17); elif j = 28 then AddSet(new_facet,13); elif j = 29 then AddSet(new_facet,15); elif j = 30 then AddSet(new_facet,14); elif j = 31 then AddSet(new_facet,22); elif j = 32 then AddSet(new_facet,24); elif j = 33 then AddSet(new_facet,23); elif j = 34 then AddSet(new_facet,19); elif j = 35 then AddSet(new_facet,21); elif j = 36 then AddSet(new_facet,20); else AddSet(new_facet,j); fi; od; AddSet(new_facets,new_facet); od; facets:=ShallowCopy(new_facets); AddSet(facets,[13,15,16,18]); AddSet(facets,[13,14,16,17]); AddSet(facets,[19,20,22,23]); AddSet(facets,[19,21,22,24]); ### transition to 9-vertex torus ### m1:=m+1; m2:=m+2; m3:=m+3; # first row # AddSet(facets,[16,18,21,m1]); AddSet(facets,[16,19,21,m1]); AddSet(facets,[13,19,21,m1]); AddSet(facets,[13,14,21,m1]); AddSet(facets,[13,14,23,m1]); AddSet(facets,[13,22,23,m1]); AddSet(facets,[18,21,m1,m2]); AddSet(facets,[14,21,m1,m2]); AddSet(facets,[14,23,m1,m2]); # second row # AddSet(facets,[17,18,21,m2]); AddSet(facets,[17,20,21,m2]); AddSet(facets,[14,20,21,m2]); AddSet(facets,[14,15,20,m2]); AddSet(facets,[14,15,23,m2]); AddSet(facets,[15,23,24,m2]); AddSet(facets,[17,20,m2,m3]); AddSet(facets,[15,20,m2,m3]); AddSet(facets,[15,24,m2,m3]); # third row # AddSet(facets,[16,17,20,m3]); AddSet(facets,[16,19,20,m3]); AddSet(facets,[13,19,20,m3]); AddSet(facets,[13,15,20,m3]); AddSet(facets,[13,15,24,m3]); AddSet(facets,[13,22,24,m3]); AddSet(facets,[16,19,m1,m3]); AddSet(facets,[13,19,m1,m3]); AddSet(facets,[13,22,m1,m3]); # flip diagonals # AddSet(facets,[22,24,m1,m3]); AddSet(facets,[16,17,m1,m3]); m:=m+3; fi; fi; ######################### ### close class fibre ### ######################### if (total_orientation = 1 and surface_orientation = 1 and not b = 0) or (total_orientation = 0 and surface_orientation = 0 and Nn_type = 1 and not b = 0) then if number_exceptional_fibres = 0 then a0:=1; b0:=1*3+1; c0:=2*3+1; else a0:=1; b0:=((n_start+1)-1)*3+1; c0:=((n_start+2)-1)*3+1; fi; a1:=a0; a2:=a0+1; a3:=a0+2; b1:=b0; b2:=b0+1; b3:=b0+2; c1:=c0; c2:=c0+1; c3:=c0+2; elif (total_orientation = 1 and surface_orientation = 0) then if g > 1 then a1:=3*n_start+m_additional+1; a2:=3*n_start+m_additional+2; a3:=3*n_start+m_additional+3; b1:=3*2*g+3+3*6*(g-1)+6+1; b2:=3*2*g+3+3*6*(g-1)+6+3; b3:=3*2*g+3+3*6*(g-1)+6+2; c1:=3*2*g+9+3*6*(g-1)+6+1; c2:=3*2*g+9+3*6*(g-1)+6+2; c3:=3*2*g+9+3*6*(g-1)+6+3; elif g = 1 then a1:=19; a2:=21; a3:=20; b1:=m1; b2:=m2; b3:=m3; c1:=34; c2:=35; c3:=36; fi; if b = 0 then Flip_Torus(a1,a2,a3,b1,b2,b3,c1,c2,c3); fi; elif (total_orientation = 0 and surface_orientation = 1) then if g > 1 then a1:=3*n_start+m_additional+1; a2:=3*n_start+m_additional+2; a3:=3*n_start+m_additional+3; b1:=3*2*g+12+3*8*(g-1)+10; b2:=3*2*g+12+3*8*(g-1)+12; b3:=3*2*g+12+3*8*(g-1)+11; c1:=3*2*g+12+3*8*(g-1)+4; c2:=3*2*g+12+3*8*(g-1)+5; c3:=3*2*g+12+3*8*(g-1)+6; elif g = 1 then a1:=m1; a2:=m2; a3:=m3; b1:=22; b2:=23; b3:=24; c1:=16; c2:=18; c3:=17; fi; if b = 0 then Flip_Torus(a1,a2,a3,b1,b2,b3,c1,c2,c3); fi; elif (total_orientation = 0 and surface_orientation = 0 and Nn_type in [2,3]) then a1:=3*n_start+m_additional+1; a2:=3*n_start+m_additional+2; a3:=3*n_start+m_additional+3; b1:=3*2*g+3+3*6*(g-1)+6+1; b2:=3*2*g+3+3*6*(g-1)+6+3; b3:=3*2*g+3+3*6*(g-1)+6+2; c1:=3*2*g+9+3*6*(g-1)+6+1; c2:=3*2*g+9+3*6*(g-1)+6+3; c3:=3*2*g+9+3*6*(g-1)+6+2; if b = 0 then Flip_Torus(a1,a2,a3,b1,b2,b3,c1,c2,c3); fi; fi; if b >= 0 then flag_inverse:=0; b_abs:=b; elif b < 0 then flag_inverse:=1; b_abs:=-b; fi; for k in [1..b_abs] do #Print("k = ",k,"\n"); if k = 1 then Flip_Torus(a1,a2,a3,b1,b2,b3,c1,c2,c3); fi; m1:=m+1; m2:=m+2; m3:=m+3; if flag_inverse = 0 then m4:=m+4; fi; torus:=[]; if flag_inverse = 0 then Compose_Torus(a1,a2,a3,b1,b2,b3,c1,c2,c3,m1,m2,m3,m4); elif flag_inverse = 1 then Compose_Torus_Inverse(a1,a2,a3,b1,b2,b3,c1,c2,c3,m1,m2,m3); fi; if flag_inverse = 0 then a3:=m1; b3:=m2; c3:=m3; else a2:=m1; b2:=m2; c2:=m3; fi; if flag_inverse = 0 then m:=m+4; elif flag_inverse = 1 then m:=m+3; fi; if k = 1 and flag_inverse = 1 then for facet in torus do if facet in facets then RemoveSet(facets,facet); else AddSet(facets,facet); fi; od; else UniteSet(facets,torus); fi; od; if b_abs > 0 or (total_orientation = 1 and surface_orientation = 0) or (total_orientation = 0 and surface_orientation = 1) or (total_orientation = 0 and surface_orientation = 0 and Nn_type in [2,3]) then ### close fibre ### d1:=m+1; d2:=m+2; d3:=m+3; torus:=[]; AddSet(torus,Set([a1,b1,b2,d1])); AddSet(torus,Set([a1,a2,b2,d1])); AddSet(torus,Set([a2,b2,b3,d1])); AddSet(torus,Set([a2,a3,b3,d1])); AddSet(torus,Set([a1,a3,b3,d1])); AddSet(torus,Set([a1,b1,b3,d1])); AddSet(torus,Set([a1,a2,a3,d1])); AddSet(torus,Set([b1,b2,b3,d1])); AddSet(torus,Set([b1,c1,c2,d2])); AddSet(torus,Set([b1,b2,c2,d2])); AddSet(torus,Set([b2,c2,c3,d2])); AddSet(torus,Set([b2,b3,c3,d2])); AddSet(torus,Set([b1,b3,c3,d2])); AddSet(torus,Set([b1,c1,c3,d2])); AddSet(torus,Set([b1,b2,b3,d2])); AddSet(torus,Set([c1,c2,c3,d2])); AddSet(torus,Set([a1,c1,c2,d3])); AddSet(torus,Set([a1,a2,c2,d3])); AddSet(torus,Set([a2,c2,c3,d3])); AddSet(torus,Set([a2,a3,c3,d3])); AddSet(torus,Set([a1,a3,c3,d3])); AddSet(torus,Set([a1,c1,c3,d3])); AddSet(torus,Set([a1,a2,a3,d3])); AddSet(torus,Set([c1,c2,c3,d3])); UniteSet(facets,torus); m:=m+3; fi; ################################ ### close exceptional fibres ### ################################ for r in [1..number_exceptional_fibres] do expansion:=[]; Compute_Continued_Fraction(exceptional_fibres[r][1],exceptional_fibres[r][2]); #Print(expansion,"\n"); current_coefficient:=1; for v_expansion in [1..Length(expansion)] do if v_expansion = 1 then if number_exceptional_fibres = 1 and flag_b = 0 then a0:=1; b0:=1*3+1; c0:=2*3+1; elif r = number_exceptional_fibres and flag_b = 0 then a0:=1; b0:=((n_start+1)-1)*3+1; c0:=((n_start+2)-1)*3+1; else a0:=((n_start+3*r)-1)*3+1; b0:=((n_start+3*r+1)-1)*3+1; c0:=((n_start+3*r+2)-1)*3+1; fi; a1:=a0; a2:=a0+1; a3:=a0+2; b1:=b0; b2:=b0+1; b3:=b0+2; c1:=c0; c2:=c0+1; c3:=c0+2; m1:=m+1; m2:=m+2; m3:=m+3; m4:=m+4; torus:=[]; Compose_Torus(a1,a2,a3,b1,b2,b3,c1,c2,c3,m1,m2,m3,m4); a3:=m1; b3:=m2; c3:=m3; m:=m+4; else m1:=m+1; m2:=m+2; m3:=m+3; m4:=m+4; if not current_coefficient = expansion[v_expansion] then #Print("flip\n"); current_coefficient:=expansion[v_expansion]; Flip_Torus(a1,a2,a3,b1,b2,b3,c1,c2,c3); else #Print("no flip\n"); fi; torus:=[]; Compose_Torus(a1,a2,a3,b1,b2,b3,c1,c2,c3,m1,m2,m3,m4); a3:=m1; b3:=m2; c3:=m3; m:=m+4; fi; UniteSet(facets,torus); od; ### close fibre ### d1:=m+1; d2:=m+2; d3:=m+3; torus:=[]; AddSet(torus,Set([a1,b1,b2,d1])); AddSet(torus,Set([a1,a2,b2,d1])); AddSet(torus,Set([a2,b2,b3,d1])); AddSet(torus,Set([a2,a3,b3,d1])); AddSet(torus,Set([a1,a3,b3,d1])); AddSet(torus,Set([a1,b1,b3,d1])); AddSet(torus,Set([a1,a2,a3,d1])); AddSet(torus,Set([b1,b2,b3,d1])); AddSet(torus,Set([b1,c1,c2,d2])); AddSet(torus,Set([b1,b2,c2,d2])); AddSet(torus,Set([b2,c2,c3,d2])); AddSet(torus,Set([b2,b3,c3,d2])); AddSet(torus,Set([b1,b3,c3,d2])); AddSet(torus,Set([b1,c1,c3,d2])); AddSet(torus,Set([b1,b2,b3,d2])); AddSet(torus,Set([c1,c2,c3,d2])); AddSet(torus,Set([a1,c1,c2,d3])); AddSet(torus,Set([a1,a2,c2,d3])); AddSet(torus,Set([a2,c2,c3,d3])); AddSet(torus,Set([a2,a3,c3,d3])); AddSet(torus,Set([a1,a3,c3,d3])); AddSet(torus,Set([a1,c1,c3,d3])); AddSet(torus,Set([a1,a2,a3,d3])); AddSet(torus,Set([c1,c2,c3,d3])); UniteSet(facets,torus); m:=m+3; od; ################################# ### compute bundle invariants ### ################################# if total_orientation = 1 then e:=b; for r in [1..Length(exceptional_fibres)] do e:=e+exceptional_fibres[r][2]/exceptional_fibres[r][1]; od; e:=-e; else e:=0; fi; if total_orientation = 1 and surface_orientation = 1 then Seifert_type:=String("Oo"); elif total_orientation = 1 and surface_orientation = 0 then Seifert_type:=String("On"); elif total_orientation = 0 and surface_orientation = 1 then Seifert_type:=String("No"); elif total_orientation = 0 and surface_orientation = 0 then if Nn_type = 1 then Seifert_type:=String("NnI"); elif Nn_type = 2 then Seifert_type:=String("NnII"); else Seifert_type:=String("NnIII"); fi; fi; if surface_orientation = 1 then chi:=2-2*g; else chi:=2-g; fi; chi_orbifold:=chi; for r in [1..Length(exceptional_fibres)] do chi_orbifold:=chi_orbifold-(1-1/exceptional_fibres[r][1]); od; if chi_orbifold > 0 then if e = 0 then geometric_type:=String("S^2xR"); else geometric_type:=String("S^3"); fi; elif chi_orbifold = 0 then if e = 0 then geometric_type:=String("E^3"); else geometric_type:=String("Nil"); fi; else if e = 0 then geometric_type:=String("H^2xR"); else geometric_type:=String("~SL(2,r)"); fi; fi; if surface_orientation = 1 then surface_type:=String("o"); else surface_type:=String("n"); fi; seifert_manifold_string:=Concatenation("The Seifert manifold {",String(Seifert_type),",",String(g),"|",String(b)); if Length(exceptional_fibres) > 0 then seifert_manifold_string:=Concatenation(seifert_manifold_string,";"); fi; for r in [1..Length(exceptional_fibres)] do seifert_manifold_string:=Concatenation(seifert_manifold_string,"[",String(exceptional_fibres[r][1]),",",String(exceptional_fibres[r][2]),"]"); if r < Length(exceptional_fibres) then seifert_manifold_string:=Concatenation(seifert_manifold_string,","); fi; od; seifert_manifold_string:=Concatenation(seifert_manifold_string,"}\n"); Print("\n",seifert_manifold_string, "has orbifold Euler characteristic ",chi_orbifold,"\n", "and Euler number ",e,",\n", "i.e., it is modeled on the geometry ",geometric_type,".\n\n"); PrintTo("SEIFERT.out","#####\n#\n", "# Triangulation produced by the GAP-program SEIFERT:\n#\n", "# ",seifert_manifold_string, "# has orbifold Euler characteristic ",chi_orbifold,"\n", "# and Euler number ",e,",\n", "# i.e., it is modeled on the geometry ",geometric_type,".\n", "#\n#####\n\n", "facets:=",facets,";\n"); fi;