  
  [1m[4m[31m5. (Co-)Homology of simplicial complexes[0m
  
  Although  [1msimpcomp[0m  relies  on  the GAP package ''homology'' [DH+04] for its
  homology  calculations  due to efficiency reasons, the package contains some
  additional  homology  related functionality, which will be explained in this
  chapter.
  
  
  [1m[4m[31m5.1 Homology computation[0m
  
  Apart  from  calculating  boundaries  of simplices, boundary matrices or the
  simplicial  homology  of a given complex, [1msimpcomp[0m is also able to compute a
  basis of the homology groups.
  
  [1m[4m[31m5.1-1 SCBoundaryOperatorMatrix[0m
  
  [1m[34m> SCBoundaryOperatorMatrix( [0m[22m[34mcomplex, dim[0m[1m[34m ) _________________________[0mfunction
  [1mReturns:[0m  a rectangular matrix upon success, [22m[32mfail[0m otherwise.
  
  Calculates  the  matrix of the boundary operator partial_[22m[34mdim+1[0m. Notice, that
  each  column  contains  the  boundaries  of  a  ([22m[34mdim[0m+1)-simplex as a list of
  oriented [22m[34mdim[0m-simplices and that the matrix is stored (GAP-typical) as a list
  of row vectors (as usual in GAP).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> c:=SCFromFacets([[1,2,3],[1,2,6],[1,3,5],[1,4,5],[1,4,6],[0m
    [22m[35m                       [2,3,4],[2,4,5],[2,5,6],[3,4,6],[3,5,6]]);;[0m
    [22m[35m gap> mat:=SCBoundaryOperatorMatrix(c,1);[0m
    [22m[35m [ [ 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [0m
    [22m[35m   [ -1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 ], [0m
    [22m[35m   [ 0, -1, 0, 0, 0, -1, 0, 0, 0, 1, 1, 1, 0, 0, 0 ], [0m
    [22m[35m   [ 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 1, 1, 0 ], [0m
    [22m[35m   [ 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, -1, 0, 1 ], [0m
    [22m[35m   [ 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, -1, -1 ] ][0m
    [22m[35m gap>[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.1-2 SCBoundarySimplex[0m
  
  [1m[34m> SCBoundarySimplex( [0m[22m[34msimplex, orientation[0m[1m[34m ) ________________________[0mfunction
  [1mReturns:[0m  a list upon success, [22m[32mfail[0m otherwise.
  
  Calculates  the  boundary of a given [22m[34msimplex[0m. If the flag [22m[34morientation[0m is set
  to  true,  the function returns the boundary as a list of oriented simplices
  of  the  form [ ORIENTATION, SIMPLEX ], where ORIENTATION is either +1 or -1
  and  a  value of +1 means that SIMPLEX is positively oriented and a value of
  -1 that SIMPLEX is negatively oriented. If the ORIENTATION flag is false, an
  unoriented list of simplices is returned, see the example.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCBoundarySimplex([1..5],true);[0m
    [22m[35m [ [ -1, [ 2, 3, 4, 5 ] ], [ 1, [ 1, 3, 4, 5 ] ], [ -1, [ 1, 2, 4, 5 ] ], [0m
    [22m[35m   [ 1, [ 1, 2, 3, 5 ] ], [ -1, [ 1, 2, 3, 4 ] ] ][0m
    [22m[35m gap> SCBoundarySimplex([1..5],false);[0m
    [22m[35m [ [ 2, 3, 4, 5 ], [ 1, 3, 4, 5 ], [ 1, 2, 4, 5 ], [ 1, 2, 3, 5 ], [0m
    [22m[35m   [ 1, 2, 3, 4 ] ][0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.1-3 SCHomologyBasis[0m
  
  [1m[34m> SCHomologyBasis( [0m[22m[34mcomplex, dim[0m[1m[34m ) __________________________________[0mfunction
  [1mReturns:[0m  a  list  of pairs of the form [22m[32m[ integer, list ][0m upon success, [22m[32mfail[0m
            otherwise.
  
  Calculates  a  set  of  basis vectors for the [22m[34mdim[0m-dimensional homology group
  (with integer coefficients) of [22m[34mcomplex[0m. The entries of the returned list are
  of the form [ MODULUS, [ BASEELM1, BASEELM2, ...] ], where the value MODULUS
  is  1  for  the basis elements of the free part of the [22m[34mdim[0m-th homology group
  and  k>=  2 for the basis elements of the k-torsion part. The basis elements
  are stored as lists of coefficient-index pairs referring to the simplices of
  the  complex,  i.e. a basis element of the form [ [ lambda_1, i], [lambda_2,
  j],  dots  ]  encodes  the  linear  combination  of  simplices  of  the form
  lambda_1*Delta_1+lambda_2*Delta_2    with    Delta_1=[22m[32mSCSkel(complex,dim)[i][0m,
  Delta_2=[22m[32mSCSkel(complex,dim)[j][0m and so on.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCLib.SearchByName("(S^2xS^1)#RP^3");[0m
    [22m[35m [ [ 247, "(S^2xS^1)#RP^3" ] ][0m
    [22m[35m gap> c:=SCLib.Load(247);;[0m
    [22m[35m gap> SCHomologyBasis(c,1);[0m
    [22m[35m [ [ 1, [ [ 1, 12 ], [ -1, 7 ], [ 1, 1 ] ] ], [0m
    [22m[35m   [ 2, [ [ 1, 68 ], [ -1, 69 ], [ -1, 71 ], [ 2, 72 ], [ -2, 73 ] ] ] ][0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.1-4 SCHomologyBasisAsSimplices[0m
  
  [1m[34m> SCHomologyBasisAsSimplices( [0m[22m[34mcomplex, dim[0m[1m[34m ) _______________________[0mfunction
  [1mReturns:[0m  a  list  of  pairs  of  the  form [22m[32m[ integer, linear combination of
            simplices ][0m upon success, [22m[32mfail[0m otherwise.
  
  In  contrast  to the function [1m[34mSCHomologyBasis[0m ([1m5.1-3[0m) this functSion returns
  the  basis elements in the same format as [1m[34mSCHomologyBasis[0m ([1m5.1-3[0m), but every
  basis  element  is returned as a linear combination of simplices of [22m[34mcomplex[0m.
  Each  term  of  the  linear  combination is of the form [ FACTOR, SIMPLEX ],
  where FACTOR is a non-zero integer value.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCLib.SearchByName("(S^2xS^1)#RP^3");[0m
    [22m[35m [ [ 247, "(S^2xS^1)#RP^3" ] ][0m
    [22m[35m gap> c:=SCLib.Load(247);;[0m
    [22m[35m gap> SCHomologyBasisAsSimplices(c,1);[0m
    [22m[35m [ [ 1, [ [ 1, [ 2, 8 ] ], [ -1, [ 1, 8 ] ], [ 1, [ 1, 2 ] ] ] ], [0m
    [22m[35m   [ 2, [ [ 1, [ 11, 12 ] ], [ -1, [ 11, 13 ] ], [ -1, [ 12, 13 ] ], [0m
    [22m[35m          [ 2, [ 12, 14 ] ], [ -2, [ 13, 14 ] ] ] ] ][0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.1-5 SCHomologyInternal[0m
  
  [1m[34m> SCHomologyInternal( [0m[22m[34mcomplex[0m[1m[34m ) ____________________________________[0mfunction
  [1mReturns:[0m  a  list  of pairs of the form [22m[32m[ integer, list ][0m upon success, [22m[32mfail[0m
            otherwise.
  
  This   function  computes  the  reduced  simplicial  homology  with  integer
  coefficients   of   a   given   simplicial   complex  [22m[34mcomplex[0m  with  integer
  coefficients. It uses the algorithm described in [DKT08].
  
  The  output is a list of homology groups of the form [H_0,....,H_d], where d
  is  the dimension of [22m[34mcomplex[0m. The format of the homology groups H_i is given
  in  terms  of  their maximal cyclic subgroups, i.e. a homology group H_icong
  Z^f  +  Z / t_1 Z times dots times Z / t_n Z is returned in form of a list [
  f,  [t_1,...,t_n]  ],  where  f  is  the  (integer) free part of H_i and t_i
  denotes the torsion parts of H_i ordered in weakly incresing size.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> c:=SCFromFacets([[1,2,3],[1,2,6],[1,3,5],[1,4,5],[1,4,6],[0m
    [22m[35m                       [2,3,4],[2,4,5],[2,5,6],[3,4,6],[3,5,6]]);;[0m
    [22m[35m gap> SCHomologyInternal(c);[0m
    [22m[35m [ [ 0, [  ] ], [ 0, [ 2 ] ], [ 0, [  ] ] ][0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m5.2 Cohomology computation[0m
  
  [1msimpcomp[0m  can  also  compute  the cohomology groups of simplicial complexes,
  bases  of  these  cohomology groups, the cup product of two cocycles and the
  intersection form of (orientable) 4-manifolds. Due to the enormous amount of
  resources  needed for the computation of exact eigenvalues, the signature of
  the  intersection form cannot be computed within [22m[32mGAP[0m. However, in some cases
  the [22m[32mGAP[0m function [22m[32mEigenvalues[0m can be used.
  
  [1m[4m[31m5.2-1 SCCoboundaryOperatorMatrix[0m
  
  [1m[34m> SCCoboundaryOperatorMatrix( [0m[22m[34mcomplex, dim[0m[1m[34m ) _______________________[0mfunction
  [1mReturns:[0m  a rectangular matrix upon success, [22m[32mfail[0m otherwise.
  
  Calculates  the  matrix  of the coboundary operator d^[22m[34mdim+1[0m as a list of row
  vectors.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> c:=SCFromFacets([[1,2,3],[1,2,6],[1,3,5],[1,4,5],[1,4,6],[0m
    [22m[35m                       [2,3,4],[2,4,5],[2,5,6],[3,4,6],[3,5,6]]);[0m
    [22m[35m gap> mat:=SCCoboundaryOperatorMatrix(c,1);;[0m
    [22m[35m [ [ -1, 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [0m
    [22m[35m   [ -1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0 ], [0m
    [22m[35m   [ 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0 ], [0m
    [22m[35m   [ 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0 ], [0m
    [22m[35m   [ 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0 ], [0m
    [22m[35m   [ 0, 0, 0, 0, 0, -1, 1, 0, 0, -1, 0, 0, 0, 0, 0 ], [0m
    [22m[35m   [ 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0 ], [0m
    [22m[35m   [ 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -1 ], [0m
    [22m[35m   [ 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1, 0, -1, 0 ], [0m
    [22m[35m   [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, -1 ] ][0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.2-2 SCCohomology[0m
  
  [1m[34m> SCCohomology( [0m[22m[34mcomplex[0m[1m[34m ) __________________________________________[0mfunction
  [1mReturns:[0m  a  list  of pairs of the form [22m[32m[ integer, list ][0m upon success, [22m[32mfail[0m
            otherwise.
  
  This  function  computes  the  simplicial  cohomology  of a given simplicial
  complex  [22m[34mcomplex[0m  with integer coefficients. It uses the algorithm described
  in [DKT08].
  
  The  output is a list of cohomology groups of the form [H^0,....,H^d], where
  d  is  the  dimension of [22m[34mcomplex[0m. The format of the cohomology groups H^i is
  given  in  terms  of their maximal cyclic subgroups, i.e. a cohomology group
  H^icong  Z^f + Z / t_1 Z times dots times Z / t_n Z is returned in form of a
  list [ f, [t_1,...,t_n] ], where f is the (integer) free part of H^i and t_i
  denotes the torsion parts of H^i ordered in weakly incresing size.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> c:=SCFromFacets([[1,2,3],[1,2,6],[1,3,5],[1,4,5],[1,4,6],[0m
    [22m[35m                       [2,3,4],[2,4,5],[2,5,6],[3,4,6],[3,5,6]]);[0m
    [22m[35m gap> SCCohomology(c);[0m
    [22m[35m [ [ 1, [  ] ], [ 0, [  ] ], [ 0, [ 2 ] ] ][0m
    [22m[35m gap>    [0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.2-3 SCCohomologyBasis[0m
  
  [1m[34m> SCCohomologyBasis( [0m[22m[34mcomplex, dim[0m[1m[34m ) ________________________________[0mfunction
  [1mReturns:[0m  a  list  of pairs of the form [22m[32m[ integer, list ][0m upon success, [22m[32mfail[0m
            otherwise.
  
  Calculates  a  set of basis vectors for the [22m[34mdim[0m-dimensional cohomology group
  (with integer coefficients) of [22m[34mcomplex[0m. The entries of the returned list are
  of the form [ MODULUS, [ BASEELM1, BASEELM2, ...] ], where the value MODULUS
  is  1 for the basis elements of the free part of the [22m[34mdim[0m-th cohomology group
  and  k>=  2 for the basis elements of the k-torsion part. The basis elements
  are stored as lists of coefficient-index pairs referring to the simplices of
  the  complex,  i.e. a basis element of the form [ [ lambda_1, i], [lambda_2,
  j],  dots  ]  encodes  the  linear  combination  of  simplices  of  the form
  lambda_1*Delta_1+lambda_2*Delta_2    with    Delta_1=[22m[32mSCSkel(complex,dim)[i][0m,
  Delta_2=[22m[32mSCSkel(complex,dim)[j][0m and so on.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCLib.SearchByName("SU(3)/SO(3)");   [0m
    [22m[35m [ [ 222, "SU(3)/SO(3) (VT)" ], [ 520, "SU(3)/SO(3) (VT)" ], [0m
    [22m[35m   [ 526, "SU(3)/SO(3) (VT)" ], [ 528, "SU(3)/SO(3) (VT)" ] ][0m
    [22m[35m gap> c:=SCLib.Load(222);;[0m
    [22m[35m gap> SCCohomologyBasis(c,3); [0m
    [22m[35m [ [ 2, [ [ -9, 259 ], [ 9, 262 ], [ 9, 263 ], [ -9, 270 ], [ 9, 271 ], [0m
    [22m[35m           [ -9, 273 ], [ -9, 274 ], [ -18, 275 ], [ -9, 276 ], [ 9, 278 ], [0m
    [22m[35m           [ -9, 279 ], [ -9, 280 ], [ 3, 283 ], [ -3, 285 ], [ 3, 289 ], [0m
    [22m[35m           [ -3, 294 ], [ 3, 310 ], [ -3, 313 ], [ 3, 316 ], [ -1, 317 ], [0m
    [22m[35m           [ -6, 318 ], [ 3, 319 ], [ -6, 320 ], [ 6, 321 ], [ 1, 322 ], [0m
    [22m[35m           [ 3, 325 ], [ -1, 328 ], [ 6, 330 ], [ -2, 331 ], [ 12, 332 ], [0m
    [22m[35m           [ 7, 333 ], [ -5, 334 ], [ 1, 345 ], [ 3, 355 ], [ -9, 357 ], [0m
    [22m[35m           [ 9, 358 ], [ 1, 363 ], [ 12, 365 ], [ -9, 366 ], [ -3, 370 ], [0m
    [22m[35m           [ -1, 371 ], [ -3, 372 ], [ 8, 373 ], [ -1, 374 ], [ 6, 375 ], [0m
    [22m[35m           [ 9, 376 ], [ 3, 377 ], [ 1, 380 ], [ 3, 383 ], [ -8, 385 ], [0m
    [22m[35m           [ -9, 386 ], [ -9, 388 ], [ -18, 404 ], [ 9, 410 ], [ -9, 425 ], [0m
    [22m[35m           [ -18, 426 ], [ -9, 427 ], [ 9, 428 ], [ -9, 429 ], [ 3, 433 ], [0m
    [22m[35m           [ -3, 435 ], [ -9, 437 ], [ 10, 442 ], [ 12, 445 ], [ 1, 447 ], [0m
    [22m[35m           [ -19, 448 ], [ 2, 449 ], [ -1, 450 ], [ -9, 451 ], [ 3, 453 ], [0m
    [22m[35m           [ 1, 455 ], [ 1, 457 ], [ -11, 458 ], [ -9, 459 ], [ 9, 461 ], [0m
    [22m[35m           [ 9, 462 ], [ -9, 468 ], [ 9, 469 ], [ -18, 471 ], [ -9, 472 ], [0m
    [22m[35m           [ 9, 474 ], [ -9, 475 ], [ 9, 488 ], [ 9, 495 ], [ -9, 500 ], [0m
    [22m[35m           [ -3, 504 ], [ 9, 505 ], [ 9, 512 ], [ 9, 515 ], [ 6, 519 ], [0m
    [22m[35m           [ 18, 521 ], [ -15, 523 ], [ 9, 524 ], [ -3, 525 ], [ 18, 527 ], [0m
    [22m[35m           [ -18, 528 ], [ 6, 529 ], [ 6, 531 ], [ 12, 532 ] ] ] ][0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.2-4 SCCohomologyBasisAsSimplices[0m
  
  [1m[34m> SCCohomologyBasisAsSimplices( [0m[22m[34mcomplex, dim[0m[1m[34m ) _____________________[0mfunction
  [1mReturns:[0m  a  list  of  pars  of  the  form  [22m[32m[ integer, linear combination of
            simplices ][0m upon success, [22m[32mfail[0m otherwise.
  
  In  contrast to the function [1m[34mSCCohomologyBasis[0m ([1m5.2-3[0m) this function returns
  the  basis  elements  in  the  same format as [1m[34mSCCohomologyBasis[0m ([1m5.2-3[0m), but
  every  basis  element  is  returned  as a linear combination of simplices of
  [22m[34mcomplex[0m.  Each  term  of  the  linear  combination  is of the form [ FACTOR,
  SIMPLEX ], where FACTOR is a non-zero integer value.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCLib.SearchByName("SU(3)/SO(3)");   [0m
    [22m[35m [ [ 222, "SU(3)/SO(3) (VT)" ], [ 520, "SU(3)/SO(3) (VT)" ], [0m
    [22m[35m   [ 526, "SU(3)/SO(3) (VT)" ], [ 528, "SU(3)/SO(3) (VT)" ] ][0m
    [22m[35m gap> c:=SCLib.Load(222);;[0m
    [22m[35m gap> SCCohomologyBasisAsSimplices(c,3);[0m
    [22m[35m [ [ 2, [ [ -9, [ 2, 7, 8, 9 ] ], [ 9, [ 2, 7, 8, 12 ] ], [ 9, [ 2, 7, 8, 13 ] ], [0m
    [22m[35m          [ -9, [ 2, 7, 11, 12 ] ], [ 9, [ 2, 7, 11, 13 ] ], [ -9, [ 2, 8, 9, 10 ] ],[0m
    [22m[35m          [ -9, [ 2, 8, 9, 11 ] ], [ -18, [ 2, 8, 9, 12 ] ], [ -9, [ 2, 8, 9, 13 ] ],[0m
    [22m[35m          [ 9, [ 2, 8, 10, 12 ] ], [ -9, [ 2, 8, 10, 13 ] ], [0m
    [22m[35m          [ -9, [ 2, 8, 11, 12 ] ], [ 3, [ 2, 9, 10, 12 ] ], [0m
    [22m[35m          [ -3, [ 2, 9, 11, 12 ] ], [ 3, [ 3, 4, 5, 7 ] ], [ -3, [ 3, 4, 5, 12 ] ], [0m
    [22m[35m          [ 3, [ 3, 4, 10, 12 ] ], [ -3, [ 3, 5, 6, 7 ] ], [ 3, [ 3, 5, 6, 11 ] ], [0m
    [22m[35m          [ -1, [ 3, 5, 6, 13 ] ], [ -6, [ 3, 5, 7, 8 ] ], [ 3, [ 3, 5, 7, 10 ] ], [0m
    [22m[35m          [ -6, [ 3, 5, 7, 11 ] ], [ 6, [ 3, 5, 7, 12 ] ], [ 1, [ 3, 5, 7, 13 ] ], [0m
    [22m[35m          [ 3, [ 3, 5, 8, 12 ] ], [ -1, [ 3, 5, 9, 13 ] ], [ 6, [ 3, 5, 10, 12 ] ], [0m
    [22m[35m          [ -2, [ 3, 5, 10, 13 ] ], [ 12, [ 3, 5, 11, 12 ] ], [0m
    [22m[35m          [ 7, [ 3, 5, 11, 13 ] ], [ -5, [ 3, 5, 12, 13 ] ], [ 1, [ 3, 6, 9, 13 ] ], [0m
    [22m[35m          [ 3, [ 3, 7, 10, 12 ] ], [ -9, [ 3, 7, 11, 12 ] ], [ 9, [ 3, 7, 11, 13 ] ],[0m
    [22m[35m          [ 1, [ 3, 8, 9, 13 ] ], [ 12, [ 3, 8, 10, 12 ] ], [ -9, [ 3, 8, 10, 13 ] ],[0m
    [22m[35m          [ -3, [ 3, 9, 10, 12 ] ], [ -1, [ 3, 9, 10, 13 ] ], [0m
    [22m[35m          [ -3, [ 3, 9, 11, 12 ] ], [ 8, [ 3, 9, 11, 13 ] ], [0m
    [22m[35m          [ -1, [ 3, 9, 12, 13 ] ], [ 6, [ 3, 10, 11, 12 ] ], [0m
    [22m[35m          [ 9, [ 3, 10, 11, 13 ] ], [ 3, [ 3, 10, 12, 13 ] ], [ 1, [ 4, 5, 6, 8 ] ], [0m
    [22m[35m          [ 3, [ 4, 5, 6, 11 ] ], [ -8, [ 4, 5, 6, 13 ] ], [ -9, [ 4, 5, 7, 8 ] ], [0m
    [22m[35m          [ -9, [ 4, 5, 7, 11 ] ], [ -18, [ 4, 6, 8, 9 ] ], [ 9, [ 4, 6, 9, 13 ] ], [0m
    [22m[35m          [ -9, [ 4, 8, 9, 10 ] ], [ -18, [ 4, 8, 9, 12 ] ], [ -9, [ 4, 8, 9, 13 ] ],[0m
    [22m[35m          [ 9, [ 4, 8, 10, 12 ] ], [ -9, [ 4, 8, 10, 13 ] ], [ 3, [ 4, 9, 10, 12 ] ],[0m
    [22m[35m          [ -3, [ 4, 9, 11, 12 ] ], [ -9, [ 4, 9, 12, 13 ] ], [ 10, [ 5, 6, 7, 8 ] ],[0m
    [22m[35m          [ 12, [ 5, 6, 7, 11 ] ], [ 1, [ 5, 6, 7, 13 ] ], [ -19, [ 5, 6, 8, 9 ] ], [0m
    [22m[35m          [ 2, [ 5, 6, 8, 11 ] ], [ -1, [ 5, 6, 8, 12 ] ], [ -9, [ 5, 6, 8, 13 ] ], [0m
    [22m[35m          [ 3, [ 5, 6, 9, 11 ] ], [ 1, [ 5, 6, 9, 13 ] ], [ 1, [ 5, 6, 10, 13 ] ], [0m
    [22m[35m          [ -11, [ 5, 6, 11, 13 ] ], [ -9, [ 5, 7, 8, 9 ] ], [ 9, [ 5, 7, 8, 12 ] ], [0m
    [22m[35m          [ 9, [ 5, 7, 8, 13 ] ], [ -9, [ 5, 7, 11, 12 ] ], [ 9, [ 5, 7, 11, 13 ] ], [0m
    [22m[35m          [ -18, [ 5, 8, 9, 12 ] ], [ -9, [ 5, 8, 9, 13 ] ], [ 9, [ 5, 8, 10, 12 ] ],[0m
    [22m[35m          [ -9, [ 5, 8, 11, 12 ] ], [ 9, [ 6, 7, 8, 13 ] ], [ 9, [ 6, 7, 11, 13 ] ], [0m
    [22m[35m          [ -9, [ 6, 8, 10, 13 ] ], [ -3, [ 6, 9, 11, 12 ] ], [0m
    [22m[35m          [ 9, [ 6, 9, 11, 13 ] ], [ 9, [ 7, 8, 9, 13 ] ], [ 9, [ 7, 8, 11, 12 ] ], [0m
    [22m[35m          [ 6, [ 7, 9, 11, 12 ] ], [ 18, [ 7, 11, 12, 13 ] ], [0m
    [22m[35m          [ -15, [ 8, 9, 10, 12 ] ], [ 9, [ 8, 9, 10, 13 ] ], [0m
    [22m[35m          [ -3, [ 8, 9, 11, 12 ] ], [ 18, [ 8, 10, 11, 12 ] ], [0m
    [22m[35m          [ -18, [ 8, 10, 12, 13 ] ], [ 6, [ 9, 10, 11, 12 ] ], [0m
    [22m[35m          [ 6, [ 9, 10, 12, 13 ] ], [ 12, [ 9, 11, 12, 13 ] ] ] ] ][0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.2-5 SCCupProduct[0m
  
  [1m[34m> SCCupProduct( [0m[22m[34mcomplex, cocycle1, cocycle2[0m[1m[34m ) ______________________[0mfunction
  [1mReturns:[0m  a list of oriented simplices upon success, [22m[32mfail[0m otherwise.
  
  The  cup  product is a method of adjoining two cocycles of degree p and q to
  form a composite cocycle of degree p + q.
  The  construction  of  the cup product starts with a product of cochains: if
  [22m[34mcocycle1[0m  is  a  p-cochain  and  [22m[34mcocylce2[0m  is  a q-cochain (given as list of
  oriented p- (q-)simplices, then
  [22m[34mcocycle1[0m  smile  [22m[34mcocycle2[0m(sigma)  =[22m[34mcocycle1[0m(sigma  circ  iota_0,1,  ... p) *
  [22m[34mcocycle2[0m(sigma circ iota_p, p+1 ,..., p + q)
  where  sigma  is  a  (p + q)-simplex and iota_S, S subset 0,1,...,p+q is the
  canonical  embedding  of  the simplex spanned by S into the (p + q)-standard
  simplex.
  sigma  circ  iota_0,1,  ...,  p is called the p-th front face and sigma circ
  iota_p, p+1, ..., p + q is the q-th back face of sigma, respectively.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCLib.SearchByName("K3");[0m
    [22m[35m [ [ 584, "K3 surface" ] ][0m
    [22m[35m gap> c:=SCLib.Load(584);;                                     [0m
    [22m[35m gap> basis:=SCCohomologyBasisAsSimplices(c,2);;[0m
    [22m[35m gap> SCCupProduct(c,basis[1][2],basis[1][2]);[0m
    [22m[35m [ [ 1, [ 1, 2, 4, 7, 11 ] ], [ 1, [ 2, 3, 4, 5, 9 ] ] ][0m
    [22m[35m gap> SCCupProduct(c,basis[1][2],basis[2][2]);[0m
    [22m[35m [ [ -1, [ 1, 2, 4, 7, 11 ] ], [ -1, [ 1, 2, 4, 7, 15 ] ], [0m
    [22m[35m   [ -1, [ 2, 3, 4, 5, 9 ] ] ][0m
    [22m[35m gap> [0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.2-6 SCIntersectionForm[0m
  
  [1m[34m> SCIntersectionForm( [0m[22m[34mcomplex[0m[1m[34m ) ____________________________________[0mfunction
  [1mReturns:[0m  a square matrix of integer values upon success, [22m[32mfail[0m otherwise.
  
  For  2d-dimensional  orientable  pseudomanifolds  M  the  cup  product  (see
  [1m[34mSCCupProduct[0m ([1m5.2-5[0m)) defines a bilinear function
  H^d ( M ) timesH^d ( M ) ->H^2d (M), (a,b) -> a cup b
  called the intersection form. This function returns the intersection form in
  integral cohomology in form of a matrix [22m[32mmat[0m with respect to the basis of H^d
  (  M  )  computed  by [1m[34mSCCohomologyBasisAsSimplices[0m ([1m5.2-4[0m). The matrix entry
  [22m[32mM[i][j][0m  equals  the  intersection  number of the [22m[32mi[0m-th element with the [22m[32mj[0m-th
  element of the basis.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCLib.SearchByName("CP^2");       [0m
    [22m[35m [ [ 17, "CP^2 (VT)" ], [ 88, "CP^2#CP^2" ], [ 89, "CP^2#-CP^2" ], [0m
    [22m[35m   [ 186, "CP^2#(S^2xS^2)" ], [ 499, "(S^3~S^1)#(CP^2)^{#5} (VT)" ] ][0m
    [22m[35m gap> c:=SCLib.Load(17);; [0m
    [22m[35m gap> c1:=SCConnectedSum(c,c);;[0m
    [22m[35m gap> c2:=SCConnectedSumMinus(c,c);;[0m
    [22m[35m gap> q1:=SCIntersectionForm(c1);;[0m
    [22m[35m gap> q2:=SCIntersectionForm(c2);;[0m
    [22m[35m gap> PrintArray(q1);[0m
    [22m[35m [ [  1,  0 ],[0m
    [22m[35m   [  0,  1 ] ][0m
    [22m[35m gap> PrintArray(q2);[0m
    [22m[35m [ [   1,   0 ],[0m
    [22m[35m   [   0,  -1 ] ][0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.2-7 SCIntersectionFormParity[0m
  
  [1m[34m> SCIntersectionFormParity( [0m[22m[34mcomplex[0m[1m[34m ) ______________________________[0mfunction
  [1mReturns:[0m  [22m[32m0[0m or [22m[32m1[0m upon success, [22m[32mfail[0m otherwise.
  
  Computes   the   parity   of   the   intersection   form   of  [22m[34mcomplex[0m  (see
  [1m[34mSCIntersectionForm[0m  ([1m5.2-6[0m)).  If  the  intersection  for is even (i. e. all
  diagonal  entries  are  even numbers) [22m[32m0[0m, if it is odd (at least one diagonal
  entry is odd), [22m[32m1[0m is returned.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCLib.SearchByName("S^2xS^2");[0m
    [22m[35m [ [ 51, "S^2xS^2" ], [ 110, "S^2xS^2 (VT)" ], [ 111, "S^2xS^2 (VT)" ], [0m
    [22m[35m   [ 112, "S^2xS^2 (VT)" ], [ 114, "(S^2xS^2)#(S^2xS^2)" ], [0m
    [22m[35m   [ 144, "(S^2xS^2)#(S^2xS^2) (VT)" ], [ 145, "(S^2xS^2)#(S^2xS^2) (VT)" ], [0m
    [22m[35m   [ 186, "CP^2#(S^2xS^2)" ] ][0m
    [22m[35m gap> c:=SCLib.Load(51);;    [0m
    [22m[35m gap> SCIntersectionFormParity(c);[0m
    [22m[35m 0[0m
    [22m[35m gap> SCLib.SearchByName("CP^2");       [0m
    [22m[35m [ [ 17, "CP^2 (VT)" ], [ 88, "CP^2#CP^2" ], [ 89, "CP^2#-CP^2" ], [0m
    [22m[35m   [ 186, "CP^2#(S^2xS^2)" ], [ 499, "(S^3~S^1)#(CP^2)^{#5} (VT)" ] ][0m
    [22m[35m gap> c:=SCLib.Load(17);; [0m
    [22m[35m gap> SCIntersectionFormParity(c);[0m
    [22m[35m 1[0m
    [22m[35m gap> [0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.2-8 SCIntersectionFormDimensionality[0m
  
  [1m[34m> SCIntersectionFormDimensionality( [0m[22m[34mcomplex[0m[1m[34m ) ______________________[0mfunction
  [1mReturns:[0m  an integer upon success, [22m[32mfail[0m otherwise.
  
  Returns  the  dimensionality  of the intersection form of [22m[34mcomplex[0m, i. e. the
  length  of a minimal generating set of H^d (M) (where 2d is the dimension of
  [22m[34mcomplex[0m). See [1m[34mSCIntersectionForm[0m ([1m5.2-6[0m) for further details.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCLib.SearchByName("CP^2");       [0m
    [22m[35m [ [ 17, "CP^2 (VT)" ], [ 88, "CP^2#CP^2" ], [ 89, "CP^2#-CP^2" ], [0m
    [22m[35m   [ 186, "CP^2#(S^2xS^2)" ], [ 499, "(S^3~S^1)#(CP^2)^{#5} (VT)" ] ][0m
    [22m[35m gap> c:=SCLib.Load(17);; ## gap> SCIntersectionFormParity(c);[0m
    [22m[35m 1[0m
    [22m[35m gap> SCCohomology(c);[0m
    [22m[35m [ [ 1, [  ] ], [ 0, [  ] ], [ 1, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ][0m
    [22m[35m gap> SCIntersectionFormDimensionality(c);[0m
    [22m[35m 1[0m
    [22m[35m gap> d:=SCConnectedProduct(c,10);;[0m
    [22m[35m gap> SCIntersectionFormDimensionality(d);[0m
    [22m[35m 10[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.2-9 SCIntersectionFormSignature[0m
  
  [1m[34m> SCIntersectionFormSignature( [0m[22m[34mcomplex[0m[1m[34m ) ___________________________[0mfunction
  [1mReturns:[0m  a triple of integers upon success, [22m[32mfail[0m otherwise.
  
  Returns  the  dimensionality  and  the signature of the intersection form of
  [22m[34mcomplex[0m as a 3-tuple that contains the dimensionality in the first entry and
  the number of positive / negative eigenvalues in the second and third entry.
  See [1m[34mSCIntersectionForm[0m ([1m5.2-6[0m) for further details.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCLib.SearchByName("CP^2");       [0m
    [22m[35m [ [ 17, "CP^2 (VT)" ], [ 88, "CP^2#CP^2" ], [ 89, "CP^2#-CP^2" ], [0m
    [22m[35m   [ 186, "CP^2#(S^2xS^2)" ], [ 499, "(S^3~S^1)#(CP^2)^{#5} (VT)" ] ][0m
    [22m[35m gap> c:=SCLib.Load(17);; ## gap> SCIntersectionFormParity(c);[0m
    [22m[35m 1[0m
    [22m[35m gap> SCCohomology(c);[0m
    [22m[35m [ [ 1, [  ] ], [ 0, [  ] ], [ 1, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ][0m
    [22m[35m gap> SCIntersectionFormSignature(c);[0m
    [22m[35m [ 1, 0, 1 ][0m
    [22m[35m gap> d:=SCConnectedSum(c,c);                           [0m
    [22m[35m [SimplicialComplex[0m
    [22m[35m [0m
    [22m[35m  Properties known: Dim, Facets, Name, VertexLabels, Vertices.[0m
    [22m[35m [0m
    [22m[35m  Name="CP^2 (VT)#+-CP^2 (VT)"[0m
    [22m[35m  Dim=4[0m
    [22m[35m [0m
    [22m[35m /SimplicialComplex][0m
    [22m[35m gap> SCIntersectionFormSignature(d);[0m
    [22m[35m [ 2, 1, 1 ][0m
    [22m[35m gap> d:=SCConnectedSumMinus(c,c);;[0m
    [22m[35m gap> SCIntersectionFormSignature(d);[0m
    [22m[35m [ 2, 0, 2 ][0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
