% generated by GAPDoc2LaTeX from XML source (Frank Luebeck)
\documentclass[11pt]{report}
\usepackage{a4wide}
\sloppy
\pagestyle{myheadings}
\usepackage{amssymb}
\usepackage[latin1]{inputenc}
\usepackage{makeidx}
\makeindex
\usepackage{color}
\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}
\definecolor{FireBrick}{rgb}{0.5812,0.0074,0.0083}
\definecolor{RoyalBlue}{rgb}{0.0236,0.0894,0.6179}
\definecolor{RoyalGreen}{rgb}{0.0236,0.6179,0.0894}
\definecolor{RoyalRed}{rgb}{0.6179,0.0236,0.0894}
\definecolor{LightBlue}{rgb}{0.8544,0.9511,1.0000}
\definecolor{Black}{rgb}{0.0,0.0,0.0}
\definecolor{FuncColor}{rgb}{1.0,0.0,0.0}
%% strange name because of pdflatex bug:
\definecolor{Chapter }{rgb}{0.0,0.0,1.0}

\usepackage{fancyvrb}

\usepackage{pslatex}


\usepackage{amsmath}
%\usepackage{lmodern}
\usepackage{graphicx}
\definecolor{FuncColor}{rgb}{0.0,0.0,0.0}
\definecolor{RoyalGreen}{rgb}{0.0,0.0,0.0}
\definecolor{RoyalRed}{rgb}{0.0,0.0,0.0}
\definecolor{RoyalBlue}{rgb}{0.0,0.0,0.0}
\definecolor{LightBlue}{rgb}{0.0,0.0,0.0}
\definecolor{Chapter }{rgb}{0.0,0.0,0.0}
\usepackage[
        a4paper=true,bookmarks=false,pdftitle={Written with GAPDoc},
        colorlinks=true,backref=page,breaklinks=true,linkcolor=RoyalBlue,
        citecolor=RoyalGreen,filecolor=RoyalRed,
        urlcolor=RoyalRed,pagecolor=RoyalBlue]{hyperref}

% write page numbers to a .pnr log file for online help
\newwrite\pagenrlog
\immediate\openout\pagenrlog =\jobname.pnr
\immediate\write\pagenrlog{PAGENRS := [}
\newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\F}{\mathbb{F}}

\newcommand{\GAP}{\textsf{GAP}}

\newsavebox{\backslashbox}
\sbox{\backslashbox}{\texttt{\symbol{92}}}
\newcommand{\bs}{\usebox{\backslashbox}}

\begin{document}

\logpage{[ 0, 0, 0 ]}
\begin{titlepage}
\begin{center}{\Huge \textbf{\textsf{simpcomp}}}\\[1cm]
\markright{\scriptsize \mbox{}\hfill \textsf{simpcomp} \hfill\mbox{}}
{\Large \textbf{A \textsf{GAP} toolbox for simplicial complexes}}\\[1cm]
{Version 1.1.21}\\[1cm]
{January 2010}\\[1cm]
\mbox{}\\[2cm]
{\large \textbf{ Felix Effenberger  }}\\
{\large \textbf{ Jonathan Spreer  }}\\
\end{center}\vfill

\mbox{}\\
{\mbox{}\\
\small \noindent \textbf{ Felix Effenberger  } --- Email: \href{mailto://effenberger@mathematik.uni-stuttgart.de}{\texttt{effenberger@mathematik.uni-stuttgart.de}}}\\
{\mbox{}\\
\small \noindent \textbf{ Jonathan Spreer  } --- Email: \href{mailto://spreer@mathematik.uni-stuttgart.de}{\texttt{spreer@mathematik.uni-stuttgart.de}}}\\

\noindent \textbf{Address: }\begin{minipage}[t]{8cm}\noindent
 University of Stuttgart\\
 Department of Mathematics\\
 Institute of Geometry and Topology\\
 D-70550 Stuttgart, Germany \end{minipage}
\end{titlepage}

\newpage\setcounter{page}{2}
{\small 
\section*{Abstract}
\logpage{[ 0, 0, 1 ]}
\textsf{simpcomp} is a \textsf{GAP} package for working with simplicial complexes. It allows the computation of
many properties of simplicial complexes (such as the $f$-, $g$- and $h$-vectors, the face lattice, the automorphism group, (co-)homology with
explicit basis computation, intersection form, etc.) and provides the user
with functions to compute new complexes from old (simplex links and stars,
connected sums, cartesian products, handle additions, bistellar flips, etc.).
Furthermore, it comes with an extensive library of known triangulations of
manifolds and provides the user with the possibility to create own complex
libraries.\\
 \textsf{simpcomp} caches computed properties of a simplicial complex, thus avoiding unnecessary
computations, internally handles the vertex labeling of the complexes and
insures the consistency of a simplicial complex throughout all operations.\\
 \textsf{simpcomp} relies on the \textsf{GAP} package \textsf{homology} \cite{Dumas04Homology} for its homology computation, but also provides the user with an own
(co-)homology algorithm in case the packacke \textsf{homology} is not available. For automorphism group computation the \textsf{GAP} package \textsf{GRAPE} \cite{Soicher06GRAPE} is used, which in turn uses the program \texttt{nauty} by Brendan McKay \cite{McKay84Nauty}. An internal automorphism group calculation algorithm in used as fallback if
the \textsf{GRAPE} package is not available. }\\[1cm]
{\small 
\section*{Copyright}
\logpage{[ 0, 0, 3 ]}
{\copyright} 2009 by Felix Effenberger and Jonathan Spreer.

 Permission is granted to copy, distribute and/or modify this document under
the terms of the GNU Free Documentation License, Version 1.2 or any later
version published by the Free Software Foundation, see \href{http://www.fsf.org/licensing/licenses/fdl.html}{\texttt{http://www.fsf.org/licensing/licenses/fdl.html}} for a copy. \textsf{simpcomp} is free software. The code of \textsf{simpcomp} is released under the GPL version 2 or later (at your preference). For the
text of the GPL see the file \texttt{COPYING} in the \textsf{simpcomp} directory or \href{http://www.gnu.org/licenses/}{\texttt{http://www.gnu.org/licenses/}}. }\\[1cm]
{\small 
\section*{Acknowledgements}
\logpage{[ 0, 0, 2 ]}
A few functions of \textsf{simpcomp} are based on code from other authors. The bistellar flips implementation is
based upon work of Frank Lutz \cite{Lutz03TrigMnfFewVertVertTrans}. Some functions were carried over from the \textsf{Homology} package by Dumas et al. \cite{Dumas04Homology} -- these functions are marked in the documentation and the source code. The
internal (co)homology algorithms were implemented by Armin Weiss. 

 Most of the complexes in the simplicial complex library are taken from the
"Manifold Page" by Frank Lutz \cite{Lutz08ManifoldPage}. 

 The first author acknowledges support by the Deutsche Forschungsgemeinschaft
(DFG). This work was carried out as part of the DFG project "Ku 1203/5-2". }\\[1cm]
\newpage

\def\contentsname{Contents\logpage{[ 0, 0, 4 ]}}

\tableofcontents
\newpage

 
\chapter{\textcolor{Chapter }{Introduction}}\label{chap:howto}
\logpage{[ 1, 0, 0 ]}
{
  \textsf{simpcomp} is a \textsf{GAP} package that provides the user with functions to do calculations and
constructions with simplicial complexes (see abstract). It builds on top of
the \textsf{GAP} packages \textsf{homology} \cite{Dumas04Homology} by J.-G. Dumas et al. and \textsf{GRAPE} \cite{Soicher06GRAPE} by L. Soicher. 

 Most parts of this manual can be accessed directly from within \textsf{GAP} using its internal help system. 
\section{\textcolor{Chapter }{Why \textsf{simpcomp}}}\label{sec:whysimpcomp}
\logpage{[ 1, 1, 0 ]}
{
  The origin of \textsf{simpcomp} was a collection of scripts of the two authors that provide basic and
often-needed functions and operations for working with simplicial complexes. 

 \textsf{simpcomp} is written entirely in the \textsf{GAP} scripting language, thus giving the user the possibility to see the behind the
scenes and to customize or alter \textsf{simpcomp} functions if needed. 

 The main benefit when working with \textsf{simpcomp} over implementing the needed functions from scratch is the fact that \textsf{simpcomp} takes care of the error-prone vertex labeling of a complex and the fact that
it transparently caches properties already calculated, thus preventing
unnecessary double calculations of the same property. It also provides the
user with functions to save and load the simplicial complexes to and from
files and ships with an extensive library of known triangulations of manifolds
and pseudomanifolds. This allows the user to work with many different known
triangulations without having to construct them first. 

 In contrast to a fully fledged software package like polymake \cite{Joswig00Polymake} providing the most efficient algorithms for each task in form of a
heterogeneous package (where algorithms are implemented in various languages),
the primary goal when developing \textsf{simpcomp} was not efficieny (this is already limited by the \textsf{GAP} scripting language), but rather ease of use and ease of extensibility by the
user in the \textsf{GAP} language with all its mathematical and algebraic capabilities. 

 Extending \textsf{simpcomp} is possible directly from within \textsf{GAP}, without having to compile anything, see chapter \ref{chap:internals}. }

 
\section{\textcolor{Chapter }{How to save time reading this document}}\label{sec:howtoread}
\logpage{[ 1, 2, 0 ]}
{
  The core component in \textsf{simpcomp} is the newly defined object type \texttt{SCSimplicialComplex}. When working with this package it is important to understand how objects of
this type can be created, accessed and modified. The reader is therefore
advised to first skim over chapter \ref{chap:complex}. 

 The impatient reader may then directly skip to chapter \ref{chap:demo} to see \textsf{simpcomp} in action. 

 The next advised step is to have a look at the functions for creating object
of type \texttt{SCSimplicialComplex}, see the first section of chapter \ref{chap:scfunc}. 

 The rest of chapter \ref{chap:scfunc} contains most of the functions that \textsf{simpcomp} provides, except for the functions related to (co-)homology, bistellar flips
and the simplicial complex library that are described in the chapters \ref{chap:homology}, \ref{chap:bistellar} and \ref{chap:libio}. }

 
\section{\textcolor{Chapter }{Organization of this document}}\label{sec:howtoorg}
\logpage{[ 1, 3, 0 ]}
{
  This manual accompanying \textsf{simpcomp} is divided into eleven chapters. 
\begin{itemize}
\item  The second chapter provides a short introduction into the theory of simplicial
complexes and PL-topology. 
\item  The third chapter is devoted to the description of the \textsf{GAP} object type \texttt{SCSimplicialComplex} that is defined by \textsf{simpcomp}. 
\item  In the fourth chapter functions for working with simplicial complexes that are
provided by \textsf{simpcomp} are described. 
\item  Chapter five describes the homology- and cohomology-related functions of \textsf{simpcomp}. 
\item  Chapter six contains a description of the functions related to bistellar flips
provided by \textsf{simpcomp}. 
\item  In chapter seven the simplicial complex library and the input output
functionality that \textsf{simpcomp} provides is described in detail. 
\item  Chapter eight contains descriptions of functions not fitting in the other
chapters, such as the error handling and the email notification system of \textsf{simpcomp}. 
\item  Chapter nine contains the transcript of a demo session with \textsf{simpcomp} showing some of the constructions and calculations with simplicial complexes
that can also be used as a first overview of things possible with this
package. 
\item  Chapter ten contains a transcript of a demo session with \textsf{simpcomp}, showing some of its functionality. 
\item  Finally, chapter eleven focuses on the description of the internal structure
of the \textsf{simpcomp} and deals with aspects of extending the functionality of the package. 
\end{itemize}
 }

 
\section{\textcolor{Chapter }{How to assure \textsf{simpcomp} works correctly}}\label{sec:testsimpcomp}
\logpage{[ 1, 4, 0 ]}
{
  As with all software, it is important to test whether \textsf{simpcomp} functions correctly on your system after installing it. \textsf{GAP} has an internal testing mechanism and \textsf{simpcomp} ships with a short testing file that does some sample computations and
verifies that the results are correct.

 To test the functionality of \textsf{simpcomp} you can run the function \texttt{SCRunTest} (\ref{SCRunTest}) from the \textsf{GAP} console: 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> SCRunTest();
  + test simpcomp package, version 1.1.21
  + GAP4stones: 69988
  true
  gap> 
\end{Verbatim}
 \texttt{SCRunTest} (\ref{SCRunTest}) should return \texttt{true}, otherwise the correct functionality of simpcomp cannot be guaranteed. }

 
\section{\textcolor{Chapter }{How to cite \textsf{simpcomp}}}\label{sec:citesimpcomp}
\logpage{[ 1, 5, 0 ]}
{
  If you would like to cite \textsf{simpcomp} using BibTeX, you can use the following BibTeX entry for the current \textsf{simpcomp} version: 
\begin{verbatim}  @manual{simpcomp,
  	author = "Felix Effenberger and Jonathan Spreer",
  	title  = "{\tt simpcomp} - a {\tt GAP} toolkit for simplicial complexes,
  	          {V}ersion 1.1.21}",
  	year   = "2009",
  	url    = "\url{http://www.igt.uni-stuttgart.de/LstDiffgeo/simpcomp}",
  }
\end{verbatim}
 If you are not using BibTeX, you can use the following entry inside the
bibliography environment of LaTeX. 
\begin{verbatim}  \bibitem{simpcomp}
  F.~Effenberger and J.~Spreer,
  \emph{{\tt simpcomp} -- a {\tt GAP} toolkit for simplicial complexes},
  Version 1.1.21, 
  2009,
  \url{http://www.igt.uni-stuttgart.de/LstDiffgeo/simpcomp}.
\end{verbatim}
 }

 }

 
\chapter{\textcolor{Chapter }{Theoretical foundations}}\label{chap:theory}
\logpage{[ 2, 0, 0 ]}
{
  The purpose of this chapter is to recall some basic definitions regarding
polytopes, triangulations and PL topology. The expert in this field may well
skip to the next chapter. 

 For a more detailed look the authors recommend the books \cite{Hudson69PLTop}, \cite{Rourke72IntrPLTop} on PL-topology and \cite{Ziegler95LectPolytopes}, \cite{Gruenbaum03ConvPoly} on the theory of polytopes. 

 An overview of the more recent developments in the field of combinatorial
topology can be found in \cite{Lutz05TrigMnfFewVertCombMnf} and \cite{Datta07MinTrigManifolds}. 
\section{\textcolor{Chapter }{Polytopes and polytopal complexes}}\label{sec:polytopes}
\logpage{[ 2, 1, 0 ]}
{
 A convex \emph{$d$-polytope} is the convex hull of $n$ points $p_i \in E^d$ in the $d$-dimensional euclidean space: 
\[P=  \operatorname{conv}   \{v_1,\dots,v_n\}\subset E^d, \]
 where the $v_1,\dots,v_n$ do not lie in a hyperplane of $E^d$. 

 From now on when talking about polytopes in this document always convex
polytopes are meant unless explicitly stated otherwise. 

 For any hyperplane $h \subset E^d$, $P\cap h$ is called a \emph{$k$-face} of $P$ if $\dim(P\cap h)=k$. The 0-faces are called \emph{vertices}, the 1-faces \emph{edges} and the $(d-1)$-faces are called \emph{facets} of $P$. 

 A polytope $P$ is called \emph{regular}, if all its $(d-1)$-faces are congruent regular $(d-1)$-polytopes. A regular 1-polytope is a regular $n$-gon. 

  Figure 1 below shows the only five regular convex 3-polytopes (also known as
\emph{platonic solids}). \begin{center} \begin{tabular}{@{}lllll@{}}
\includegraphics[width=2cm]{figures/platonicsolids1}&
\includegraphics[width=2cm]{figures/platonicsolids2}&
\includegraphics[width=2cm]{figures/platonicsolids3}&
\includegraphics[width=2cm]{figures/platonicsolids4}&
\includegraphics[width=2cm]{figures/platonicsolids5} \end{tabular}\\\bigskip
{\small Figure 1. The \emph{platonic solids} as the five regular convex
3-polytopes.} \end{center}  

 The set of all $k$-faces of $P$ is called the \emph{$k$-skeleton} of $P$, written as  $\operatorname{skel}_k(P)$    \begin{center} \includegraphics[width=8cm]{figures/skelcube}\\\bigskip {\small
Figure 2. From left to right, drawn in red: the 0-skeleton, the 1-skeleton and
the 2-skeleton of the cube.} \end{center}  

 A \emph{polytopal complex} is a finite collection of polytopes $P_i$, $1 \leq i \leq n$, for which the intersection of any two polytopes $P_i \cap P_j$ is either empty or a common face of $P_i$ and $P_j$. 

 For every $d$-dimensional polytopal complex the $(d+1)$-tuple, containing its number of $i$-faces in the $i$-th entry is called the \emph{$f$-vector} of the polytopal complex. 

 Every polytope $P$ gives rise to a polytopal complex consisting of all the proper faces of $P$. This polytopal complex is called the \emph{boundary complex $C(\partial P)$ of the polytope $P$}. 

  Figure 2 below shows the boundary complex of the cube. \begin{center}
\includegraphics[width=8cm]{figures/cubecomplex}\\\bigskip {\small Figure 3.
The 3-cube (left) and its boundary complex (right) where the 0-faces shown in
black, the 1-faces dark gray and the 2-faces in light gray.} \end{center}  }


\section{\textcolor{Chapter }{Simplices and simplicial complexes}}\label{sec:simplex}
\logpage{[ 2, 2, 0 ]}
{
 A $d$-dimensional \emph{simplex} or \emph{$d$-simplex} for short is the convex hull of $d+1$ points in $E^d$ in general position. Thus the $d$-simplex is the smallest (with respect to the number of vertices) possible $d$-polytope. Every face of the $d$-simplex is a $m$-simplex, $m \leq d$. 

 A 0-simplex is a point, a $1$-simplex is a line segment, a $2$-simplex is a triangle, a $3$-simplex a tetrahedron, and so on. 

  \begin{center} \includegraphics[width=10cm]{figures/simplices}\\\bigskip
{\small Figure 4. From left to right: a 0-simplex, a 1-simplex, a 2-simplex, a
3-simplex and a Schlegel diagram of a 4-simplex.} \end{center}  

 A polytopal complex which entirely consists of simplices is called a \emph{simplicial complex} (for this it actually suffices that the facets of a polytopal complex are
simplices). 

  \begin{center} \includegraphics[height=4cm]{figures/simplcompl}\\\bigskip
{\small Figure 4. A simplicial complex (left) and a collection of simplices
that does not form a simplicial complex (right).} \end{center}  

 The dimension of a simplicial complex is the maximal dimension of a facet. A
simplicial complex is said to be \emph{pure} if all facets are of the same dimension. A pure simplicial complex of
dimension $d$ satisfies the \emph{pseudomanifold condition} if every $(d-1)$-face is part of exactly two facets. 

 Other properties (faces, facets, etc.) are defined in the same way as for
polytopes and polytopal complexes. 

 }


\section{\textcolor{Chapter }{From geometry to combinatorics}}\label{sec:geomcomb}
\logpage{[ 2, 3, 0 ]}
{
 Every $d$-simplex has an \emph{underlying set} in $E^d$, as the set of all points of that simplex. In the same way one can define the \emph{underlying set} $|C|$ of a simplicial complex $C$. If the underlying set of a simplicial complex $C$ is a topological manifold, then $C$ is called \emph{triangulated manifold} (or \emph{triangulation of $|C|$}). 

 One can also go the other way and assign an abstract simplicial complex (in
form of a \emph{poset}) to a geometrical one by identifying each simplex with its vertex set. This
obviously defines a set of sets with a natural partial ordering given by the
inclusion (a socalled \emph{poset}). 

  \begin{center} \includegraphics[height=3.5cm]{figures/hasse_complex}\quad
\includegraphics[height=3.5cm]{figures/hasse_diagram}\\\bigskip {\small Figure
5. A geometrical simplicial complex (left) and its abstract version in form of
a poset (right).} \end{center}  

 Let $v$ be a vertex of $C$. The set of all facets that contain $v$ is called \emph{star of $v$ in $C$} and is denoted by star$_C(v)$. The subcomplex of star$_C(v)$ that contains all faces that does not contain $v$ is called \emph{link of $v$ in $C$}, written as lk$_C(v)$. 

 A \emph{combinatorial $0$-sphere} is a 0-dimensional simplicial complex consisting only of two (different)
vertices. Let us now come to the notion of a \emph{combinatorial manifold}: 

 A \emph{combinatorial $d$-manifold} is a $d$-dimensional simplicial complex whose vertex links are all combinatorial $(d-1)$-spheres. A \emph{combinatorial pseudomanifold} is a simplicial complex whose vertex links are all combinatorial $(d-1)$-manifolds. 

  \begin{center}
\includegraphics[height=.5\textwidth]{figures/moebius}\\\bigskip {\small
Figure 6. A simplicial complex that is a vertex-minimal combinatorial
triangulation of the torus $T^2$ (so called M\"obius' torus) -- each vertex
link is a hexagon.} \end{center}  

 Note, that every combinatorial manifold is a triangulated manifold. The
opposite is wrong: for example, there exists a triangulation of the $5$-sphere that is not combinatorial, the so called \emph{Edward's sphere}, see \cite{Bjoerner00SimplMnfBistellarFlips}. 

 A combinatorial manifold carries an induced PL-structure and can be understood
in terms of an abstract simplicial complex. If the complex has $d$ vertices there exists a natural embedding of $C$ into the $(d-1)$ simplex and, thus, into $E^{d-1}$. In general, there is no canonical embedding into any lower dimensional
space. However, combinatorial methods allow to examine a given simplicial
complex independently from an embedding and, in particular, independently from
vertex coordinates. 

 Some fundamental properties of an abstract simplicial complex $C$ are the following: 
\begin{description}
\item[{Dimensionality.}] The dimension of $C$.
\item[{$f$, $g$ and $h$-vector.}]  The $f$-vector ($f_k$ equals the number of $k$-faces of a simplicial complex), the $g$- and $h$-vector can be obtained from the $f$-vector via linear transformations.
\item[{Euler characteristic}] The Euler characteristic as the alternating sum over the Betti numbers / the $f$-vector.
\item[{(Co-)Homology.}] The simplicical (co-)homology groups and Betti numbers.
\item[{Connectedness and closeness.}] Whether $C$ is strongly connected, path connected, has a boundary or not.
\item[{Symmetries.}] The automorphism group, i. e. the group of all permutations on the set of
vertex labels that do not change the complex as a whole.
\end{description}
 

 All of those properties and many more can be computed on a strictly
combinatorial basis. }


\section{\textcolor{Chapter }{Normal surfaces and combinatorial slicings}}\label{sec:NormSurfTheory}
\logpage{[ 2, 4, 0 ]}
{
 The intersection of a tetrahedron $\Delta$ with a plane that does not intersect any vertex of $\Delta$ is called a \emph{normal subset} of $\Delta$. A closed $PL$-surface, properly embedded into a combinatorial $3$-manifold $M$, which is equal to a finite union of normal subsets of tetrahedra of $M$ is called \emph{normal surface}. 

  \medskip  Let $M$ be a closed comb. $3$-mfld., $\Delta \in M$ a tetrahedron and $v,w \in V$ two vertices in $M$. A function $f : M \to \mathbb{R} $ with $f|_{\Delta}$ is linear for any $\Delta$ and $f(v) \neq f(w) $ whenever $v \neq w$ is called \emph{regular simplexwise linear (rsl) function} or \emph{simplicial Morse function}. We call a level set $f^{-1} (\alpha)$, $\alpha \in \operatorname{Im}(f) \subset \mathbb{R}$ of an rsl-function that does not hit any vertex on $M$ a \emph{slicing} of $M$. 

  \medskip  See \cite{Kuehnel95TightPolySubm} for an introduction to the theory of polyhedral Morse functions. 

  \begin{center}
\includegraphics[width=.8\textwidth]{figures/haken.pdf}\\\bigskip {\small
Figure 7. The seven different normal subsets of the tetrahedron.} \end{center}  

  \begin{center}
\includegraphics[width=.8\textwidth]{figures/slicing.pdf}\\\bigskip {\small
Figure 8. One dimensional slicing of the $2$-sphere (represented as the
boundary of the $3$-simplex) seen as a level set of a regular point of a
simplicial Morse function.} \end{center}  

  \begin{center}
\includegraphics[width=.4\textwidth]{figures/3x3gridtorus.pdf}\\\bigskip
{\small Figure 9. Handlebody decomposition of genus $1$ of a $6$-vertex
$3$-sphere - a $3 \times 3$-grid torus.} \end{center}  

  \begin{center}
\includegraphics[width=.5\textwidth]{figures/titlepicture.pdf}\\\bigskip
{\small Figure 10. Separating sphere of an $8$-vertex cylinder $S_4^2 \times
[0,1]$ - A cuboctahedron (drawn as a Schlegel diagram of a quadrilateral
face).} \end{center}  }

 }

 
\chapter{\textcolor{Chapter }{The GAP object types SCSimplicicalComplex and SCNormalSurface}}\label{chap:complex}
\logpage{[ 3, 0, 0 ]}
{
  The \textsf{simpcomp} package defines a new GAP object type \texttt{SCSimplicialComplex}, which is used to store simplicial complexes and their properties. As a
property should not be calculated multiple times if the complex was not
altered, \textsf{simpcomp} caches all calculated properties (the ``known properties'') of a simplicial
complex within the \texttt{SCSimplicialComplex} object such that each property is only calculated once (see \texttt{SCForceRecalc} (\ref{SCForceRecalc}) for a way of switching off this behaviour). Internally, this behaviour is
accomplished by making \texttt{SCSimplicialComplex} a subtype of \texttt{SCPropertyObject}, a GAP object type defined by \textsf{simpcomp} that provides the means to store (i.e. cache) certain properties of objects
and also provides means of (de)serializing these objects to and from a XML
format (see section \ref{chap:libio}). 
\section{\textcolor{Chapter }{The object types \texttt{SCSimplicialComplex} and \texttt{SCPropertyObject}}}\label{sec:SCSimplComplObj}
\logpage{[ 3, 1, 0 ]}
{
  The object type \texttt{SCPropertyObject} provides a GAP object consisting of permanent and temporary attributes. While
the permanent attributes are serialized to and from XML (and thus are
persistent), this is not the case for temporary attributes. The permanent and
temporary properties of a \texttt{SCPropertyObject} can be accessed directly with the functions \texttt{SCPropertyByName}, \texttt{SCPropertyTmpByName} and changed with \texttt{SCPropertySet}, \texttt{SCPropertyTmpSet}. But this direct access to property objects is discouraged when working with \textsf{simpcomp}, as the internal consistency of the objects cannot be guaranteed when the
properties of the objects are accessed (and modified) in this way. Instead,
the access to the object properties via so called property handlers is
strongly recommended (and actually the \texttt{SCProperty...}-functions are only meant for internal use). For each property that an object
of type \texttt{SCPropertyObject} can have, a function referred to as property handler ensures the integrity of
the property and handles caching of this property. See section \ref{sec:AcessSC} below for a description of how to access properties of a \texttt{SCSimplicialComplex} object. Note that all properties returned by such property handlers are
immutable objects. You can use \texttt{ShallowCopy} to obtain mutable copies. For a list of properties that \texttt{SCSimplicialComplex} handles, see chapter \ref{chap:scfunc}. For a few fundamental methods and functions (such as checking the object
class, copying objects of this type, etc.) for \texttt{SCSimplcicialComplex} see below. 

\subsection{\textcolor{Chapter }{SCIsSimplicialComplex}}
\logpage{[ 3, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsSimplicialComplex( object )\index{SCIsSimplicialComplex@\texttt{SCIsSimplicialComplex}}
\label{SCIsSimplicialComplex}
}\hfill{\scriptsize (filter)}}\\
\textbf{\indent Returns:\ }
\texttt{true}, if \mbox{\texttt{object}} is of type \texttt{SCSimplicialComplex}, \texttt{false} otherwise.



 Filter for the category of a simplicial complex \texttt{SCSimplicialComplex}. The category \texttt{SCSimplicialComplex} is derived from the category \texttt{SCPropertyObject}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCEmpty();;
   gap> SCIsSimplicialComplex(c);
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCCopy}}
\logpage{[ 3, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCCopy( complex )\index{SCCopy@\texttt{SCCopy}}
\label{SCCopy}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a copy of \mbox{\texttt{complex}} upon success, \texttt{fail} otherwise.



 Makes a ``deep copy'' of \mbox{\texttt{complex}} -- this is a copy such that all properties of the copy can be altered without
changing the original complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;
   gap> d:=SCCopy(c)-1;;
   gap> c.Facets=d.Facets;
   false
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;
   gap> d:=SCCopy(c);;
   gap> IsIdenticalObj(c,d);
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{ShallowCopy (SCSimplicialComplex)}}
\logpage{[ 3, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{ShallowCopy (SCSimplicialComplex)( complex )\index{ShallowCopy (SCSimplicialComplex)@\texttt{ShallowCopy (SCSimplicialComplex)}}
\label{ShallowCopy (SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a copy of \mbox{\texttt{complex}} upon success, \texttt{fail} otherwise.



 Makes a copy of \mbox{\texttt{complex}}. This is actually a ``deep copy'' such that all properties of the copy can be
altered without changing the original complex. Internally calls \texttt{SCCopy} (\ref{SCCopy}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCLib.Load(87);;
   gap> d:=ShallowCopy(c)+10;;
   gap> c.Facets=d.Facets;
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCForceRecalc}}
\logpage{[ 3, 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCForceRecalc( complex, flag )\index{SCForceRecalc@\texttt{SCForceRecalc}}
\label{SCForceRecalc}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\mbox{\texttt{true}} upon success, \texttt{fail} otherwise.



 An object of the type \texttt{SCSimplicialComplex} normally caches its previously calculated properties such that each property
only has to be calculated once. With this function this behaviour can be
changed, if \mbox{\texttt{flag}} equals \texttt{true}, caching is turned off, for \mbox{\texttt{flag}} equals \texttt{false}, caching is turned on. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets(Combinations([1..16],15));;
   gap> c.F;; time;
   2000
   gap> c.F;; time;
   0
   gap> SCForceRecalc(c,true);
   true
   gap> c.F;; time;
   2036
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Accessing properties of a \texttt{SCSimplicialComplex} object}}\label{sec:AcessSC}
\logpage{[ 3, 2, 0 ]}
{
  As described in section \ref{sec:SCSimplComplObj} the object type \texttt{SCSimplicialComplex} has properties that are handled by so called property handlers. These handlers
take care of the internal consistency of objects of type \texttt{SCSimplicialComplex} and (re)compute necessary object attributes if necessary. There are two ways
of accessing properties of a \texttt{SCSimplicialComplex} object. The first is to call a property handler function of the property one
wishes to calculate directly. The first argument of such a property handler
function is always the simplicial complex for which the property should be
calculated, optionally followed by further arguments of the property handler
function. An example would be: 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> c:=SCBdSimplex(3);; # create a simplicial complex object
  gap> SCFVector(c);
  [ 4, 6, 4 ]
  gap> SCSkel(c,0);
  [ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ]
\end{Verbatim}
 Here the functions \texttt{SCFVector} and \texttt{SCSkel} are the property handler functions, see chapter \ref{chap:prophandler} for a list of all property handlers of a \texttt{SCSimplicialComplex} object. Apart from this (standard) method of calling the property handlers
directly with a \texttt{SCSimplicialComplex} object, \textsf{simpcomp} provides the user with another more object oriented method of calling property
handlers of a \texttt{SCSimplicialComplex} object inderectly and more conveniently: 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> c:=SCBdSimplex(3);; # create a simplicial complex object
  gap> c.F;
  [ 4, 6, 4 ]
  gap> c.Skel(0);
  [ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ]
\end{Verbatim}
 Note that the code in this example calculates the same properties as in the
first example above, but the properties of a \texttt{SCSimplicialComplex} object are accessed via the \texttt{.} operator (the record access operator). As GAP lacks object orientation, this
behaviour is internally accomplished via a helper function (that calls the
property handlers), such that accessing properties in this (indirect) way is a
tiny bit slower than with the direct method described above. But this tiny
drawback in speed is traded for a great deal of less and easier things that
have to be typed (also note that \texttt{c.F} is accessed like a list, although internally the property handler function is
called). If one is interested in utmost efficiency one must either use the
direct calling method of property handlers or use a software package that is
optimized for performance, such as polymake \cite{Joswig00Polymake}. For each property handler of a \texttt{SCSimplicialComplex} object the short object oriented form of this property handler is given in the
description of the property handler function. In most cases it is just formed
by dropping the prefix ``\texttt{SC}'' of the property handler functions. }

 
\section{\textcolor{Chapter }{Overloaded operators of \texttt{SCSimplicialComplex}}}\logpage{[ 3, 3, 0 ]}
{
 \textsf{simpcomp} overloads some standard operations for the object type \texttt{SCSimplcicialComplex} if this definition is intuitive and mathematically sound. See a list of
overloaded operators below.  

\subsection{\textcolor{Chapter }{Operation + (SCSimplicialComplex, Integer)}}
\logpage{[ 3, 3, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation + (SCSimplicialComplex, Integer)( complex, value )\index{Operation + (SCSimplicialComplex, Integer)@\texttt{Operation + (SCSimplicialComplex, Integer)}}
\label{Operation + (SCSimplicialComplex, Integer)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
the simplicial complex passed as argument upon success, \texttt{fail} otherwise.



 Positively shifts the vertex labels of \mbox{\texttt{complex}} by the amount specified in \mbox{\texttt{value}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3)+10;;
   gap> c.Facets;
   [[11, 12, 13], [11, 12, 14], [11, 13, 14], [12, 13, 14]]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation - (SCSimplicialComplex, Integer)}}
\logpage{[ 3, 3, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation - (SCSimplicialComplex, Integer)( complex, value )\index{Operation - (SCSimplicialComplex, Integer)@\texttt{Operation - (SCSimplicialComplex, Integer)}}
\label{Operation - (SCSimplicialComplex, Integer)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
the simplicial complex passed as argument unpon success, \texttt{fail} otherwise.



 Negatively shifts the vertex labels of \mbox{\texttt{complex}} by the amount specified in \mbox{\texttt{value}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3)-1;;
   gap> c.Facets;
   [[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation mod (SCSimplicialComplex, Integer)}}
\logpage{[ 3, 3, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation mod (SCSimplicialComplex, Integer)( complex, value )\index{Operation mod (SCSimplicialComplex, Integer)@\texttt{Operation mod (SCSimplicialComplex, Integer)}}
\label{Operation mod (SCSimplicialComplex, Integer)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
the simplicial complex passed as argument unpon success, \texttt{fail} otherwise.



 Takes all vertex labels of \mbox{\texttt{complex}} modulo the value specified in \mbox{\texttt{value}}. Warning: this might result in different vertices being assigned the same
label, so be careful. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=(SCBdSimplex(3)*10) mod 7;;
   gap> c.Facets;
   [[3, 6, 2], [3, 6, 5], [3, 2, 5], [6, 2, 5]]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation {\^{}} (SCSimplicialComplex, Integer)}}
\logpage{[ 3, 3, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation {\^{}} (SCSimplicialComplex, Integer)( complex, value )\index{Operation ^ (SCSimplicialComplex, Integer)@\texttt{Operation {\^{}} (SCSimplicialComplex, Integer)}}
\label{Operation ^ (SCSimplicialComplex, Integer)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Forms the \mbox{\texttt{value}}-th cartesian power of \mbox{\texttt{complex}}, i.e. the \mbox{\texttt{value}}-fold cartesian product of copies of \mbox{\texttt{complex}}. The complex passed as argument is not altered. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(2)^2; #a torus
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, TopologicalType, VertexLabels.
   
    Name="(S^1_3)^2"
    Dim=2
    TopologicalType="(S^1)^2"
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation + (SCSimplicialComplex, SCSimplicialComplex)}}
\logpage{[ 3, 3, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation + (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 )\index{Operation + (SCSimplicialComplex, SCSimplicialComplex)@\texttt{Operation + (SCSimplicialComplex, SCSimplicialComplex)}}
\label{Operation + (SCSimplicialComplex, SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Forms the connected sum of \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}}. Currently uses the lexicographically first facets of both complex to do the
gluing. The complexes passed as arguments are not altered. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^3");
   [ [ 45, "RP^3" ], [ 103, "RP^3=L(2,1) (VT)" ], [ 246, "(S^2~S^1)#RP^3" ], 
     [ 247, "(S^2xS^1)#RP^3" ], [ 283, "(S^2~S^1)#2#RP^3" ], 
     [ 285, "(S^2xS^1)#2#RP^3" ], [ 409, "RP^3#RP^3" ], ...
   gap> SCLib.SearchByName("S^2~S^1");
   [ [ 14, "S^2~S^1 (VT)" ], [ 29, "S^2~S^1 (VT)" ], [ 34, "S^2~S^1 (VT)" ], 
     [ 42, "S^2~S^1 (VT)" ], [ 48, "S^2~S^1 (VT)" ], [ 49, "S^2~S^1 (VT)" ], 
     [ 84, "S^2~S^1 (VT)" ], [ 87, "S^2~S^1 (VT)" ], ...
   gap> c:=SCLib.Load(45)+SCLib.Load(14); #form RP^3#(S^2~S^1)
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels, Vertices.
   
    Name="RP^3#+-S^2~S^1 (VT)"
    Dim=3
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation - (SCSimplicialComplex, SCSimplicialComplex)}}
\logpage{[ 3, 3, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation - (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 )\index{Operation - (SCSimplicialComplex, SCSimplicialComplex)@\texttt{Operation - (SCSimplicialComplex, SCSimplicialComplex)}}
\label{Operation - (SCSimplicialComplex, SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Calls \texttt{SCDifference} (\ref{SCDifference})(\mbox{\texttt{complex1}}, \mbox{\texttt{complex2}}) }

 

\subsection{\textcolor{Chapter }{Operation * (SCSimplicialComplex, SCSimplicialComplex)}}
\logpage{[ 3, 3, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation * (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 )\index{Operation * (SCSimplicialComplex, SCSimplicialComplex)@\texttt{Operation * (SCSimplicialComplex, SCSimplicialComplex)}}
\label{Operation * (SCSimplicialComplex, SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Forms the cartesian product of \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^2");
   [ [ 3, "RP^2 (VT)" ], [ 284, "RP^2xS^1" ] ]
   gap> c:=SCLib.Load(3)*SCBdSimplex(3); #form RP^2 x S^2
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="RP^2 (VT)xS^2_4"
    Dim=4
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation = (SCSimplicialComplex, SCSimplicialComplex)}}
\logpage{[ 3, 3, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation = (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 )\index{Operation = (SCSimplicialComplex, SCSimplicialComplex)@\texttt{Operation = (SCSimplicialComplex, SCSimplicialComplex)}}
\label{Operation = (SCSimplicialComplex, SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false} upon success, \texttt{fail} otherwise.



 Calculates whether two simplicial complexes are equal, i.e. have equal facet
sets in standard labeling. Returns \texttt{true} if the facet sets in standard labeling are equal as sets, \texttt{false} otherwise. Note: this check only compares the facet lists in standard
labeling. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> c=c+10;
   true
   gap> c=SCBdCrossPolytope(4);
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation Union (SCSimplicialComplex, SCSimplicialComplex)}}
\logpage{[ 3, 3, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation Union (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 )\index{Operation Union (SCSimplicialComplex, SCSimplicialComplex)@\texttt{Operation Union (SCSimplicialComplex, SCSimplicialComplex)}}
\label{Operation Union (SCSimplicialComplex, SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Computes the union of two simplicial complexes by calling \texttt{SCUnion} (\ref{SCUnion}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=Union(SCBdSimplex(3),SCBdSimplex(3)+3); #a wedge of two 2-spheres
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="S^2_4 cup S^2_4"
    Dim=2
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation Difference (SCSimplicialComplex, SCSimplicialComplex)}}
\logpage{[ 3, 3, 10 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation Difference (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 )\index{Operation Difference (SCSimplicialComplex, SCSimplicialComplex)@\texttt{Operation Difference (SCSimplicialComplex, SCSimplicialComplex)}}
\label{Operation Difference (SCSimplicialComplex, SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Computes the ``difference'' of two simplicial complexes by calling \texttt{SCDifference} (\ref{SCDifference}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> d:=SC([[1,2,3]]);;
   gap> disc:=Difference(c,d);;
   gap> disc.Facets;
   [ [ 1, 2, 4 ], [ 1, 3, 4 ], [ 2, 3, 4 ] ]
   gap> empty:=Difference(d,c);;
   gap> empty.Dim;
   -1
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation Intersection (SCSimplicialComplex, SCSimplicialComplex)}}
\logpage{[ 3, 3, 11 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation Intersection (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 )\index{Operation Intersection (SCSimplicialComplex, SCSimplicialComplex)@\texttt{Operation Intersection (SCSimplicialComplex, SCSimplicialComplex)}}
\label{Operation Intersection (SCSimplicialComplex, SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Computes the ``intersection'' of two simplicial complexes by calling \texttt{SCIntersection} (\ref{SCIntersection}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;        
   gap> d:=SCBdSimplex(3);;        
   gap> d:=SCMove(d,[[1,2,3],[]]);;
   gap> d:=d+1;;                   
   gap> s1:=SCIntersection(c,d);   
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="S^2_4 cap unnamed complex n"
    Dim=1
   
   /SimplicialComplex]
   gap> s1.Facets;                 
   [ [ 2, 3 ], [ 2, 4 ], [ 3, 4 ] ]
   gap> 
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{\texttt{SCSimplicialComplex} as a subtype of \texttt{Set}}}\label{sec:SubtypeOfSet}
\logpage{[ 3, 4, 0 ]}
{
  Apart from being a subtype of \texttt{SCPropertyObject}, an object of type \texttt{SCSimplicialComplex} also behaves like a GAP \texttt{Set} type. The elements of the set are given by the facets of the simplical
complex, grouped by their dimensionality, i.e. if \texttt{complex} is an object of type \texttt{SCSimplicialComplex}, \texttt{c[1]} refers to the 0-faces of \texttt{complex}, \texttt{c[2]} to the 1-faces, etc. 

\subsection{\textcolor{Chapter }{Size (SCSimplicialComplex)}}
\logpage{[ 3, 4, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Size (SCSimplicialComplex)( complex )\index{Size (SCSimplicialComplex)@\texttt{Size (SCSimplicialComplex)}}
\label{Size (SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
an integer upon success, \texttt{fail} otherwise.



 Returns the ``size'' of a simplicial complex. This is $d+1$, where $d$ is the dimension of the complex. $d+1$ is returned instead of $d$, as all lists in GAP are indexed beginning with 1 -- thus this also holds for
all the face lattice related properties of the complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByAttribute("F=·[12,66,108,54]");
   [ [ 116, "S^2xS^1 (VT)" ], [ 117, "S^2xS^1 (VT)" ], 
     [ 118, "(S^2xS^1)#(S^2xS^1) (VT)" ], [ 119, "S^2~S^1 (VT)" ], 
     [ 120, "(S^2xS^1)#(S^2xS^1) (VT)" ], [ 121, "(S^2xS^1)#(S^2xS^1) (VT)" ], 
     [ 122, "S^2xS^1 (VT)" ], [ 123, "(S^2xS^1)#(S^2xS^1) (VT)" ], ...
   gap> c:=SCLib.Load(116);;
   gap> for i in [1..Size(c)] do Print(c.F[i],"\n"); od;
   12
   66
   108
   54
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Length (SCSimplicialComplex)}}
\logpage{[ 3, 4, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Length (SCSimplicialComplex)( complex )\index{Length (SCSimplicialComplex)@\texttt{Length (SCSimplicialComplex)}}
\label{Length (SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
an integer upon success, \texttt{fail} otherwise.



 Returns the ``size'' of a simplicial complex by calling \texttt{Size(}\mbox{\texttt{complex}}\texttt{)}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByAttribute("F=¸[12,66,108,54]");
   [ [ 116, "Sˆ2xSˆ1 (VT)" ], [ 117, "Sˆ2xSˆ1 (VT)" ],
   [ 118, "(Sˆ2xSˆ1)#(Sˆ2xSˆ1) (VT)" ], [ 119, "Sˆ2˜Sˆ1 (VT)" ],
   [ 120, "(Sˆ2xSˆ1)#(Sˆ2xSˆ1) (VT)" ], [ 121, "(Sˆ2xSˆ1)#(Sˆ2xSˆ1) (VT)" ],
   [ 122, "Sˆ2xSˆ1 (VT)" ], [ 123, "(Sˆ2xSˆ1)#(Sˆ2xSˆ1) (VT)" ], ...
   gap> c:=SCLib.Load(116);;
   gap> for i in [1..Length(c)] do Print(c.F[i],"\n"); od;
   12
   66
   108
   54
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation [] (SCSimplicialComplex)}}
\logpage{[ 3, 4, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation [] (SCSimplicialComplex)( complex, pos )\index{Operation [] (SCSimplicialComplex)@\texttt{Operation [] (SCSimplicialComplex)}}
\label{Operation [] (SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a list of faces upon success, \texttt{fail} otherwise.



 Returns the $(pos-1)$-dimensional faces of \mbox{\texttt{complex}} as list. If $pos \leq 0$ or $pos \geq d+2$, where $d$ is the dimension of \mbox{\texttt{complex}}, the empty set is returned. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("K^2");
   [ [ 19, "K^2 (VT)" ], [ 230, "K^2 (VT)" ] ]
   gap> c:=SCLib.Load(230);;
   gap> c[2];
   [ [ 1, 2 ], [ 1, 3 ], [ 1, 7 ], [ 1, 9 ], [ 1, 13 ], [ 1, 14 ], [ 2, 3 ], 
     [ 2, 4 ], [ 2, 8 ], [ 2, 10 ], [ 2, 14 ], [ 3, 4 ], [ 3, 5 ], [ 3, 9 ], 
     [ 3, 11 ], [ 4, 5 ], [ 4, 6 ], [ 4, 10 ], [ 4, 12 ], [ 5, 6 ], [ 5, 7 ], 
     [ 5, 11 ], [ 5, 13 ], [ 6, 7 ], [ 6, 8 ], [ 6, 12 ], [ 6, 14 ], [ 7, 8 ], 
     [ 7, 9 ], [ 7, 13 ], [ 8, 9 ], [ 8, 10 ], [ 8, 14 ], [ 9, 10 ], [ 9, 11 ], 
     [ 10, 11 ], [ 10, 12 ], [ 11, 12 ], [ 11, 13 ], [ 12, 13 ], [ 12, 14 ], 
     [ 13, 14 ] ]
   gap> c[4];
   [  ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{IsBound (SCSimplicialComplex)}}
\logpage{[ 3, 4, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IsBound (SCSimplicialComplex)( complex, pos )\index{IsBound (SCSimplicialComplex)@\texttt{IsBound (SCSimplicialComplex)}}
\label{IsBound (SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} or \texttt{false} upon success, \texttt{fail} otherwise.



 Returns \texttt{true} when \mbox{\texttt{complex}} has proper faces of dimension $(pos-1)$, \texttt{false} otherwise. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(4);;
   gap> IsBound(c[4]);
   true
   gap> IsBound(c[5]);
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Iterator (SCSimplicialComplex)}}
\logpage{[ 3, 4, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Iterator (SCSimplicialComplex)( complex )\index{Iterator (SCSimplicialComplex)@\texttt{Iterator (SCSimplicialComplex)}}
\label{Iterator (SCSimplicialComplex)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
an iterator on the face lattice of \mbox{\texttt{complex}} upon success, \texttt{fail} otherwise.



 Provides an iterator object for the face lattice of a simplicial complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(4);;
   gap> for faces in c do Print(Length(faces),"\n"); od;
   8
   24
   32
   16
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{The object types \texttt{SCNormalSurface} as asubtyope of \texttt{SCPropertyObject}}}\label{sec:NormSurf}
\logpage{[ 3, 5, 0 ]}
{
  The \textsf{simpcomp} package defines a GAP object type \texttt{SCNormalSurface} to describe normal surfaces / slicings (level sets of discrete Morse
functions) in combinatorial $3$-manifolds. Internally \texttt{SCNormalSurface} is a subtype of \texttt{SCPropertyObject} and, thus, mostly behaves like a \texttt{SCSimplicialComplex} object (see section \ref{sec:SCSimplComplObj}). For a very short introduction to normal surfaces see \ref{sec:NormSurfTheory}, for some fundamental methods and functions for \texttt{SCNormalSurface} see below. }

 
\section{\textcolor{Chapter }{Overloaded operators of \texttt{SCNormalSurface}}}\logpage{[ 3, 6, 0 ]}
{
  As with the object type \texttt{SCSimplcicialComplex}, \textsf{simpcomp} overloads some standard operations for the object type \texttt{SCNormalSurface}. See a list of overloaded operators below. 

\subsection{\textcolor{Chapter }{Operation + (SCNormalSurface, Integer)}}
\logpage{[ 3, 6, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation + (SCNormalSurface, Integer)( complex, value )\index{Operation + (SCNormalSurface, Integer)@\texttt{Operation + (SCNormalSurface, Integer)}}
\label{Operation + (SCNormalSurface, Integer)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
the normal surface passed as argument upon success, \texttt{fail} otherwise.



 Positively shifts the vertex labels of \mbox{\texttt{complex}} by the amount specified in \mbox{\texttt{value}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> ns:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);;
   gap> ns.Facets;                                    
   [ [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ] ], [ [ 1, 2 ], [ 1, 3 ], [ 1, 5 ] ], 
     [ [ 1, 2 ], [ 1, 4 ], [ 1, 5 ] ], [ [ 1, 3 ], [ 1, 4 ], [ 1, 5 ] ] ]
   gap> ns:=ns + 2;;                                  
   gap> ns.Facets;  
   [ [ [ 3, 4 ], [ 3, 5 ], [ 3, 6 ] ], [ [ 3, 4 ], [ 3, 5 ], [ 3, 7 ] ], 
     [ [ 3, 4 ], [ 3, 6 ], [ 3, 7 ] ], [ [ 3, 5 ], [ 3, 6 ], [ 3, 7 ] ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation - (SCNormalSurface, Integer)}}
\logpage{[ 3, 6, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation - (SCNormalSurface, Integer)( complex, value )\index{Operation - (SCNormalSurface, Integer)@\texttt{Operation - (SCNormalSurface, Integer)}}
\label{Operation - (SCNormalSurface, Integer)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
the normal surface passed as argument unpon success, \texttt{fail} otherwise.



 Negatively shifts the vertex labels of \mbox{\texttt{complex}} by the amount specified in \mbox{\texttt{value}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> ns:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);;
   gap> ns.Facets;                                    
   [ [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ] ], [ [ 1, 2 ], [ 1, 3 ], [ 1, 5 ] ], 
     [ [ 1, 2 ], [ 1, 4 ], [ 1, 5 ] ], [ [ 1, 3 ], [ 1, 4 ], [ 1, 5 ] ] ]
   gap> ns:=ns - 2;;                                  
   gap> ns.Facets;  
   [ [ [ -1, 0 ], [ -1, 1 ], [ -1, 2 ] ], [ [ -1, 0 ], [ -1, 1 ], [ -1, 3 ] ], 
     [ [ -1, 0 ], [ -1, 2 ], [ -1, 3 ] ], [ [ -1, 1 ], [ -1, 2 ], [ -1, 3 ] ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation mod (SCNormalSurface, Integer)}}
\logpage{[ 3, 6, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation mod (SCNormalSurface, Integer)( complex, value )\index{Operation mod (SCNormalSurface, Integer)@\texttt{Operation mod (SCNormalSurface, Integer)}}
\label{Operation mod (SCNormalSurface, Integer)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
the normal surface passed as argument unpon success, \texttt{fail} otherwise.



 Takes all vertex labels of \mbox{\texttt{complex}} modulo the value specified in \mbox{\texttt{value}}. Warning: this might result in different vertices being assigned the same
label, so be careful. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> ns:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);;    
   gap> ns.Facets;
   [ [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ] ], [ [ 1, 2 ], [ 1, 3 ], [ 1, 5 ] ], 
     [ [ 1, 2 ], [ 1, 4 ], [ 1, 5 ] ], [ [ 1, 3 ], [ 1, 4 ], [ 1, 5 ] ] ]
   gap> ns:=ns mod 2;;
   gap> ns.Facets;    
   [ [ [ 1, 0 ], [ 1, 1 ], [ 1, 0 ] ], [ [ 1, 0 ], [ 1, 1 ], [ 1, 1 ] ], 
     [ [ 1, 0 ], [ 1, 0 ], [ 1, 1 ] ], [ [ 1, 1 ], [ 1, 0 ], [ 1, 1 ] ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation = (SCNormalSurface, SCNormalSurface)}}
\logpage{[ 3, 6, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation = (SCNormalSurface, SCNormalSurface)( complex1, complex2 )\index{Operation = (SCNormalSurface, SCNormalSurface)@\texttt{Operation = (SCNormalSurface, SCNormalSurface)}}
\label{Operation = (SCNormalSurface, SCNormalSurface)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false} upon success, \texttt{fail} otherwise.



 Calculates whether two normal surface are equal, i.e. have equal facet sets in
standard labeling. Returns \texttt{true} if the facet sets in standard labeling are equal as sets, \texttt{false} otherwise. Note: this check only compares the facet lists in standard
labeling. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> ns:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);;
   gap> ns1:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);;
   gap> ns2:=SCNSSlicing(SCBdSimplex(4),[[2],[1,3,4,5]]);;   
   gap> ns1=ns2;
   true
   gap> ns2:=SCNSSlicing(SCBdSimplex(4),[[1,2],[3,4,5]]);;  
   gap> ns1=ns2;                                          
   false
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{Operation Union (SCNormalSurface, SCNormalSurface)}}
\logpage{[ 3, 6, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{Operation Union (SCNormalSurface, SCNormalSurface)( complex1, complex2 )\index{Operation Union (SCNormalSurface, SCNormalSurface)@\texttt{Operation Union (SCNormalSurface, SCNormalSurface)}}
\label{Operation Union (SCNormalSurface, SCNormalSurface)}
}\hfill{\scriptsize (operation)}}\\
\textbf{\indent Returns:\ }
a new normnal surface upon success, \texttt{fail} otherwise.



 Computes the union of two normal surfaces by calling \texttt{SCUnion} (\ref{SCUnion}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByAttribute("F=[6,15,18,9]");
   [ [ 4, "S^3 (VT)" ] ]
   gap> c:=SCLib.Load(4);;
   gap> ns1:=SCNSSlicing(c,[[1,3,5],[2,4,6]]);;
   gap> ns2:=SCNSSlicing(c,[[1,3,5],[2,4,6]])+10;;
   gap> SCNSTopologicalType(ns1);
   "T^2"
   gap> SCNSTopologicalType(ns2);
   "T^2"
   gap> ns3:=Union(ns1,ns2);;
   gap> SCNSTopologicalType(ns3);
   "T^2 U T^2"
   gap> 
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{\texttt{SCNormalSurface} as a subtype of \texttt{Set}}}\logpage{[ 3, 7, 0 ]}
{
  Like objects of type \texttt{SCSimplicialComplex}, an object of type \texttt{SCNormalSurface} behaves like a GAP \texttt{Set} type. The elements of the set are given by the facets of the normal surface,
grouped by their dimensionality and type, i.e. if \texttt{complex} is an object of type \texttt{SCNormalSurface}, \texttt{c[1]} refers to the 0-faces of \texttt{complex}, \texttt{c[2]} to the 1-faces, \texttt{c[3]} to the triangles and \texttt{c[4]} to the quadrilaterals. See section \ref{sec:SubtypeOfSet} for details. }

 }


\chapter{\textcolor{Chapter }{Functions for simplicial complexes}}\label{chap:scfunc}
\logpage{[ 4, 0, 0 ]}
{
 
\section{\textcolor{Chapter }{Creating an \texttt{SCSimplicialComplex} object from a facet list}}\logpage{[ 4, 1, 0 ]}
{
  This section contains functions to generate or to construct new simplicial
complexes. Some of them obtain new complexes from existing ones, some generate
new complexes. 

\subsection{\textcolor{Chapter }{SCFromFacets}}
\logpage{[ 4, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFromFacets( facets )\index{SCFromFacets@\texttt{SCFromFacets}}
\label{SCFromFacets}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
simplicial complex of type \texttt{SCSimplicialComplex} upon success, fail otherwise.



 Constructs a simplicial complex object from the given facet list. The facet
list \mbox{\texttt{facets}} has to be a duplicate free list (or set) which consists of duplicate free
entries, which are in turn lists or sets. Any vertex labeling can be used,
even sets as vertex labels are allowed. Internally the vertices are mapped to
the standard labeling $1..N$, where $N$ is the number of vertices of the complex, but the vertex labels of the
original complex are stored in the property ''VertexLabels'', see \texttt{SCLabels} (\ref{SCLabels}) and the \texttt{SCRelabel..} functions like \texttt{SCRelabel} (\ref{SCRelabel}) or \texttt{SCRelabelStandard} (\ref{SCRelabelStandard}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets([[1,2,5], [1,4,5], [1,4,6], [2,3,5], 
                         [3,4,6], [3,5,6]]);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="unnamed complex n"
    Dim=2
   
   /SimplicialComplex]
   gap> c:=SCFromFacets([["a","d","e"], ["a","b","e"], ["b","c","e"],
                         ["c","e","f"], ["c","d","f"], ["a", "d", "f"]]);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="unnamed complex n"
    Dim=2
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SC}}
\logpage{[ 4, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SC( facets )\index{SC@\texttt{SC}}
\label{SC}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
simplicial complex of type SCSimplicialComplex upon success, fail otherwise.



 A shorter function to create a simplicial complex from a facet list, just
calls \texttt{SCFromFacets} (\ref{SCFromFacets})(\mbox{\texttt{facets}}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC(Combinations([1..6],5));
   [SimplicialComplex
   
    Properties known: Dim, Facets, VertexLabels.
  
    Name="unnamed complex n"
    Dim=4
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFromDifferenceCycles}}
\logpage{[ 4, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFromDifferenceCycles( diffcycles )\index{SCFromDifferenceCycles@\texttt{SCFromDifferenceCycles}}
\label{SCFromDifferenceCycles}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a simplicial complex upon success, \texttt{fail} otherwise.



 Creates a simplicial complex object from the list of difference cycles
provided. If \mbox{\texttt{diffcycles}} is of length $1$ the computation is equivalent to the one in \texttt{SCDifferenceCycleExpand} (\ref{SCDifferenceCycleExpand}). Otherwise the induced modulus of all cycles has to be equal and the union of
all expanded difference cycles is returned. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromDifferenceCycles([[1,1,6],[2,3,3]]);;
   gap> c.F;
   [ 8, 24, 16 ]
   gap> c.Homology;
   [ [ 0, [  ] ], [ 2, [  ] ], [ 1, [  ] ] ]
   gap> c.Chi;
   0
   gap> c.HasBoundary;
   false
   gap> SCIsPseudoManifold(c);
   true
   gap> SCIsManifold(c);
   #I  SCIsManifold: link is sphere.
   #I  SCIsManifold: transitive automorphism group, checking only one link.
   true
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFromGenerators}}
\logpage{[ 4, 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFromGenerators( group, generators )\index{SCFromGenerators@\texttt{SCFromGenerators}}
\label{SCFromGenerators}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
simplicial complex of type \texttt{SCSimplicialComplex} upon success, fail otherwise.



 Constructs a simplicial complex object from the set of \mbox{\texttt{generators}} on which the group \mbox{\texttt{group}} acts, i.e. a complex which has \mbox{\texttt{group}} as automorphism group that consists of the orbits specified by the list of
representatives passed in \mbox{\texttt{generators}}. Internally calls \texttt{SCFromFacets} (\ref{SCFromFacets}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> #group: (C7 : C3) : C2, order 42
   gap> G:=Group([(2,6,5,7,3,4),(1,3,5,7,2,4,6)]);;
   gap> c:=SCFromGenerators(G,[[ 1, 2, 4 ]]);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="unnamed complex n"
    Dim=2
   
   /SimplicialComplex]
   gap> SCLib.DetermineTopologicalType(c);
   [ [ true, 5 ] ]
   gap> # a torus
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Generating some standard triangulations}}\logpage{[ 4, 2, 0 ]}
{
  

\subsection{\textcolor{Chapter }{SCBdCrossPolytope}}
\logpage{[ 4, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCBdCrossPolytope( dim )\index{SCBdCrossPolytope@\texttt{SCBdCrossPolytope}}
\label{SCBdCrossPolytope}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 Generates the boundary of the $dim$-dimensional cross polytope $\beta^{d}$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCBdCrossPolytope(3); # the octahedron
   [SimplicialComplex
   
    Properties known: Chi, Dim, F, Facets, HasBoundary, Homology, IsConnected, 
                      IsStronglyConnected, Name, TopologicalType, VertexLabels.
   
    Name="Bd(\beta^3)"
    Dim=2
    Chi=2
    F=[ 6, 12, 8 ]
    Homology=[ [ 0, [ ] ], [ 0, [ ] ], [ 1, [ ] ] ]
    IsConnected=true
   IsStronglyConnected=true
    TopologicalType="S^2"
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCBdSimplex}}
\logpage{[ 4, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCBdSimplex( dim )\index{SCBdSimplex@\texttt{SCBdSimplex}}
\label{SCBdSimplex}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 Generates the boundary of the $d$-simplex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCBdSimplex(5);
   [SimplicialComplex
   
    Properties known: AutomorphismGroup, AutomorphismGroupOrder, 
                      AutomorphismGroupStructure, AutomorphismGroupTransitivity, 
                      Chi, Dim, F, Facets, Generators, HasBoundary, Homology, 
                      IsConnected, IsStronglyConnected, Name, TopologicalType, 
                      VertexLabels.
   
    Name="S^4_6"
    Dim=4
    AutomorphismGroupStructure="S6"
    AutomorphismGroupTransitivity=6
    Chi=2
    F=[ 6, 15, 20, 15, 6 ]
    Homology=[ [ 0, [ ] ], [ 0, [ ] ], [ 0, [ ] ], [ 0, [ ] ], [ 1, [ ] ] ]
    IsConnected=true
    IsStronglyConnected=true
    TopologicalType="S^4"
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCEmpty}}
\logpage{[ 4, 2, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCEmpty(  )\index{SCEmpty@\texttt{SCEmpty}}
\label{SCEmpty}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 simplicial complex with empty facet list upon success, \texttt{fail} otherwise.



 Generates an empty complex (of dimension $-1$). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCEmpty();
   [SimplicialComplex
   
    Properties known: Dim, Faces, Facets, Name, VertexLabels.
   
    Name="empty complex"
    Dim=-1
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCSimplex}}
\logpage{[ 4, 2, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCSimplex( dim )\index{SCSimplex@\texttt{SCSimplex}}
\label{SCSimplex}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 Generates the \mbox{\texttt{dim}}-simplex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCSimplex(3);
   [SimplicialComplex
   
    Properties known: Chi, Dim, Facets, Name, TopologicalType, VertexLabels.
   
    Name="B^3_4"
    Dim=3
    Chi=1
    TopologicalType="B^3"
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Generating new complexes from old}}\logpage{[ 4, 3, 0 ]}
{
  

\subsection{\textcolor{Chapter }{SCCartesianPower}}
\logpage{[ 4, 3, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCCartesianPower( complex, n )\index{SCCartesianPower@\texttt{SCCartesianPower}}
\label{SCCartesianPower}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 The new complex is $PL$-homeomorphic to $n$-times the cartesian product of \mbox{\texttt{complex}}, of dimensions $n \cdot \dim$ and has $f_{\dim}^n \cdot n \cdot \frac{2n-1}{2^{n-1}}!$ facets where $\dim$ denotes the dimension of \mbox{\texttt{complex}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(2);;
   gap> 4torus:=SCCartesianPower(c,4);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, TopologicalType, VertexLabels.
   
    Name="(S^1_3)^4"
    Dim=4
    TopologicalType="(S^1)^4"
   
   /SimplicialComplex]
   gap> 4torus.Homology;
   [ [ 0, [  ] ], [ 4, [  ] ], [ 6, [  ] ], [ 4, [  ] ], [ 1, [  ] ] ]
   gap> 4torus.Chi;
   0
   gap> 4torus.F;
   [ 81, 1215, 4050, 4860, 1944 ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCCartesianProduct}}
\logpage{[ 4, 3, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCCartesianProduct( complex1, complex2 )\index{SCCartesianProduct@\texttt{SCCartesianProduct}}
\label{SCCartesianProduct}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 Computes the simplicial cartesian product of \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} where \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} are pure, simplicial complexes. The original vertex labeling of \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} is changed into the standard one. The new complex has vertex labels of type $[v_i, v_j]$ where $v_i$ is a vertex of \mbox{\texttt{complex1}} and $v_j$ is a vertex of \mbox{\texttt{complex2}}.

 If $n_i$, $i=1,2$ are the number facets and if $d_i$, $i=1,2$ are the dimensions of \mbox{\texttt{complexi}}, then the new complex has $n_1 \cdot n_2 \cdot { d_1+d_2 \choose d_1}$ facets. The number of vertices of the new complex equals the product of the
numbers of vertices of the arguments. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c1:=SCBdSimplex(2);;
   gap> c2:=SCBdSimplex(3);;
   gap> c3:=SCCartesianProduct(c1,c2);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, TopologicalType, VertexLabels.
   
    Name="S^1_3xS^2_4"
    Dim=3
    TopologicalType="S^1xS^2"
   
   /SimplicialComplex]
   gap> c3.Homology;
   [ [ 0, [  ] ], [ 1, [  ] ], [ 1, [  ] ], [ 1, [  ] ] ]
   gap> c3.F;
   [ 12, 48, 72, 36 ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCConnectedComponents}}
\logpage{[ 4, 3, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCConnectedComponents( complex )\index{SCConnectedComponents@\texttt{SCConnectedComponents}}
\label{SCConnectedComponents}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of simplicial complexes upon success, \texttt{fail} otherwise.



 Computes all connected components of an arbitrary simplicial complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,3],[3,4,5],[4,5,6,7,8]]);;
   gap> SCRename(c,"connected complex");;
   gap> SCConnectedComponents(c);
   [ [SimplicialComplex
   
        Properties known: Dim, Facets, Name, VertexLabels.
   
        Name="Connected component #1 of connected complex"
        Dim=4
   
       /SimplicialComplex] ]
   gap> c:=SC([[1,2,3],[4,5],[6,7,8]]);;
   gap> SCRename(c,"non-connected complex");;
   gap> SCConnectedComponents(c);
   [ [SimplicialComplex
   
        Properties known: Dim, Facets, Name, VertexLabels.
   
        Name="Connected component #1 of non-connected complex"
        Dim=2
   
       /SimplicialComplex], [SimplicialComplex
   
        Properties known: Chi, Dim, Facets, Name, VertexLabels.
   
        Name="Connected component #2 of non-connected complex"
        Dim=1
        Chi=0
   
       /SimplicialComplex], [SimplicialComplex
   
        Properties known: Dim, Facets, Name, VertexLabels.
   
        Name="Connected component #3 of non-connected complex"
        Dim=2
   
       /SimplicialComplex] ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCConnectedProduct}}
\logpage{[ 4, 3, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCConnectedProduct( complex, n )\index{SCConnectedProduct@\texttt{SCConnectedProduct}}
\label{SCConnectedProduct}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a simplicial complex upon success, \texttt{fail} otherwise.



 If $n \geq 2$, the function internally calls $1 \times$ \texttt{SCConnectedSum} (\ref{SCConnectedSum}) and $(n-2) \times$ \texttt{SCConnectedSumMinus} (\ref{SCConnectedSumMinus}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("T^2");
   [ [ 5, "T^2 (VT)" ], [ 7, "T^2 (VT)" ], [ 11, "T^2 (VT)" ], 
     [ 12, "T^2 (VT)" ], [ 20, "T^2 (VT)" ], [ 22, "(T^2)#2" ], 
     [ 27, "(T^2)#3" ], [ 41, "T^2 (VT)" ], [ 44, "(T^2)#4" ], ... 
   gap> torus:=SCLib.Load(5);;
   gap> genus10:=SCConnectedProduct(torus,10);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="T^2 (VT)#+-T^2 (VT)#+-T^2 (VT)#+-T^2 (VT)#+-T^2 (VT)#+-T^2 (VT)#+-T^2 (\
   VT)#+-T^2 (VT)#+-T^2 (VT)#+-T^2 (VT)"
    Dim=2
   
   /SimplicialComplex]
   gap> genus10.Chi;
   -18
   gap> genus10.F;
   [ 43, 183, 122 ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCConnectedSum}}
\logpage{[ 4, 3, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCConnectedSum( complex1, complex2 )\index{SCConnectedSum@\texttt{SCConnectedSum}}
\label{SCConnectedSum}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 The function removes the first simplex of \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} and glues them together along the boundary. The boundary components of the
complexes are glued in with a twist (a transposition on the vertex labels of
the boundary of \texttt{complex2}). Thus, \texttt{SCConnectedSum} is different from \texttt{SCConnectedSumMinus} (\ref{SCConnectedSumMinus}) whenever \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} do not allow an orientation reversing homeomorphism. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("T^2");
   [ [ 5, "T^2 (VT)" ], [ 7, "T^2 (VT)" ], [ 11, "T^2 (VT)" ], 
     [ 12, "T^2 (VT)" ], [ 20, "T^2 (VT)" ], [ 22, "(T^2)#2" ], 
     [ 27, "(T^2)#3" ], [ 41, "T^2 (VT)" ], [ 44, "(T^2)#4" ], ...
   gap> torus:=SCLib.Load(5);;
   gap> genus2:=SCConnectedSum(torus,torus);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="T^2 (VT)#+-T^2 (VT)"
    Dim=2
   
   /SimplicialComplex]
   gap> genus2.Homology;
   [ [ 0, [  ] ], [ 4, [  ] ], [ 1, [  ] ] ]
   gap> genus2.Chi;
   -2
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("CP^2");
   [ [ 17, "CP^2 (VT)" ], [ 88, "CP^2#CP^2" ], [ 89, "CP^2#-CP^2" ], 
     [ 186, "CP^2#(S^2xS^2)" ], [ 499, "(S^3~S^1)#(CP^2)^{#5} (VT)" ] ]
   gap> cp2:=SCLib.Load(17);;
   # CP^2 # CP^2 (signature of intersection form is 2)  
   gap> c1:=SCConnectedSum(cp2,cp2);;
   # CP^2 # - CP^2 (signature of intersection form is 0)
   gap> c2:=SCConnectedSumMinus(cp2,cp2);;
   gap> c1.F=c2.F;
   true
   gap> c1.ASDet=c2.ASDet;
   true
   gap> SCIsIsomorphic(c1,c2);
   false
   gap> PrintArray(SCIntersectionForm(c1));
   [ [  1,  0 ],
     [  0,  1 ] ]
   gap> PrintArray(SCIntersectionForm(c2));
   [ [   1,   0 ],
     [   0,  -1 ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCConnectedSumMinus}}
\logpage{[ 4, 3, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCConnectedSumMinus( complex1, complex2 )\index{SCConnectedSumMinus@\texttt{SCConnectedSumMinus}}
\label{SCConnectedSumMinus}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 The function removes the first simplex of \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} and glues them together along the boundary. The boundary components of the
complexes are glued in without twist. Thus, \texttt{SCConnectedSumMinus} is different from \texttt{SCConnectedSum} (\ref{SCConnectedSum}) whenever \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} do not allow an orientation reversing homeomorphism. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("T^2");
   [ [ 5, "T^2 (VT)" ], [ 7, "T^2 (VT)" ], [ 11, "T^2 (VT)" ], 
     [ 12, "T^2 (VT)" ], [ 20, "T^2 (VT)" ], [ 22, "(T^2)#2" ], 
     [ 27, "(T^2)#3" ], [ 41, "T^2 (VT)" ], [ 44, "(T^2)#4" ], ...
   gap> torus:=SCLib.Load(5);;
   gap> genus2:=SCConnectedSumMinus(torus,torus);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="T^2 (VT)#+-T^2 (VT)"
    Dim=2
   
   /SimplicialComplex]
   gap> genus2.Homology;
   [ [ 0, [  ] ], [ 4, [  ] ], [ 1, [  ] ] ]
   gap> genus2.Chi;
   -2
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("CP^2");
   [ [ 17, "CP^2 (VT)" ], [ 88, "CP^2#CP^2" ], [ 89, "CP^2#-CP^2" ], 
     [ 186, "CP^2#(S^2xS^2)" ], [ 499, "(S^3~S^1)#(CP^2)^{#5} (VT)" ] ]
   gap> cp2:=SCLib.Load(17);;
   # CP^2 # CP^2 (signature of intersection form is 2)  
   gap> c1:=SCConnectedSum(cp2,cp2);;
   # CP^2 # - CP^2 (signature of intersection form is 0)
   gap> c2:=SCConnectedSumMinus(cp2,cp2);;
   gap> c1.F=c2.F;
   true
   gap> c1.ASDet=c2.ASDet;
   true
   gap> SCIsIsomorphic(c1,c2);
   false
   gap> PrintArray(SCIntersectionForm(c1));
   [ [  1,  0 ],
     [  0,  1 ] ]
   gap> PrintArray(SCIntersectionForm(c2));
   [ [   1,   0 ],
     [   0,  -1 ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCDifferenceCycleCompress}}
\logpage{[ 4, 3, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCDifferenceCycleCompress( simplex, modulus )\index{SCDifferenceCycleCompress@\texttt{SCDifferenceCycleCompress}}
\label{SCDifferenceCycleCompress}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 list with possibly duplicate entries upon success, \texttt{fail} otherwise.



 A difference cycle is returned, i. e. a list of integer values of length $(d+1)$, if $d$ is the dimension of \mbox{\texttt{complex}}, and a sum equal to \mbox{\texttt{modulus}}. In some sense this is the inverse operation of \texttt{SCDifferenceCycleExpand} (\ref{SCDifferenceCycleExpand}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> sphere:=SCBdSimplex(4);;
   gap> gens:=SCGenerators(sphere);
   [ [ [ 1, 2, 3, 4 ], [ [ 5 ] ] ] ]
   gap> diffcycle:=SCDifferenceCycleCompress(gens[1][1],5);
   [ 1, 1, 1, 2 ]
   gap> c:=SCDifferenceCycleExpand([1,1,1,2]);;
   gap> c.Facets;
   [ [ 1, 2, 3, 4 ], [ 1, 2, 3, 5 ], [ 1, 2, 4, 5 ], [ 1, 3, 4, 5 ],
     [ 2, 3, 4, 5 ] ]
   gap>  
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCDifferenceCycleExpand}}
\logpage{[ 4, 3, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCDifferenceCycleExpand( diffcycle )\index{SCDifferenceCycleExpand@\texttt{SCDifferenceCycleExpand}}
\label{SCDifferenceCycleExpand}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a simplicial complex upon success, \texttt{fail} otherwise.



 \mbox{\texttt{diffcycle}} induces a simplex $\Delta = ( v_1 , \ldots , v_{n+1} )$ by $v_1 = $\mbox{\texttt{diffcycle[1]}}, $v_i = v_{i-1} + $ \mbox{\texttt{diffcycle[i]}} and a cyclic group action by $\mathbb{Z}_{\sigma}$ where $\sigma = \sum $ \mbox{\texttt{diffcycle[i]}} is the modulus of \texttt{diffcycle}. The function returns the $\mathbb{Z}_{\sigma}$-orbit of $\Delta$.

 Note, that modulo operations in GAP are often a little bit cumbersome, since
all integer ranges usually start from $1$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCDifferenceCycleExpand([1,1,2]);;
   gap> c.Facets;
   [ [ 1, 2, 3 ], [ 1, 2, 4 ], [ 1, 3, 4 ], [ 2, 3, 4 ] ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFVectorBdCrossPolytope}}
\logpage{[ 4, 3, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFVectorBdCrossPolytope( dim )\index{SCFVectorBdCrossPolytope@\texttt{SCFVectorBdCrossPolytope}}
\label{SCFVectorBdCrossPolytope}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of integers of size \texttt{dim + 1} upon success, \texttt{fail} otherwise.



 Computes the $f$-vector of the $d$-dimensional cross polytope without generating the underlying complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  SCFVectorBdCrossPolytope(50);
  [100, 4900, 156800, 3684800, 67800320, 1017004800, 12785203200,
    137440934400, 1282782054400, 10518812846080, 76500457062400,
    497252970905600, 2907017368371200, 15365663232819200, 73755183517532160,
    322678927889203200, 1290715711556812800, 4732624275708313600,
    15941471244491161600, 49418560857922600960, 141195888165493145600,
    372243705163572838400, 906332499528699084800, 2039248123939572940800,
    4241636097794311716864, 8156992495758291763200, 14501319992459185356800,
    23823597130468661657600, 36146147370366245273600, 50604606318512743383040,
    65296266217435797913600, 77539316133205010022400, 84588344872587283660800,
    84588344872587283660800, 77337915312079802204160, 64448262760066501836800,
    48771658304915190579200, 33370081998099867238400, 20535435075753764454400,
    11294489291664570449920, 5509506971543692902400, 2361217273518725529600,
    878592473867432755200, 279552150776001331200, 74547240206933688320,
    16205921784116019200, 2758454771764428800, 344806846470553600,
    28147497671065600, 1125899906842624]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFVectorBdSimplex}}
\logpage{[ 4, 3, 10 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFVectorBdSimplex( dim )\index{SCFVectorBdSimplex@\texttt{SCFVectorBdSimplex}}
\label{SCFVectorBdSimplex}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of integers of size \texttt{dim + 1} upon success, \texttt{fail} otherwise.



 Computes the $f$-vector of the $d$-simplex without generating the underlying complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   SCFVectorBdSimplex(100);
   [101, 5050, 166650, 4082925, 79208745, 1267339920, 17199613200,
     202095455100, 2088319702700, 19212541264840, 158940114100040,
     1192050855750300, 8160963550905900, 51297485177122800, 297525414027312240,
     1599199100396803290, 7995995501984016450, 37314645675925410100,
     163006083742200475700, 668324943343021950370, 2577824781465941808570,
     9373908296239788394800, 32197337191432316660400, 104641345872155029146300,
     322295345286237489770604, 942094086221309585483304,
     2616928017281415515231400, 6916166902815169575968700,
     17409661513983013070541900, 41783187633559231369300560,
     95696978128474368620010960, 209337139656037681356273975,
     437704928371715151926754675, 875409856743430303853509350,
     1675784582908852295948146470, 3072271735332895875904935195,
     5397234129638871133346507775, 9090078534128625066688855200,
     14683973016669317415420458400, 22760158175837441993901710520,
     33862674359172779551902544920, 48375249084532542217003635600,
     66375341767149302111702662800, 87494768693060443692698964600,
     110826707011209895344085355160, 134919469404951176940625649760,
     157884485473879036845412994400, 177620046158113916451089618700,
     192119641762857909630770403900, 199804427433372226016001220056,
     199804427433372226016001220056, 192119641762857909630770403900,
     177620046158113916451089618700, 157884485473879036845412994400,
     134919469404951176940625649760, 110826707011209895344085355160,
     87494768693060443692698964600, 66375341767149302111702662800,
     48375249084532542217003635600, 33862674359172779551902544920,
     22760158175837441993901710520, 14683973016669317415420458400,
     9090078534128625066688855200, 5397234129638871133346507775,
     3072271735332895875904935195, 1675784582908852295948146470,
     875409856743430303853509350, 437704928371715151926754675,
     209337139656037681356273975, 95696978128474368620010960,
     41783187633559231369300560, 17409661513983013070541900,
     6916166902815169575968700, 2616928017281415515231400,
     942094086221309585483304, 322295345286237489770604,
     104641345872155029146300, 32197337191432316660400, 9373908296239788394800,
     2577824781465941808570, 668324943343021950370, 163006083742200475700,
     37314645675925410100, 7995995501984016450, 1599199100396803290,
     297525414027312240, 51297485177122800, 8160963550905900, 1192050855750300,
     158940114100040, 19212541264840, 2088319702700, 202095455100, 17199613200,
     1267339920, 79208745, 4082925, 166650, 5050, 101]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCStronglyConnectedComponents}}
\logpage{[ 4, 3, 11 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCStronglyConnectedComponents( complex )\index{SCStronglyConnectedComponents@\texttt{SCStronglyConnectedComponents}}
\label{SCStronglyConnectedComponents}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of simplicial complexes upon success, \texttt{fail} otherwise.



 Computes all strongly connected components of an arbitrary simplicial complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,3],[3,4,5],[4,5,6,7,8,9],[6,7,8,9,10,11]]);;
   gap> comps:=SCStronglyConnectedComponents(c);
   [ [SimplicialComplex
       
        Properties known: Dim, Facets, Name, VertexLabels.
       
        Name="Strongly connected component #1 of unnamed complex n20"
        Dim=2
       
       /SimplicialComplex], [SimplicialComplex
       
        Properties known: Dim, Facets, Name, VertexLabels.
       
        Name="Strongly connected component #2 of unnamed complex n20"
        Dim=5
       
       /SimplicialComplex], [SimplicialComplex
       
        Properties known: Dim, Facets, Name, VertexLabels.
       
        Name="Strongly connected component #3 of unnamed complex n20"
        Dim=5
       
       /SimplicialComplex] ]
   gap> comps[1].Facets;
   [ [ 1, 2, 3 ] ]
   gap> comps[2].Facets;
   [ [ 3, 4, 5 ], [ 4, 5, 6, 7, 8, 9 ] ]
   gap> comps[3].Facets;
   [ [ 6, 7, 8, 9, 10, 11 ] ]
   gap>  
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Vertex labelings and label operations}}\logpage{[ 4, 4, 0 ]}
{
  Functions operating on the labels of a complex such as the name or the vertex
labeling.

 Internally, \textsf{simpcomp} uses the standard labeling $[1, \ldots , n]$. It is recommended to use simple vertex labels like integers end, whenever
possible, the standard labeling, see also \texttt{SCRelabelStandard} (\ref{SCRelabelStandard}). 

\subsection{\textcolor{Chapter }{SCLabelMax}}
\logpage{[ 4, 4, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLabelMax( complex )\index{SCLabelMax@\texttt{SCLabelMax}}
\label{SCLabelMax}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
maximal vertex label of \mbox{\texttt{complex}} upon success, \texttt{fail} otherwise.



 The maximum over all vertex labels is determined by the gap function \texttt{MaximumList}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> SCRelabel(c,[10,100,100000,3500]);;
   gap> SCLabelMax(c);
   100000
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> SCRelabel(c,["a","bbb",5,[1,1]]);
   true
   gap> SCLabelMax(c);
   "bbb"
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLabelMin}}
\logpage{[ 4, 4, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLabelMin( complex )\index{SCLabelMin@\texttt{SCLabelMin}}
\label{SCLabelMin}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
minimal vertex label of \mbox{\texttt{complex}} upon success, \texttt{fail} otherwise.



 The minimum over all vertex labels is determined by the gap function \texttt{MinimumList}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> SCRelabel(c,[10,100,100000,3500]);;
   gap> SCLabelMin(c);
   10
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> SCRelabel(c,["a","bbb",5,[1,1]]);
   true
   gap> SCLabelMin(c);
   5
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLabels}}
\logpage{[ 4, 4, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLabels( complex )\index{SCLabels@\texttt{SCLabels}}
\label{SCLabels}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a list of vertex labels upon success, \texttt{fail} otherwise.



 Returns the vertex labels of \mbox{\texttt{complex}} as a list. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets(Combinations(["a","b","c","d"],3));;
   gap> SCLabels(c);
   [ "a", "b", "c", "d" ]
   gap> c.Labels;
   [ "a", "b", "c", "d" ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCRelabel}}
\logpage{[ 4, 4, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCRelabel( complex, maptable )\index{SCRelabel@\texttt{SCRelabel}}
\label{SCRelabel}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} upon success, \texttt{fail} otherwise.



 \mbox{\texttt{maptable}} has to be a list of length $f_0$. The function maps the $i$-th entry of \mbox{\texttt{maptable}} to the $i$-th entry of the current vertex labels. If \mbox{\texttt{complex}} has the standard vertex labeling $[1, \ldots , n]$ $i$ is mapped to \mbox{\texttt{maptable[i]}}.

 Internally the property ``VertexLabels'' of \mbox{\texttt{complex}} is replaced by \mbox{\texttt{maptable.}} 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByAttribute("F[1]=12"); 
   [ [ 56, "S^2 (VT)" ], [ 57, "T^2 (VT)" ], [ 58, "T^2 (VT)" ], 
     [ 59, "T^2 (VT)" ], [ 60, "T^2 (VT)" ], [ 61, "(T^2)#2 (VT)" ], 
     [ 62, "(P^2)#4 (VT)" ], [ 63, "(T^2)#2 (VT)" ], [ 64, "(T^2)#2 (VT)" ], 
   gap> c:=SCLib.Load(56);;
   gap> SCPropertyByName(c,"VertexLabels");
   [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
   gap> SCRelabel(c,["a","b","c","d","e","f","g","h","i","j","k","l"]);
   true
   gap> SCLabels(c);
   [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l" ]
   gap>  
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCRelabelStandard}}
\logpage{[ 4, 4, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCRelabelStandard( complex )\index{SCRelabelStandard@\texttt{SCRelabelStandard}}
\label{SCRelabelStandard}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} upon success upon success, \texttt{fail} otherwise.



 Maps vertex labels $v_1 , \ldots , v_n$ of \mbox{\texttt{complex}} to $[1 , \ldots , n]$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByAttribute("F[1]=12"); 
   [ [ 56, "S^2 (VT)" ], [ 57, "T^2 (VT)" ], [ 58, "T^2 (VT)" ], 
     [ 59, "T^2 (VT)" ], [ 60, "T^2 (VT)" ], [ 61, "(T^2)#2 (VT)" ], 
     [ 62, "(P^2)#4 (VT)" ], [ 63, "(T^2)#2 (VT)" ], [ 64, "(T^2)#2 (VT)" ], 
   gap> c:=SCLib.Load(56);;
   gap> SCRelabel(c,[4..15]);
   true
   gap> SCVertices(c);
   [ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ]
   gap> SCRelabelStandard(c);
   true
   gap> SCLabels(c);
   [ 1 .. 12 ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCRelabelTransposition}}
\logpage{[ 4, 4, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCRelabelTransposition( complex, pair )\index{SCRelabelTransposition@\texttt{SCRelabelTransposition}}
\label{SCRelabelTransposition}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} upon success, \texttt{fail} otherwise.



 Permutes vertex labels of a single pair of vertices. \mbox{\texttt{pair}} has to be a list of length $2$ and a sublist of the property ``VertexLabels''.

 The function is equivalent to \texttt{SCRelabel} (\ref{SCRelabel}) with \mbox{\texttt{maptable}} $= [ VertexLabels[1] , \ldots , VertexLabels[i] , \ldots , VertexLabels[j] ,
\dots , VertexLabels[n]]$ if \mbox{\texttt{pair}} $= [ VertexLabels[j] , VertexLabels[i]]$, $j \leq i$, $j \neq i$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> SCVertices(c);
   [ 1, 2, 3, 4 ]
   gap> SCRelabelTransposition(c,[1,2]);;
   gap> SCLabels(c);
   [ 2, 1, 3, 4 ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCRename}}
\logpage{[ 4, 4, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCRename( complex, name )\index{SCRename@\texttt{SCRename}}
\label{SCRename}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} upon success, \texttt{fail} otherwise.



 Renames a simplicial complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(5);;
   gap> SCName(c);
   "S^4_6"
   gap> SCRename(c,"mySphere");
   true
   gap> SCName(c);
   "mySphere"
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCSortComplex}}
\logpage{[ 4, 4, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCSortComplex( complex )\index{SCSortComplex@\texttt{SCSortComplex}}
\label{SCSortComplex}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex from sorted facet list upon success, \texttt{fail} otherwise.



 Sorts facet list (with arbitrary vertex labels) and returns a new simplicial
complex object from sorted facets. In particular all known properties are lost
by this operation. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3); 
   [SimplicialComplex
   
    Properties known: AutomorphismGroup, AutomorphismGroupOrder, 
                      AutomorphismGroupStructure, AutomorphismGroupTransitivity,  
                      Chi, Dim, F, Facets, Generators, HasBoundary, Homology, 
                      IsConnected, IsStronglyConnected, Name, TopologicalType, 
                      VertexLabels.
   
    Name="S^2_4"
    Dim=2
    AutomorphismGroupStructure="S4"
    AutomorphismGroupTransitivity=4
    Chi=2
    F=[ 4, 6, 4 ]
    Homology=[ [ 0, [ ] ], [ 0, [ ] ], [ 1, [ ] ] ]
    IsConnected=true
    IsStronglyConnected=true
    TopologicalType="S^2"
   
   /SimplicialComplex]
   gap> SCRelabel(c,[4,3,2,1]);;
   gap> SCFacets(c);
   [ [ 4, 3, 2 ], [ 4, 3, 1 ], [ 4, 2, 1 ], [ 3, 2, 1 ] ]
   gap> d:=SCSortComplex(c);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="unnamed complex n"
    Dim=2
   
   /SimplicialComplex]
   gap> SCFacets(d);
   [ [ 1, 2, 3 ], [ 1, 2, 4 ], [ 1, 3, 4 ], [ 2, 3, 4 ] ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCUnlabelFace}}
\logpage{[ 4, 4, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCUnlabelFace( complex, face )\index{SCUnlabelFace@\texttt{SCUnlabelFace}}
\label{SCUnlabelFace}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list upon success, \texttt{fail} otherwise.



 Computes the standard labeling of \mbox{\texttt{face}} in \mbox{\texttt{complex}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> SCRelabel(c,["a","bbb",5,[1,1]]);;
   gap> SCUnlabelFace(c,["a","bbb",5]);
   [ 1, 2, 3 ]
   gap>
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Computing properties of simplicial complexes}}\logpage{[ 4, 5, 0 ]}
{
  The following functions compute some basic properties of a simplicial complex.
In particular, the facets of the complex are not altered by these functions.

 Note: Every simplicial complex is internally stored with the standard vertex
labeling from $1$ to $n$ and a maptable to restore the original vertex labeling. Thus, we have to
relabel some of the complex properties (facets, face lattice, generators,
etc...) whenever we want to return them to the user. As a consequence, some of
the functions exist twice, one of them with the appendix "Ex". These functions
return the standard labeling whereas the other ones relabel the result to the
original labeling. 

\subsection{\textcolor{Chapter }{SCAltshulerSteinberg}}
\logpage{[ 4, 5, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCAltshulerSteinberg( complex )\index{SCAltshulerSteinberg@\texttt{SCAltshulerSteinberg}}
\label{SCAltshulerSteinberg}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a non-negative integer upon success, \texttt{fail} otherwise.



 Computes the Altshuler-Steinberg determinant.

 Definition: Let $v_i$, $1 \leq i \leq n$ be the vertices and let $F_j$, $1 \leq j \leq m$ be the facets of a pure simplicial complex $C$, then the determinant of $AS \in \mathbb{Z}^{n \times m}$, $AS_{ij}=1$ if $v_i \in F_j$, $AS_{ij}=0$ otherwise, is called the Altshuler-Steinberg-determinant. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("T^2"); 
   [ [ 5, "T^2 (VT)" ], [ 7, "T^2 (VT)" ], [ 11, "T^2 (VT)" ], 
     [ 12, "T^2 (VT)" ], [ 20, "T^2 (VT)" ], [ 22, "(T^2)#2" ], 
     [ 27, "(T^2)#3" ], [ 41, "T^2 (VT)" ], [ 44, "(T^2)#4" ], ...
   gap> torus:=SCLib.Load(5);;
   gap> SCAltshulerSteinberg(torus);
   73728
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> SCAltshulerSteinberg(c);
   9
   gap> c:=SCBdSimplex(4);;
   gap> SCAltshulerSteinberg(c);
   16
   gap> c:=SCBdSimplex(5);;
   gap> SCAltshulerSteinberg(c);
   25
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCAutomorphismGroup}}
\logpage{[ 4, 5, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCAutomorphismGroup( complex )\index{SCAutomorphismGroup@\texttt{SCAutomorphismGroup}}
\label{SCAutomorphismGroup}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a group upon success, \texttt{fail} otherwise



 Computes the automorphism group of a strongly connected pseudomanifold \mbox{\texttt{complex}}. Necessarily the group is a subgroup of the symmetric group $S_n$ where $n$ is the number of vertices of the simplicial complex.

 The function uses an efficient algorithm provided by the package \textsf{GRAPE} (see \cite{Soicher06GRAPE}, which is based on the program \texttt{nauty} by Brendan McKay \cite{McKay84Nauty}). If the package \textsf{GRAPE} is not available, this function call falls back to \texttt{SCAutomorphismGroupInternal} (\ref{SCAutomorphismGroupInternal}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("K3"); 
   [ [ 584, "K3 surface" ] ]
   gap> k3surf:=SCLib.Load(584);;
   gap> SCAutomorphismGroup(k3surf);
   ((C2 x C2 x C2 x C2) : C5) : C3
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCAutomorphismGroupInternal}}
\logpage{[ 4, 5, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCAutomorphismGroupInternal( complex )\index{SCAutomorphismGroupInternal@\texttt{SCAutomorphismGroupInternal}}
\label{SCAutomorphismGroupInternal}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 permutation group in structure description upon success, \texttt{fail} otherwise.



 Computes the group of all automorphisms on the set of vertices of a simplicial
complex that do not change the complex as a whole. Necessarily the group is a
subgroup of $S_n$ where $n$ is the number of vertices of the simplicial complex.

 The group is given in structure description, provided by the GAP function \texttt{StructureDescription()}. Note, that this is not always unique, since every non trivial semi-direct
product is denoted by ''\texttt{:}''. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(5);;
   gap> SCAutomorphismGroupInternal(c);
   S6
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(2);;
   gap> g:=SCAutomorphismGroupInternal(c);
   S3
   gap> List(g);
   [(), (1,3), (1,2,3), (2,3), (1,3,2), (1,2)]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCBoundary}}
\logpage{[ 4, 5, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCBoundary( complex )\index{SCBoundary@\texttt{SCBoundary}}
\label{SCBoundary}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 Computes the boundary of a combinatorial pseudomanifold. The boundary is
returned as a simplicial complex and stored as a property of \mbox{\texttt{complex}}.

 If the complex is not a pseudomanifold the function returns \texttt{fail}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,3,4],[1,2,3,5],[1,2,4,5],[1,3,4,5]]);
   [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels.
  
   Name="unnamed complex n"
   Dim=3
  
   /SimplicialComplex]
   gap> SCBoundary(c);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="Bd(unnamed complex 5)"
    Dim=2
   
   /SimplicialComplex]
   gap> c;  
   [SimplicialComplex
   
    Properties known: Boundary, Dim, Faces, Facets, HasBoundary, Name, 
                      VertexLabels.
   
    Name="unnamed complex 5"
    Dim=3
    HasBoundary=true
   
   /SimplicialComplex]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCDim}}
\logpage{[ 4, 5, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCDim( complex )\index{SCDim@\texttt{SCDim}}
\label{SCDim}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 an integer value $\geq -1$ upon success, \texttt{fail} otherwise.



 Computes the dimension of a simplicial complex. If the complex is not pure,
the dimension of the highest dimensional simplex is returned. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> complex:=SC([[1,2,3], [1,2,4], [1,3,4], [2,3,4]]);;
   gap> SCDim(complex);                                    
   2
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1], [2,4], [3,4], [5,6,7,8]]);;
   gap> SCDim(c);
   3
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCDualGraph}}
\logpage{[ 4, 5, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCDualGraph( complex )\index{SCDualGraph@\texttt{SCDualGraph}}
\label{SCDualGraph}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A 1-dimensional simplicial complex upon success, \texttt{fail} otherwise



 Computes the dual graph of \mbox{\texttt{complex}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> sphere:=SCBdSimplex(5);;
   gap> graph:=SCFaces(sphere,1);       
   [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 1, 5 ], [ 1, 6 ], [ 2, 3 ], [ 2, 4 ], 
     [ 2, 5 ], [ 2, 6 ], [ 3, 4 ], [ 3, 5 ], [ 3, 6 ], [ 4, 5 ], [ 4, 6 ], 
     [ 5, 6 ] ]
   gap> graph:=SC(graph);;              
   gap> dualGraph:=SCDualGraph(sphere); 
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="dual graph of S^4_6"
    Dim=1
   
   /SimplicialComplex]
   gap> graph.Facets = dualGraph.Facets;
   true
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCEulerCharacteristic}}
\logpage{[ 4, 5, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCEulerCharacteristic( complex )\index{SCEulerCharacteristic@\texttt{SCEulerCharacteristic}}
\label{SCEulerCharacteristic}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 integer upon success, \texttt{fail} otherwise.



 Computes the Euler characteristic of a simplicial complex $C$ 

$ \chi(C)=\sum \limits_{i=0}^{d} (-1)^{i} f_i $

 where $f_i$ denotes the $i$-th component of the $f$-vector. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> complex:=SCFromFacets([[1,2,3], [1,2,4], [1,3,4], [2,3,4]]);;
   gap> SCEulerCharacteristic(complex);
   2
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> s2:=SCBdSimplex(3);;
   gap> s2.EulerCharacteristic;
   2
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFVector}}
\logpage{[ 4, 5, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFVector( complex )\index{SCFVector@\texttt{SCFVector}}
\label{SCFVector}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of integers upon success, \texttt{fail} otherwise.



 Computes the $f$-vector of the simplicial complex \mbox{\texttt{complex}}, . i. e. the number of $i$-dimensional faces for $ 0 \leq i \leq d $, where $d$ is the dimension of the complex. A memory-saving implicit algorithm is used
that avoids calculating the face lattice of the complex. Internally calls \texttt{SCNumFaces} (\ref{SCNumFaces}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> complex:=SC([[1,2,3], [1,2,4], [1,3,4], [2,3,4]]);;
   gap> SCFVector(complex);
   [4, 6, 4]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFaceLattice}}
\logpage{[ 4, 5, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFaceLattice( complex )\index{SCFaceLattice@\texttt{SCFaceLattice}}
\label{SCFaceLattice}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of face lists upon success, \texttt{fail} otherwise.



 Computes the entire face lattice of a $d$-dimensional simplicial complex, i. e. all of its $i$-skeletons for $0 \leq i \leq d$. The faces are returned in the original labeling. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([["a","b","c"],["a","b","d"], ["a","c","d"], ["b","c","d"]]);;
   gap> SCFaceLattice(c);
   [ [ ["a"], ["b"], ["c"], ["d"] ],
     [ ["a", "b"], ["a", "c"], ["a", "d"], 
   	   ["b", "c"], ["b", "d"], ["c", "d"] ],
     [ ["a", "b", "c"], ["a", "b", "d"], 
       ["a", "c", "d"], ["b", "c", "d"] ] ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFaceLatticeEx}}
\logpage{[ 4, 5, 10 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFaceLatticeEx( complex )\index{SCFaceLatticeEx@\texttt{SCFaceLatticeEx}}
\label{SCFaceLatticeEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of face lists upon success, \texttt{fail} otherwise.



 Computes the entire face lattice of a $d$-dimensional simplicial complex, i. e. all of its $i$-skeletons for $0 \leq i \leq d$. The faces are returned in the standard labeling. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([["a","b","c"],["a","b","d"], ["a","c","d"], ["b","c","d"]]);;
   gap> SCFaceLatticeEx(c);
   [ [ [1], [2], [3], [4] ],
     [ [1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4] ],
     [ [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4] ] ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFaces}}
\logpage{[ 4, 5, 11 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFaces( complex, dim )\index{SCFaces@\texttt{SCFaces}}
\label{SCFaces}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a face list upon success, \texttt{fail} otherwise.



 This is a synonym of the function \texttt{SCSkel} (\ref{SCSkel}). }

 

\subsection{\textcolor{Chapter }{SCFacesEx}}
\logpage{[ 4, 5, 12 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFacesEx( complex, dim )\index{SCFacesEx@\texttt{SCFacesEx}}
\label{SCFacesEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a face list upon success, \texttt{fail} otherwise.



 This is a synonym of the function \texttt{SCSkelEx} (\ref{SCSkelEx}). }

 

\subsection{\textcolor{Chapter }{SCFacets}}
\logpage{[ 4, 5, 13 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFacets( complex )\index{SCFacets@\texttt{SCFacets}}
\label{SCFacets}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a facet list upon success, \texttt{fail} otherwise.



 Returns the facets of a simplicial complex in the original vertex labeling. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[2,3],[3,4],[4,2]]);;
   gap> SCFacets(c);
   [ [ 2, 3 ], [ 3, 4 ], [ 2, 4 ] ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFacetsEx}}
\logpage{[ 4, 5, 14 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFacetsEx( complex )\index{SCFacetsEx@\texttt{SCFacetsEx}}
\label{SCFacetsEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a facet list upon success, \texttt{fail} otherwise.



 Returns the facets of a simplicial complex as they are stored, i. e. with
standard vertex labeling from 1 to n. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[2,3],[3,4],[4,2]]);;
   gap> SCFacetsEx(c);
   [ [ 1, 2 ], [ 2, 3 ], [ 1, 3 ] ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFpBettiNumbers}}
\logpage{[ 4, 5, 15 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFpBettiNumbers( complex, p )\index{SCFpBettiNumbers@\texttt{SCFpBettiNumbers}}
\label{SCFpBettiNumbers}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of non-negative integers upon success, \texttt{fail} otherwise.



 Computes the $\mathbb{F}_p$ Betti numbers of a simplicial complex for any prime number \texttt{p}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("K^2");    
   [ [ 19, "K^2 (VT)" ], [ 230, "K^2 (VT)" ] ]
   gap> kleinBottle:=SCLib.Load(19);; 
   gap> SCHomology(kleinBottle);      
   [ [ 0, [  ] ], [ 1, [ 2 ] ], [ 0, [  ] ] ]
   gap> SCFpBettiNumbers(kleinBottle,2);
   [ 1, 2, 1 ]
   gap> SCFpBettiNumbers(kleinBottle,3);
   [ 1, 1, 0 ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCFundamentalGroup}}
\logpage{[ 4, 5, 16 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCFundamentalGroup( complex )\index{SCFundamentalGroup@\texttt{SCFundamentalGroup}}
\label{SCFundamentalGroup}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
an fp group upon success, \texttt{fail} otherwise.



 Computes the first fundamental group of \mbox{\texttt{complex}} which must be a connected simplicial complex and returns it in form of a
finitely presented group. The generators of the group are given as 2-tuples
that correspond to the edges of \mbox{\texttt{complex}} in standard labeling. You can use GAP's \texttt{SimplifiedFpGroup} to simplify the group presenation. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   # an RP^2
   gap> c:=SC([[ 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 ]]);;
   gap> g:=SCFundamentalGroup(c);
   <fp group on the generators [ [2,3], [2,4], [2,5], [2,6], [3,4], [3,5], 
     [3,6], [4,5], [4,6], [5,6] ]>
   gap> Order(g);
   2
   gap> Elements(g);
   [ <identity ...>, [2,4] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCGVector}}
\logpage{[ 4, 5, 17 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCGVector( complex )\index{SCGVector@\texttt{SCGVector}}
\label{SCGVector}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of non-negative integers upon success, \texttt{fail} otherwise.



 Computes the g-vector of a simplicial complex. The $g$-vector is defined as follows:

 Let $h$ be the $h$-vector of a $d$-dimensional simplicial complex C, then 

$h_{-1}:=1 ; \quad g_i:=h_i - h_{i-1} ; \quad \frac{d-1}{2} \geq i \geq 0 $

 is called the $g$-vector of $C$. For the definition of the $h$-vector see \texttt{SCHVector} (\ref{SCHVector}). The information contained in $g$ suffices to determine the $f$-vector of $C$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^2");
   [ [ 3, "RP^2 (VT)" ], [ 284, "RP^2xS^1" ] ]
   gap> rp2_6:=SCLib.Load(3);;
   gap> SCFVector(rp2_6);
   [ 6, 15, 10 ]
   gap> SCHVector(rp2_6);
   [ 3, 6, 0 ]
   gap> SCGVector(rp2_6);
   [ 2 ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCGenerators}}
\logpage{[ 4, 5, 18 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCGenerators( complex )\index{SCGenerators@\texttt{SCGenerators}}
\label{SCGenerators}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of the form \texttt{[ list, integer ]} upon success, \texttt{fail} otherwise.



 Computes the generators of a simplicial complex in the original vertex
labeling.\\
 The generating set of a simplicial complex is a list of simplices that will
generate the complex by uniting their $G$-orbits if $G$ is the group of automorphisms of \mbox{\texttt{complex}}.\\
 The function will return the simplices together with the length of the their
orbits. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("T^2"); 
   [ [ 5, "T^2 (VT)" ], [ 7, "T^2 (VT)" ], [ 11, "T^2 (VT)" ], 
     [ 12, "T^2 (VT)" ], [ 20, "T^2 (VT)" ], [ 22, "(T^2)#2" ], 
     [ 27, "(T^2)#3" ], [ 41, "T^2 (VT)" ], [ 44, "(T^2)#4" ], ...
   gap> torus:=SCLib.Load(5);;
   gap> SCGenerators(torus); 
   [ [ [ 1, 2, 4 ], 14 ] ]
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("K3");
   [ [ 584, "K3 surface" ] ]
   gap> SCLib.Load(584);
   [SimplicialComplex
   
    Properties known: AltshulerSteinberg, AutomorphismGroup, 
                      AutomorphismGroupSize, AutomorphismGroupStructure, 
                      AutomorphismGroupTransitivity, Boundary, Chi, 
                      ConnectedComponents, Dim, DualGraph, F, Faces, Facets, G, 
                      Generators, H, HasBoundary, HasInterior, Homology, 
                      Interior, IsCentrallySymmetric, IsConnected, 
                      IsEulerianManifold, IsOrientable, IsPM, IsPure, 
                      MinimalNonFaces, Name, Neighborliness, Orientation, 
                      StronglyConnected, VertexLabels, Vertices.
   
    Name="K3 surface"
    Dim=4
    AutomorphismGroupSize=240
    AutomorphismGroupStructure="((C2 x C2 x C2 x C2) : C5) : C3"
    AutomorphismGroupTransitivity=2
    Chi=24
    F=[ 16, 120, 560, 720, 288 ]
    G=[ 10, 55 ]
    H=[ 11, 66, 286, -99, 23 ]
    HasBoundary=false
    HasInterior=true
    Homology=[ [ 0, [ ] ], [ 0, [ ] ], [ 22, [ ] ], [ 0, [ ] ], [ 1, [ ] ] ]
    IsCentrallySymmetric=false
    IsConnected=true
    IsEulerianManifold=true
    IsOrientable=true
    IsPM=true
    IsPure=true
    Neighborliness=3
   
   /SimplicialComplex]
   gap> SCGenerators(last);
   [ [ [ 1, 2, 3, 8, 12 ], 240 ], [ [ 1, 2, 5, 8, 14 ], 48 ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCGeneratorsEx}}
\logpage{[ 4, 5, 19 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCGeneratorsEx( complex )\index{SCGeneratorsEx@\texttt{SCGeneratorsEx}}
\label{SCGeneratorsEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of the form \texttt{[ list, integer ]} upon success, \texttt{fail} otherwise.



 Computes the generators of a simplicial complex in the standard vertex
labeling.\\
 The generating set of a simplicial complex is a list of simplices that will
generate the complex by uniting their $G$-orbits if $G$ is the group of automorphisms of \mbox{\texttt{complex}}.\\
 The function will return the simplices together with the length of the their
orbits. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("T^2"); 
   [ [ 5, "T^2 (VT)" ], [ 7, "T^2 (VT)" ], [ 11, "T^2 (VT)" ], 
     [ 12, "T^2 (VT)" ], [ 20, "T^2 (VT)" ], [ 22, "(T^2)#2" ], 
     [ 27, "(T^2)#3" ], [ 41, "T^2 (VT)" ], [ 44, "(T^2)#4" ], ...
   gap> torus:=SCLib.Load(5);;
   gap> SCGeneratorsEx(torus); 
   [ [ [ 1, 2, 4 ], 14 ] ]
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("K3");
   [ [ 584, "K3 surface" ] ]
   gap> SCLib.Load(584);
   [SimplicialComplex
   
    Properties known: AltshulerSteinberg, AutomorphismGroup, 
                      AutomorphismGroupSize, AutomorphismGroupStructure, 
                      AutomorphismGroupTransitivity, Boundary, Chi, 
                      ConnectedComponents, Dim, DualGraph, F, Faces, Facets, G, 
                      Generators, H, HasBoundary, HasInterior, Homology, 
                      Interior, IsCentrallySymmetric, IsConnected, 
                      IsEulerianManifold, IsOrientable, IsPM, IsPure, 
                      MinimalNonFaces, Name, Neighborliness, Orientation, 
                      StronglyConnected, VertexLabels, Vertices.
   
    Name="K3 surface"
    Dim=4
    AutomorphismGroupSize=240
    AutomorphismGroupStructure="((C2 x C2 x C2 x C2) : C5) : C3"
    AutomorphismGroupTransitivity=2
    Chi=24
    F=[ 16, 120, 560, 720, 288 ]
    G=[ 10, 55 ]
    H=[ 11, 66, 286, -99, 23 ]
    HasBoundary=false
    HasInterior=true
    Homology=[ [ 0, [ ] ], [ 0, [ ] ], [ 22, [ ] ], [ 0, [ ] ], [ 1, [ ] ] ]
    IsCentrallySymmetric=false
    IsConnected=true
    IsEulerianManifold=true
    IsOrientable=true
    IsPM=true
    IsPure=true
    Neighborliness=3
   
   /SimplicialComplex]
   gap> SCGeneratorsEx(last);
   [ [ [ 1, 2, 3, 8, 12 ], 240 ], [ [ 1, 2, 5, 8, 14 ], 48 ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCHVector}}
\logpage{[ 4, 5, 20 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCHVector( complex )\index{SCHVector@\texttt{SCHVector}}
\label{SCHVector}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of integers upon success, \texttt{fail} otherwise.



 Computes the $h$-vector of a simplicial complex. The $h$-vector is defined as follows:

 Let $f \in \mathbb{N}^{d+1}$ be the $f$-vector of a $d$-dimensional simplicial complex, i. e. the number of its $i$-faces for $0 \leq i \leq d$ $C$, and let $p(C,x)$ be the polynomial 

$p(C,x)=x^{d+1}+f_0 x^d +f_1 + x^{d-1} + \ldots + f_{d-1} x + f_d$

 of degree $d+1$. Then $h=(h_0 , \ldots , h_d) \in \mathbb{Z}^{d+1}$ is given by 

$q(C,x):=p(C,x-1) =x^{d+1}+h_0 x^d +h_1 + x^{d-1} + \ldots + h_{d-1} x + h_d.$

 This results into the following formula 

$ h_k:=(-1)^{k+1}{d+1 \choose k+1} + \sum \limits_{i=0}^{k} (-1)^{k-i}{d-i
\choose d-k} f_i.$

 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^2");
   [ [ 3, "RP^2 (VT)" ], [ 284, "RP^2xS^1" ] ]
   gap> rp2_6:=SCLib.Load(3);;
   gap> SCFVector(rp2_6);
   [ 6, 15, 10 ]
   gap> SCHVector(rp2_6);
   [ 3, 6, 0 ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCHasBoundary}}
\logpage{[ 4, 5, 21 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCHasBoundary( complex )\index{SCHasBoundary@\texttt{SCHasBoundary}}
\label{SCHasBoundary}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks, if a combinatorial pseudomanifold \mbox{\texttt{complex}} has a boundary. If the complex is closed \texttt{false} is returned, if the complex is not a pseudomanifold, \texttt{fail} is returned. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("K^2"); 
   [ [ 19, "K^2 (VT)" ], [ 230, "K^2 (VT)" ] ]
   gap> kleinBottle:=SCLib.Load(19);;
   gap> SCHasBoundary(kleinBottle);
   false
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,3,4],[1,2,3,5],[1,2,4,5],[1,3,4,5]]);;
   gap> SCHasBoundary(c);
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCHasInterior}}
\logpage{[ 4, 5, 22 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCHasInterior(  )\index{SCHasInterior@\texttt{SCHasInterior}}
\label{SCHasInterior}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Returns \texttt{true} if there exist at least one $(d-1)$-face of \mbox{\texttt{complex}} that is not in its boundary. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,3,4],[1,2,3,5],[1,2,4,5],[1,3,4,5]]);;
   gap> SCHasInterior(c)
   true
   gap> c:=SC([[1,2,3,4]]);;
   gap> SCHasInterior(c);
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCHomology}}
\logpage{[ 4, 5, 23 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCHomology( complex )\index{SCHomology@\texttt{SCHomology}}
\label{SCHomology}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of the form \texttt{[ integer, list ]}.



 Computes the integral simplicial homology groups for a simplicial complex
(internally calls \texttt{SimplicialHomology(complex.FacetsEx)} from the \textsf{homology} package, version 1.4.2., see \cite{Dumas04Homology}.

 If the \textsf{homology} package is not available, this function call falls back to \texttt{SCHomologyInternal} (\ref{SCHomologyInternal}). The output is a list of homology groups of the form $[H_0,....,H_d]$, where $d$ is the dimension of \mbox{\texttt{complex}}. The format of the homology groups $H_i$ is given in terms of their maximal cyclic subgroups, i.e. a homology group $H_i\cong \mathbb{Z}^f + \mathbb{Z} / t_1 \mathbb{Z} \times \dots \times
\mathbb{Z} / t_n \mathbb{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. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("K^2");
   [ [ 19, "K^2 (VT)" ], [ 230, "K^2 (VT)" ] ]
   gap> kleinBottle:=SCLib.Load(19);;
   gap> kleinBottle.Homology;          
   [ [ 0, [  ] ], [ 1, [ 2 ] ], [ 0, [  ] ] ]
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("L_");
   [ [ 139, "L_3_1" ], [ 282, "L_4_1" ], [ 300, "L_5_2" ], 
     [ 411, "(S^2xS^1)#L_3_1" ], [ 412, "(S^2~S^1)#L_3_1" ], [ 444, "L_5_1" ], 
     [ 445, "(S^2xS^1)#2#L_3_1" ], [ 446, "(S^2~S^1)#2#L_3_1" ], ...
   gap> c:=SCConnectedSum(SCConnectedProduct(SCLib.Load(446),3),
    SCConnectedProduct(SCLib.Load(445),2));
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels, Vertices.
   
    Name="(S^2~S^1)#2#L_3_1#+-(S^2~S^1)#2#L_3_1#+-(S^2~S^1)#2#L_3_1#+-(S^2xS^1)#
     2#L_3_1#+-(S^2xS^1)#2#L_3_1"
    Dim=3
   
   /SimplicialComplex]
   gap> SCHomology(c);
   [ [ 0, [  ] ], [ 10, [ 3, 3, 3, 3, 3 ] ], [ 9, [ 2 ] ], [ 0, [  ] ] ]
   gap> SCFpBettiNumbers(c,2);
   [ 1, 10, 10, 1 ]
   gap> SCFpBettiNumbers(c,3);
   [ 1, 15, 14, 0 ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIncidences}}
\logpage{[ 4, 5, 24 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIncidences( complex, dim )\index{SCIncidences@\texttt{SCIncidences}}
\label{SCIncidences}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of face lists upon success, \texttt{fail} otherwise.



 Returns an array of all \mbox{\texttt{dim}}-faces of \mbox{\texttt{complex}}. The array is sorted by the incidence of the face in the (\mbox{\texttt{dim}}+1)-skeleton of the complex, i. e. the $i$-th entry of the array contains all \mbox{\texttt{dim}}-faces with incidence $i$. The faces are returned in the original labeling. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,3],[2,3,4],[3,4,5],[4,5,6],[1,5,6],[1,4,6],[2,3,6]]);;
   gap> SCIncidences(c,1);
   [ [ [1, 2], [1, 3], [1, 4], [1, 5], 
       [2, 4], [2, 6], [3, 5], [3, 6] ], 
     [ [1, 6], [3, 4], [4, 5], [4, 6], [5, 6] ],
     [ [2, 3] ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIncidencesEx}}
\logpage{[ 4, 5, 25 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIncidencesEx( complex, dim )\index{SCIncidencesEx@\texttt{SCIncidencesEx}}
\label{SCIncidencesEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of face lists upon success, \texttt{fail} otherwise.



 Returns an array of all \mbox{\texttt{dim}}-faces of \mbox{\texttt{complex}}. The array is sorted by the incidence of the face in the (\mbox{\texttt{dim}}+1)-skeleton of the complex, i. e. the $i$-th entry of the array contains all \mbox{\texttt{dim}}-faces with incidence $i$. The faces are returned in the standard labeling. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,3],[2,3,4],[3,4,5],[4,5,6],[1,5,6],[1,4,6],[2,3,6]]);;
   gap> SCIncidences(c,1);
   [ [ [1, 2], [1, 3], [1, 4], [1, 5], 
       [2, 4], [2, 6], [3, 5], [3, 6] ], 
     [ [1, 6], [3, 4], [4, 5], [4, 6], [5, 6] ],
     [ [2, 3] ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCInterior}}
\logpage{[ 4, 5, 26 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCInterior( complex )\index{SCInterior@\texttt{SCInterior}}
\label{SCInterior}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 Computes all $(d-1)$-faces of a combinatorial $d$-pseudomanifold $C$ that occur in exactly two facets, i. e. returns the part of the $(d-1)$-skeleton of $C$ that is not part of the boundary. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,3,4],[1,2,3,5],[1,2,4,5],[1,3,4,5]]);;
   gap> SCInterior(c).Facets;
   [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5],
     [1, 4, 5]]
   gap> c:=SC([[1,2,3,4]]);;
   gap> SCInterior(c).Facets;
   []
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsCentrallySymmetric}}
\logpage{[ 4, 5, 27 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsCentrallySymmetric( complex )\index{SCIsCentrallySymmetric@\texttt{SCIsCentrallySymmetric}}
\label{SCIsCentrallySymmetric}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks, if a simplicial complex is centrally symmetric, i. e. if its
automorphism group contains a fixed point free involution. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(4);;
   gap> SCIsCentrallySymmetric(c);
   true
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;
   gap> SCIsCentrallySymmetric(c);
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsConnected}}
\logpage{[ 4, 5, 28 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsConnected( complex )\index{SCIsConnected@\texttt{SCIsConnected}}
\label{SCIsConnected}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks, if a simplicial complex is connected. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(1);;
   gap> SCIsConnected(c);
   false
   gap> c:=SCBdSimplex(2);;
   gap> SCIsConnected(c);
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsEmpty}}
\logpage{[ 4, 5, 29 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsEmpty( complex )\index{SCIsEmpty@\texttt{SCIsEmpty}}
\label{SCIsEmpty}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks if \mbox{\texttt{complex}} is empty 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1]]);;
   gap> SCIsEmpty(c);
   false
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([]);;
   gap> SCIsEmpty(c);
   true
   gap> c:=SC([[]]);;
   gap> SCIsEmpty(c);
   true
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsEulerianManifold}}
\logpage{[ 4, 5, 30 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsEulerianManifold( complex )\index{SCIsEulerianManifold@\texttt{SCIsEulerianManifold}}
\label{SCIsEulerianManifold}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks whether a given simplicial complex is a Eulerian manifold or not, i. e.
checks, if all vertex links of a combinatorial pseudomanifold have the Euler
characteristic of a sphere. In particular the function returns \texttt{false} in case of a bounded manifold. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;
   gap> SCIsEulerianManifold(c);
   true
   gap> moebius:=SCLib.Load(6); # a moebius strip
   gap> SCIsEulerianManifold(moebius);
   false
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsHomologySphere}}
\logpage{[ 4, 5, 31 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsHomologySphere( complex )\index{SCIsHomologySphere@\texttt{SCIsHomologySphere}}
\label{SCIsHomologySphere}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} or \texttt{false} upon success, \texttt{fail} otherwise.



 Checks, whether the \mbox{\texttt{complex}} given is a homology sphere, or not. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[2,3],[3,4],[4,2]]);;
   gap> SCIsHomologySphere(c);
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsInKd}}
\logpage{[ 4, 5, 32 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsInKd( complex, k )\index{SCIsInKd@\texttt{SCIsInKd}}
\label{SCIsInKd}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 an integer upon success, \texttt{fail} otherwise.



 Checks, whether the complex is in the class $K^k(d)$ of simplicial complexes that only have k-stacked spheres as vertex links.
Returns the minimal determined $k$ for which the membership was tested or 0 if the membership test could not be
decided for the given complex. Internally calls \texttt{SCIsKStackedSphere} (\ref{SCIsKStackedSphere}) for all links. Please note that this is a radomized algorithm that may give an
indefinite answer to the membership problem. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("S^2~S^1");   
   [ [ 14, "S^2~S^1 (VT)" ], [ 29, "S^2~S^1 (VT)" ], [ 34, "S^2~S^1 (VT)" ], 
     [ 42, "S^2~S^1 (VT)" ], [ 48, "S^2~S^1 (VT)" ], [ 49, "S^2~S^1 (VT)" ], 
     [ 84, "S^2~S^1 (VT)" ], [ 87, "S^2~S^1 (VT)" ], [ 90, "(S^2~S^1)#2" ], ...
   gap> c:=SCLib.Load(14);;
   gap> c.AutomorphismGroup;
   D18
   gap> SCIsInKd(c,1);
   #I  SCIsInKd: checking link 1/9
   #I  SCIsKStackedSphere: try 1/50
   round 0: [ 7, 15, 10 ]
   round 1: [ 6, 12, 8 ]
   round 2: [ 5, 9, 6 ]
   round 3: [ 4, 6, 4 ]
   Computed locally minimal complex after 4 rounds.
   #I  SCIsInKd: complex has transitive automorphism group, all links are 
   1-stacked.
   1
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsKNeighborly}}
\logpage{[ 4, 5, 33 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsKNeighborly( complex, k )\index{SCIsKNeighborly@\texttt{SCIsKNeighborly}}
\label{SCIsKNeighborly}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks, if a simplicial complex is $k$-neighborly, i. e. if it contains all possible ${f_0 \choose k}$ $(k-1)$-simplices, where $f_0$ denotes the number of simplices. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^2");   
   [ [ 3, "RP^2 (VT)" ], [ 284, "RP^2xS^1" ] ]
   gap> rp2_6:=SCLib.Load(3);;
   gap> SCFVector(rp2_6);
   [6, 15, 10]
   gap> SCIsKNeighborly(rp2_6,2);
   true
   gap> SCIsKNeighborly(rp2_6,3);
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsOrientable}}
\logpage{[ 4, 5, 34 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsOrientable( complex )\index{SCIsOrientable@\texttt{SCIsOrientable}}
\label{SCIsOrientable}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks, if a combinatorial pseudomanifold is orientable. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(4);;
   gap> SCIsOrientable(c);
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsPseudoManifold}}
\logpage{[ 4, 5, 35 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsPseudoManifold( complex )\index{SCIsPseudoManifold@\texttt{SCIsPseudoManifold}}
\label{SCIsPseudoManifold}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks, if every $(d-1)$-face of \mbox{\texttt{complex}} is contained in exactly $2$ facets. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   # Two 2-spheres glued together at [1]
   gap> c:=SC([[1,2,3],[1,2,4],[1,3,4],[2,3,4],[1,5,6],[1,5,7],[1,6,7],[5,6,7]]);;
   gap> SCIsPseudoManifold(c);
   true
   # Two circles glued together a 1
   gap> c:=SC([[1,2],[2,3],[3,1],[1,4],[4,5],[5,1]]);;
   gap> SCIsPseudoManifold(c);
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsPure}}
\logpage{[ 4, 5, 36 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsPure( complex )\index{SCIsPure@\texttt{SCIsPure}}
\label{SCIsPure}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a pair of the form \texttt{[ integer, boolean ]} upon success, \texttt{fail} otherwise.



 Checks, if a simplicial complex is pure. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2], [1,4], [2,4], [2,3,4]]);;
   gap> SCIsPure(c);
   false
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2], [1,4], [2,4]]);;
   gap> SCIsPure(c);
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsShellable}}
\logpage{[ 4, 5, 37 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsShellable( complex )\index{SCIsShellable@\texttt{SCIsShellable}}
\label{SCIsShellable}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks, if a bounded simplical complex is shellable. See \cite{Ziegler95LectPolytopes}, \cite{Pachner87KonstrMethKombHomeo} to learn more about shellings. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(4);;       
   gap> c:=Difference(c,SC([[1,3,5,7]]));; # bounded version
   gap> SCIsShellable(c);
   true
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsStronglyConnected}}
\logpage{[ 4, 5, 38 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsStronglyConnected( complex )\index{SCIsStronglyConnected@\texttt{SCIsStronglyConnected}}
\label{SCIsStronglyConnected}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks, if a simplicial complex is strongly connected, i. e. if for any pair
of facets $(\hat{\Delta},\tilde{\Delta})$ there exists a sequence of facets $( \Delta_1 , \ldots , \Delta_n )$ with $\Delta_1 = \hat{\Delta}$ and $\Delta_n = \tilde{\Delta}$ and dim$(\Delta_i , \Delta_{i+1} ) = d - 1$ for all $1 \leq i \leq n - 1$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   # Two 2-spheres, glued along [1]
   gap> c:=SC([[1,2,3],[1,2,4],[1,3,4],[2,3,4],[1,5,6],[1,5,7],[1,6,7],[5,6,7]]);
   gap> SCIsConnected(c);        
   true
   gap> SCIsStronglyConnected(c);                                                
   false
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMinimalNonFaces}}
\logpage{[ 4, 5, 39 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMinimalNonFaces( complex )\index{SCMinimalNonFaces@\texttt{SCMinimalNonFaces}}
\label{SCMinimalNonFaces}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of face lists upon success, \texttt{fail} otherwise.



 Computes all missing proper faces of \mbox{\texttt{complex}} by calling \texttt{SCMinimalNonFacesEx} (\ref{SCMinimalNonFacesEx}). The simplices are returned in the original labeling of \mbox{\texttt{complex}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets(["abc","abd"]);;
   gap> SCMinimalNonFaces(c);           
   [ [  ], [ "cd" ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMinimalNonFacesEx}}
\logpage{[ 4, 5, 40 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMinimalNonFacesEx( complex )\index{SCMinimalNonFacesEx@\texttt{SCMinimalNonFacesEx}}
\label{SCMinimalNonFacesEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of face lists upon success, \texttt{fail} otherwise.



 Computes all missing proper faces of \mbox{\texttt{complex}}, i.e. the missing $(i+1)$-tuples in the $i$-dim. skeleton of a complex in minimal dimension. A missing $(i+1)$-tuple is not listed if it only consists of missing $i$-tuples. Note, that whenever \mbox{\texttt{complex}} is $k$-neighborly the first $k+1$ entries are empty. Note that the simplices returned are in standard labeling $1,\dots,n$, where $n$ is the number of vertices of \mbox{\texttt{complex}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("T^2"); 
   [ [ 5, "T^2 (VT)" ], [ 7, "T^2 (VT)" ], [ 11, "T^2 (VT)" ], 
     [ 12, "T^2 (VT)" ], [ 20, "T^2 (VT)" ], [ 22, "(T^2)#2" ], 
     [ 27, "(T^2)#3" ], [ 41, "T^2 (VT)" ], [ 44, "(T^2)#4" ], ... 
   gap> torus:=SCLib.Load(5);;
   gap> SCFVector(torus);
   [7, 21, 14]
   gap> SCMinimalNonFacesEx(torus);
   [ [  ], [  ] ]
   gap> SCMinimalNonFacesEx(SCBdCrossPolytope(4));
   [ [  ], [  ], 
     [ [ 1 .. 3 ], [ 1, 2, 4 ], [ 1, 2, 5 ], [ 1, 2, 6 ], [ 1, 2, 7 ], 
       [ 1, 2, 8 ], [ 1, 3, 4 ], [ 1, 5, 6 ], [ 1, 7, 8 ], [ 2, 3, 4 ], 
       [ 2, 5, 6 ], [ 2, 7, 8 ], [ 3, 4, 5 ], [ 3, 4, 6 ], [ 3, 4, 7 ], 
       [ 3, 4, 8 ], [ 3, 5, 6 ], [ 3, 7, 8 ], [ 4, 5, 6 ], [ 4, 7, 8 ], 
       [ 5, 6, 7 ], [ 5, 6, 8 ], [ 5, 7, 8 ], [ 6, 7, 8 ] ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCName}}
\logpage{[ 4, 5, 41 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCName( complex )\index{SCName@\texttt{SCName}}
\label{SCName}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a string upon success, \texttt{fail} otherwise.



 Returns the name of \mbox{\texttt{complex}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(5);;
   gap> SCName(c);
   "S^4_6"
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2],[2,3],[3,1]]);;
   gap> SCName(c);
   "unnamed complex n"
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNeighborliness}}
\logpage{[ 4, 5, 42 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNeighborliness( complex )\index{SCNeighborliness@\texttt{SCNeighborliness}}
\label{SCNeighborliness}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a positive integer upon success, \texttt{fail} otherwise.



 Returns $k$ if a simplicial complex is $k$-neighborly but not $(k+1)$-neighborly. See also \texttt{SCIsKNeighborly} (\ref{SCIsKNeighborly})\\
 Note, that every complex is at least $1$-neighborly. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;
   gap> SCNeighborliness(c);
   4
   gap> c:=SCBdCrossPolytope(4);;
   gap> SCNeighborliness(c);
   1
   gap> SCLib.SearchByAttribute("F[3]=Binomial(F[1],3)");
   [ [ 10, "S^5 (VT)" ], [ 17, "CP^2 (VT)" ], [ 18, "S^5 (VT)" ], 
     [ 38, "S^5 (VT)" ], [ 39, "S^6 (VT)" ], [ 40, "S^7 (VT)" ], 
     [ 53, "S^5 (VT)" ], [ 54, "S^5 (VT)" ], [ 55, "S^7 (VT)" ], ... 
   gap> cp2:=SCLib.Load(17);;
   gap> SCNeighborliness(cp2);
   3
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNumFaces}}
\logpage{[ 4, 5, 43 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNumFaces( complex[, i] )\index{SCNumFaces@\texttt{SCNumFaces}}
\label{SCNumFaces}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 an integer or a list of integers upon success, \texttt{fail} otherwise.



 Computes the $f$-vector of the simplicial complex \mbox{\texttt{complex}}, . i. e. the number of $i$-dimensional faces for $ 0 \leq i \leq d $, where $d$ is the dimension of the complex. Note that a value of \mbox{\texttt{i}}=$k$ calculates the number of $(k-1)$-faces of \mbox{\texttt{complex}}. A memory-saving implicit algorithm is used that avoids calculating the face
lattice of the complex. If the optional integer parameter \mbox{\texttt{i}} is passed, only the \mbox{\texttt{i}}-th position of the face vector of \mbox{\texttt{complex}} is calculated. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> complex:=SC([[1,2,3], [1,2,4], [1,3,4], [2,3,4]]);;
   gap> SCNumFaces(complex,1);
   4
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCOrientation}}
\logpage{[ 4, 5, 44 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCOrientation( complex )\index{SCOrientation@\texttt{SCOrientation}}
\label{SCOrientation}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of the type $\{ \pm 1 \}^{f_d}$ / \texttt{[ ]} upon success, \texttt{fail} otherwise.



 This function tries to compute an orientation of a pure simplicial complex
that fulfills the pseudomanifold property. If \mbox{\texttt{complex}} is orientable, an orientation in form of a list of orientations for the facets
of \mbox{\texttt{complex}} is returned, otherwise an empty set. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(4);;
   gap> SCOrientation(c);
   [ 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1 ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCSkel}}
\logpage{[ 4, 5, 45 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCSkel( complex, dim )\index{SCSkel@\texttt{SCSkel}}
\label{SCSkel}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a face list upon success, \texttt{fail} otherwise.



 Computes the \mbox{\texttt{dim}}-skeleton of a simplcial complex, i. e. all \mbox{\texttt{dim}}-faces of \mbox{\texttt{complex}}, if \mbox{\texttt{dim}} is an integer value. If \mbox{\texttt{dim}} is a list, a list of all \mbox{\texttt{dim}}\texttt{[i]}-faces of \mbox{\texttt{complex}} for each entry \mbox{\texttt{dim}}\texttt{[i]} (which has to be an integer) is returned. The faces are returned in the
original labeling. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^2"); 
   [ [ 3, "RP^2 (VT)" ], [ 284, "RP^2xS^1" ] ]
   gap> rp2_6:=SCLib.Load(3);;      
   gap> rp2_6:=SC(rp2_6.Facets+10);;
   gap> SCSkelEx(rp2_6,1);
   [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 1, 5 ], [ 1, 6 ], [ 2, 3 ], [ 2, 4 ], 
     [ 2, 5 ], [ 2, 6 ], [ 3, 4 ], [ 3, 5 ], [ 3, 6 ], [ 4, 5 ], [ 4, 6 ], 
     [ 5, 6 ] ]
   gap> SCSkel(rp2_6,1);  
   [ [ 11, 12 ], [ 11, 13 ], [ 11, 14 ], [ 11, 15 ], [ 11, 16 ], [ 12, 13 ], 
     [ 12, 14 ], [ 12, 15 ], [ 12, 16 ], [ 13, 14 ], [ 13, 15 ], [ 13, 16 ], 
     [ 14, 15 ], [ 14, 16 ], [ 15, 16 ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCSkelEx}}
\logpage{[ 4, 5, 46 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCSkelEx( complex, dim )\index{SCSkelEx@\texttt{SCSkelEx}}
\label{SCSkelEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a face list upon success, \texttt{fail} otherwise.



 Computes the \mbox{\texttt{dim}}-skeleton of a simplcial complex, i. e. all \mbox{\texttt{dim}}-faces of \mbox{\texttt{complex}}, if \mbox{\texttt{dim}} is an integer value. If \mbox{\texttt{dim}} is a list, a list of all \mbox{\texttt{dim}}\texttt{[i]}-faces of \mbox{\texttt{complex}} for each entry \mbox{\texttt{dim}}\texttt{[i]} (which has to be an integer) is returned. The faces are returned in the
standard labeling. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^2"); 
   [ [ 3, "RP^2 (VT)" ], [ 284, "RP^2xS^1" ] ]
   gap> rp2_6:=SCLib.Load(3);;      
   gap> rp2_6:=SC(rp2_6.Facets+10);;
   gap> SCSkelEx(rp2_6,1);
   [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 1, 5 ], [ 1, 6 ], [ 2, 3 ], [ 2, 4 ], 
     [ 2, 5 ], [ 2, 6 ], [ 3, 4 ], [ 3, 5 ], [ 3, 6 ], [ 4, 5 ], [ 4, 6 ], 
     [ 5, 6 ] ]
   gap> SCSkel(rp2_6,1);  
   [ [ 11, 12 ], [ 11, 13 ], [ 11, 14 ], [ 11, 15 ], [ 11, 16 ], [ 12, 13 ], 
     [ 12, 14 ], [ 12, 15 ], [ 12, 16 ], [ 13, 14 ], [ 13, 15 ], [ 13, 16 ], 
     [ 14, 15 ], [ 14, 16 ], [ 15, 16 ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCSpanningTree}}
\logpage{[ 4, 5, 47 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCSpanningTree( complex )\index{SCSpanningTree@\texttt{SCSpanningTree}}
\label{SCSpanningTree}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a spanning tree of \mbox{\texttt{complex}} upon success, \texttt{fail} otherwise.



 Computes a spanning tree of \mbox{\texttt{complex}} which must be a connected simplicial complex with a greedy algorithm and
returns it in form of a \texttt{SCSimplicialComplex} object. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([["a","b","c"],["a","b","d"], ["a","c","d"], ["b","c","d"]]);;
   gap> s:=SCSpanningTree(c);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="spanning tree of unnamed complex n"
    Dim=1
   
   /SimplicialComplex]
   gap> s.Facets;
   [ [ "a", "b" ], [ "a", "c" ], [ "a", "d" ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCVertices}}
\logpage{[ 4, 5, 48 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCVertices( complex )\index{SCVertices@\texttt{SCVertices}}
\label{SCVertices}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of vertex labels upon success, \texttt{fail} otherwise.



 Returns vertex labels. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> sphere:=SC([["x",45,[1,1]],["x",45,["b",3]],["x",[1,1],
     ["b",3]],[45,[1,1],["b",3]]]);;
   gap> SCVerticesEx(sphere);
   [1, 2, 3, 4]
   gap> SCVertices(sphere);
   [ 45, [ 1, 1 ], "x", [ "b", 3 ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCVerticesEx}}
\logpage{[ 4, 5, 49 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCVerticesEx( complex )\index{SCVerticesEx@\texttt{SCVerticesEx}}
\label{SCVerticesEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 $[ 1, \ldots , n ]$ upon success, \texttt{fail} otherwise.



 Returns $\left[1, \ldots , n \right]$, where $n$ is the number of vertices of \mbox{\texttt{complex}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,4,5],[4,9,8],[12,13,14,15,16,17]]);;
   gap> SCVerticesEx(c);
   [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Operations on simplicial complexes}}\logpage{[ 4, 6, 0 ]}
{
  The following functions perform operations on simplicial complexes. Most of
them return simplicial complexes. Thus, this section is closely related to
section ''Generate new complexes from old'' earlier in this chapter. However,
the data generated here is rather seen as an intrinsic attribute of the
original complex and not as an independent complex. 

\subsection{\textcolor{Chapter }{SCAlexanderDual}}
\logpage{[ 4, 6, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCAlexanderDual( complex )\index{SCAlexanderDual@\texttt{SCAlexanderDual}}
\label{SCAlexanderDual}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 The Alexander dual of \mbox{\texttt{complex}} is the simplicial complex whose faces are the complements of the nonfaces of \mbox{\texttt{complex}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   # a square
   gap> c:=SC([[1,2],[2,3],[3,4],[4,1]]);;
   gap> dual:=SCAlexanderDual(c);;
   gap> dual.F;
   [4, 2]
   gap> dual.IsConnected;
   false
   gap> dual.Facets;
   [[1, 3], [2, 4]]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCCollapseGreedy}}
\logpage{[ 4, 6, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCCollapseGreedy( complex )\index{SCCollapseGreedy@\texttt{SCCollapseGreedy}}
\label{SCCollapseGreedy}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Employs a greedy collapsing algorithm in order to collapse \mbox{\texttt{complex}}. The source code of this function is taken from \cite{Lutz08ManifoldPage}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("T^2"); 
   [ [ 5, "T^2 (VT)" ], [ 7, "T^2 (VT)" ], [ 11, "T^2 (VT)" ], 
     [ 12, "T^2 (VT)" ], [ 20, "T^2 (VT)" ], [ 22, "(T^2)#2" ], 
     [ 27, "(T^2)#3" ], [ 41, "T^2 (VT)" ], [ 44, "(T^2)#4" ], ... 
   gap> torus:=SCLib.Load(5);;
   gap> torus:=SCLib.Load(5);;                             
   gap> bdtorus:=SCDifference(torus,SC([torus.Facets[1]]));;
   gap> coll:=SCCollapseGreedy(bdtorus);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="collapsed version of T^2 (VT) \ unnamed complex n"
    Dim=1
   
   /SimplicialComplex]
   gap> coll.Facets;
   [ [ 3, 6 ], [ 3, 7 ], [ 5, 6 ], [ 5, 7 ], [ 6, 7 ] ]
   gap> sphere:=SCBdSimplex(4);;                              
   gap> bdsphere:=SCDifference(sphere,SC([sphere.Facets[1]]));;
   gap> coll:=SCCollapseGreedy(bdsphere);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="collapsed version of S^3_5 \ unnamed complex n"
    Dim=0
   
   /SimplicialComplex]
   gap> coll.Facets;                     
   [ [ 5 ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCCone}}
\logpage{[ 4, 6, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCCone(  )\index{SCCone@\texttt{SCCone}}
\label{SCCone}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 Takes a new vertex $v$ and unites every facet with it. The function returns the new complex in the
standard vertex labeling from $1$ to $(n+1)$. The apex of the cone is $(n+1)$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^3");
   [ [ 45, "RP^3" ], [ 103, "RP^3=L(2,1) (VT)" ], [ 246, "(S^2~S^1)#RP^3" ], 
     [ 247, "(S^2xS^1)#RP^3" ], [ 283, "(S^2~S^1)#2#RP^3" ], 
     [ 285, "(S^2xS^1)#2#RP^3" ], [ 409, "RP^3#RP^3" ], ...
   gap> rp3:=SCLib.Load(45);;
   gap> rp3.F;
   [11, 51, 80, 40]
   gap> cone:=SCCone(rp3);;
   gap> cone.F;
   [12, 62, 131, 120, 40]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCDeletedJoin}}
\logpage{[ 4, 6, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCDeletedJoin( complex1, complex2 )\index{SCDeletedJoin@\texttt{SCDeletedJoin}}
\label{SCDeletedJoin}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Calculates the simplicial deleted join of the simplicial complexes \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}}. Internally falls back to the \textsf{homology} package \cite{Dumas04Homology} if called with a facet list and does not interfere with the \textsf{homology} package. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> deljoin:=SCDeletedJoin(SCBdSimplex(3),SCBdSimplex(3));
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="S^2_4 deljoin S^2_4"
    Dim=3
   
   /SimplicialComplex]
   gap> bddeljoin:=SCBoundary(deljoin);;
   gap> bddeljoin.Homology;
   [ [ 1, [  ] ], [ 0, [  ] ], [ 2, [  ] ] ]
   gap> deljoin.Facets;
   [ [ [ 1, 1 ], [ 2, 1 ], [ 3, 1 ], [ 4, 2 ] ],
     [ [ 1, 1 ], [ 2, 1 ], [ 3, 2 ], [ 4, 1 ] ],
     [ [ 1, 1 ], [ 2, 1 ], [ 3, 2 ], [ 4, 2 ] ],
     [ [ 1, 1 ], [ 2, 2 ], [ 3, 1 ], [ 4, 1 ] ],
     [ [ 1, 1 ], [ 2, 2 ], [ 3, 1 ], [ 4, 2 ] ],
     [ [ 1, 1 ], [ 2, 2 ], [ 3, 2 ], [ 4, 1 ] ],
     [ [ 1, 1 ], [ 2, 2 ], [ 3, 2 ], [ 4, 2 ] ],
     [ [ 1, 2 ], [ 2, 1 ], [ 3, 1 ], [ 4, 1 ] ],
     [ [ 1, 2 ], [ 2, 1 ], [ 3, 1 ], [ 4, 2 ] ],
     [ [ 1, 2 ], [ 2, 1 ], [ 3, 2 ], [ 4, 1 ] ],
     [ [ 1, 2 ], [ 2, 1 ], [ 3, 2 ], [ 4, 2 ] ],
     [ [ 1, 2 ], [ 2, 2 ], [ 3, 1 ], [ 4, 1 ] ],
     [ [ 1, 2 ], [ 2, 2 ], [ 3, 1 ], [ 4, 2 ] ],
     [ [ 1, 2 ], [ 2, 2 ], [ 3, 2 ], [ 4, 1 ] ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCDifference}}
\logpage{[ 4, 6, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCDifference( complex1, complex2 )\index{SCDifference@\texttt{SCDifference}}
\label{SCDifference}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Forms the ``difference'' of two simplicial complexes \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} as the simplicial complex formed by the difference of the face lattices of \mbox{\texttt{complex1}} minus \mbox{\texttt{complex2}}. The two arguments are not altered. Note: for the difference process the
vertex labelings of the complexes are taken into account, see also \texttt{Operation Difference (SCSimplicialComplex, SCSimplicialComplex)} (\ref{Operation Difference (SCSimplicialComplex, SCSimplicialComplex)}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> d:=SC([[1,2,3]]);;
   gap> disc:=SCDifference(c,d);;
   gap> disc.Facets;
   [ [ 1, 2, 4 ], [ 1, 3, 4 ], [ 2, 3, 4 ] ]
   gap> empty:=SCDifference(d,c);;
   gap> empty.Dim;
   -1
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCHandleAddition}}
\logpage{[ 4, 6, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCHandleAddition( complex, f1, f2 )\index{SCHandleAddition@\texttt{SCHandleAddition}}
\label{SCHandleAddition}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 simplicial complex obtained by identifying the vertices of facet \mbox{\texttt{f1}} with the ones of facet \mbox{\texttt{f2}} in \mbox{\texttt{complex}}. \texttt{fail} upon an error.



 A combinatorial handle addition is possible, whenever we have d$(v,w) \geq 3$ for any two vertices $v \in $\mbox{\texttt{f1}} and $w \in $\mbox{\texttt{f2}}, where d$(\cdot,\cdot)$ is the length of the shortest path from $v$ to $w$. This condition is not checked by this algorithm. See. \cite{Bagchi08OnWalkupKd} for further information. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,4],[2,4,5],[2,3,5],[3,5,6],[1,3,6],[1,4,6]]);;
   gap> c:=SCUnion(c,SCUnion(SCCopy(c)+3,SCCopy(c)+6));;
   gap> c:=SCUnion(c,SC([[1,2,3],[10,11,12]]));;
   gap> c.Facets;
   [[1, 2, 3], [1, 2, 4], [1, 3, 6], [1, 4, 6], [2, 3, 5],
     [2, 4, 5], [3, 5, 6], [4, 5, 7], [4, 6, 9], [4, 7, 9],
     [5, 6, 8], [5, 7, 8], [6, 8, 9], [7, 8, 10], [7, 9, 12],
     [7, 10, 12], [8, 9, 11], [8, 10, 11], [9, 11, 12], [10, 11, 12]]
   gap> c.Homology;
   [[0, []], [0, []], [1, []]]
   gap> torus:=SCHandleAddition(c,[1,2,3],[10,11,12]);;
   gap> torus.Homology;
   [[0, []], [2, []], [1, []]]
   gap> ism:=SCIsManifold(torus);;
   gap> ism;
   true
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIntersection}}
\logpage{[ 4, 6, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIntersection( complex1, complex2 )\index{SCIntersection@\texttt{SCIntersection}}
\label{SCIntersection}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Forms the ``intersection'' of two simplicial complexes \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} as the simplicial complex formed by the intersection of the face lattices of \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}}. The two arguments are not altered. Note: for the intersection process the
vertex labelings of the complexes are taken into account. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;        
   gap> d:=SCBdSimplex(3)+1;;      
   gap> d.Facets;
   [ [ 2, 3, 4 ], [ 2, 3, 5 ], [ 2, 4, 5 ], [ 3, 4, 5 ] ]
   gap> c:=SCBdSimplex(3);;  
   gap> d:=SCBdSimplex(3);;  
   gap> d:=SCMove(d,[[1,2,3],[]])+1;;
   gap> s1:=SCIntersection(c,d);;
   gap> s1.Facets;               
   [ [ 2, 3 ], [ 2, 4 ], [ 3, 4 ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsIsomorphic}}
\logpage{[ 4, 6, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsIsomorphic( complex1, complex2 )\index{SCIsIsomorphic@\texttt{SCIsIsomorphic}}
\label{SCIsIsomorphic}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 \texttt{true} is returned, if \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} are combinatorially isomorphic, \texttt{false} if not. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c1:=SC([[11,12,13],[11,12,14],[11,13,14],[12,13,14]]);;
   gap> c2:=SCBdSimplex(3);;
   gap> SCIsIsomorphic(c1,c2);
   true
   gap> c3:=SCBdCrossPolytope(3);;
   gap> SCIsIsomorphic(c1,c3);
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsSubcomplex}}
\logpage{[ 4, 6, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsSubcomplex( sc1, sc2 )\index{SCIsSubcomplex@\texttt{SCIsSubcomplex}}
\label{SCIsSubcomplex}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} if \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} are combinatorially isomorphic, \texttt{false} otherwise.



 Returns \texttt{true} if \mbox{\texttt{sc2}} is a subcomplex of \mbox{\texttt{sc1}}, \texttt{false} otherwise. If dim(\mbox{\texttt{sc2}}) $\leq$ dim(\mbox{\texttt{sc1}}) the facets of \mbox{\texttt{sc2}} are compared with the dim(\mbox{\texttt{sc2}})-skeleton of \mbox{\texttt{sc1}}. Only works for pure simplicial complexes. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByAttribute("F[1]=10");
   [ [ 19, "K^2 (VT)" ], [ 20, "T^2 (VT)" ], [ 21, "S^3 (VT)" ], 
     [ 22, "(T^2)#2" ], [ 23, "S^3 (VT)" ], [ 24, "S^2xS^1 (VT)" ], 
     [ 25, "S^3 (VT)" ], [ 26, "S^4 (VT)" ], [ 27, "(T^2)#3" ], ...
   gap> t2:=SCLib.Load(20);;
   gap> c:=SCBdSimplex(9);;
   gap> t2.F;
   [10, 30, 20]
   gap> c.F;
   [10, 45, 120, 210, 252, 210, 120, 45, 10]
   gap> SCIsSubcomplex(c,t2);
   true
   gap> SCIsSubcomplex(t2,c);
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsomorphism}}
\logpage{[ 4, 6, 10 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsomorphism( complex1, complex2 )\index{SCIsomorphism@\texttt{SCIsomorphism}}
\label{SCIsomorphism}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of vertex labels upon success, \texttt{fail} otherwise.



 Returns an isomorphism of \mbox{\texttt{complex1}} to \mbox{\texttt{complex2}} in the original labeling if they are combinatorially isomorphic, \texttt{false} otherwise. Internally calls \texttt{SCIsomorphismEx} (\ref{SCIsomorphismEx})\texttt{(complex1,complex2);} 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c1:=SC([[11,12,13],[11,12,14],[11,13,14],[12,13,14]]);;
   gap> c2:=SCBdSimplex(3);;
   gap> SCIsomorphism(c1,c2);
   [ [ 11, 1 ], [ 12, 2 ], [ 13, 3 ], [ 14, 4 ] ]
   gap> SCIsomorphismEx(c1,c2);
   [ [ [ 1, 1 ], [ 2, 2 ], [ 3, 3 ], [ 4, 4 ] ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsomorphismEx}}
\logpage{[ 4, 6, 11 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsomorphismEx( complex1, complex2 )\index{SCIsomorphismEx@\texttt{SCIsomorphismEx}}
\label{SCIsomorphismEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of vertex labels upon success, \texttt{fail} otherwise.



 Returns an isomorphism of \mbox{\texttt{complex1}} to \mbox{\texttt{complex2}} in the standard labeling if they are combinatorially isomorphic, \texttt{false} otherwise. If $f$-vector and Altshuler-Steinberg determinant are equal, the internal function \texttt{SCIntFunc.SCComputeIsomorphismsEx"(complex1,complex2,true)} is called. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c1:=SC([[11,12,13],[11,12,14],[11,13,14],[12,13,14]]);;
   gap> c2:=SCBdSimplex(3);;
   gap> SCIsomorphism(c1,c2);
   [ [ 11, 1 ], [ 12, 2 ], [ 13, 3 ], [ 14, 4 ] ]
   gap> SCIsomorphismEx(c1,c2);
   [ [ [ 1, 1 ], [ 2, 2 ], [ 3, 3 ], [ 4, 4 ] ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCJoin}}
\logpage{[ 4, 6, 12 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCJoin( complex1, complex2 )\index{SCJoin@\texttt{SCJoin}}
\label{SCJoin}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Calculates the simplicial join of the simplicial complexes \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}}. Internally falls back to the homology package \cite{Dumas04Homology} and does not interfere with the homology package. Note that the vertex
labelings of the complexes passed as arguments are not propagated to the new
complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> sphere:=SCJoin(SCBdSimplex(2),SCBdSimplex(2));
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="S^1_3 join S^1_3"
    Dim=3
   
   /SimplicialComplex]
   gap> SCHasBoundary(sphere);
   false
   gap> sphere.Facets;
   [ [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ],
     [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 3 ] ],
     [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 3 ] ],
     [ [ 1, 1 ], [ 1, 3 ], [ 2, 1 ], [ 2, 2 ] ],
     [ [ 1, 1 ], [ 1, 3 ], [ 2, 1 ], [ 2, 3 ] ],
     [ [ 1, 1 ], [ 1, 3 ], [ 2, 2 ], [ 2, 3 ] ],
     [ [ 1, 2 ], [ 1, 3 ], [ 2, 1 ], [ 2, 2 ] ],
     [ [ 1, 2 ], [ 1, 3 ], [ 2, 1 ], [ 2, 3 ] ],
     [ [ 1, 2 ], [ 1, 3 ], [ 2, 2 ], [ 2, 3 ] ] ]
   gap> sphere.Homology;
   [ [ 0, [  ] ], [ 0, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ]
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> ball:=SCJoin(SC([[1]]),SCBdSimplex(2));
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="unnamed complex n join S^1_3"
    Dim=2
   
   /SimplicialComplex]
   gap> ball.Homology;
   [ [ 0, [  ] ], [ 0, [  ] ], [ 0, [  ] ] ]
   gap> ball.Facets;
   [ [ [ 1, 1 ], [ 2, 1 ], [ 2, 2 ] ], [ [ 1, 1 ], [ 2, 1 ], [ 2, 3 ] ],
     [ [ 1, 1 ], [ 2, 2 ], [ 2, 3 ] ] ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLink}}
\logpage{[ 4, 6, 13 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLink( complex, face )\index{SCLink@\texttt{SCLink}}
\label{SCLink}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 Computes the link of \mbox{\texttt{face}} in \mbox{\texttt{complex}}, i. e. all facets containing \mbox{\texttt{face}}, reduced by \mbox{\texttt{face}}. if \mbox{\texttt{complex}} is pure, the resulting complex is of dimension dim(\mbox{\texttt{complex}}) - dim(\mbox{\texttt{face}}) $-1$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^2");     
   [ [ 3, "RP^2 (VT)" ], [ 284, "RP^2xS^1" ] ]
   gap> rp2:=SCLib.Load(3);;
   gap> SCVertices(rp2);
   [1, 2, 3, 4, 5, 6]
   gap> SCLink(rp2,[1]);
   [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels.
  
   Name="unnamed complex n"
   Dim=1
  
   /SimplicialComplex]
   gap> last.Facets;
   [[2, 3], [2, 6], [3, 5], [4, 5], [4, 6]]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLinks}}
\logpage{[ 4, 6, 14 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLinks( complex, dim )\index{SCLinks@\texttt{SCLinks}}
\label{SCLinks}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of new simplicial complexes upon success, \texttt{fail} otherwise.



 Computes the link of all \mbox{\texttt{dim}}-faces in \mbox{\texttt{complex}} and stores them in a list of simplicial complexes. Internally calls \texttt{SCLink} (\ref{SCLink}) for every face. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;
   # all vertex links -> 2 spheres
   gap> SCLinks(c,0);
   [ [SimplicialComplex
       
        Properties known: Dim, Facets, Name, VertexLabels.
       
        Name="lk([ 1 ]) in S^3_5"
        Dim=2
       
       /SimplicialComplex], # ... etc 
  ]
   # all edge links -> circles
   gap> SCLinks(c,1);
   [ [SimplicialComplex
       
        Properties known: Dim, Facets, Name, VertexLabels.
       
        Name="lk([ 1, 2 ]) in S^3_5"
        Dim=1
       
       /SimplicialComplex], # ... etc
   ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNeighbors}}
\logpage{[ 4, 6, 15 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNeighbors( complex, face )\index{SCNeighbors@\texttt{SCNeighbors}}
\label{SCNeighbors}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a list of faces upon success, \texttt{fail} otherwise.



 Computes the neighboring faces of a given \mbox{\texttt{face}} in \mbox{\texttt{complex}}. A neighboring face is a face distinct from \mbox{\texttt{face}} that must have the same dimension as \mbox{\texttt{face}} and intersect \mbox{\texttt{face}} in a $(d-1)$-face, where \mbox{\texttt{face}} is of dimensions $d$. The face is returned in original labeling. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets(Combinations(["a","b","c"],2));
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="unnamed complex n"
    Dim=1
   
   /SimplicialComplex]
   gap> SCNeighbors(c,["a","d"]);
   [ [ "a", "b" ], [ "a", "c" ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNeighborsEx}}
\logpage{[ 4, 6, 16 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNeighborsEx( complex, face )\index{SCNeighborsEx@\texttt{SCNeighborsEx}}
\label{SCNeighborsEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a list of faces upon success, \texttt{fail} otherwise.



 Computes the neighboring faces of a given \mbox{\texttt{face}} in standard labeling in \mbox{\texttt{complex}}. A neighboring face is a face distinct from \mbox{\texttt{face}} that must have the same dimension as \mbox{\texttt{face}} and intersect \mbox{\texttt{face}} in a $(d-1)$-face, where \mbox{\texttt{face}} is of dimensions $d$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets(Combinations(["a","b","c"],2));
   [SimplicialComplex
   
    Properties known: Chi, Dim, Facets, Name, VertexLabels.
   
    Name="unnamed complex n"
    Dim=1
   
   /SimplicialComplex]
   gap> SCLabels(c);
   [ "a", "b", "c" ]
   gap> SCNeighborsEx(c,[1,2]);
   [ [ 1, 3 ], [ 2, 3 ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCShelling}}
\logpage{[ 4, 6, 17 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCShelling( complex )\index{SCShelling@\texttt{SCShelling}}
\label{SCShelling}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a permuted list of the facets of \mbox{\texttt{complex}} upon success, \texttt{fail} otherwise.



 \mbox{\texttt{complex}} must be a pure, strongly connected pseudomanifold with boundary. 

 Internally calls \texttt{SCShellingExt} (\ref{SCShellingExt})\texttt{(complex,false,[]);}. To learn more about shellings see \cite{Ziegler95LectPolytopes}, \cite{Pachner87KonstrMethKombHomeo}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,3],[1,2,4],[1,3,4]]);;
   gap> SCShelling(c);
   [[1, 2, 3], [1, 2, 4], [1, 3, 4]]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCShellingExt}}
\logpage{[ 4, 6, 18 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCShellingExt( sc, all, checkvector )\index{SCShellingExt@\texttt{SCShellingExt}}
\label{SCShellingExt}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of permuted lists of the facets of \mbox{\texttt{sc}} of size $1$ (\mbox{\texttt{all}} = \texttt{false}), $n$ (\mbox{\texttt{all}} = \texttt{true}) if \mbox{\texttt{checkvector}} is empty, \texttt{true} / \texttt{false} if \mbox{\texttt{checkvector}} is not empty, \texttt{fail} upon an error.



 \mbox{\texttt{sc}} must be a pure, bounded, strongly connected combinatorial pseudomanifold.

 A shelling is an ordering on the facet list of \mbox{\texttt{sc}} starting with a facet at the boundary. The facets are removed with respect to
that ordering. In every step the intersection of the removed facet and the
already removed facets has to be a shelling too.

 Every shelling is represented as a permuted version of the facet list of \mbox{\texttt{sc}}. A checkvector encodes a shelling in a shorter form. It only contains the
indices of the facets. If an order of indices is assigned to \mbox{\texttt{checkvector}} the function tests whether it is a valid shelling or not.

 See \cite{Ziegler95LectPolytopes}, \cite{Pachner87KonstrMethKombHomeo} to learn more about shellings. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^2");                 
   [ [ 3, "RP^2 (VT)" ], [ 284, "RP^2xS^1" ] ]
   gap> rp2:=SCLib.Load(3);;                        
   gap> rp2:=SCDifference(rp2,SC([rp2.Facets[1]]));; # bounded version
   gap> all:=SCShellingExt(rp2,true,[]);;
   gap> Size(all);                                  
   1488
   gap> all[1];
   [ [ 1, 2, 6 ], [ 1, 4, 6 ], [ 1, 4, 5 ], [ 1, 3, 5 ], [ 2, 4, 5 ], 
     [ 2, 3, 4 ], [ 2, 5, 6 ], [ 3, 4, 6 ], [ 3, 5, 6 ] ]
   gap> all:=SCShellingExt(rp2,false,[]);
   [ [ [1, 2, 6], [1, 4, 6], [1, 4, 5], [1, 3, 5], 
       [2, 4, 5], [2, 3, 4], [2, 5, 6], [3, 4, 6], [3, 5, 6] 	] 
   ]
   # valid shelling
   gap> all:=SCShellingExt(rp2,false,[4, 9, 3, 2, 5, 6, 7, 1, 8]);
   true
   gap> all:=SCShellingExt(rp2,true,[4, 9, 3, 2, 5, 6, 7, 1, 8]);
   true
   # invalid shelling
   gap> all:=SCShellingExt(rp2,true,[1 .. 9]);
   #I  SCShellingExt: 2 is not a valid shelling facet.
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCShellings}}
\logpage{[ 4, 6, 19 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCShellings( complex )\index{SCShellings@\texttt{SCShellings}}
\label{SCShellings}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of permuted versions of the facet list of \mbox{\texttt{complex}}.



 Internally calls \texttt{SCShellingExt} (\ref{SCShellingExt})\texttt{(complex,true,[]);}. To learn more about shellings see \cite{Ziegler95LectPolytopes}, \cite{Pachner87KonstrMethKombHomeo}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2,3],[1,2,4],[1,3,4]]);;
   gap> SCShellings(c);
   [[[1, 2, 3], [1, 2, 4], [1, 3, 4]],
     [[1, 2, 3], [1, 3, 4], [1, 2, 4]],
     [[1, 2, 4], [1, 2, 3], [1, 3, 4]],
     [[1, 3, 4], [1, 2, 3], [1, 2, 4]],
     [[1, 2, 4], [1, 3, 4], [1, 2, 3]],
     [[1, 3, 4], [1, 2, 4], [1, 2, 3]] 
  ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCSpan}}
\logpage{[ 4, 6, 20 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCSpan( complex, subset )\index{SCSpan@\texttt{SCSpan}}
\label{SCSpan}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise.



 Computes the reduced face lattice of all faces that are a subset of \mbox{\texttt{subset}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(4);;
   gap> SCVertices(c);
   [1, 2, 3, 4, 5, 6, 7, 8]
   gap> span:=SCSpan(c,[1,2,3,4]);
   [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels.
  
   Name="span([ 1, 2, 3, 4 ]) in Bd(\beta^4)"
   Dim=1
  
   /SimplicialComplex]
   gap> span.Facets;
   [[1, 3], [1, 4], [2, 3], [2, 4]]
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2],[1,4,5],[2,3,4]]);;
   gap> span:=SCSpan(c,[2,3,5]);
   [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels.
  
   Name="span([ 2, 3, 5 ]) in unnamed complex n"
   Dim=1
  
   /SimplicialComplex]
   gap> SCFacets(span);
   [[2, 3], [5]]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCStar}}
\logpage{[ 4, 6, 21 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCStar( complex, face )\index{SCStar@\texttt{SCStar}}
\label{SCStar}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex upon success, \texttt{fail} otherwise .



 Computes the star of \mbox{\texttt{face}} in \mbox{\texttt{complex}}, i. e. the set of facets of \mbox{\texttt{complex}} that contain \mbox{\texttt{face}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("RP^2");     
   [ [ 3, "RP^2 (VT)" ], [ 284, "RP^2xS^1" ] ]
   gap> rp2:=SCLib.Load(3);;
   gap> SCVertices(rp2);
   [1, 2, 3, 4, 5, 6]
   gap> SCStar(rp2,[1]);
   [SimplicialComplex
   
    Properties known: Dim, Facets, VertexLabels.
  
    Name="star([ 1 ]) in RP^2 (VT)"
    Dim=2
   
   /SimplicialComplex]
   gap> last.Facets;
   [[1, 2, 3], [1, 2, 6], [1, 3, 5], [1, 4, 5], [1, 4, 6]]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCStars}}
\logpage{[ 4, 6, 22 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCStars( complex, dim )\index{SCStars@\texttt{SCStars}}
\label{SCStars}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of new simplicial complexes upon success, \texttt{fail} otherwise.



 Computes for every \mbox{\texttt{dim}}-face $f$ the set of facets that contain $f$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("T^2");
   [ [ 5, "T^2 (VT)" ], [ 7, "T^2 (VT)" ], [ 11, "T^2 (VT)" ], 
     [ 12, "T^2 (VT)" ], [ 20, "T^2 (VT)" ], [ 22, "(T^2)#2" ], 
     [ 27, "(T^2)#3" ], [ 41, "T^2 (VT)" ], [ 44, "(T^2)#4" ], ...
   # the minimal 7-vertex torus
   gap> torus:=SCLib.Load(5);;
   # 7 2-discs as vertex stars
   gap> SCStars(torus,0);
   [ [SimplicialComplex
       
        Properties known: Dim, Facets, Name, VertexLabels.
       
        Name="star([ 1 ]) in T^2 (VT)"
        Dim=2
       
       /SimplicialComplex], # ... etc
   ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCSuspension}}
\logpage{[ 4, 6, 23 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCSuspension( complex )\index{SCSuspension@\texttt{SCSuspension}}
\label{SCSuspension}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Calculates the simplicial suspension of the simplicial complex \mbox{\texttt{complex}}. Internally falls back to the homology package \cite{Dumas04Homology} and does not interfere with the homology package. Note that the vertex
labelings of the complexes passed as arguments are not propagated to the new
complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("Poincare");
   [ [ 563, "Poincare_sphere" ] ]
   gap> phs:=SCLib.Load(587);
   [SimplicialComplex
   
    Properties known: AltshulerSteinberg, AutomorphismGroup, 
                      AutomorphismGroupSize, AutomorphismGroupStructure, 
                      AutomorphismGroupTransitivity, Boundary, Chi, 
                      ConnectedComponents, Dim, DualGraph, F, Faces, Facets, G, 
                      Generators, H, HasBoundary, HasInterior, Homology, 
                      Interior, IsCentrallySymmetric, IsConnected, 
                      IsEulerianManifold, IsOrientable, IsPM, IsPure, 
                      MinimalNonFaces, Name, Neighborliness, Orientation, 
                      StronglyConnected, VertexLabels, Vertices.
   
    Name="B4"
    Dim=3
    AutomorphismGroupSize=1
    AutomorphismGroupStructure="1"
    AutomorphismGroupTransitivity=0
    Chi=0
    F=[ 17, 117, 200, 100 ]
    G=[ 12, 59 ]
    H=[ 13, 72, 13, 1 ]
    HasBoundary=false
    HasInterior=true
    Homology=[ [ 0, [ ] ], [ 1, [ 4 ] ], [ 0, [ 2 ] ], [ 0, [ ] ] ]
    IsCentrallySymmetric=false
    IsConnected=true
    IsEulerianManifold=true
    IsOrientable=false
    IsPM=true
    IsPure=true
    Neighborliness=1
   
   /SimplicialComplex]
   gap> phs:=SCLib.Load(587);;
   gap> susp:=SCSuspension(phs);;
   gap> edwardsSphere:=SCSuspension(susp);;
   gap> SCIsManifold(edwardsSphere);
   ...
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCUnion}}
\logpage{[ 4, 6, 24 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCUnion( complex1, complex2 )\index{SCUnion@\texttt{SCUnion}}
\label{SCUnion}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Forms the union of two simplicial complexes \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} as the simplicial complex formed by the union of their facets sets. The two
arguments are not altered. Note: for the union process the vertex labelings of
the complexes are taken into account, see also \texttt{Operation Union (SCSimplicialComplex, SCSimplicialComplex)} (\ref{Operation Union (SCSimplicialComplex, SCSimplicialComplex)}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCUnion(SCBdSimplex(3),SCBdSimplex(3)+3); #a wedge of two 2-spheres
   [SimplicialComplex
   
    Properties known: Dim, Facets, VertexLabels.
  
    Name="S^2_4 cup S^2_4"
    Dim=2
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCVertexIdentification}}
\logpage{[ 4, 6, 25 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCVertexIdentification( complex, v1, v2 )\index{SCVertexIdentification@\texttt{SCVertexIdentification}}
\label{SCVertexIdentification}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
simplicial complex with pinched point \mbox{\texttt{v1}}=\mbox{\texttt{v2}} upon success, \texttt{fail} otherwise.



 A vertex identification of \mbox{\texttt{v1}} and \mbox{\texttt{v2}} is possible whenever d(\mbox{\texttt{v1}},\mbox{\texttt{v2}}) $\geq 3$. This is not checked by this algorithm. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2],[2,3],[3,4]]);;
   gap> circle:=SCVertexIdentification(c,[1],[4]);;
   gap> circle.Facets;
   [[1, 2], [1, 3], [2, 3]]
   gap> circle.Homology;
   [[0, []], [1, []]]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCWedge}}
\logpage{[ 4, 6, 26 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCWedge( complex1, complex2, ... )\index{SCWedge@\texttt{SCWedge}}
\label{SCWedge}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a new simplicial complex upon success, \texttt{fail} otherwise.



 Calculates the wedge product of the complexes supplied as arguments. Note,
that the vertex labelings of the complexes passed as arguments are not
propagated to the new complex. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> wedge:=SCWedge(SCBdSimplex(2),SCBdSimplex(2));
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="S^1_3 wedge S^1_3"
    Dim=1
   
   /SimplicialComplex]
   gap> wedge.Facets;
   [ [ [ 1, 2 ], [ 1, 3 ] ], [ [ 2, 2 ], [ 2, 3 ] ], [ [ 1, 2 ], "a" ], 
     [ [ 1, 3 ], "a" ], [ [ 2, 2 ], "a" ], [ [ 2, 3 ], "a" ] ]
   gap> 
   
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{(Co-)Homology of simplicial complexes}}\label{chap:homology}
\logpage{[ 5, 0, 0 ]}
{
 Although \textsf{simpcomp} relies on the GAP package ''homology'' \cite{Dumas04Homology} for its homology calculations due to efficiency reasons, the package contains
some additional homology related functionality, which will be explained in
this chapter. 
\section{\textcolor{Chapter }{Homology computation}}\logpage{[ 5, 1, 0 ]}
{
  Apart from calculating boundaries of simplices, boundary matrices or the
simplicial homology of a given complex, \textsf{simpcomp} is also able to compute a basis of the homology groups. 

\subsection{\textcolor{Chapter }{SCBoundaryOperatorMatrix}}
\logpage{[ 5, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCBoundaryOperatorMatrix( complex, dim )\index{SCBoundaryOperatorMatrix@\texttt{SCBoundaryOperatorMatrix}}
\label{SCBoundaryOperatorMatrix}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a rectangular matrix upon success, \texttt{fail} otherwise.



 Calculates the matrix of the boundary operator $\partial_{\mbox{\texttt{dim+1}}}$. Notice, that each column contains the boundaries of a (\mbox{\texttt{dim}}+1)-simplex as a list of oriented \mbox{\texttt{dim}}-simplices and that the matrix is stored (GAP-typical) as a list of row
vectors (as usual in GAP). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets([[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]]);;
   gap> mat:=SCBoundaryOperatorMatrix(c,1);
   [ [ 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], 
     [ -1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 ], 
     [ 0, -1, 0, 0, 0, -1, 0, 0, 0, 1, 1, 1, 0, 0, 0 ], 
     [ 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 1, 1, 0 ], 
     [ 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, -1, 0, 1 ], 
     [ 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, -1, -1 ] ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCBoundarySimplex}}
\logpage{[ 5, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCBoundarySimplex( simplex, orientation )\index{SCBoundarySimplex@\texttt{SCBoundarySimplex}}
\label{SCBoundarySimplex}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list upon success, \texttt{fail} otherwise.



 Calculates the boundary of a given \mbox{\texttt{simplex}}. If the flag \mbox{\texttt{orientation}} 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. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCBoundarySimplex([1..5],true);
   [ [ -1, [ 2, 3, 4, 5 ] ], [ 1, [ 1, 3, 4, 5 ] ], [ -1, [ 1, 2, 4, 5 ] ], 
     [ 1, [ 1, 2, 3, 5 ] ], [ -1, [ 1, 2, 3, 4 ] ] ]
   gap> SCBoundarySimplex([1..5],false);
   [ [ 2, 3, 4, 5 ], [ 1, 3, 4, 5 ], [ 1, 2, 4, 5 ], [ 1, 2, 3, 5 ], 
     [ 1, 2, 3, 4 ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCHomologyBasis}}
\logpage{[ 5, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCHomologyBasis( complex, dim )\index{SCHomologyBasis@\texttt{SCHomologyBasis}}
\label{SCHomologyBasis}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of the form \texttt{[ integer, list ]} upon success, \texttt{fail} otherwise.



 Calculates a set of basis vectors for the \mbox{\texttt{dim}}-dimensional homology group (with integer coefficients) of \mbox{\texttt{complex}}. 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 \mbox{\texttt{dim}}-th homology group and $k\geq 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$=\texttt{SCSkel(complex,dim)[i]}, $\Delta_2$=\texttt{SCSkel(complex,dim)[j]} and so on. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("(S^2xS^1)#RP^3");
   [ [ 247, "(S^2xS^1)#RP^3" ] ]
   gap> c:=SCLib.Load(247);;
   gap> SCHomologyBasis(c,1);
   [ [ 1, [ [ 1, 12 ], [ -1, 7 ], [ 1, 1 ] ] ], 
     [ 2, [ [ 1, 68 ], [ -1, 69 ], [ -1, 71 ], [ 2, 72 ], [ -2, 73 ] ] ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCHomologyBasisAsSimplices}}
\logpage{[ 5, 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCHomologyBasisAsSimplices( complex, dim )\index{SCHomologyBasisAsSimplices@\texttt{SCHomologyBasisAsSimplices}}
\label{SCHomologyBasisAsSimplices}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of the form \texttt{[ integer, linear combination of simplices ]} upon success, \texttt{fail} otherwise.



 In contrast to the function \texttt{SCHomologyBasis} (\ref{SCHomologyBasis}) this functSion returns the basis elements in the same format as \texttt{SCHomologyBasis} (\ref{SCHomologyBasis}), but every basis element is returned as a linear combination of simplices of \mbox{\texttt{complex}}. Each term of the linear combination is of the form [ FACTOR, SIMPLEX ],
where FACTOR is a non-zero integer value. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("(S^2xS^1)#RP^3");
   [ [ 247, "(S^2xS^1)#RP^3" ] ]
   gap> c:=SCLib.Load(247);;
   gap> SCHomologyBasisAsSimplices(c,1);
   [ [ 1, [ [ 1, [ 2, 8 ] ], [ -1, [ 1, 8 ] ], [ 1, [ 1, 2 ] ] ] ], 
     [ 2, [ [ 1, [ 11, 12 ] ], [ -1, [ 11, 13 ] ], [ -1, [ 12, 13 ] ], 
            [ 2, [ 12, 14 ] ], [ -2, [ 13, 14 ] ] ] ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCHomologyInternal}}
\logpage{[ 5, 1, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCHomologyInternal( complex )\index{SCHomologyInternal@\texttt{SCHomologyInternal}}
\label{SCHomologyInternal}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of the form \texttt{[ integer, list ]} upon success, \texttt{fail} otherwise.



 This function computes the reduced simplicial homology with integer
coefficients of a given simplicial complex \mbox{\texttt{complex}} with integer coefficients. It uses the algorithm described in \cite{Desbrun08DiscDiffFormCompModel}. 

 The output is a list of homology groups of the form $[H_0,....,H_d]$, where $d$ is the dimension of \mbox{\texttt{complex}}. The format of the homology groups $H_i$ is given in terms of their maximal cyclic subgroups, i.e. a homology group $H_i\cong \mathbb{Z}^f + \mathbb{Z} / t_1 \mathbb{Z} \times \dots \times
\mathbb{Z} / t_n \mathbb{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. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets([[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]]);;
   gap> SCHomologyInternal(c);
   [ [ 0, [  ] ], [ 0, [ 2 ] ], [ 0, [  ] ] ]
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Cohomology computation}}\logpage{[ 5, 2, 0 ]}
{
  \textsf{simpcomp} 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 \texttt{GAP}. However, in some cases the \texttt{GAP} function \texttt{Eigenvalues} can be used. 

\subsection{\textcolor{Chapter }{SCCoboundaryOperatorMatrix}}
\logpage{[ 5, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCCoboundaryOperatorMatrix( complex, dim )\index{SCCoboundaryOperatorMatrix@\texttt{SCCoboundaryOperatorMatrix}}
\label{SCCoboundaryOperatorMatrix}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a rectangular matrix upon success, \texttt{fail} otherwise.



 Calculates the matrix of the coboundary operator $d^{\mbox{\texttt{dim+1}}}$ as a list of row vectors. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets([[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]]);
   gap> mat:=SCCoboundaryOperatorMatrix(c,1);;
   [ [ -1, 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], 
     [ -1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0 ], 
     [ 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0 ], 
     [ 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0 ], 
     [ 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0 ], 
     [ 0, 0, 0, 0, 0, -1, 1, 0, 0, -1, 0, 0, 0, 0, 0 ], 
     [ 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0 ], 
     [ 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -1 ], 
     [ 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1, 0, -1, 0 ], 
     [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, -1 ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCCohomology}}
\logpage{[ 5, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCCohomology( complex )\index{SCCohomology@\texttt{SCCohomology}}
\label{SCCohomology}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of the form \texttt{[ integer, list ]} upon success, \texttt{fail} otherwise.



 This function computes the simplicial cohomology of a given simplicial complex \mbox{\texttt{complex}} with integer coefficients. It uses the algorithm described in \cite{Desbrun08DiscDiffFormCompModel}.

 The output is a list of cohomology groups of the form $[H^0,....,H^d]$, where $d$ is the dimension of \mbox{\texttt{complex}}. The format of the cohomology groups $H^i$ is given in terms of their maximal cyclic subgroups, i.e. a cohomology group $H^i\cong \mathbb{Z}^f + \mathbb{Z} / t_1 \mathbb{Z} \times \dots \times
\mathbb{Z} / t_n \mathbb{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. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets([[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]]);
   gap> SCCohomology(c);
   [ [ 1, [  ] ], [ 0, [  ] ], [ 0, [ 2 ] ] ]
   gap>    
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCCohomologyBasis}}
\logpage{[ 5, 2, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCCohomologyBasis( complex, dim )\index{SCCohomologyBasis@\texttt{SCCohomologyBasis}}
\label{SCCohomologyBasis}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of the form \texttt{[ integer, list ]} upon success, \texttt{fail} otherwise.



 Calculates a set of basis vectors for the \mbox{\texttt{dim}}-dimensional cohomology group (with integer coefficients) of \mbox{\texttt{complex}}. 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 \mbox{\texttt{dim}}-th cohomology group and $k\geq 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$=\texttt{SCSkel(complex,dim)[i]}, $\Delta_2$=\texttt{SCSkel(complex,dim)[j]} and so on. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("SU(3)/SO(3)");   
   [ [ 222, "SU(3)/SO(3) (VT)" ], [ 520, "SU(3)/SO(3) (VT)" ], 
     [ 526, "SU(3)/SO(3) (VT)" ], [ 528, "SU(3)/SO(3) (VT)" ] ]
   gap> c:=SCLib.Load(222);;
   gap> SCCohomologyBasis(c,3); 
   [ [ 2, [ [ -9, 259 ], [ 9, 262 ], [ 9, 263 ], [ -9, 270 ], [ 9, 271 ], 
             [ -9, 273 ], [ -9, 274 ], [ -18, 275 ], [ -9, 276 ], [ 9, 278 ], 
             [ -9, 279 ], [ -9, 280 ], [ 3, 283 ], [ -3, 285 ], [ 3, 289 ], 
             [ -3, 294 ], [ 3, 310 ], [ -3, 313 ], [ 3, 316 ], [ -1, 317 ], 
             [ -6, 318 ], [ 3, 319 ], [ -6, 320 ], [ 6, 321 ], [ 1, 322 ], 
             [ 3, 325 ], [ -1, 328 ], [ 6, 330 ], [ -2, 331 ], [ 12, 332 ], 
             [ 7, 333 ], [ -5, 334 ], [ 1, 345 ], [ 3, 355 ], [ -9, 357 ], 
             [ 9, 358 ], [ 1, 363 ], [ 12, 365 ], [ -9, 366 ], [ -3, 370 ], 
             [ -1, 371 ], [ -3, 372 ], [ 8, 373 ], [ -1, 374 ], [ 6, 375 ], 
             [ 9, 376 ], [ 3, 377 ], [ 1, 380 ], [ 3, 383 ], [ -8, 385 ], 
             [ -9, 386 ], [ -9, 388 ], [ -18, 404 ], [ 9, 410 ], [ -9, 425 ], 
             [ -18, 426 ], [ -9, 427 ], [ 9, 428 ], [ -9, 429 ], [ 3, 433 ], 
             [ -3, 435 ], [ -9, 437 ], [ 10, 442 ], [ 12, 445 ], [ 1, 447 ], 
             [ -19, 448 ], [ 2, 449 ], [ -1, 450 ], [ -9, 451 ], [ 3, 453 ], 
             [ 1, 455 ], [ 1, 457 ], [ -11, 458 ], [ -9, 459 ], [ 9, 461 ], 
             [ 9, 462 ], [ -9, 468 ], [ 9, 469 ], [ -18, 471 ], [ -9, 472 ], 
             [ 9, 474 ], [ -9, 475 ], [ 9, 488 ], [ 9, 495 ], [ -9, 500 ], 
             [ -3, 504 ], [ 9, 505 ], [ 9, 512 ], [ 9, 515 ], [ 6, 519 ], 
             [ 18, 521 ], [ -15, 523 ], [ 9, 524 ], [ -3, 525 ], [ 18, 527 ], 
             [ -18, 528 ], [ 6, 529 ], [ 6, 531 ], [ 12, 532 ] ] ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCCohomologyBasisAsSimplices}}
\logpage{[ 5, 2, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCCohomologyBasisAsSimplices( complex, dim )\index{SCCohomologyBasisAsSimplices@\texttt{SCCohomologyBasisAsSimplices}}
\label{SCCohomologyBasisAsSimplices}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pars of the form \texttt{[ integer, linear combination of simplices ]} upon success, \texttt{fail} otherwise.



 In contrast to the function \texttt{SCCohomologyBasis} (\ref{SCCohomologyBasis}) this function returns the basis elements in the same format as \texttt{SCCohomologyBasis} (\ref{SCCohomologyBasis}), but every basis element is returned as a linear combination of simplices of \mbox{\texttt{complex}}. Each term of the linear combination is of the form [ FACTOR, SIMPLEX ],
where FACTOR is a non-zero integer value. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("SU(3)/SO(3)");   
   [ [ 222, "SU(3)/SO(3) (VT)" ], [ 520, "SU(3)/SO(3) (VT)" ], 
     [ 526, "SU(3)/SO(3) (VT)" ], [ 528, "SU(3)/SO(3) (VT)" ] ]
   gap> c:=SCLib.Load(222);;
   gap> SCCohomologyBasisAsSimplices(c,3);
   [ [ 2, [ [ -9, [ 2, 7, 8, 9 ] ], [ 9, [ 2, 7, 8, 12 ] ], [ 9, [ 2, 7, 8, 13 ] ], 
            [ -9, [ 2, 7, 11, 12 ] ], [ 9, [ 2, 7, 11, 13 ] ], [ -9, [ 2, 8, 9, 10 ] ],
            [ -9, [ 2, 8, 9, 11 ] ], [ -18, [ 2, 8, 9, 12 ] ], [ -9, [ 2, 8, 9, 13 ] ],
            [ 9, [ 2, 8, 10, 12 ] ], [ -9, [ 2, 8, 10, 13 ] ], 
            [ -9, [ 2, 8, 11, 12 ] ], [ 3, [ 2, 9, 10, 12 ] ], 
            [ -3, [ 2, 9, 11, 12 ] ], [ 3, [ 3, 4, 5, 7 ] ], [ -3, [ 3, 4, 5, 12 ] ], 
            [ 3, [ 3, 4, 10, 12 ] ], [ -3, [ 3, 5, 6, 7 ] ], [ 3, [ 3, 5, 6, 11 ] ], 
            [ -1, [ 3, 5, 6, 13 ] ], [ -6, [ 3, 5, 7, 8 ] ], [ 3, [ 3, 5, 7, 10 ] ], 
            [ -6, [ 3, 5, 7, 11 ] ], [ 6, [ 3, 5, 7, 12 ] ], [ 1, [ 3, 5, 7, 13 ] ], 
            [ 3, [ 3, 5, 8, 12 ] ], [ -1, [ 3, 5, 9, 13 ] ], [ 6, [ 3, 5, 10, 12 ] ], 
            [ -2, [ 3, 5, 10, 13 ] ], [ 12, [ 3, 5, 11, 12 ] ], 
            [ 7, [ 3, 5, 11, 13 ] ], [ -5, [ 3, 5, 12, 13 ] ], [ 1, [ 3, 6, 9, 13 ] ], 
            [ 3, [ 3, 7, 10, 12 ] ], [ -9, [ 3, 7, 11, 12 ] ], [ 9, [ 3, 7, 11, 13 ] ],
            [ 1, [ 3, 8, 9, 13 ] ], [ 12, [ 3, 8, 10, 12 ] ], [ -9, [ 3, 8, 10, 13 ] ],
            [ -3, [ 3, 9, 10, 12 ] ], [ -1, [ 3, 9, 10, 13 ] ], 
            [ -3, [ 3, 9, 11, 12 ] ], [ 8, [ 3, 9, 11, 13 ] ], 
            [ -1, [ 3, 9, 12, 13 ] ], [ 6, [ 3, 10, 11, 12 ] ], 
            [ 9, [ 3, 10, 11, 13 ] ], [ 3, [ 3, 10, 12, 13 ] ], [ 1, [ 4, 5, 6, 8 ] ], 
            [ 3, [ 4, 5, 6, 11 ] ], [ -8, [ 4, 5, 6, 13 ] ], [ -9, [ 4, 5, 7, 8 ] ], 
            [ -9, [ 4, 5, 7, 11 ] ], [ -18, [ 4, 6, 8, 9 ] ], [ 9, [ 4, 6, 9, 13 ] ], 
            [ -9, [ 4, 8, 9, 10 ] ], [ -18, [ 4, 8, 9, 12 ] ], [ -9, [ 4, 8, 9, 13 ] ],
            [ 9, [ 4, 8, 10, 12 ] ], [ -9, [ 4, 8, 10, 13 ] ], [ 3, [ 4, 9, 10, 12 ] ],
            [ -3, [ 4, 9, 11, 12 ] ], [ -9, [ 4, 9, 12, 13 ] ], [ 10, [ 5, 6, 7, 8 ] ],
            [ 12, [ 5, 6, 7, 11 ] ], [ 1, [ 5, 6, 7, 13 ] ], [ -19, [ 5, 6, 8, 9 ] ], 
            [ 2, [ 5, 6, 8, 11 ] ], [ -1, [ 5, 6, 8, 12 ] ], [ -9, [ 5, 6, 8, 13 ] ], 
            [ 3, [ 5, 6, 9, 11 ] ], [ 1, [ 5, 6, 9, 13 ] ], [ 1, [ 5, 6, 10, 13 ] ], 
            [ -11, [ 5, 6, 11, 13 ] ], [ -9, [ 5, 7, 8, 9 ] ], [ 9, [ 5, 7, 8, 12 ] ], 
            [ 9, [ 5, 7, 8, 13 ] ], [ -9, [ 5, 7, 11, 12 ] ], [ 9, [ 5, 7, 11, 13 ] ], 
            [ -18, [ 5, 8, 9, 12 ] ], [ -9, [ 5, 8, 9, 13 ] ], [ 9, [ 5, 8, 10, 12 ] ],
            [ -9, [ 5, 8, 11, 12 ] ], [ 9, [ 6, 7, 8, 13 ] ], [ 9, [ 6, 7, 11, 13 ] ], 
            [ -9, [ 6, 8, 10, 13 ] ], [ -3, [ 6, 9, 11, 12 ] ], 
            [ 9, [ 6, 9, 11, 13 ] ], [ 9, [ 7, 8, 9, 13 ] ], [ 9, [ 7, 8, 11, 12 ] ], 
            [ 6, [ 7, 9, 11, 12 ] ], [ 18, [ 7, 11, 12, 13 ] ], 
            [ -15, [ 8, 9, 10, 12 ] ], [ 9, [ 8, 9, 10, 13 ] ], 
            [ -3, [ 8, 9, 11, 12 ] ], [ 18, [ 8, 10, 11, 12 ] ], 
            [ -18, [ 8, 10, 12, 13 ] ], [ 6, [ 9, 10, 11, 12 ] ], 
            [ 6, [ 9, 10, 12, 13 ] ], [ 12, [ 9, 11, 12, 13 ] ] ] ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCCupProduct}}
\logpage{[ 5, 2, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCCupProduct( complex, cocycle1, cocycle2 )\index{SCCupProduct@\texttt{SCCupProduct}}
\label{SCCupProduct}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of oriented simplices upon success, \texttt{fail} 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 \mbox{\texttt{cocycle1}} is a p-cochain and \mbox{\texttt{cocylce2}} is a q-cochain (given as list of oriented p- (q-)simplices, then\\
\\
 \mbox{\texttt{cocycle1}} $\smile$ \mbox{\texttt{cocycle2}}$(\sigma) = $\mbox{\texttt{cocycle1}}$(\sigma \circ \iota_{0,1, ... p}) \cdot$ \mbox{\texttt{cocycle2}}$(\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.\\
\\
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("K3");
   [ [ 584, "K3 surface" ] ]
   gap> c:=SCLib.Load(584);;                                     
   gap> basis:=SCCohomologyBasisAsSimplices(c,2);;
   gap> SCCupProduct(c,basis[1][2],basis[1][2]);
   [ [ 1, [ 1, 2, 4, 7, 11 ] ], [ 1, [ 2, 3, 4, 5, 9 ] ] ]
   gap> SCCupProduct(c,basis[1][2],basis[2][2]);
   [ [ -1, [ 1, 2, 4, 7, 11 ] ], [ -1, [ 1, 2, 4, 7, 15 ] ], 
     [ -1, [ 2, 3, 4, 5, 9 ] ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIntersectionForm}}
\logpage{[ 5, 2, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIntersectionForm( complex )\index{SCIntersectionForm@\texttt{SCIntersectionForm}}
\label{SCIntersectionForm}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a square matrix of integer values upon success, \texttt{fail} otherwise.



 For $2d$-dimensional orientable pseudomanifolds $M$ the cup product (see \texttt{SCCupProduct} (\ref{SCCupProduct})) defines a bilinear function \\
\\
 H$^d ( M ) \times $H$^d ( M ) \to $H$^{2d} (M), (a,b) \mapsto a \cup b $ \\
\\
 called the intersection form. This function returns the intersection form in
integral cohomology in form of a matrix \texttt{mat} with respect to the basis of H$^d ( M )$ computed by \texttt{SCCohomologyBasisAsSimplices} (\ref{SCCohomologyBasisAsSimplices}). The matrix entry \texttt{M[i][j]} equals the intersection number of the \texttt{i}-th element with the \texttt{j}-th element of the basis. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("CP^2");       
   [ [ 17, "CP^2 (VT)" ], [ 88, "CP^2#CP^2" ], [ 89, "CP^2#-CP^2" ], 
     [ 186, "CP^2#(S^2xS^2)" ], [ 499, "(S^3~S^1)#(CP^2)^{#5} (VT)" ] ]
   gap> c:=SCLib.Load(17);; 
   gap> c1:=SCConnectedSum(c,c);;
   gap> c2:=SCConnectedSumMinus(c,c);;
   gap> q1:=SCIntersectionForm(c1);;
   gap> q2:=SCIntersectionForm(c2);;
   gap> PrintArray(q1);
   [ [  1,  0 ],
     [  0,  1 ] ]
   gap> PrintArray(q2);
   [ [   1,   0 ],
     [   0,  -1 ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIntersectionFormParity}}
\logpage{[ 5, 2, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIntersectionFormParity( complex )\index{SCIntersectionFormParity@\texttt{SCIntersectionFormParity}}
\label{SCIntersectionFormParity}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{0} or \texttt{1} upon success, \texttt{fail} otherwise.



 Computes the parity of the intersection form of \mbox{\texttt{complex}} (see \texttt{SCIntersectionForm} (\ref{SCIntersectionForm})). If the intersection for is even (i. e. all diagonal entries are even
numbers) \texttt{0}, if it is odd (at least one diagonal entry is odd), \texttt{1} is returned. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("S^2xS^2");
   [ [ 51, "S^2xS^2" ], [ 110, "S^2xS^2 (VT)" ], [ 111, "S^2xS^2 (VT)" ], 
     [ 112, "S^2xS^2 (VT)" ], [ 114, "(S^2xS^2)#(S^2xS^2)" ], 
     [ 144, "(S^2xS^2)#(S^2xS^2) (VT)" ], [ 145, "(S^2xS^2)#(S^2xS^2) (VT)" ], 
     [ 186, "CP^2#(S^2xS^2)" ] ]
   gap> c:=SCLib.Load(51);;    
   gap> SCIntersectionFormParity(c);
   0
   gap> SCLib.SearchByName("CP^2");       
   [ [ 17, "CP^2 (VT)" ], [ 88, "CP^2#CP^2" ], [ 89, "CP^2#-CP^2" ], 
     [ 186, "CP^2#(S^2xS^2)" ], [ 499, "(S^3~S^1)#(CP^2)^{#5} (VT)" ] ]
   gap> c:=SCLib.Load(17);; 
   gap> SCIntersectionFormParity(c);
   1
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIntersectionFormDimensionality}}
\logpage{[ 5, 2, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIntersectionFormDimensionality( complex )\index{SCIntersectionFormDimensionality@\texttt{SCIntersectionFormDimensionality}}
\label{SCIntersectionFormDimensionality}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 an integer upon success, \texttt{fail} otherwise.



 Returns the dimensionality of the intersection form of \mbox{\texttt{complex}}, i. e. the length of a minimal generating set of H$^d (M)$ (where $2d$ is the dimension of \mbox{\texttt{complex}}). See \texttt{SCIntersectionForm} (\ref{SCIntersectionForm}) for further details. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("CP^2");       
   [ [ 17, "CP^2 (VT)" ], [ 88, "CP^2#CP^2" ], [ 89, "CP^2#-CP^2" ], 
     [ 186, "CP^2#(S^2xS^2)" ], [ 499, "(S^3~S^1)#(CP^2)^{#5} (VT)" ] ]
   gap> c:=SCLib.Load(17);; ## gap> SCIntersectionFormParity(c);
   1
   gap> SCCohomology(c);
   [ [ 1, [  ] ], [ 0, [  ] ], [ 1, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ]
   gap> SCIntersectionFormDimensionality(c);
   1
   gap> d:=SCConnectedProduct(c,10);;
   gap> SCIntersectionFormDimensionality(d);
   10
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIntersectionFormSignature}}
\logpage{[ 5, 2, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIntersectionFormSignature( complex )\index{SCIntersectionFormSignature@\texttt{SCIntersectionFormSignature}}
\label{SCIntersectionFormSignature}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a triple of integers upon success, \texttt{fail} otherwise.



 Returns the dimensionality and the signature of the intersection form of \mbox{\texttt{complex}} 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 \texttt{SCIntersectionForm} (\ref{SCIntersectionForm}) for further details. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("CP^2");       
   [ [ 17, "CP^2 (VT)" ], [ 88, "CP^2#CP^2" ], [ 89, "CP^2#-CP^2" ], 
     [ 186, "CP^2#(S^2xS^2)" ], [ 499, "(S^3~S^1)#(CP^2)^{#5} (VT)" ] ]
   gap> c:=SCLib.Load(17);; ## gap> SCIntersectionFormParity(c);
   1
   gap> SCCohomology(c);
   [ [ 1, [  ] ], [ 0, [  ] ], [ 1, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ]
   gap> SCIntersectionFormSignature(c);
   [ 1, 0, 1 ]
   gap> d:=SCConnectedSum(c,c);                           
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels, Vertices.
   
    Name="CP^2 (VT)#+-CP^2 (VT)"
    Dim=4
   
   /SimplicialComplex]
   gap> SCIntersectionFormSignature(d);
   [ 2, 1, 1 ]
   gap> d:=SCConnectedSumMinus(c,c);;
   gap> SCIntersectionFormSignature(d);
   [ 2, 0, 2 ]
   
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{Bistellar flips}}\label{chap:bistellar}
\logpage{[ 6, 0, 0 ]}
{
 
\section{\textcolor{Chapter }{Theory}}\label{sec:bftheory}
\logpage{[ 6, 1, 0 ]}
{
  Bistellar flips, first introduced by Pachner in \cite{Pachner87KonstrMethKombHomeo} and sometimes also refered to as Pachner moves, can prove useful for the
following tasks: 
\begin{enumerate}
\item  Try to decide whether two closed simplicial pseudomanifolds are
PL-homeomorphic.
\item  Reduce a given triangulation without changing its PL-type.
\item  Verify whether a closed simplicial pseudomanifold is a combinatorial manifold.
\end{enumerate}
 Bistellar moves are a convenient means to prove the PL equivalence of
triangulations, see \cite{Lutz03TrigMnfFewVertVertTrans} for an example.

 Since bistellar flips do not respect the combinatorial properties of a
complex, no attention to the original vertex labels is payed, i. e. the
flipped complex will be relabeled whenever its vertex labels become different
from the standard labeling (for example after every reverse 0-move). }

 
\section{\textcolor{Chapter }{Functions for bistellar flips}}\logpage{[ 6, 2, 0 ]}
{
  

\subsection{\textcolor{Chapter }{SCBistellarOptions}}
\logpage{[ 6, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCBistellarOptions(  )\index{SCBistellarOptions@\texttt{SCBistellarOptions}}
\label{SCBistellarOptions}
}\hfill{\scriptsize (property)}}\\


 Record of global variables to adjust output an behavior of bistellar moves in \texttt{SCIntFunc.SCChooseMove} (\ref{SCIntFunc.SCChooseMove}) and \texttt{SCReduceComplexEx} (\ref{SCReduceComplexEx}) respectively. 
\begin{enumerate}
\item \texttt{BaseRelaxation}: determines the length of the relaxation period. Default: $3$
\item \texttt{BaseHeating}: determines the length of the heating period. Default: $4$
\item \texttt{Relaxation}: value of the current relaxation period. Default: $0$
\item \texttt{Heating}: value of the current heating period. Default: $0$
\item \texttt{MaxRounds}: maximal over all number of bistellar flips that will be performed. Default: $500000$
\item \texttt{MaxInterval}: maximal number of bistellar flips that will be performed without a change of
the moved complex. Default: $100000$
\item \texttt{Mode}: flip mode, $0$=reducing, $1$=comparing, $2$=reduce as subcomplex. Default: $0$ 
\item \texttt{LogLevel}: $0$=no logging, $1$=reduced logging, $2$=full logging, information about every flip. Default: $2$ 
\item \texttt{WriteLevel}: $0$=no output, $1$=storing of every vertex minimal complex to user library, $2$=e-mail notification. Default: $1$ 
\item \texttt{MailNotifyIntervall}: (minimum) number of seconds between two e-mail notifications. Default: $24 \cdot 60 \cdot 60$ (one day)
\item \texttt{MaxIntervalIsManifold}: maximal number of bistellar flips that will be performed without a change of
a vertex link while trying to prove that the complex is a combinatorial
manifold. Default: $500$
\end{enumerate}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCBistellarOptions.BaseRelaxation;
   3
   gap> SCBistellarOptions.BaseHeating;
   4
   gap> SCBistellarOptions.Relaxation;
   0
   gap> SCBistellarOptions.Heating;
   0
   gap> SCBistellarOptions.MaxRounds;
   500000
   gap> SCBistellarOptions.MaxInterval;
   100000
   gap> SCBistellarOptions.Mode;
   0
   gap> SCBistellarOptions.LogLevel;
   2
   gap> SCBistellarOptions.WriteLevel;
   1
   gap> SCBistellarOptions.MailNotifyInterval;
   86400
   gap> SCBistellarOptions.MaxIntervalIsManifold;
   5000
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCEquivalent}}
\logpage{[ 6, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCEquivalent( complex1, complex2 )\index{SCEquivalent@\texttt{SCEquivalent}}
\label{SCEquivalent}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Tests, whether the closed simplicial pseudomanifold \mbox{\texttt{complex1}} can be reduced via bistellar moves to \mbox{\texttt{complex2}}, i. e. whether \mbox{\texttt{complex1}} and \mbox{\texttt{complex2}} are $PL$-homeomorphic. Note, that in general the problem is undecidable.

 It is recommended to use a minimal triangulation of \mbox{\texttt{complex2}} for the check if possible.

 Internally calls \texttt{SCReduceComplexEx} (\ref{SCReduceComplexEx})\texttt{(complex1,complex2,1,SCIntFunc.SCChooseMove);} 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   # hexagon
   gap> obj:=SC([[1,2],[2,3],[3,4],[4,5],[5,6],[6,1]]);;
   # triangle as a (minimal) reference object
   gap> refObj:=SCBdSimplex(2);;
   gap> SCEquivalent(obj,refObj);
   #I  round 0: [ 5, 5 ]
   #I  round 1: [ 4, 4 ]
   #I  round 2: [ 3, 3 ]
   #I  SCReduceComplexEx: complexes are bistellarly equivalent.
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCExamineComplexBistellar}}
\logpage{[ 6, 2, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCExamineComplexBistellar( complex )\index{SCExamineComplexBistellar@\texttt{SCExamineComplexBistellar}}
\label{SCExamineComplexBistellar}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 simplicial complex passed as argument with additional properties upon success, \texttt{fail} otherwise.



 Computes face lattice, $f$-vector, AS-determinant, dimension and maximal vertex label of \mbox{\texttt{complex}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> obj:=SC([[1,2],[2,3],[3,4],[4,5],[5,6],[6,1]]);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="unnamed complex n"
    Dim=1
   
   /SimplicialComplex]
   gap> SCExamineComplexBistellar(obj);
   [SimplicialComplex
   
    Properties known: AltshulerSteinberg, Boundary, Chi, Dim, F, Faces, Facets, 
                      HasBoundary, IsPM, IsPure, Name, VertexLabels.
   
    Name="unnamed complex 21"
    Dim=1
    Chi=0
    F=[ 6, 6 ]
    HasBoundary=false
    IsPM=true
    IsPure=true
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIntFunc.SCChooseMove}}
\logpage{[ 6, 2, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIntFunc.SCChooseMove( dim, moves )\index{SCIntFunc.SCChooseMove@\texttt{SCIntFunc.SCChooseMove}}
\label{SCIntFunc.SCChooseMove}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a bistellar move, i. e. a pair of lists upon success, \texttt{fail} otherwise.



 Since the problem of finding a bistellar flip sequence that reduces a
simplicial complex is undecidable, we have to use an heuristic approach to
choose the next move. 

 The implemented strategy \texttt{SCIntFunc.SCChooseMove} first tries to directly remove vertices, edges, $i$-faces in increasing dimension etc. If this is not possible it inserts high
dimensional faces in decreasing co-dimension. To do this in an efficient way a
number of parameters have to be adjusted, namely \texttt{SCBistellarOptions.BaseHeating} and \texttt{SCBistellarOptions.BaseRelaxation}. See \texttt{SCBistellarOptions} (\ref{SCBistellarOptions}) for further options. 

 If this strategy does not work for you, just implement a customized strategy
and pass it to \texttt{SCReduceComplexEx} (\ref{SCReduceComplexEx}).

 See \texttt{SCRMoves} (\ref{SCRMoves}) for further information. }

 

\subsection{\textcolor{Chapter }{SCIsKStackedSphere}}
\logpage{[ 6, 2, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsKStackedSphere( complex, k )\index{SCIsKStackedSphere@\texttt{SCIsKStackedSphere}}
\label{SCIsKStackedSphere}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
an integer value upon success, \texttt{fail} otherwise.



 Checks, whether the given \mbox{\texttt{complex}} that must be a homology sphere is a \mbox{\texttt{k}}-stacked sphere by a randomized algorithm based on bistellar moves. Returns an
integer less or equal to \mbox{\texttt{k}}, where a positive return value of \texttt{i} means that the complex is \texttt{i}-stacked, a zero return value means that the complex cannot be \mbox{\texttt{k}}-stacked and -1 if the question could not be decided.

 Internally calls \texttt{SCReduceComplexEx} (\ref{SCReduceComplexEx}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("S^4~S^1");
   [ [ 204, "S^4~S^1 (VT)" ], [ 339, "S^4~S^1 (VT)" ], [ 341, "S^4~S^1 (VT)" ], 
     [ 438, "S^4~S^1 (VT)" ], [ 493, "S^4~S^1 (VT)" ], [ 494, "S^4~S^1 (VT)" ], 
     [ 495, "S^4~S^1 (VT)" ], [ 496, "S^4~S^1 (VT)" ], [ 497, "S^4~S^1 (VT)" ], 
     [ 500, "S^4~S^1 (VT)" ], [ 501, "S^4~S^1 (VT)" ], [ 502, "S^4~S^1 (VT)" ] ]
   gap> c:=SCLib.Load(204);;
   gap> l:=c.Link(1);
   [SimplicialComplex
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="lk(1) in S^4~S^1 (VT)"
    Dim=4
   
   /SimplicialComplex]
   gap> SCIsKStackedSphere(l,1);
   #I  SCIsKStackedSphere: try 1/50
   #I  round 0: [ 11, 40, 70, 65, 26 ]
   #I  round 1: [ 10, 35, 60, 55, 22 ]
   #I  round 2: [ 9, 30, 50, 45, 18 ]
   #I  round 3: [ 8, 25, 40, 35, 14 ]
   #I  round 4: [ 7, 20, 30, 25, 10 ]
   #I  round 5: [ 6, 15, 20, 15, 6 ]
   #I  SCReduceComplexEx: computed locally minimal complex after 6 rounds.
   1
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsManifold}}
\logpage{[ 6, 2, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsManifold( complex )\index{SCIsManifold@\texttt{SCIsManifold}}
\label{SCIsManifold}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Tries to prove that a closed simplicial d-pseudomanifold is a combinatorial
manifold by reducing its vertex links to the boundary of the d-simplex.

 \texttt{false} is only returned, if a minimal version of a reduced vertex link can be
computed which is different from the boundary of the simplex. Internally calls \texttt{SCReduceComplexEx} (\ref{SCReduceComplexEx})\texttt{(link,SCEmpty(),0,SCIntFunc.SCChooseMove);} for every link of \mbox{\texttt{complex}}. Note, that \texttt{false} is returned in case of a bounded manifold. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(3);;
   gap> SCIsManifold(c);
   #I  SCIsManifold: processing vertex link 1/6
   #I  round 0: [ 3, 3 ]
   #I  SCReduceComplexEx: computed locally minimal complex after 1 rounds.
   #I  SCIsManifold: link is sphere.
   ...
   #I  SCIsManifold: processing vertex link 6/6
   #I  round 0: [ 3, 3 ]
   #I  SCReduceComplexEx: computed locally minimal complex after 1 rounds.
   #I  SCIsManifold: link is sphere.
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCIsMovableComplex}}
\logpage{[ 6, 2, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsMovableComplex( complex )\index{SCIsMovableComplex@\texttt{SCIsMovableComplex}}
\label{SCIsMovableComplex}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Checks, if \mbox{\texttt{complex}} can be modified by bistellar moves, i. e. if it is a closed combinatorial
pseudomanifold. 

 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(3);;
   gap> SCIsMovableComplex(c);
   true
   
\end{Verbatim}
 Bounded pseudomanifold 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SC([[1,2],[2,3],[3,4],[3,1]]);;
   gap> SCIsMovableComplex(c);
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMove}}
\logpage{[ 6, 2, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMove( complex, move )\index{SCMove@\texttt{SCMove}}
\label{SCMove}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a new simplicial complex in standard labeling.



 Applies the bistellar move \mbox{\texttt{move}} to \mbox{\texttt{complex}}. \mbox{\texttt{move}} is given as a $(r+1)$-tuple together with a $(d+1-r)$-tuple if $d$ is the dimension of \mbox{\texttt{complex}} an if \mbox{\texttt{move}} is a $r$-move. See \texttt{SCRMoves} (\ref{SCRMoves}) for detailed information about bistellar $r$-Moves.

 Note: \mbox{\texttt{move}} and \mbox{\texttt{complex}} should be given in standard labeling to ensure a correct result. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> obj:=SC([[1,2],[2,3],[3,4],[4,1]]);
   [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels.
  
   Name="unnamed complex n"
   Dim=1
  
   /SimplicialComplex]
   gap> moves:=SCMoves(obj);
   [[[[1, 2], []], [[1, 4], []], 
       [[2, 3], []], [[3, 4], []]], 
     [[[1], [2, 4]], [[2], [1, 3]], 
       [[3], [2, 4]], [[4], [1, 3]]]]
   gap> obj:=SCMove(obj,last[2][1]);
   [SimplicialComplex
   
    Properties known: Chi, Dim, F, Faces, Facets, VertexLabels.
  
    Name="unnamed complex n"
    Dim=1
    Chi=0
    F=[3, 3]
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMoves}}
\logpage{[ 6, 2, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMoves( complex )\index{SCMoves@\texttt{SCMoves}}
\label{SCMoves}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of list of pairs of lists upon success, \texttt{fail} otherwise.



 See \texttt{SCRMoves} (\ref{SCRMoves}) for further information. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(3);;
   gap> moves:=SCMoves(c);
   [
   # 0-moves
     [[[1, 3, 5], []], [[1, 3, 6], []], [[1, 4, 5], []], 
       [[1, 4, 6], []], [[2, 3, 5], []], [[2, 3, 6], []],
       [[2, 4, 5], []], [[2, 4, 6], []]], 
   # 1-moves
     [[[1, 3], [5, 6]], [[1, 4], [5, 6]], [[1, 5], [3, 4]], 
       [[1, 6], [3, 4]], [[2, 3], [5, 6]], [[2, 4], [5, 6]], 
       [[2, 5], [3, 4]], [[2, 6], [3, 4]], [[3, 5], [1, 2]], 
       [[3, 6], [1, 2]], [[4, 5], [1, 2]], [[4, 6], [1, 2]]],
   # 2-moves
     [] 
  ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCRMoves}}
\logpage{[ 6, 2, 10 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCRMoves( complex, r )\index{SCRMoves@\texttt{SCRMoves}}
\label{SCRMoves}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 a list of pairs of the form \texttt{[ list, list ]}.



 A bistellar $r$-move of a $d$-dimensional combinatorial manifold \mbox{\texttt{complex}} is a $r$-face $m_1$ together with a $d-r$-tuple $m_2$ where $m_1$ is a common face of exactly $(d+1-r)$ facets and $m_2$ is not a face of \mbox{\texttt{complex}}.

 The $r$-Move removes all facets containing $m_1$ and replaces them by the $(r+1)$ faces obtained by uniting $m_2$ with any subset of $m_1$ of order $r$.

 The resulting complex has the same (PL-)topolgy as \mbox{\texttt{complex}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(3);;
   gap> moves:=SCRMoves(c,1);
   [ [ [ 1, 3 ], [ 5, 6 ] ], [ [ 1, 4 ], [ 5, 6 ] ], [ [ 1, 5 ], [ 3, 4 ] ], 
     [ [ 1, 6 ], [ 3, 4 ] ], [ [ 2, 3 ], [ 5, 6 ] ], [ [ 2, 4 ], [ 5, 6 ] ], 
     [ [ 2, 5 ], [ 3, 4 ] ], [ [ 2, 6 ], [ 3, 4 ] ], [ [ 3, 5 ], [ 1, 2 ] ], 
     [ [ 3, 6 ], [ 1, 2 ] ], [ [ 4, 5 ], [ 1, 2 ] ], [ [ 4, 6 ], [ 1, 2 ] ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCReduceAsSubcomplex}}
\logpage{[ 6, 2, 11 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCReduceAsSubcomplex( complex1, complex2 )\index{SCReduceAsSubcomplex@\texttt{SCReduceAsSubcomplex}}
\label{SCReduceAsSubcomplex}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{SCBistellarOptions.WriteLevel=0}: a triple of the form \texttt{[ boolean, simplicial complex, rounds performed ]} upon termination of the algorithm.\\
 \texttt{SCBistellarOptions.WriteLevel=1}: A library of simplicial complexes with all vertex minimal complexes and
(upon termination) a triple of the form \texttt{[ boolean, simplicial complex, rounds performed ]}.\\
 \texttt{SCBistellarOptions.WriteLevel=2}: A mail in case a smaller version of \mbox{\texttt{complex1}} was found, a library of simplicial complexes with all vertex minimal complexes
and (upon termination) a triple of the form \texttt{[ boolean, simplicial complex, rounds performed ]} upon termination of the algorithm.\\
 Returns \texttt{fail} upon an error.



 Reduces a closed simplicial pseudomanifold \mbox{\texttt{complex1}} as a subcomplex of \mbox{\texttt{complex2}}. 

 Main application: Reduce a subcomplex of the cross polytope without
introducing diagonals. 

 Internally calls \texttt{SCReduceComplexEx} (\ref{SCReduceComplexEx})\texttt{(complex1,complex2,2,SCIntFunc.SCChooseMove);} 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets([[1,3],[3,5],[4,5],[4,1]]);;
   gap> SCReduceAsSubcomplex(c,SCBdCrossPolytope(3));
   #I  round 0, move: [ [ 2 ], [ 1, 4 ] ]
   [ 3, 3 ]
   #I  SCReduceComplexEx: computed locally minimal complex after 1 rounds.
   [ true, [SimplicialComplex
       
        Properties known: Dim, Facets, Name, VertexLabels.
       
        Name="unnamed complex 9"
        Dim=1
       
       /SimplicialComplex], 1 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCReduceComplex}}
\logpage{[ 6, 2, 12 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCReduceComplex( complex )\index{SCReduceComplex@\texttt{SCReduceComplex}}
\label{SCReduceComplex}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 \texttt{SCBistellarOptions.WriteLevel=0}: a triple of the form \texttt{[ boolean, simplicial complex, rounds performed ]} upon termination of the algorithm.\\
 \texttt{SCBistellarOptions.WriteLevel=1}: A library of simplicial complexes with all vertex minimal complexes and
(upon termination) a triple of the form \texttt{[ boolean, simplicial complex, rounds performed ]}.\\
 \texttt{SCBistellarOptions.WriteLevel=2}: A mail in case a smaller version of \mbox{\texttt{complex1}} was found, a library of simplicial complexes with all vertex minimal complexes
and (upon termination) a triple of the form \texttt{[ boolean, simplicial complex, rounds performed ]} upon termination of the algorithm.\\
 Returns \texttt{fail} upon an error..



 Reduces a closed simplicial pseudomanifold via bistellar moves. Internally
calls \texttt{SCReduceComplexEx} (\ref{SCReduceComplexEx})\texttt{(complex,SCEmpty(),0,SCIntFunc.SCChooseMove);} 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   # hexagon
   gap> obj:=SC([[1,2],[2,3],[3,4],[4,5],[5,6],[6,1]]);;
   gap> SCReduceComplex(obj);
   #I  round 0, move: [ [ 6 ], [ 1, 5 ] ]
   [ 5, 5 ]
   #I  round 1, move: [ [ 4 ], [ 3, 5 ] ]
   [ 4, 4 ]
   #I  round 2, move: [ [ 3 ], [ 2, 5 ] ]
   [ 3, 3 ]
   #I  SCReduceComplexEx: computed locally minimal complex after 3 rounds.
   [ true, [SimplicialComplex
       
        Properties known: Dim, Facets, Name, VertexLabels.
       
        Name="unnamed complex 6"
        Dim=1
       
       /SimplicialComplex], 3 ]
   ## 
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCReduceComplexEx}}
\logpage{[ 6, 2, 13 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCReduceComplexEx( complex, refComplex, mode, choosemove )\index{SCReduceComplexEx@\texttt{SCReduceComplexEx}}
\label{SCReduceComplexEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{SCBistellarOptions.WriteLevel=0}: a triple of the form \texttt{[ boolean, simplicial complex, rounds ]} upon termination of the algorithm.\\
 \texttt{SCBistellarOptions.WriteLevel=1}: A library of simplicial complexes with all vertex minimal complexes and
(upon termination) a triple of the form \texttt{[ boolean, simplicial complex, rounds ]}.\\
 \texttt{SCBistellarOptions.WriteLevel=2}: A mail in case a smaller version of \mbox{\texttt{complex1}} was found, a library of simplicial complexes with all vertex minimal complexes
and (upon termination) a triple of the form \texttt{[ boolean, simplicial complex, rounds ]} upon termination of the algorithm.\\
 Returns \texttt{fail} upon an error.



 Reduces a closed simplicial pseudomanifold (\mbox{\texttt{complex}}) via bistellar moves. Compares it ("mode"=1) to \mbox{\texttt{refComplex}} or reduces it as a subcomplex of \mbox{\texttt{refComplex}} (\mbox{\texttt{mode}}=2). 

 \mbox{\texttt{choosemove}} is a function containing a flip strategy for the flip sequence, see also \texttt{SCIntFunc.SCChooseMove} (\ref{SCIntFunc.SCChooseMove}). 

 The currently minimal complex is stored to the variable \texttt{minComplex}, the currently minimal $f$-vector to \texttt{minF}. Note, that in general the algorithm will not stop until the maximum number
of rounds is reached. You can adjust the maximum number of rounds via the
property \texttt{SCBistellarOptions} (\ref{SCBistellarOptions}). The number of rounds performed is returned in the third entry of the triple
returned by this function. \\
 This function is called by 
\begin{enumerate}
\item  \texttt{SCReduceComplex} (\ref{SCReduceComplex}),
\item  \texttt{SCEquivalent} (\ref{SCEquivalent}),
\item  \texttt{SCReduceAsSubcomplex} (\ref{SCReduceAsSubcomplex}),
\item  \texttt{SCIsManifold} (\ref{SCIsManifold}).
\end{enumerate}
 Please see \texttt{SCMailIsPending} (\ref{SCMailIsPending}) for further information about the email notification system in case \texttt{SCBistellarOptions.WriteLevel=2} is set.\\
 }

 }

 }

 
\chapter{\textcolor{Chapter }{Functions for normal surfaces}}\label{chap:NormSurfFunc}
\logpage{[ 7, 0, 0 ]}
{
 
\section{\textcolor{Chapter }{Creating an \texttt{SCNormalSurface} object}}\logpage{[ 7, 1, 0 ]}
{
  This section contains functions to construct normal surfaces from facet lists
or combinatorial $3$-manifolds. 

\subsection{\textcolor{Chapter }{SCNSEmpty}}
\logpage{[ 7, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSEmpty(  )\index{SCNSEmpty@\texttt{SCNSEmpty}}
\label{SCNSEmpty}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 normal surface with empty facet list upon success, \texttt{fail} otherwise.



 Generates an empty complex (of dimension $-1$). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCNSEmpty();
   [NormalSurface
   
    Properties known: Dim, Faces, Facets, Name, VertexLabels.
   
    Name="empty normal surface"
    Dim=-1
   
   /NormalSurface]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSFromFacets}}
\logpage{[ 7, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSFromFacets( facets )\index{SCNSFromFacets@\texttt{SCNSFromFacets}}
\label{SCNSFromFacets}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A new object of type \texttt{SCNormalSurface} upon success, \texttt{fail} otherwise.



 Constructor of a normal surface from a facet list, see \texttt{SCFromFacets} (\ref{SCFromFacets}) for details. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> ns:=SCNSFromFacets([[1,2,3],[1,2,4,5],[1,3,4,6],[2,3,5,6],[4,5,6]]);
   [NormalSurface
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="unnamed normal surface n"
    Dim=2
   
   /NormalSurface]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNS}}
\logpage{[ 7, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNS( facets )\index{SCNS@\texttt{SCNS}}
\label{SCNS}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A new object of type \texttt{SCNormalSurface} upon success, \texttt{fail} otherwise.



 Internally calls \texttt{SCNSFromFacets} (\ref{SCNSFromFacets}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> ns:=SCNS([[1,2,3],[1,2,4,5],[1,3,4,6],[2,3,5,6],[4,5,6]]);
   [NormalSurface
   
    Properties known: Dim, Facets, Name, VertexLabels.
   
    Name="unnamed normal surface n"
    Dim=2
   
   /NormalSurface]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSSlicing}}
\logpage{[ 7, 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSSlicing( complex, slicing )\index{SCNSSlicing@\texttt{SCNSSlicing}}
\label{SCNSSlicing}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a normal surface upon success, \texttt{fail} otherwise.



 Computes a slicing defined by a partition \mbox{\texttt{slicing}} of the set of vertices of the $3$-dimensional combinatorial pseudo manifold \mbox{\texttt{complex}}. \mbox{\texttt{slicing}} has to be of size $2$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByAttribute("F=[6,15,18,9]");
   [ [ 4, "S^3 (VT)" ] ]
   gap> c:=SCLib.Load(4);;                       
   gap> ns:=SCNSSlicing(c,[[1,2,3],[4,5,6]]);    
   [NormalSurface
   
    Properties known: Chi, ConnectedComponents, Dim, F, Facets, Genus, IsConnect\
   ed, Name, Oriented, Subdivision, TopologicalType, VertexLabels, Vertices.
   
    Name="slicing [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] of S^3 (VT)"
    Dim=2
    Chi=2
    F=[ 9, 16, 4, 5 ]
    IsConnected=true
    TopologicalType="S^2"
   
   /NormalSurface]
   gap> ns.Facets;
   [ [ [ 1, 4 ], [ 2, 4 ], [ 3, 4 ] ], 
     [ [ 1, 6 ], [ 2, 6 ], [ 3, 6 ] ], 
     [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ] ], 
     [ [ 1, 5 ], [ 1, 6 ], [ 2, 5 ], [ 2, 6 ] ], 
     [ [ 1, 4 ], [ 1, 6 ], [ 3, 4 ], [ 3, 6 ] ], 
     [ [ 1, 4 ], [ 1, 5 ], [ 1, 6 ] ], 
     [ [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ], 
     [ [ 2, 5 ], [ 2, 6 ], [ 3, 5 ], [ 3, 6 ] ], 
     [ [ 3, 4 ], [ 3, 5 ], [ 3, 6 ] ] ]
   gap> ns:=SCNSSlicing(c,[[1,3,5],[2,4,6]]);    
   [NormalSurface
   
    Properties known: Chi, ConnectedComponents, Dim, F, Facets, Genus, IsConnect\
   ed, Name, Oriented, Subdivision, TopologicalType, VertexLabels, Vertices.
   
    Name="slicing [ [ 1, 3, 5 ], [ 2, 4, 6 ] ] of S^3 (VT)"
    Dim=2
    Chi=0
    F=[ 9, 18, 0, 9 ]
    IsConnected=true
    TopologicalType="T^2"
   
   /NormalSurface]
   gap> ns.Facets;                           
   [ [ [ 1, 2 ], [ 1, 4 ], [ 3, 2 ], [ 3, 4 ] ], 
     [ [ 1, 2 ], [ 1, 6 ], [ 3, 2 ], [ 3, 6 ] ], 
     [ [ 1, 2 ], [ 1, 4 ], [ 5, 2 ], [ 5, 4 ] ], 
     [ [ 1, 2 ], [ 1, 6 ], [ 5, 2 ], [ 5, 6 ] ], 
     [ [ 1, 4 ], [ 1, 6 ], [ 3, 4 ], [ 3, 6 ] ], 
     [ [ 1, 4 ], [ 1, 6 ], [ 5, 4 ], [ 5, 6 ] ], 
     [ [ 3, 2 ], [ 3, 4 ], [ 5, 2 ], [ 5, 4 ] ], 
     [ [ 3, 2 ], [ 3, 6 ], [ 5, 2 ], [ 5, 6 ] ], 
     [ [ 3, 4 ], [ 3, 6 ], [ 5, 4 ], [ 5, 6 ] ] ]
   gap> 
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Generating new objects from normal surfaces}}\logpage{[ 7, 2, 0 ]}
{
  \textsf{simpcomp} provides the possibility to copy and / or triangulate normal surfaces. Note,
that other constructions like the connected sum or the cartesian product do
not make sense for (embedded) normal surfaces in general. 

\subsection{\textcolor{Chapter }{SCNSCopy}}
\logpage{[ 7, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSCopy( complex )\index{SCNSCopy@\texttt{SCNSCopy}}
\label{SCNSCopy}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a normal surface upon success, \texttt{fail} otherwise.



 Copies a \texttt{GAP} object of type \texttt{SCNormalSurface} (cf. \texttt{SCCopy} (\ref{SCCopy})). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> sl:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);
   [NormalSurface
   
    Properties known: Chi, ConnectedComponents, Dim, F, Facets, Genus, IsConnect\
   ed, Name, Oriented, Subdivision, TopologicalType, VertexLabels, Vertices.
   
    Name="slicing [ [ 1 ], [ 2, 3, 4, 5 ] ] of S^3_5"
    Dim=2
    Chi=2
    F=[ 4, 6, 4 ]
    IsConnected=true
    TopologicalType="S^2"
   
   /NormalSurface]
   gap> sl_2:=SCNSCopy(sl);                          
   [NormalSurface
   
    Properties known: Chi, ConnectedComponents, Dim, F, Facets, Genus, IsConnect\
   ed, Name, Oriented, Subdivision, TopologicalType, VertexLabels, Vertices.
   
    Name="slicing [ [ 1 ], [ 2, 3, 4, 5 ] ] of S^3_5"
    Dim=2
    Chi=2
    F=[ 4, 6, 4 ]
    IsConnected=true
    TopologicalType="S^2"
   
   /NormalSurface]
   gap> IsIdenticalObj(sl,sl_2);                     
   false
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSSubdivision}}
\logpage{[ 7, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSSubdivision( normalsurface )\index{SCNSSubdivision@\texttt{SCNSSubdivision}}
\label{SCNSSubdivision}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a simplicial complex upon success, \texttt{fail} otherwise.



 Computes a simplicial subdivision of \mbox{\texttt{normalsurface}} without introducing new vertices. The subdivision is stored as a property of \mbox{\texttt{normalsurface}}. Note, that symmetry may be lost during the process of subdividing. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByAttribute("F=[6,15,18,9]");
   [ [ 4, "S^3 (VT)" ] ]
   gap> c:=SCLib.Load(4);;
   gap> ns:=SCNSSlicing(c,[[1,3,5],[2,4,6]]);;
   gap> ns.F; 
   [ 9, 18, 0, 9 ]
   gap> sc:=SCNSSubdivision(ns);;
   gap> sc.F;
   [ 9, 27, 18 ]
   gap> 
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Properties of \texttt{SCNormalSurface} objects}}\logpage{[ 7, 3, 0 ]}
{
  Although some properties of a normal surface can be computed by using the
functions for simplicial complexes, there is a variety of properties needing
specially designed functions. See below for a list. 

\subsection{\textcolor{Chapter }{SCNSDim}}
\logpage{[ 7, 3, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSDim( normalsurface )\index{SCNSDim@\texttt{SCNSDim}}
\label{SCNSDim}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
$2$ if \mbox{\texttt{normalsurface}} is not empty, $-1$ otherwise.



 Computes the dimension of a normal surface (which is always $2$ in the non-empty case. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> ns:=SCNSEmpty();;                                                    
   gap> SCNSDim(ns);                                                         
   -1
   gap> ns:=SCNSFromFacets([[1,2,3],[1,2,4,5],[1,3,4,6],[2,3,5,6],[4,5,6]]);;
   gap> SCNSDim(ns);                                                         
   2
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSEulerCharacteristic}}
\logpage{[ 7, 3, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSEulerCharacteristic( normalsurface )\index{SCNSEulerCharacteristic@\texttt{SCNSEulerCharacteristic}}
\label{SCNSEulerCharacteristic}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
an integer upon success, \texttt{fail} otherwise.



 Computes the Euler characteristic of a normal surface. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("S^2xS^1");  
   [ [ 24, "S^2xS^1 (VT)" ], [ 33, "S^2xS^1 (VT)" ], [ 68, "S^2xS^1 (VT)" ], 
   [ 81, "S^2xS^1 (VT)" ], [ 82, "S^2xS^1 (VT)" ], [ 83, "S^2xS^1 (VT)" ], ... 
   ]
   gap> c:=SCLib.Load(24);;             
   gap> ns:=c.Slicing([[1..5],[6..10]]);;
   gap> SCNSEulerCharacteristic(ns);                 
   4
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSFVector}}
\logpage{[ 7, 3, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSFVector( normalsurface )\index{SCNSFVector@\texttt{SCNSFVector}}
\label{SCNSFVector}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a $1$, $3$ or $4$ tuple of (non-negative) integer values upon success, \texttt{fail} otherwise.



 Computes the $f$-vector of a normal surface, i. e. the number of vertices, edges, triangles
and quadrilaterals of \mbox{\texttt{normalsurface}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("S^2xS^1");  
   [ [ 24, "S^2xS^1 (VT)" ], [ 33, "S^2xS^1 (VT)" ], [ 68, "S^2xS^1 (VT)" ], 
   [ 81, "S^2xS^1 (VT)" ], [ 82, "S^2xS^1 (VT)" ], [ 83, "S^2xS^1 (VT)" ], ... 
   ]
   gap> c:=SCLib.Load(24);;             
   gap> ns:=c.Slicing([[1..5],[6..10]]);;
   gap> SCNSFVector(ns);                 
   [ 20, 40, 16, 8 ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSFaceLattice}}
\logpage{[ 7, 3, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSFaceLattice( complex )\index{SCNSFaceLattice@\texttt{SCNSFaceLattice}}
\label{SCNSFaceLattice}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a list of facet lists upon success, \texttt{fail} otherwise.



 Computes the face lattice of a normal surface in original labeling. Triangles
and quadrilaterals are stored separately (cf. \texttt{SCNSSkel} (\ref{SCNSSkel})). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;              
   gap> ns:=SCNSSlicing(c,[[1,2],[3..5]]);;
   gap> SCNSFaceLattice(ns);                            
   [ [ [ [ 1, 3 ] ], [ [ 1, 4 ] ], [ [ 1, 5 ] ], [ [ 2, 3 ] ], [ [ 2, 4 ] ], 
         [ [ 2, 5 ] ] ], 
     [ [ [ 1, 3 ], [ 1, 4 ] ], [ [ 1, 3 ], [ 1, 5 ] ], [ [ 1, 3 ], [ 2, 3 ] ], 
       [ [ 1, 4 ], [ 1, 5 ] ], [ [ 1, 4 ], [ 2, 4 ] ], [ [ 1, 5 ], [ 2, 5 ] ],
       [ [ 2, 3 ], [ 2, 4 ] ], [ [ 2, 3 ], [ 2, 5 ] ], [ [ 2, 4 ], [ 2, 5 ] ] ], 
     [ [ [ 1, 3 ], [ 1, 4 ], [ 1, 5 ] ], [ [ 2, 3 ], [ 2, 4 ], [ 2, 5 ] ] ], 
     [ [ [ 1, 3 ], [ 1, 4 ], [ 2, 3 ], [ 2, 4 ] ], 
       [ [ 1, 3 ], [ 1, 5 ], [ 2, 3 ], [ 2, 5 ] ], 
       [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ] ] ] ]
   gap> ns.F;
   [ 6, 9, 2, 3 ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSFaceLatticeEx}}
\logpage{[ 7, 3, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSFaceLatticeEx( complex )\index{SCNSFaceLatticeEx@\texttt{SCNSFaceLatticeEx}}
\label{SCNSFaceLatticeEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a list of facet lists upon success, \texttt{fail} otherwise.



 Computes the face lattice of a normal surface in standard labeling. Triangles
and quadrilaterals are stored separately (cf. \texttt{SCNSSkelEx} (\ref{SCNSSkelEx})). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;              
   gap> ns:=SCNSSlicing(c,[[1,2],[3..5]]);;
   gap> SCNSFaceLatticeEx(ns);                            
   [ [ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ] ], 
     [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 2, 3 ], [ 2, 5 ], 
       [ 3, 6 ], [ 4, 5 ], [ 4, 6 ], [ 5, 6 ] ], 
     [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], 
     [ [ 1, 2, 4, 5 ], [ 1, 3, 4, 6 ], [ 2, 3, 5, 6 ] ] ]
   gap> ns.F;
   [ 6, 9, 2, 3 ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSFpBettiNumbers}}
\logpage{[ 7, 3, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSFpBettiNumbers( normalsurface, p )\index{SCNSFpBettiNumbers@\texttt{SCNSFpBettiNumbers}}
\label{SCNSFpBettiNumbers}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a list of non-negative integers upon success, \texttt{fail} otherwise



 Computes the Betti numbers modulo \mbox{\texttt{p}} of \mbox{\texttt{normalsurface}}. Internally, \mbox{\texttt{normalsurface}} is subdivided and the Betti numbers are computed on the subdivision (cf. \texttt{SCNSSubdivision} (\ref{SCNSSubdivision})). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("(S^2xS^1)#20");       
   [ [ 688, "(S^2xS^1)#20" ] ]
   gap> c:=SCLib.Load(688);;
   gap> c.F;
   [ 27, 298, 542, 271 ]
   gap> ns:=c.Slicing([[1..13],[14..27]]);;
   gap> SCNSFpBettiNumbers(ns,2);
   [ 2, 14, 2 ]
   gap>
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSGenus}}
\logpage{[ 7, 3, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSGenus( normalsurface )\index{SCNSGenus@\texttt{SCNSGenus}}
\label{SCNSGenus}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a non-negative integer upon success, \texttt{fail} otherwise.



 Computes the genus of a normal surface. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("(S^2xS^1)#20");
   [ [ 688, "(S^2xS^1)#20" ] ]
   gap> c:=SCLib.Load(688);;               
   gap> c.F;                               
   [ 27, 298, 542, 271 ]
   gap> ns:=c.Slicing([[1..12],[13..27]]);;
   gap> SCIsConnected(ns);
   true
   gap> SCNSGenus(ns);                     
   7
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSHomology}}
\logpage{[ 7, 3, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSHomology( normalsurface )\index{SCNSHomology@\texttt{SCNSHomology}}
\label{SCNSHomology}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a list of homology groups upon success, \texttt{fail} otherwise



 Computes the homology of \mbox{\texttt{normalsurface}}. Internally, \mbox{\texttt{normalsurface}} is subdivided and simplicial homology is computed on the subdivision (cf. \texttt{SCNSSubdivision} (\ref{SCNSSubdivision})). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("(S^2xS^1)#20");       
   [ [ 688, "(S^2xS^1)#20" ] ]
   gap> c:=SCLib.Load(688);;
   gap> c.F;
   [ 27, 298, 542, 271 ]
   gap> ns:=c.Slicing([[1..12],[13..27]]);;   
   gap> ns.Homology;
   [ [ 0, [  ] ], [ 14, [  ] ], [ 1, [  ] ] ]
   gap> ns:=c.Slicing([[1..13],[14..27]]);;
   gap> ns.Homology;                       
   [ [ 1, [  ] ], [ 14, [  ] ], [ 2, [  ] ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSSkel}}
\logpage{[ 7, 3, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSSkel( normalsurface, dim )\index{SCNSSkel@\texttt{SCNSSkel}}
\label{SCNSSkel}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a facet list of dimension \mbox{\texttt{dim}} upon success, \texttt{fail} otherwise.



 Computes all faces of one type in original labeling: \mbox{\texttt{dim}} $= 0$ computes the vertices, \mbox{\texttt{dim}} $= 1$ computes the edges, \mbox{\texttt{dim}} $= 2$ computes the triangles, \mbox{\texttt{dim}} $= 3$ computes the quadrilaterals, 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;              
   gap> ns:=SCNSSlicing(c,[[1],[2..5]]);;
   gap> SCNSSkel(ns,1);                            
   [ [ [ 1, 2 ], [ 1, 3 ] ], [ [ 1, 2 ], [ 1, 4 ] ], [ [ 1, 2 ], [ 1, 5 ] ], 
     [ [ 1, 3 ], [ 1, 4 ] ], [ [ 1, 3 ], [ 1, 5 ] ], [ [ 1, 4 ], [ 1, 5 ] ] ]
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;              
   gap> ns:=SCNSSlicing(c,[[1],[2..5]]);;
   gap> SCNSSkel(ns,3);                            
   [ ]
   gap> ns:=SCNSSlicing(c,[[1,2],[3..5]]);;
   gap> SCNSSkelEx(ns,3);                            
   [ [ [ 1, 3 ], [ 1, 4 ], [ 2, 3 ], [ 2, 4 ] ], 
     [ [ 1, 3 ], [ 1, 5 ], [ 2, 3 ], [ 2, 5 ] ], 
     [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ] ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSSkelEx}}
\logpage{[ 7, 3, 10 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSSkelEx( normalsurface, dim )\index{SCNSSkelEx@\texttt{SCNSSkelEx}}
\label{SCNSSkelEx}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a facet list of dimension \mbox{\texttt{dim}} upon success, \texttt{fail} otherwise.



 Computes all faces of one type in standard labeling: \mbox{\texttt{dim}} $= 0$ computes the vertices, \mbox{\texttt{dim}} $= 1$ computes the edges, \mbox{\texttt{dim}} $= 2$ computes the triangles, \mbox{\texttt{dim}} $= 3$ computes the quadrilaterals, 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;              
   gap> ns:=SCNSSlicing(c,[[1],[2..5]]);;
   gap> SCNSSkelEx(ns,1);                            
   [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 2, 3 ], [ 2, 4 ], [ 3, 4 ] ]
   gap> 
   
\end{Verbatim}
 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(4);;              
   gap> ns:=SCNSSlicing(c,[[1],[2..5]]);;
   gap> SCNSSkelEx(ns,3);                            
   [ ]
   gap> ns:=SCNSSlicing(c,[[1,2],[3..5]]);;
   gap> SCNSSkelEx(ns,3);                            
   [ [ 1, 2, 4, 5 ], [ 1, 3, 4, 6 ], [ 2, 3, 5, 6 ] ]
   gap> 
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCNSTopologicalType}}
\logpage{[ 7, 3, 11 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCNSTopologicalType( ns )\index{SCNSTopologicalType@\texttt{SCNSTopologicalType}}
\label{SCNSTopologicalType}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a string upon success, \texttt{fail} otherwise.



 Determines the topological type of \mbox{\texttt{ns}} via the classification theorem for closed surfaces. If \mbox{\texttt{ns}} is not connected, the topological type of each connected component is
computed. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib.SearchByName("(S^2xS^1)#20");      
   [ [ 688, "(S^2xS^1)#20" ] ]
   gap> c:=SCLib.Load(688);;
   gap> c.F;
   [ 27, 298, 542, 271 ]
   gap> for i in [1..26] do 
   > ns:=SCNSSlicing(c,[[1..i],[i+1..27]]); 
   > Print(ns.TopologicalType,"\n"); 
   > od;                                           
   S^2
   S^2
   S^2
   S^2
   S^2 U S^2
   S^2 U S^2
   S^2
   (T^2)#3
   (T^2)#5
   (T^2)#4
   (T^2)#3
   (T^2)#7
   (T^2)#7 U S^2
   (T^2)#7 U S^2
   (T^2)#7 U S^2
   (T^2)#8 U S^2
   (T^2)#7 U S^2
   (T^2)#8
   (T^2)#6
   (T^2)#6
   (T^2)#5
   (T^2)#3
   (T^2)#2
   T^2
   S^2
   S^2
   gap> 
   
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{Library and I/O}}\label{chap:libio}
\logpage{[ 8, 0, 0 ]}
{
  
\section{\textcolor{Chapter }{Simplicial complex library}}\logpage{[ 8, 1, 0 ]}
{
  \textsf{simpcomp} contains a library of simplicial complexes on few vertices, most of them
(combinatorial) triangulations of manifolds. The user can load these known
triangulations from the library in order to study their properties or to
construct new triangulations out of the known ones. For exmaple, a user could
determine the topological type of a given triangulation -- which can be quite
tedious if done by hand -- by establishing a PL equivalence to a complex in
the library.

 Among other known triangulations, the library contains all of the vertex
transitive triangulations of d-manifolds, $d \leq 11$ with few ($n\leq 13$ and $n\leq 15$ for $d=2,3,9,10,11$) vertices classified by Frank Lutz that can be found on his ``Manifold Page'' \href{http://www.math.tu-berlin.de/diskregeom/stellar/}{\texttt{http://www.math.tu-berlin.de/diskregeom/stellar/}}, along with some triangulations of sphere bundles and vertex transitive
triangulations of pseudomanifolds.

 See \texttt{SCLib} (\ref{SCLib}) for a naming convention used for the global library of \textsf{simpcomp}. 

\subsection{\textcolor{Chapter }{SCIsLibRepository}}
\logpage{[ 8, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCIsLibRepository( object )\index{SCIsLibRepository@\texttt{SCIsLibRepository}}
\label{SCIsLibRepository}
}\hfill{\scriptsize (filter)}}\\
\textbf{\indent Returns:\ }
\texttt{true} / \texttt{false} upon success, \texttt{fail} otherwise.



 Filter for the category of a library repository \texttt{SCIsLibRepository} used by the \textsf{simpcomp} library. The category \texttt{SCLibRepository} is derived from the category \texttt{SCPropertyObject}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCIsLibRepository(SCLib); #the global library is stored in SCLib
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLib}}
\logpage{[ 8, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLib\index{SCLib@\texttt{SCLib}}
\label{SCLib}
}\hfill{\scriptsize (global variable)}}\\


 The global variable \texttt{SCLib} contains the library object of the global library of \textsf{simpcomp} through which the user can access the library. The path to the global library
is \texttt{GAPROOT/pkg/simpcomp/complexes}.

 The naming convention in the global library is the following: complexes are
usually named by their topological type. As usual, ` S\^{}d' denotes a $d$-sphere, `T' a torus, `x' the cartesian product, `\~{}' the twisted product and `\#' the connected sum. The Klein Bottle is denoted by `K' or `K\^{}2'. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLib;
   [Simplicial complex library. Properties:
    CalculateIndexAttributes=true
    Number of complexes in library=689
    IndexAttributes=["Name", "Date", "Dim", "F", "G", "H", "Chi", "Homology"]
    Loaded=true
    Path="GAPROOT/pkg/simpcomp/complexes/"
   ]
   gap> SCLib.Size;
   689
   gap> SCLib.SearchByName("S^4~");
   [ [ 204, "S^4~S^1 (VT)" ], [ 339, "S^4~S^1 (VT)" ], [ 341, "S^4~S^1 (VT)" ], 
     [ 438, "S^4~S^1 (VT)" ], [ 493, "S^4~S^1 (VT)" ], [ 494, "S^4~S^1 (VT)" ], 
     [ 495, "S^4~S^1 (VT)" ], [ 496, "S^4~S^1 (VT)" ], [ 497, "S^4~S^1 (VT)" ], 
     [ 500, "S^4~S^1 (VT)" ], [ 501, "S^4~S^1 (VT)" ], [ 502, "S^4~S^1 (VT)" ] ]
   gap> SCLib.Load(204);          
   [SimplicialComplex
   
    Properties known: AltshulerSteinberg, Boundary, Chi, ConnectedComponents, 
                      Dim, DualGraph, F, Faces, Facets, G, H, HasBoundary, 
                      HasInterior, Homology, Interior, IsConnected, 
                      IsEulerianManifold, IsOrientable, IsPM, IsPure, 
                      MinimalNonFaces, Name, Neighborliness, Orientation, 
                      Reference, StronglyConnected, VertexLabels, Vertices.
   
    Name="S^4~S^1 (VT)"
    Dim=5
    Chi=0
    F=[ 13, 78, 195, 260, 195, 65 ]
    G=[ 6, 21, -35 ]
    H=[ 7, 28, -7, 28, 7, 1 ]
    HasBoundary=false
    HasInterior=true
    Homology=[ [ 0, [ ] ], [ 1, [ ] ], [ 0, [ ] ], [ 0, [ ] ], [ 0, [ 2 ] ], [ 0,\
    [ ] ] ]
    IsConnected=true
    IsEulerianManifold=true
    IsOrientable=false
    IsPM=true
    IsPure=true
    Neighborliness=2
   
   /SimplicialComplex]
   
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibAdd}}
\logpage{[ 8, 1, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibAdd( repository, complex[, name] )\index{SCLibAdd@\texttt{SCLibAdd}}
\label{SCLibAdd}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} upon success, \texttt{fail} otherwise.



 Adds a given complex \mbox{\texttt{complex}} to a given repository \mbox{\texttt{repository}}. The complex is saved to a file with suffix \texttt{.sc} in the repositories base path, where the file name is either formed from the
optional argument \mbox{\texttt{name}} and the current time or taken fom the name of the complex, if it is named. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> myRepository:=SCLibInit("~/myrepository");
   #I  SCLibInit: made directory "~/myrepository/" for user library.
   #I  SCIntFunc.SCLibInit: index not found -- trying to reconstruct it.
   #I  SCLibUpdate: rebuilding index for ~/myrepository/.
   #I  SCLibUpdate: rebuilding index done.
   gap> complex:=SCBdCrossPolytope(4);;
   gap> SCLibAdd(myRepository,complex);
   #I  SCLibAdd: saving complex to file "complex_Bd(beta4)_2009-10-29_17-12-36.sc\
   ".
   true
   gap> myRepository.Add(complex);; # alternative syntax
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibAllComplexes}}
\logpage{[ 8, 1, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibAllComplexes( repository )\index{SCLibAllComplexes@\texttt{SCLibAllComplexes}}
\label{SCLibAllComplexes}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 list of entries of the form \texttt{[ID,NAME]} upon success, \texttt{fail} otherwise.



 Returns a list with entries of the form \texttt{[ID,NAME]} of all the complexes in the given repository \mbox{\texttt{repository}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> all:=SCLibAllComplexes(SCLib);;
   gap> all[1];
   [ 1, "Moebius Strip" ]
   gap> Length(all);
   689
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibDelete}}
\logpage{[ 8, 1, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibDelete( repository, id )\index{SCLibDelete@\texttt{SCLibDelete}}
\label{SCLibDelete}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} upon success, \texttt{fail} otherwise.



 Deletes the simplicial complex with the given id \mbox{\texttt{id}} from the given repository \mbox{\texttt{repository}}. Apart from deleting the complexes' index entry, the associated \texttt{.sc} file is also deleted. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> myRepository:=SCLibInit("~/myrepository");
   #I  SCLibInit: made directory "~/myrepository/" for user library.
   #I  SCIntFunc.SCLibInit: index not found -- trying to reconstruct it.
   #I  SCLibUpdate: rebuilding index for ~/myrepository/.
   #I  SCLibUpdate: rebuilding index done.
   gap> SCLibDelete(myRepository,1);
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibDetermineTopologicalType}}
\logpage{[ 8, 1, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibDetermineTopologicalType( [repository,] complex )\index{SCLibDetermineTopologicalType@\texttt{SCLibDetermineTopologicalType}}
\label{SCLibDetermineTopologicalType}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
a simplicial complex or a list of items integer ids upon success, \texttt{fail} otherwise.



 Tries to determine the topological type of a given complex \mbox{\texttt{complex}} by first looking for complexes with matching homology in the library
repository \mbox{\texttt{repository}} (if no repository is passed, the global repository \texttt{SCLib} is used) and either returns a simplicial complex object (that is
combinatorially isomorphic to the complex given) or a list of library ids of
complexes in the library with the same homology as the complex provided.\\
 The ids obtained in this way can then be used to compare the complexes with \mbox{\texttt{complex}} by \texttt{SCEquivalent} (\ref{SCEquivalent}).\\
 If no complexes with matching homology can be found, the empty set is
returned. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCFromFacets([[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]]);;
   gap> SCLibDetermineTopologicalType(c);
   [SimplicialComplex
   
    Properties known: AltshulerSteinberg, AutomorphismGroup, 
                      AutomorphismGroupSize, AutomorphismGroupStructure, 
                      AutomorphismGroupTransitivity, Boundary, Chi, 
                      ConnectedComponents, Dim, DualGraph, F, Faces, Facets, G, 
                      Generators, H, HasBoundary, HasInterior, Homology, 
                      Interior, IsCentrallySymmetric, IsConnected, 
                      IsEulerianManifold, IsOrientable, IsPM, IsPure, 
                      MinimalNonFaces, Name, Neighborliness, Orientation, 
                      Reference, StronglyConnected, VertexLabels, Vertices.
   
    Name="RP^2 (VT)"
    Dim=2
    AutomorphismGroupSize=60
    AutomorphismGroupStructure="A5"
    AutomorphismGroupTransitivity=2
    Chi=1
    F=[ 6, 15, 10 ]
    G=[ 2 ]
    H=[ 3, 6, 0 ]
    HasBoundary=false
    HasInterior=true
    Homology=[ [ 0, [ ] ], [ 0, [ 2 ] ], [ 0, [ ] ] ]
    IsCentrallySymmetric=false
    IsConnected=true
    IsEulerianManifold=true
    IsOrientable=false
    IsPM=true
    IsPure=true
    Neighborliness=2
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibFlush}}
\logpage{[ 8, 1, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibFlush( repository, confirm )\index{SCLibFlush@\texttt{SCLibFlush}}
\label{SCLibFlush}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} upon success, \texttt{fail} otherwise.



 Completely empties a given repository \mbox{\texttt{repository}}. The index and all simplicial complexes in this repository are deleted. The
second argument, \mbox{\texttt{confirm}}, must be the string \texttt{"yes"} in order to confirm the deletion. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> myRepository:=SCLibInit("~/repository");;
   #I  SCLibInit: made directory "~/repository/" for user library.
   #I  SCIntFunc.SCLibInit: index not found -- trying to reconstruct it.
   #I  SCLibUpdate: rebuilding index for ~/repository/.
   #I  SCLibUpdate: rebuilding index done.
   gap> SCLibFlush(myRepository,"yes");
   #I  SCLibUpdate: rebuilding index for /home/effenbfx/testrepo/.
   #I  SCLibUpdate: rebuilding index done.
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibInit}}
\logpage{[ 8, 1, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibInit( dir )\index{SCLibInit@\texttt{SCLibInit}}
\label{SCLibInit}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
library repository of type \texttt{SCLibRepository} upon success, \texttt{fail} otherwise.



 This function initializes a library repository object for the given directory \mbox{\texttt{dir}} and returns that library repository object in case of success. The returned
object then provides a mean to access the library repository via the
SCLib-functions of \textsf{simpcomp}. The global library repository of \textsf{simpcomp} is loaded automatically at startup and is stored in the variable \texttt{SCLib}. User repositories can be created by calling \texttt{SCLibInit} with a desired destination directory. Note, that each repository must reside
in a different path since otherwise data may get lost. The function first
tries to load the repository index for the given directory to rebuild it (by
calling \texttt{SCLibUpdate}) if loading the index fails. The library index of a library repository is
stored in its base path in the XML file \texttt{complexes.idx}, the complexes are stored in files with suffix \texttt{.sc}, also in XML format. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> myRepository:=SCLibInit("~/myrepository");
   #I  SCLibInit: made directory "~/myrepository/" for user library.
   #I  SCIntFunc.SCLibInit: index not found -- trying to reconstruct it.
   #I  SCLibUpdate: rebuilding index for ~/myrepository/.
   #I  SCLibUpdate: rebuilding index done.
   [Simplicial complex library. Properties:
   CalculateIndexAttributes=true
   Number of complexes in library=0
   IndexAttributes=["Name", "Date", "Dim", "F", "G", "H", "Chi", "Homology"]
   Loaded=true
   Path="~/myrepository/"
  ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibIsLoaded}}
\logpage{[ 8, 1, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibIsLoaded( repository )\index{SCLibIsLoaded@\texttt{SCLibIsLoaded}}
\label{SCLibIsLoaded}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false} upon succes, \texttt{fail} otherwise.



 Returns \texttt{true} when a given library repository \mbox{\texttt{repository}} is in loaded state. This means that the directory of this repository is
accessible and a repository index file for this repository exists in the
repositories' path. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLibIsLoaded(SCLib);
   true
   gap> SCLib.IsLoaded;
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibSearchByAttribute}}
\logpage{[ 8, 1, 10 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibSearchByAttribute( repository, expr )\index{SCLibSearchByAttribute@\texttt{SCLibSearchByAttribute}}
\label{SCLibSearchByAttribute}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A list of items of the form \texttt{[ID, NAME]} upon success, \texttt{fail} otherwise.



 Searches a given repository \mbox{\texttt{repository}} for complexes for which the boolean expression \mbox{\texttt{expr}}, passed as string, evaluates to \texttt{true} and returns a list of complexes with entries of the form \texttt{[ID, NAME]} or \texttt{fail} upon error. The expression may use all GAP functions and can access all the
indexed attributes of the complexes in the given repository for the query. The
standard attributes are: Dim (Dimension), F (f-vector), G (g-vector), H
(h-vector), Chi (Euler characteristic), Homology, Name. See \texttt{SCLib} for the set of indexed attributes of the global library of \textsf{simpcomp}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   #search for all 3-neighborly complexes of dimension 4 in the global library
   gap> SCLibSearchByAttribute(SCLib,"Dim=4 and F[3]=Binomial(F[1],3)");
   [ [ 17, "CP^2 (VT)" ], [ 584, "K3 surface" ] ]
   # alternative syntax
   gap> SCLib.SearchByAttribute("Dim=4 and F[3]=Binomial(F[1],3)");
   [ [ 17, "CP^2 (VT)" ], [ 584, "K3 surface" ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibSearchByName}}
\logpage{[ 8, 1, 11 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibSearchByName( repository, name )\index{SCLibSearchByName@\texttt{SCLibSearchByName}}
\label{SCLibSearchByName}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
A list of items of the form \texttt{[ID, NAME]} upon success, \texttt{fail} otherwise.



 Searches a given repository \mbox{\texttt{repository}} for complexes that contain the string \mbox{\texttt{name}} as a substring of their name attribute and returns a list of the complexes
found with entries of the form \texttt{[ID, NAME]}. See \texttt{SCLib} (\ref{SCLib}) for a naming convention used for the global library of \textsf{simpcomp}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLibSearchByName(SCLib,"K3");
   [ [ 584, "K3 surface" ] ]
   gap> SCLib.SearchByName("K3"); #alternative syntax
   [ [ 584, "K3 surface" ] ]
   gap> SCLib.SearchByName("S^4x"); #search for products with S^4
   [ [ 291, "S^4xS^1 (VT)" ], [ 340, "S^4xS^1 (VT)" ], [ 342, "S^4xS^1 (VT)" ], 
     [ 571, "S^4xS^2" ], [ 627, "S^4xS^3" ], [ 655, "S^4xS^4" ] ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibSize}}
\logpage{[ 8, 1, 12 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibSize( repository )\index{SCLibSize@\texttt{SCLibSize}}
\label{SCLibSize}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
 integer upon success, \texttt{fail} otherwise.



 Returns the number of complexes contained in the given repository \mbox{\texttt{repository}}. Fails if the library repository was not previously loaded with \texttt{SCLibInit}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLibSize(SCLib); #SCLib is the repository of the global library
   689
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibUpdate}}
\logpage{[ 8, 1, 13 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibUpdate( repository, OR, path[, recalc] )\index{SCLibUpdate@\texttt{SCLibUpdate}}
\label{SCLibUpdate}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
library repository of type \texttt{SCLibRepository} upon success, fail otherwise.



 Recreates the index of a given repository (either via a repository object \mbox{\texttt{repository}} or a base path \texttt{path} of a repository) by scanning the base path for all \texttt{.sc} files containing simplicial complexes of the repository. Returns a repository
object with the newly created index on success of fail in case of an error.
The optional boolean argument \mbox{\texttt{recalc}} forces \textsf{simpcomp} to recompute all the indexed properties (such as f-vector, homology, etc.) of
the simplicial complexes in the repository if set to \texttt{true}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> myRepository:=SCLibInit("~/repository");;
   #I  SCLibInit: made directory "~/repository/" for user library.
   #I  SCIntFunc.SCLibInit: index not found -- trying to reconstruct it.
   #I  SCLibUpdate: rebuilding index for ~/repository/.
   #I  SCLibUpdate: rebuilding index done.
   gap> SCLibUpdate(myRepository);
   #I  SCLibUpdate: rebuilding index for ~/repository/.
   #I  SCLibUpdate: rebuilding index done.
   [Simplicial complex library. Properties:
   CalculateIndexAttributes=true
   Number of complexes in library=0
   IndexAttributes=["Name", "Date", "Dim", "F", "G", "H", "Chi", "Homology"]
   Loaded=true
   Path="~/myrepository/"
  ]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCLibStatus}}
\logpage{[ 8, 1, 14 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLibStatus( repository )\index{SCLibStatus@\texttt{SCLibStatus}}
\label{SCLibStatus}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
the library repository object of type \texttt{SCLibRepository} passed as argument.



 Lets GAP print the status of a given library repository \mbox{\texttt{repository}}. \texttt{IndexAttributes} is the list of attributes indexed for this repository. If \texttt{CalculateIndexAttributes} is true, the index attributes for a complex added to the library are
calculated automatically upon addition of the complex, otherwise this is left
to the user and only precalculated attributes are indexed. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCLibStatus(SCLib);
   [Simplicial complex library. Properties:
   CalculateIndexAttributes=true
   Number of complexes in library=N
   IndexAttributes=["Name", "Date", "Dim", "F", "G", "H", "Chi", "Homology"]
   Loaded=true
   Path="GAPROOT/pkg/simpcomp/complexes/"
  ]
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{\textsf{simpcomp} input / output functions}}\logpage{[ 8, 2, 0 ]}
{
  This section contains a description of the input/output-functionality provided
by \textsf{simpcomp}. The package provides the functionality to save and load simplicial complexes
(and their known properties) to, respectively from files in XML format.
Furthermore it provides the user with functions to export simplicial complexes
into polymake format (for this format there also exists rudimentary import
functionality), as JavaView geometry or in form of a latex table. For
importing more complex polymake data the package polymaking \cite{Roeder07Polymaking} can be used. 

\subsection{\textcolor{Chapter }{SCLoad}}
\logpage{[ 8, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCLoad( filename )\index{SCLoad@\texttt{SCLoad}}
\label{SCLoad}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
simplicial complex of type \texttt{SCSimplicialComplex} if successful, fail otherwise.



 Loads a simplicial complex stored in XML format from a file specified in \mbox{\texttt{filename}} (as string). If the filename provided does not end in \texttt{.sc}, this suffix is appended to the file name. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> SCSave(c,"bddelta3");
   true
   gap> c:=SCLoad("bddelta3");
   [SimplicialComplex
   
    Properties known: AutomorphismGroup, AutomorphismGroupOrder, 
                      AutomorphismGroupStructure, AutomorphismGroupTransitivity, 
                      Chi, Dim, F, Facets, Generators, HasBoundary, Homology, 
                      IsConnected, IsStronglyConnected, Name, TopologicalType, 
                      VertexLabels.
   
    Name="S^2_4"
    Dim=2
    TopologicalType="S^2"
    Chi=2
    F=[4, 6, 4]
    Homology=[[0, []], [0, []], [1, []]]
    AutomorphismGroupStructure="S4"
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCSave}}
\logpage{[ 8, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCSave( complex, filename )\index{SCSave@\texttt{SCSave}}
\label{SCSave}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
true if successful, fail otherwise.



 Saves a simplicial complex \mbox{\texttt{complex}} to a file specified by \mbox{\texttt{filename}} (as string) in XML format. If the file name provided does not end in \texttt{.sc}, this suffix is appended to the file name. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(3);;
   gap> SCSave("bddelta3");
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCExportPolymake}}
\logpage{[ 8, 2, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCExportPolymake( complex, filename )\index{SCExportPolymake@\texttt{SCExportPolymake}}
\label{SCExportPolymake}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
true upon success, fail otherwise.



 Exports the facet list with vertex labels of a given simplicial complex \mbox{\texttt{complex}} in \texttt{polymake} format to a file specified by \mbox{\texttt{filename}}. Currently, only the export in the format of \texttt{polymake} version 2.3 is supported. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdCrossPolytope(4);;
   gap> SCExportPolymake(c,"bdbeta4.poly");
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCImportPolymake}}
\logpage{[ 8, 2, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCImportPolymake( filename )\index{SCImportPolymake@\texttt{SCImportPolymake}}
\label{SCImportPolymake}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
simplicial complex of type \texttt{SCSimplicialComplex} upon success, fail otherwise.



 Imports the facet list of a topaz polymake file (discarding any vertex labels)
specified by \mbox{\texttt{filename}} and creates a simplicial complex object from these facets. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCImportPolymake("3dimcomplex.poly");
   [SimplicialComplex
   
   Properties known: Chi, Dim, Facets, VertexLabels.
  
    Name="unnamed complex n"
    Dim=3
   
   /SimplicialComplex]
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCExportLatexTable}}
\logpage{[ 8, 2, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCExportLatexTable( complex, filename, itemsperline )\index{SCExportLatexTable@\texttt{SCExportLatexTable}}
\label{SCExportLatexTable}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
true on success, fail otherwise.



 Exports the facet list of a given simplicial complex \mbox{\texttt{complex}} in form of a LaTeX table to a file specified by \mbox{\texttt{filename}}. The argument \mbox{\texttt{itemsperline}} specifies, how many columns the exported table should have. Facets are
exported in the format $\langle v_1,\dots,v_{dim-1} \rangle$. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> c:=SCBdSimplex(5);;
   gap> SCExportLatexTable(c,"bd5simplex.tex",5);
   true
   gap> c.ExportLatexTable("bd5simplex.tex",5);
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCExportJavaView}}
\logpage{[ 8, 2, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCExportJavaView( complex, file, coords )\index{SCExportJavaView@\texttt{SCExportJavaView}}
\label{SCExportJavaView}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
true on success, fail otherwise.



 Exports the facet list of the given simplicial complex \mbox{\texttt{complex}} in \texttt{JavaView} format (file name suffix \texttt{.jvx}) to a file specified by \mbox{\texttt{filename}} (as string). The list \mbox{\texttt{coords}} must contain a 3-tuple of real coordinates for each vertex of the complex,
either as tuple of length three containing the coordinates or as string of the
form \texttt{"x.x y.y z.z"} with decimal numbers \texttt{x.x}, \texttt{y.y}, \texttt{z.z} for the three coordinates (i.e. \texttt{"1.0 0.0 0.0"}). Warning: as GAP only has rudementary support for floating point values,
currently only integer numbers can be used as coordinates. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> coords:=[[1,0,0],[0,1,0],[0,0,1]];;
   gap> SCExportJavaView(SCBdSimplex(2),"triangle.jvx",coords);
   true
   
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{Miscellaneous functions}}\label{chap:misc}
\logpage{[ 9, 0, 0 ]}
{
  The bahaviour of \textsf{simpcomp} can be changed by setting global options, functions for which will be
described in the following. 
\section{\textcolor{Chapter }{\textsf{simpcomp} error handling}}\logpage{[ 9, 1, 0 ]}
{
  \textsf{simpcomp} can be configured to either enter a break loop when encountering an error or
to just log the error and return \texttt{fail} in the called function. Examples for errors would be a computation failing or
a \texttt{SCSimplicialComplex} object having an inconsistent internal state 

\subsection{\textcolor{Chapter }{SCErrorBreak}}
\logpage{[ 9, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCErrorBreak( flag )\index{SCErrorBreak@\texttt{SCErrorBreak}}
\label{SCErrorBreak}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} upon success, \texttt{fail} otherwise.



 Sets whether \textsf{simpcomp} enters a break loop when encountering an error or just returns \texttt{fail} in the function called. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCErrorBreak(true);
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCErrorMail}}
\logpage{[ 9, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCErrorMail( flag )\index{SCErrorMail@\texttt{SCErrorMail}}
\label{SCErrorMail}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} upon success, \texttt{fail} otherwise.



 Sets whether \textsf{simpcomp} should send an email to the address specified by \texttt{SCMailSetAddress} (\ref{SCMailSetAddress}) when encountering an error. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCErrorMail(true);
   true
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Email notification system}}\logpage{[ 9, 2, 0 ]}
{
  \textsf{simpcomp} comes with an email notification system that can be used for being notified of
the progress of lengthy computations (such as reducing a complex via bistellar
flips). See below for a descriptions of the mail notification related
functions. 

\subsection{\textcolor{Chapter }{SCMailClearPending}}
\logpage{[ 9, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMailClearPending(  )\index{SCMailClearPending@\texttt{SCMailClearPending}}
\label{SCMailClearPending}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
nothing.



 Clears a pending mail message. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCMailClearPending();
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMailIsEnabled}}
\logpage{[ 9, 2, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMailIsEnabled(  )\index{SCMailIsEnabled@\texttt{SCMailIsEnabled}}
\label{SCMailIsEnabled}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false} upon success, \texttt{fail} otherwise.



 Returns \texttt{true} when the mail notification system of \textsf{simpcomp} is enabled, \texttt{false} otherwise. Default setting is \texttt{false}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCMailIsEnabled();
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMailIsPending}}
\logpage{[ 9, 2, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMailIsPending(  )\index{SCMailIsPending@\texttt{SCMailIsPending}}
\label{SCMailIsPending}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} or \texttt{false} upon success, \texttt{fail} otherwise.



 Returns \texttt{true} when an email of the \textsf{simpcomp} email notification system is pending, \texttt{false} otherwise. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCMailIsPending();
   false
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMailSend}}
\logpage{[ 9, 2, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMailSend( message[, starttime][,][forcesend] )\index{SCMailSend@\texttt{SCMailSend}}
\label{SCMailSend}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} when the message was sent, \texttt{false} if it was not send, \texttt{fail} upon an error.



 Tries to send an email to the address specified by \texttt{SCMailSetAddress} (\ref{SCMailSetAddress}) using the unix program \texttt{mail}. The optional parameter \mbox{\texttt{starttime}} specifies the starting time (as the integer unix timestamp) a calculation was
started (then the duration of the calculation is included in the email), the
optional boolean parameter \mbox{\texttt{forcewrite}} can be used to force the sending of an email, even if this violates the
minimal email sending interval, see \texttt{SCMailSetMinInterval} (\ref{SCMailSetMinInterval}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCMailIsEnabled();
   true
   gap> SCMailSend("Hello, this is simpcomp.");
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMailSendPending}}
\logpage{[ 9, 2, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMailSendPending(  )\index{SCMailSendPending@\texttt{SCMailSendPending}}
\label{SCMailSendPending}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} upon success, \texttt{fail} otherwise.



 Tries to send a pending email of the \textsf{simpcomp} email notification system. Returns \texttt{true} on success or if there was no mail pending. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCMailSendPending();
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMailSetAddress}}
\logpage{[ 9, 2, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMailSetAddress( address )\index{SCMailSetAddress@\texttt{SCMailSetAddress}}
\label{SCMailSetAddress}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} upon success, \texttt{fail} otherwise.



 Sets the email address that should be used to send notification messages and
enables the mail notification system by calling \texttt{SCMailSetEnabled} (\ref{SCMailSetEnabled})(\texttt{true}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCMailSetAddress("johndoe@somehost");
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMailSetEnabled}}
\logpage{[ 9, 2, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMailSetEnabled( flag )\index{SCMailSetEnabled@\texttt{SCMailSetEnabled}}
\label{SCMailSetEnabled}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} upon success, \texttt{fail} otherwise.



 Enables or disables the mail notification system of \textsf{simpcomp}. By default it is disabled. Returns \texttt{fail} if no email message was previously set with \texttt{SCMailSetAddress} (\ref{SCMailSetAddress}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCMailSetAddress("johndoe@somehost"); #enables mail notification
   true
   gap> SCMailSetEnabled(false);
   true
   
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SCMailSetMinInterval}}
\logpage{[ 9, 2, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCMailSetMinInterval( interval )\index{SCMailSetMinInterval@\texttt{SCMailSetMinInterval}}
\label{SCMailSetMinInterval}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} upon success, \texttt{fail} otherwise.



 Sets the minimal time interval in seconds that mail messages can be sent by \textsf{simpcomp}. This prevents a flooding of the specified email address with messages sent
by \textsf{simpcomp}. Default is 3600, i.e. one hour. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCMailSetMinInterval(7200);
   true
   
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Testing the functionality of \textsf{simpcomp}}}\logpage{[ 9, 3, 0 ]}
{
  \textsf{simpcomp} makes use of the \textsf{GAP} internal testing mechanisms and provides the user with a function to test the
functionality of the package. 

\subsection{\textcolor{Chapter }{SCRunTest}}
\logpage{[ 9, 3, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SCRunTest(  )\index{SCRunTest@\texttt{SCRunTest}}
\label{SCRunTest}
}\hfill{\scriptsize (function)}}\\
\textbf{\indent Returns:\ }
\texttt{true} upon success, \texttt{fail} otherwise.



 Test whether the package \textsf{simpcomp} is functional by calling \texttt{ReadTest("GAPROOT/pkg/simpcomp/tst/simpcomp.tst");}. The returned value of GAP4stones is a measure of your system performance. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
   gap> SCRunTest();
   + test simpcomp package, version 1.1.21
   + GAP4stones: 69988
   true
   
\end{Verbatim}
 }

 }

 }

 
\chapter{\textcolor{Chapter }{Property handlers}}\label{chap:prophandler}
\logpage{[ 10, 0, 0 ]}
{
 As explained in chapter \ref{chap:complex}, an object of type \texttt{SCSimplicialComplex} or \texttt{SCNormalSurface} provides a set of property handlers for easily accessing and computing its
properties using the .-operator.\\
 For example, the $f$-vector of a simplicial complex / normal surface \texttt{c} that is stored as \texttt{SCSimplicialComplex} object can be accessed via the statement \texttt{c.F;}. See below for a list of all properties supported by a \texttt{SCSimplicialComplex} and \texttt{SCNormalSurface} object. 
\section{\textcolor{Chapter }{Property handlers of a \texttt{SCSimplicialComplex}}}\label{sec:prophandlerSC}
\logpage{[ 10, 1, 0 ]}
{
 This section contains a table of all property handlers of a \texttt{SCSimplicialComplex} object. \begin{center}
\begin{tabular}{ll}\textsc{Property handler}&
\textsc{Function called}\\
\hline
&
\\
ASDet&
\texttt{SCAltshulerSteinberg} (\ref{SCAltshulerSteinberg})\\
AlexanderDual&
\texttt{SCAlexanderDual} (\ref{SCAlexanderDual})\\
AutomorphismGroup&
\texttt{SCAutomorphismGroup} (\ref{SCAutomorphismGroup})\\
AutomorphismGroupInternal&
\texttt{SCAutomorphismGroupInternal} (\ref{SCAutomorphismGroupInternal})\\
Boundary&
\texttt{SCBoundary} (\ref{SCBoundary})\\
BoundaryOperatorMatrix&
\texttt{SCBoundaryOperatorMatrix} (\ref{SCBoundaryOperatorMatrix})\\
Chi&
\texttt{SCEulerCharacteristic} (\ref{SCEulerCharacteristic})\\
CoboundaryOperatorMatrix&
\texttt{SCCoboundaryOperatorMatrix} (\ref{SCCoboundaryOperatorMatrix})\\
Cohomology&
\texttt{SCCohomology} (\ref{SCCohomology})\\
CohomologyBasis&
\texttt{SCCohomologyBasis} (\ref{SCCohomologyBasis})\\
CohomologyBasisAsSimplices&
\texttt{SCCohomologyBasisAsSimplices} (\ref{SCCohomologyBasisAsSimplices})\\
CollapseGreedy&
\texttt{SCCollapseGreedy} (\ref{SCCollapseGreedy})\\
Cone&
\texttt{SCCone} (\ref{SCCone})\\
ConnectedComponents&
\texttt{SCConnectedComponents} (\ref{SCConnectedComponents})\\
Copy&
\texttt{SCCopy} (\ref{SCCopy})\\
CupProduct&
\texttt{SCCupProduct} (\ref{SCCupProduct})\\
DeletedJoin&
\texttt{SCDeletedJoin} (\ref{SCDeletedJoin})\\
DetermineTopologicalType&
\texttt{SCLibDetermineTopologicalType} (\ref{SCLibDetermineTopologicalType})\\
Difference&
\texttt{SCDifference} (\ref{SCDifference})\\
Dim&
\texttt{SCDim} (\ref{SCDim})\\
DualGraph&
\texttt{SCDualGraph} (\ref{SCDualGraph})\\
Equivalent&
\texttt{SCEquivalent} (\ref{SCEquivalent})\\
ExportJavaView&
\texttt{SCExportJavaView} (\ref{SCExportJavaView})\\
ExportLatexTable&
\texttt{SCExportLatexTable} (\ref{SCExportLatexTable})\\
ExportPolymake&
\texttt{SCExportPolymake} (\ref{SCExportPolymake})\\
\end{tabular}\\[2mm]
\end{center}

 \begin{center}
\begin{tabular}{ll}F&
\texttt{SCFVector} (\ref{SCFVector})\\
FaceLattice&
\texttt{SCFaceLattice} (\ref{SCFaceLattice})\\
FaceLatticeEx&
\texttt{SCFaceLatticeEx} (\ref{SCFaceLatticeEx})\\
Faces&
\texttt{SCFaces} (\ref{SCFaces})\\
FacesEx&
\texttt{SCFacesEx} (\ref{SCFacesEx})\\
Facets&
\texttt{SCFacets} (\ref{SCFacets})\\
FacetsEx&
\texttt{SCFacetsEx} (\ref{SCFacetsEx})\\
FpBetti&
\texttt{SCFpBettiNumbers} (\ref{SCFpBettiNumbers})\\
FundamentalGroup&
\texttt{SCFundamentalGroup} (\ref{SCFundamentalGroup})\\
G&
\texttt{SCGVector} (\ref{SCGVector})\\
Generators&
\texttt{SCGenerators} (\ref{SCGenerators})\\
GeneratorsEx&
\texttt{SCGeneratorsEx} (\ref{SCGeneratorsEx})\\
H&
\texttt{SCHVector} (\ref{SCHVector})\\
HandleAddition&
\texttt{SCHandleAddition} (\ref{SCHandleAddition})\\
HasBoundary&
\texttt{SCHasBoundary} (\ref{SCHasBoundary})\\
HasInterior&
\texttt{SCHasInterior} (\ref{SCHasInterior})\\
Homology&
\texttt{SCHomology} (\ref{SCHomology})\\
HomologyBasis&
\texttt{SCHomologyBasis} (\ref{SCHomologyBasis})\\
HomologyBasisAsSimplices&
\texttt{SCHomologyBasisAsSimplices} (\ref{SCHomologyBasisAsSimplices})\\
HomologyInternal&
\texttt{SCHomologyInternal} (\ref{SCHomologyInternal})\\
Incidences&
\texttt{SCIncidences} (\ref{SCIncidences})\\
IncidencesEx&
\texttt{SCIncidencesEx} (\ref{SCIncidencesEx})\\
Interior&
\texttt{SCInterior} (\ref{SCInterior})\\
Intersection&
\texttt{SCIntersection} (\ref{SCIntersection})\\
IntersectionForm&
\texttt{SCIntersectionForm} (\ref{SCIntersectionForm})\\
IntersectionFormDimensionality&
\texttt{SCIntersectionFormDimensionality} (\ref{SCIntersectionFormDimensionality})\\
IntersectionFormParity&
\texttt{SCIntersectionFormParity} (\ref{SCIntersectionFormParity})\\
IsCentrallySymmetric&
\texttt{SCIsCentrallySymmetric} (\ref{SCIsCentrallySymmetric})\\
IsConnected&
\texttt{SCIsConnected} (\ref{SCIsConnected})\\
IsEmpty&
\texttt{SCIsEmpty} (\ref{SCIsEmpty})\\
IsEulerianManifold&
\texttt{SCIsEulerianManifold} (\ref{SCIsEulerianManifold})\\
IsHomologySphere&
\texttt{SCIsHomologySphere} (\ref{SCIsHomologySphere})\\
IsInKd&
\texttt{SCIsInKd} (\ref{SCIsInKd})\\
IsIsomorphic&
\texttt{SCIsIsomorphic} (\ref{SCIsIsomorphic})\\
IsKNeighborly&
\texttt{SCIsKNeighborly} (\ref{SCIsKNeighborly})\\
IsKStackedSphere&
\texttt{SCIsKStackedSphere} (\ref{SCIsKStackedSphere})\\
IsManifold&
\texttt{SCIsManifold} (\ref{SCIsManifold})\\
IsMovable&
\texttt{SCIsMovableComplex} (\ref{SCIsMovableComplex})\\
IsOrientable&
\texttt{SCIsOrientable} (\ref{SCIsOrientable})\\
IsPM&
\texttt{SCIsPseudoManifold} (\ref{SCIsPseudoManifold})\\
IsPure&
\texttt{SCIsPure} (\ref{SCIsPure})\\
IsShellable&
\texttt{SCIsShellable} (\ref{SCIsShellable})\\
IsStronglyConnected&
\texttt{SCIsStronglyConnected} (\ref{SCIsStronglyConnected})\\
IsSubcomplex&
\texttt{SCIsSubcomplex} (\ref{SCIsSubcomplex})\\
Isomorphism&
\texttt{SCIsomorphism} (\ref{SCIsomorphism})\\
IsomorphismEx&
\texttt{SCIsomorphismEx} (\ref{SCIsomorphismEx})\\
\end{tabular}\\[2mm]
\end{center}

 \begin{center}
\begin{tabular}{ll}Join&
\texttt{SCJoin} (\ref{SCJoin})\\
LabelMax&
\texttt{SCLabelMax} (\ref{SCLabelMax})\\
LabelMin&
\texttt{SCLabelMin} (\ref{SCLabelMin})\\
Labels&
\texttt{SCLabels} (\ref{SCLabels})\\
Link&
\texttt{SCLink} (\ref{SCLink})\\
Links&
\texttt{SCLinks} (\ref{SCLinks})\\
Load&
\texttt{SCLoad} (\ref{SCLoad})\\
MinimalNonFaces&
\texttt{SCMinimalNonFaces} (\ref{SCMinimalNonFaces})\\
MinimalNonFacesEx&
\texttt{SCMinimalNonFacesEx} (\ref{SCMinimalNonFacesEx})\\
Move&
\texttt{SCMove} (\ref{SCMove})\\
Moves&
\texttt{SCMoves} (\ref{SCMoves})\\
Name&
\texttt{SCName} (\ref{SCName})\\
Neighborliness&
\texttt{SCNeighborliness} (\ref{SCNeighborliness})\\
Neighbors&
\texttt{SCNeighbors} (\ref{SCNeighbors})\\
NeighborsEx&
\texttt{SCNeighborsEx} (\ref{SCNeighborsEx})\\
NumFaces&
\texttt{SCNumFaces} (\ref{SCNumFaces})\\
Orientation&
\texttt{SCOrientation} (\ref{SCOrientation})\\
RMoves&
\texttt{SCRMoves} (\ref{SCRMoves})\\
Recalc&
\texttt{SCForceRecalc} (\ref{SCForceRecalc})\\
Reduce&
\texttt{SCReduceComplex} (\ref{SCReduceComplex})\\
ReduceAsSubcomplex&
\texttt{SCReduceAsSubcomplex} (\ref{SCReduceAsSubcomplex})\\
ReduceEx&
\texttt{SCReduceComplexEx} (\ref{SCReduceComplexEx})\\
Relabel&
\texttt{SCRelabel} (\ref{SCRelabel})\\
RelabelStandard&
\texttt{SCRelabelStandard} (\ref{SCRelabelStandard})\\
RelabelTransposition&
\texttt{SCRelabelTransposition} (\ref{SCRelabelTransposition})\\
Rename&
\texttt{SCRename} (\ref{SCRename})\\
Save&
\texttt{SCSave} (\ref{SCSave})\\
Shelling&
\texttt{SCShelling} (\ref{SCShelling})\\
ShellingExt&
\texttt{SCShellingExt} (\ref{SCShellingExt})\\
Shellings&
\texttt{SCShellings} (\ref{SCShellings})\\
Skel&
\texttt{SCSkel} (\ref{SCSkel})\\
SkelEx&
\texttt{SCSkelEx} (\ref{SCSkelEx})\\
Slicing&
\texttt{SCNSSlicing} (\ref{SCNSSlicing})\\
SortComplex&
\texttt{SCSortComplex} (\ref{SCSortComplex})\\
Span&
\texttt{SCSpan} (\ref{SCSpan})\\
SpanningTree&
\texttt{SCSpanningTree} (\ref{SCSpanningTree})\\
Star&
\texttt{SCStar} (\ref{SCStar})\\
Stars&
\texttt{SCStars} (\ref{SCStars})\\
StronglyConnectedComponents&
\texttt{SCStronglyConnectedComponents} (\ref{SCStronglyConnectedComponents})\\
Suspension&
\texttt{SCSuspension} (\ref{SCSuspension})\\
Union&
\texttt{SCUnion} (\ref{SCUnion})\\
UnlabelFace&
\texttt{SCUnlabelFace} (\ref{SCUnlabelFace})\\
VertexIdentification&
\texttt{SCVertexIdentification} (\ref{SCVertexIdentification})\\
Vertices&
\texttt{SCVertices} (\ref{SCVertices})\\
VerticesEx&
\texttt{SCVerticesEx} (\ref{SCVerticesEx})\\
Wedge&
\texttt{SCWedge} (\ref{SCWedge})\\
\end{tabular}\\[2mm]
\end{center}

 }

 
\section{\textcolor{Chapter }{Property handlers of a \texttt{SCNormalSurface}}}\label{sec:prophandlerNS}
\logpage{[ 10, 2, 0 ]}
{
 This section contains a table of all property handlers of a \texttt{SCNormalSurface} object. \begin{center}
\begin{tabular}{ll}\textsc{Property handler}&
\textsc{Function called}\\
\hline
&
\\
Betti&
SCNSFpBettiNumbers\\
Chi&
SCNSEulerCharacteristic\\
ConnComp&
SCConnectedComponents\\
Connected&
SCIsConnected\\
Copy&
SCNSCopy\\
Dim&
SCNSDim\\
F&
SCNSFVector\\
FaceLattice&
SCNSFaceLattice\\
Faces&
SCNSSkel\\
Facets&
SCFacets\\
Genus&
SCNSGenus\\
Homology&
SCNSHomology\\
IsEmpty&
SCIsEmpty\\
Labels&
SCLabels\\
Name&
SCName\\
Triangulation&
SCNSSubdivision\\
Type&
SCNSTopologicalType\\
Vertices&
SCVertices\\
\end{tabular}\\[2mm]
\end{center}

 }

 }

 
\chapter{\textcolor{Chapter }{A demo session with SimpComp}}\label{chap:demo}
\logpage{[ 11, 0, 0 ]}
{
  This chapter contains the transcript of a demo session with SimpComp that is
intended to give an insight into what things can be done with this package. Of
course this only scratches the surface of the functions provided by SimpComp,
see chapters \ref{chap:scfunc} through \ref{chap:misc} for further functions provided by SimpComp. 
\section{\textcolor{Chapter }{Creating a \texttt{SCSimplicialComplex} object}}\label{sec:DemoCreatingCompl}
\logpage{[ 11, 1, 0 ]}
{
  Simplicial complex objects can either be created from a facet list, from a
function generating triangulations of standard complexes or by expanding
difference cycles. There are also functions creating new simplicial complexes
from old, see chapter \ref{chap:scfunc} which will be described in the next sections. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> #first run functionality test on simpcomp
  gap> SCRunTest();
  + test simpcomp package, version 1.1.21
  + GAP4stones: 69988
  true
  gap> #all ok
  gap> c1:=SCFromFacets([[1,2],[2,3],[3,1]]);
  [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels.
  
   Name="unnamed complex 1"
   Dim=1
  
  /SimplicialComplex]
  gap> c2:=SCBdSimplex(2);
  [SimplicialComplex
  
   Properties known: AutomorphismGroup, AutomorphismGroupOrder, 
                     AutomorphismGroupStructure, AutomorphismGroupTransitivity, 
                     Chi, Dim, F, Facets, Generators, HasBounday, Homology, 
                     IsConnected, IsStronglyConnected, Name, TopologicalType, 
                     VertexLabels.
  
   Name="S^1_3"
   Dim=1
   AutomorphismGroupStructure="S3"
   AutomorphismGroupTransitivity=3
   Chi=0
   F=[ 3, 3 ]
   Homology=[ [ 0, [ ] ], [ 1, [ ] ] ]
   IsConnected=true
   IsStronglyConnected=true
   TopologicalType="S^1"
  
  /SimplicialComplex]
  gap> c3:=SCFromDifferenceCycles([[1,1,6],[3,3,2]]);
  [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels.
  
   Name="complex from diffcycles [ [ 1, 1, 6 ], [ 3, 3, 2 ] ]"
   Dim=2
  
  /SimplicialComplex]
  gap> 
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Working with a \texttt{SCSimplicialComplex} object}}\label{sec:DemoWorkingCompl}
\logpage{[ 11, 2, 0 ]}
{
  As described in section \ref{sec:AcessSC} there are two several ways of accessing an object of type \texttt{SCSimplicialComplex}. An example for the two equivalent ways is given below. The preference will
be given to the object oriented notation in this demo session. The code listed
below 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> c:=SCBdSimplex(3);; # create a simplicial complex object
  gap> SCFVector(c);
  [ 4, 6, 4 ]
  gap> SCSkel(c,0);
  [ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ]
  gap> 
\end{Verbatim}
 is equivalent to 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> c:=SCBdSimplex(3);; # create a simplicial complex object
  gap> c.F;
  [ 4, 6, 4 ]
  gap> c.Skel(0);
  [ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ]
  gap> 
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Calculating properties of a \texttt{SCSimplicialComplex} object}}\label{sec:DemoPropsCompl}
\logpage{[ 11, 3, 0 ]}
{
  SimpComp provides a variety of functions for calculating properties of
simplicial complexes, see chapter \ref{chap:scfunc}. All these properties are only calculated once and stored in the simplicial
complex object. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> c1.F;     
  [ 3, 3 ]
  gap> c1.FaceLattice;
  [ [ [ 1 ], [ 2 ], [ 3 ] ], [ [ 1, 2 ], [ 1, 3 ], [ 2, 3 ] ] ]
  gap> c1.AutomorphismGroup;
  S3
  gap> c1.Generators;
  [ [ [ 1, 2 ], 3 ] ]
  gap> c3.Facets;
  [ [ 1, 2, 3 ], [ 1, 2, 8 ], [ 1, 3, 6 ], [ 1, 4, 6 ], [ 1, 4, 7 ], 
    [ 1, 7, 8 ], [ 2, 3, 4 ], [ 2, 4, 7 ], [ 2, 5, 7 ], [ 2, 5, 8 ], 
    [ 3, 4, 5 ], [ 3, 5, 8 ], [ 3, 6, 8 ], [ 4, 5, 6 ], [ 5, 6, 7 ], 
    [ 6, 7, 8 ] ]
  gap> c3.F;
  [ 8, 24, 16 ]
  gap> c3.G;
  [ 4 ]
  gap> c3.H;
  [ 5, 11, -1 ]
  gap> c3.ASDet;
  186624
  gap> c3.Chi;
  0
  gap> c3.Generators;
  [ [ [ 1, 2, 3 ], 16 ] ]
  gap> c3.HasBoundary;
  false
  gap> c3.IsConnected;
  true
  gap> c3.IsCentrallySymmetric;
  true
  gap> c3.Vertices;
  [ 1, 2, 3, 4, 5, 6, 7, 8 ]
  gap> c3.ConnectedComponents;
  [ [SimplicialComplex
      
       Properties known: Dim, Facets, Name, VertexLabels.
      
       Name="Connected component #1 of complex from diffcycles [ [ 1, 1, 6 ], [ \
  3, 3, 2 ] ]"
       Dim=2
      
      /SimplicialComplex] ]
  gap> c3.UnknownProperty;
  #I  SCPropertyObject: unhandled property 'UnknownProperty'. Handled properties\
   are [ "Equivalent", "IsKStackedSphere", "IsManifold", "IsMovable", "Move", 
    "Moves", "RMoves", "ReduceAsSubcomplex", "Reduce", "ReduceEx", "Copy", 
    "Recalc", "ASDet", "AutomorphismGroup", "AutomorphismGroupInternal", 
    "Boundary", "ConnectedComponents", "Dim", "DualGraph", "Chi", "F", 
    "FaceLattice", "FaceLatticeEx", "Faces", "FacesEx", "Facets", "FacetsEx", 
    "FpBetti", "FundamentalGroup", "G", "Generators", "GeneratorsEx", "H", 
    "HasBoundary", "HasInterior", "Homology", "Incidences", "IncidencesEx", 
    "Interior", "IsCentrallySymmetric", "IsConnected", "IsEmpty", 
    "IsEulerianManifold", "IsHomologySphere", "IsInKd", "IsKNeighborly", 
    "IsOrientable", "IsPM", "IsPure", "IsShellable", "IsStronglyConnected", 
    "MinimalNonFaces", "MinimalNonFacesEx", "Name", "Neighborliness", 
    "Orientation", "Skel", "SkelEx", "SpanningTree", 
    "StronglyConnectedComponents", "Vertices", "VerticesEx", 
    "BoundaryOperatorMatrix", "HomologyBasis", "HomologyBasisAsSimplices", 
    "HomologyInternal", "CoboundaryOperatorMatrix", "Cohomology", 
    "CohomologyBasis", "CohomologyBasisAsSimplices", "CupProduct", 
    "IntersectionForm", "IntersectionFormParity", 
    "IntersectionFormDimensionality", "Load", "Save", "ExportPolymake", 
    "ExportLatexTable", "ExportJavaView", "LabelMax", "LabelMin", "Labels", 
    "Relabel", "RelabelStandard", "RelabelTransposition", "Rename", 
    "SortComplex", "UnlabelFace", "AlexanderDual", "CollapseGreedy", "Cone", 
    "DeletedJoin", "Difference", "HandleAddition", "Intersection", 
    "IsIsomorphic", "IsSubcomplex", "Isomorphism", "IsomorphismEx", "Join", 
    "Link", "Links", "Neighbors", "NeighborsEx", "Shelling", "ShellingExt", 
    "Shellings", "Span", "Star", "Stars", "Suspension", "Union", 
    "VertexIdentification", "Wedge", "DetermineTopologicalType", "Dim", 
    "Facets", "VertexLabels", "Name", "Vertices", "IsConnected", 
    "ConnectedComponents" ].
  
  fail
  gap> 
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Creating new complexes from a \texttt{SCSimplicialComplex} object}}\label{sec:DemoNewCompl}
\logpage{[ 11, 4, 0 ]}
{
  
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> c4:=c3+c3;
  [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels, Vertices.
  
   Name="complex from diffcycles [ [ 1, 1, 6 ], [ 3, 3, 2 ] ]#+-complex from dif\
  fcycles [ [ 1, 1, 6 ], [ 3, 3, 2 ] ]"
   Dim=2
  
  /SimplicialComplex]
  gap> SCRename(c4,"T^2#T^2");
  true
  gap> SCLink(c4,1);
  [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels.
  
   Name="lk(1) in T^2#T^2"
   Dim=1
  
  /SimplicialComplex]
  gap> SCStar(c4,[1,2]);
  [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels.
  
   Name="star([ 1, 2 ]) in T^2#T^2"
   Dim=2
  
  /SimplicialComplex]
  gap> SCRename(c3,"T^2");
  true
  gap> SCConnectedProduct(c3,4);
  [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels, Vertices.
  
   Name="T^2#+-T^2#+-T^2#+-T^2"
   Dim=2
  
  /SimplicialComplex]
  gap> SCCartesianProduct(c2,c2);
  [SimplicialComplex
  
   Properties known: Dim, Facets, Name, TopologicalType, VertexLabels.
  
   Name="S^1_3xS^1_3"
   Dim=2
   TopologicalType="S^1xS^1"
  
  /SimplicialComplex]
  gap> SCCartesianPower(c2,3);
  [SimplicialComplex
  
   Properties known: Dim, Facets, Name, TopologicalType, VertexLabels.
  
   Name="(S^1_3)^3"
   Dim=3
   TopologicalType="(S^1)^3"
  
  /SimplicialComplex]
  gap> 
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Homology related calculations}}\label{sec:DemoHom}
\logpage{[ 11, 5, 0 ]}
{
  SimpComp relies on the GAP package homology \cite{Dumas04Homology} for its homology computations but provides further (co-)homology related
functions, see chapter \ref{chap:homology}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> s2s2:=SCCartesianProduct(SCBdSimplex(3),SCBdSimplex(3));
  [SimplicialComplex
  
   Properties known: Dim, Facets, Name, TopologicalType, VertexLabels.
  
   Name="S^2_4xS^2_4"
   Dim=4
   TopologicalType="S^2xS^2"
  
  /SimplicialComplex]
  gap> SCHomology(s2s2);
  [ [ 0, [  ] ], [ 0, [  ] ], [ 2, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ]
  gap> SCHomologyInternal(s2s2);
  [ [ 0, [  ] ], [ 0, [  ] ], [ 2, [  ] ], [ 0, [  ] ], [ 1, [  ] ] ]
  gap> SCHomologyBasis(s2s2,2);
  [ [ 1, [ [ 1, 70 ], [ -1, 12 ], [ 1, 2 ], [ -1, 1 ] ] ], 
    [ 1, [ [ 1, 143 ], [ -1, 51 ], [ 1, 29 ], [ -1, 25 ] ] ] ]
  gap> SCHomologyBasisAsSimplices(s2s2,2);
  [ [ 1, 
        [ [ 1, [ 2, 3, 4 ] ], [ -1, [ 1, 3, 4 ] ], [ 1, [ 1, 2, 4 ] ], [ -1, [ 1
                      , 2, 3 ] ] ] ], 
    [ 1, [ [ 1, [ 5, 9, 13 ] ], [ -1, [ 1, 9, 13 ] ], [ 1, [ 1, 5, 13 ] ], 
            [ -1, [ 1, 5, 9 ] ] ] ] ]
  gap> SCCohomologyBasis(s2s2,2);
  [ [ 1, 
        [ [ 1, 122 ], [ 1, 115 ], [ 1, 112 ], [ 1, 111 ], [ 1, 93 ], [ 1, 90 ], 
            [ 1, 89 ], [ 1, 84 ], [ 1, 83 ], [ 1, 82 ], [ 1, 46 ], [ 1, 43 ], 
            [ 1, 42 ], [ 1, 37 ], [ 1, 36 ], [ 1, 35 ], [ 1, 28 ], [ 1, 27 ], 
            [ 1, 26 ], [ 1, 25 ] ] ], 
    [ 1, [ [ 1, 213 ], [ 1, 201 ], [ 1, 192 ], [ 1, 189 ], [ 1, 159 ], 
            [ 1, 150 ], [ 1, 147 ], [ 1, 131 ], [ 1, 128 ], [ 1, 125 ], 
            [ 1, 67 ], [ 1, 58 ], [ 1, 55 ], [ 1, 39 ], [ 1, 36 ], [ 1, 33 ], 
            [ 1, 10 ], [ 1, 7 ], [ 1, 4 ], [ 1, 1 ] ] ] ]
  gap> SCCohomologyBasisAsSimplices(s2s2,2);
  [ [ 1, [ [ 1, [ 4, 8, 12 ] ], [ 1, [ 3, 8, 12 ] ], [ 1, [ 3, 7, 12 ] ], 
            [ 1, [ 3, 7, 11 ] ], [ 1, [ 2, 8, 12 ] ], [ 1, [ 2, 7, 12 ] ], 
            [ 1, [ 2, 7, 11 ] ], [ 1, [ 2, 6, 12 ] ], [ 1, [ 2, 6, 11 ] ], 
            [ 1, [ 2, 6, 10 ] ], [ 1, [ 1, 8, 12 ] ], [ 1, [ 1, 7, 12 ] ], 
            [ 1, [ 1, 7, 11 ] ], [ 1, [ 1, 6, 12 ] ], [ 1, [ 1, 6, 11 ] ], 
            [ 1, [ 1, 6, 10 ] ], [ 1, [ 1, 5, 12 ] ], [ 1, [ 1, 5, 11 ] ], 
            [ 1, [ 1, 5, 10 ] ], [ 1, [ 1, 5, 9 ] ] ] ], 
    [ 1, [ [ 1, [ 13, 14, 15 ] ], [ 1, [ 9, 14, 15 ] ], [ 1, [ 9, 10, 15 ] ], 
            [ 1, [ 9, 10, 11 ] ], [ 1, [ 5, 14, 15 ] ], [ 1, [ 5, 10, 15 ] ], 
            [ 1, [ 5, 10, 11 ] ], [ 1, [ 5, 6, 15 ] ], [ 1, [ 5, 6, 11 ] ], 
            [ 1, [ 5, 6, 7 ] ], [ 1, [ 1, 14, 15 ] ], [ 1, [ 1, 10, 15 ] ], 
            [ 1, [ 1, 10, 11 ] ], [ 1, [ 1, 6, 15 ] ], [ 1, [ 1, 6, 11 ] ], 
            [ 1, [ 1, 6, 7 ] ], [ 1, [ 1, 2, 15 ] ], [ 1, [ 1, 2, 11 ] ], 
            [ 1, [ 1, 2, 7 ] ], [ 1, [ 1, 2, 3 ] ] ] ] ]
  gap> PrintArray(SCIntersectionForm(s2s2));
  [ [  0,  1 ],
    [  1,  0 ] ]
  gap> c:=s2s2+s2s2;
  [SimplicialComplex
  
   Properties known: Dim, Facets, Name, VertexLabels, Vertices.
  
   Name="S^2_4xS^2_4#+-S^2_4xS^2_4"
   Dim=4
  
  /SimplicialComplex]
  gap> PrintArray(SCIntersectionForm(c));
  [ [   0,  -1,   0,   0 ],
    [  -1,   0,   0,   0 ],
    [   0,   0,   0,  -1 ],
    [   0,   0,  -1,   0 ] ]
  gap> 
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Bistellar flips}}\label{sec:DemoBist}
\logpage{[ 11, 6, 0 ]}
{
  
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> beta4:=SCBdCrossPolytope(4);;    
  gap> s3:=SCBdSimplex(4);;             
  gap> SCEquivalent(beta4,s3);
  #I  round 0, move: [ [ 2, 6, 7 ], [ 3, 4 ] ]
  [ 8, 25, 34, 17 ]
  #I  round 1, move: [ [ 2, 7 ], [ 3, 4, 5 ] ]
  [ 8, 24, 32, 16 ]
  #I  round 2, move: [ [ 2, 5 ], [ 3, 4, 8 ] ]
  [ 8, 23, 30, 15 ]
  #I  round 3, move: [ [ 2 ], [ 3, 4, 6, 8 ] ]
  [ 7, 19, 24, 12 ]
  #I  round 4, move: [ [ 6, 8 ], [ 1, 3, 4 ] ]
  [ 7, 18, 22, 11 ]
  #I  round 5, move: [ [ 8 ], [ 1, 3, 4, 5 ] ]
  [ 6, 14, 16, 8 ]
  #I  round 6, move: [ [ 5 ], [ 1, 3, 4, 7 ] ]
  [ 5, 10, 10, 5 ]
  #I  SCReduceComplexEx: complexes are bistellarly equivalent.
  true
  gap> SCBistellarOptions.WriteLevel;   
  0
  gap> SCBistellarOptions.WriteLevel:=1;
  1
  gap> SCEquivalent(beta4,s3);          
  #I  SCLibInit: made directory "~/PATH" for user library.
  #I  SCIntFunc.SCLibInit: index not found -- trying to reconstruct it.
  #I  SCLibUpdate: rebuilding index for ~/PATH.
  #I  SCLibUpdate: rebuilding index done.
  
  #I  round 0, move: [ [ 2, 4, 6 ], [ 7, 8 ] ]
  [ 8, 25, 34, 17 ]
  #I  round 1, move: [ [ 2, 4 ], [ 5, 7, 8 ] ]
  [ 8, 24, 32, 16 ]
  #I  round 2, move: [ [ 4, 5 ], [ 1, 7, 8 ] ]
  [ 8, 23, 30, 15 ]
  #I  round 3, move: [ [ 4 ], [ 1, 6, 7, 8 ] ]
  [ 7, 19, 24, 12 ]
  #I  SCLibAdd: saving complex to file "complex_ReducedComplex_7_vertices_3_2009\
  -10-27_11-40-00.sc".
  #I  round 4, move: [ [ 2, 6 ], [ 3, 7, 8 ] ]
  [ 7, 18, 22, 11 ]
  #I  round 5, move: [ [ 2 ], [ 3, 5, 7, 8 ] ]
  [ 6, 14, 16, 8 ]
  #I  SCLibAdd: saving complex to file "complex_ReducedComplex_6_vertices_5_2009\
  -10-27_11-40-00.sc".
  #I  round 6, move: [ [ 5 ], [ 1, 3, 7, 8 ] ]
  [ 5, 10, 10, 5 ]
  #I  SCLibAdd: saving complex to file "complex_ReducedComplex_5_vertices_6_2009\
  -10-27_11-40-00.sc".
  #I  SCLibAdd: saving complex to file "complex_ReducedComplex_5_vertices_7_2009\
  -10-27_11-40-00.sc".
  #I  SCReduceComplexEx: complexes are bistellarly equivalent.
  true
  gap> myLib:=SCLibInit("~/PATH"); # copy path from above             
  [Simplicial complex library. Properties:
  CalculateIndexAttributes=true
  Number of complexes in library=4
  IndexAttributes=[ "Name", "Date", "Dim", "F", "G", "H", "Chi", "Homology" ]
  Loaded=true
  Path="/home/spreerjn/reducedComplexes/2009-10-27_11-40-00/"
  ]
  gap> s3:=myLib.Load(3);
  [SimplicialComplex
  
   Properties known: Chi, Date, Dim, F, Faces, Facets, G, H, Homology, 
                     IsConnected, Name, VertexLabels.
  
   Name="ReducedComplex_5_vertices_6"
   Dim=3
   Chi=0
   F=[ 5, 10, 10, 5 ]
   G=[ 0, 0 ]
   H=[ 1, 1, 1, 1 ]
   Homology=[ [ 0, [ ] ], [ 0, [ ] ], [ 0, [ ] ], [ 1, [ ] ] ]
   IsConnected=true
  
  /SimplicialComplex]
  gap> s3:=myLib.Load(2);
  [SimplicialComplex
  
   Properties known: Chi, Date, Dim, F, Faces, Facets, G, H, Homology, 
                     IsConnected, Name, VertexLabels.
  
   Name="ReducedComplex_6_vertices_5"
   Dim=3
   Chi=0
   F=[ 6, 14, 16, 8 ]
   G=[ 1, 0 ]
   H=[ 2, 2, 2, 1 ]
   Homology=[ [ 0, [ ] ], [ 0, [ ] ], [ 0, [ ] ], [ 1, [ ] ] ]
   IsConnected=true
  
  /SimplicialComplex]
  gap> t2:=SCCartesianProduct(SCBdSimplex(2),SCBdSimplex(2));;
  gap> t2.F;
  [ 9, 27, 18 ]
  gap> SCBistellarOptions.WriteLevel:=0;
  0
  gap> SCBistellarOptions.LogLevel:=0;  
  0
  gap> mint2:=SCReduceComplex(t2);    
  [ true, [SimplicialComplex
      
       Properties known: Dim, Facets, Name, VertexLabels.
      
       Name="unnamed complex 85"
       Dim=2
      
      /SimplicialComplex], 32 ]
  gap> 
  			
\end{Verbatim}
 }

 }

 
\chapter{\textcolor{Chapter }{\textsf{simpcomp} internals}}\label{chap:internals}
\logpage{[ 12, 0, 0 ]}
{
  The package \textsf{simpcomp} works with simplicial complexes for which a \textsf{GAP} object type \texttt{SCSimplicialComplex} is defined and calculates properties of these objects via so called property
handlers. This chapter describes how to extend \textsf{simpcomp} by writing own property handlers. 

 By writing own property handlers, \textsf{simpcomp} can be extended in its functionality. If you extended \textsf{simpcomp} and want to share your extension with other users please send your extension
to one of the authors and we will consider including it (of course with giving
credit) in a future release of \textsf{simpcomp}. 

 
\section{\textcolor{Chapter }{Example of a common property handler}}\label{sec:prophandlerex}
\logpage{[ 12, 1, 0 ]}
{
  In this section we will have a look at the property handler \texttt{SCFVector} in oder to explain the inner workings of property handlers. This is the code
of the property handler for calculating the $f$-vector of a complex in \textsf{simpcomp}: 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  InstallGlobalFunction(SCFVector,
  	function(complex)
  
  	local f, faces;
  	
  	if(not SCIsSimplicialComplex(complex)) then
  		SCError()("SCFVector: first argument must be of type
  		SCSimplicialComplex.\n");
  		return fail;
  	fi;
  
  	f:=SCPropertyByName(complex,"F");
  	if f<>fail and not SCIntFunc.ForceRecalcEnabled(complex) and  IsList(f)
  		and	ForAll(f,x->IsInt(x) and x>=0) then
  		return f;
  	else
  		SCPropertyDrop(complex,"F");
  		faces:=SCFaceLatticeEx(complex);
  		if faces=fail then
  			return fail;
  		fi;
  		f:=List(faces,x->Size(x));
  		SCPropertySet(complex,"F",f);
  		return f;
  	fi;
  end);
\end{Verbatim}
 When looking at the code one already see the structure that such a handler
needs to have: 
\begin{enumerate}
\item The arguments are checked for validity -- in case of invalid arguments an
error is signaled with \texttt{SCError()("Error message")}. \texttt{SCError} then displays the error message and optionally enters a break loop.
\item It is checked whether the property was computed already with the function \texttt{SCPropertyByName} -- it takes a complex (as \texttt{SCPropertyObject}) and a property name (as \texttt{String}) as arguments and returns the property or \texttt{fail} if that property does not exist.
\item If \texttt{SCPropertyByName} did not return \texttt{fail}, \texttt{SCIntFunc.ForceRecalcEnabled(complex)} did return false and the cached property passes a validity check the cached
property is returned.
\item Otherwise the property is first dropped via the function \texttt{SCPropertyDrop} -- it takes a complex (as \texttt{SCPropertyObject}) and a property name (as \texttt{String}) as arguments -- then recomputed and finally written back to the complex via
the function \texttt{SCPropertySet} (that takes a complex, a property name and a property as arguments) and
returned.
\end{enumerate}
 }

 
\section{\textcolor{Chapter }{Writing a property handler}}\label{sec:prophandlerskel}
\logpage{[ 12, 2, 0 ]}
{
  This section provides the skeleton of a property handler that can be used when
writing own property handlers: 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  DeclareGlobalFunction("SCMyPropertyHandler");
  
  InstallGlobalFunction(SCMyPropertyHandler,
  	function(complex[, further arguments])
  
  	local myprop,....;
  	
  	# test arguments
  	if(not SCIsSimplicialComplex(complex)) then
  		SCError()("SCMyPropertyHandler: first argument must be of type
  					SCSimplicialComplex.\n");
  		return fail;
  	fi;
  
  	# check if the property that you want to compute is cached
  	myprop:=SCPropertyByName(complex,"MyProperty");
  
  	if myprop<>fail and not SCIntFunc.ForceRecalcEnabled(complex) and 
  		[check for validity of myprop here] then
  		#return the cached property
  		return myprop;
  	else
  		# first drop the property
  		SCPropertyDrop(complex,"MyProperty");
  		
  		# now (re)compute the property  
  		[ do property computation here]
  		
  		# set the newly created property and return it
  		SCPropertySet(complex,"MyProperty",myprop);
  		return myprop;
  	fi;
  end);
\end{Verbatim}
 }

 }

 \def\bibname{References\logpage{[ "Bib", 0, 0 ]}}

\bibliographystyle{alpha}
\bibliography{biblio}

\def\indexname{Index\logpage{[ "Ind", 0, 0 ]}}


\printindex

\newpage
\immediate\write\pagenrlog{["End"], \arabic{page}];}
\immediate\closeout\pagenrlog
\end{document}
