# Additional Classes

## AbelianGroup

class `snappy.``AbelianGroup`

  An AbelianGroup object represents a finitely generated abelian group, usually the first homology group of a snappy Manifold.

  Instantiate as AbelianGroup(P) where P is a presentation matrix given as a list of lists of integers. Alternatively, use AbelianGroup(elementary_divisors=[n_1, n_2, ... ]) where the n_i are the elementary divisors of the group.

      >>> AbelianGroup([[1,3,2],[2,0,6]])
      Z/2 + Z
      >>> A = AbelianGroup(elementary_divisors=[5,15,0,0])
      >>> A
      Z/5 + Z/15 + Z + Z
      >>> A[1]
      15
      >>> A.betti_number()
      2
      >>> A.order()
      'infinite'
      >>> len(A)
      4

  `betti_number`()

    The rank of the maximal free abelian subgroup.

  `elementary_divisors`()

    The elementary_divisors of this finitely generated abelian group.

  `order`()

    The order of the group. Returns the string ‘infinite’ if the group is infinite.

  `rank`()

    The rank of the group.

## FundamentalGroup

class `snappy.``HolonomyGroup`

  A HolonomyGroup is a FundamentalGroup with added structure consisting of a holonomy representation into O(3,1), and an arbitrarily chosen lift of the holonomy representation to SL(2,C). The holonomy is determined by the shapes of the tetrahedra, so a HolonomyGroup is associated to a Manifold, while a Triangulation only has a FundamentalGroup. Methods are provided to evaluate the representations on a group element.

  A FundamentalGroup represents a presentation of the fundamental group of a SnapPea Triangulation. Group elements are described as words in the generators a,b,..., where the inverse of a is denoted A. Words are represented by python strings (and the concatenation operator is named ‘+’, according to Python conventions).

  Instantiate via M.fundamental_group(), where M is a Manifold.

  `O31`()

    Return the image of the element represented by the input word under the holonomy representation, where Isom(H^3) is identified with SO(3,1).

  `SL2C`()

    Return the image of the element represented by the input word under some SL(2,C) representation that lifts the holonomy representation. Note: the choice of lift is not guaranteed to vary continuously when filling coefficients are changed.

  `complex_length`()

    Return the complex length of the isometry represented by the input word.

  `gap_string`()

    Returns a string which will define this group within GAP.

  `generators`()

    Return the letters representing the generators in the presentation.

  `generators_in_originals`()

    Return the current generators in terms of the original geometric generators (before simplification).

    If the flag “raw_form” is set to True, it returns a sequence of instructions for expressing the current generators in terms of the orignal ones. This is sometimes much more concise, though the format is somewhat obscure. See the source code of this function in SnapPy.pyx for details.

  `longitude`()

    Returns a word representing a conjugate of the current longitude for the given cusp. Guaranteed to commute with the meridian for the same cusp. Note: for Klein bottle cusps, the longitude must be defined carefully.

        >>> G = Manifold('m004').fundamental_group()
        >>> G.longitude(0)
        'aBAbABab'
        >>> G.longitude()   # shortcut for the above.
        'aBAbABab'

  `magma_string`()

    Returns a string which will define this group within MAGMA.

  `meridian`()

    Returns a word representing a conjugate of the current meridian for the given cusp. Guaranteed to commute with the longitude for the same cusp.

        >>> G = Manifold('m125').fundamental_group()
        >>> G.meridian(0)
        'aaba'
        >>> G.meridian(-1)  # The last cusp
        'baaba'

  `num_generators`()

    Return the number of generators for the presentation.

  `num_original_generators`()

    Return the number of geometric generators (before simplification).

  `num_relators`()

    Return the number of generators for the presentation.

  `original_generators`()

    Return the original geometric generators (before simplification) in terms of the current generators.

  `peripheral_curves`()

    Returns a list of meridian-longitude pairs for all cusps.

        >>> G = Manifold('m125').fundamental_group()
        >>> G.peripheral_curves()
        [('aaba', 'abb'), ('baaba', 'Ba')]

  `relators`()

    Return a list of words representing the relators in the presentation.

    If the optional argument verbose_form is True, then the relator is returned in the form “a*b*a^-1*b^-1” instead of “abAB”.

  `sage`()

    Returns the corresponding Sage FinitelyPresentedGroup

## SymmetryGroup

class `snappy.``SymmetryGroup`

  A SymmetryGroup is a group of self-isometries of hyperbolic 3-manifold. Instantiate as follows:

      >>> M = Manifold('m004')
      >>> M.symmetry_group()
      D4

  `abelian_description`()

    If the symmetry group is abelian, return it as an AbelianGroup

        >>> S = Manifold('v3379').symmetry_group()
        >>> S.abelian_description()
        Z/2 + Z/2 + Z/2

  `abelianization`()

    Return the abelianization of the symmetry group

        >>> S = Manifold('m004').symmetry_group()
        >>> S.abelianization()
        Z/2 + Z/2

  `center`()

    Return the center of the symmetry group

        >>> S = Manifold('m004').symmetry_group()
        >>> S.center()
        Z/2

  `commutator_subgroup`()

    Return the commutator subgroup of the SymmetryGroup

        >>> S = Manifold('m004').symmetry_group()
        >>> S
        D4
        >>> S.commutator_subgroup()
        Z/2

  `direct_product_description`()

    If the SymmetryGroup is a nontrivial direct product with at least one nonabelian factor, return a pair of SymmetryGroups consisting of the (two) factors.

        >>> S = Manifold('s960').symmetry_group()
        >>> S.direct_product_description()
        (Z/4, D3)

  `is_S5`()

    Returns whether the group is the symmetric group on five things.

  `is_abelian`()

    Return whether the symmetry group is abelian.

        >>> S = Manifold('m004').symmetry_group()
        >>> S.is_abelian()
        False

  `is_amphicheiral`()

    Return whether the manifold has an orientation reversing symmetry.

        >>> S = Manifold('m004').symmetry_group()
        >>> S.is_amphicheiral()
        True

  `is_dihedral`()

    Return whether the symmetry group is dihedral.

        >>> S = Manifold('m004').symmetry_group()
        >>> S.is_dihedral()
        True

  `is_direct_product`()

    Return whether the SymmetryGroup is a nontrivial direct product with at least one nonabelian factor.

        >>> S = Manifold('s960').symmetry_group()
        >>> S.is_direct_product()
        True
        >>> S
        Z/4 x D3

  `is_full_group`()

    Return whether the full symmetry group has been found.

        >>> S = Manifold('m004').symmetry_group()
        >>> S.is_full_group()
        True

  `is_invertible_knot`()

    Return whether a one-cusped has a symmetry that acts on the cusp via the matrix -I.

        >>> S = Manifold('m015').symmetry_group()
        >>> S.is_invertible_knot()
        True

  `is_polyhedral`()

    Returns whether the symmetry group is a (possibly binary) polyhedral group.

  `isometries`()

    Return a detailed list of all the isometries in the symmetry group.

        >>> S = Manifold('s959').symmetry_group()
        >>> isoms = S.isometries()
        >>> isoms[8]
        0 -> 1   1 -> 0
        [-1 -1]  [ 0  1]
        [ 1  0]  [-1 -1]
        Does not extend to link

  `multiply_elements`()

    Returns the product of group elements i and j. The convention is that products of symmetries read right to left. That is, the composition (symmetry[i] o symmetry[j]) acts by first doing symmetry[j], then symmetry[i].

        >>> S = Manifold('m004').symmetry_group()
        >>> S.multiply_elements(2, 3)
        1

  `order`()

    Return the order of the symmetry group

        >>> S = Manifold('s000').symmetry_group()
        >>> S.order()
        4

  `polyhedral_description`()

    If the symmetry group is a (possibly binary) polyhedral group, return a description of it.

## DirichletDomain

class `snappy.``DirichletDomain`

  A DirichletDomain object represents a Dirichlet Domain of a hyperbolic manifold, typically centered at a point which is a local maximum of injectivity radius. It will have ideal vertices if the manifold is not closed.

  Instantiate as M.dirichlet_domain() where M is a Manifold to obtain a Dirichlet Domain centered at a point which maximizes injectivity radius.

  Other options can be provided to customize the computation, with the default values shown here

      >>> M = Manifold('m003(3,-4)')
      >>> M.dirichlet_domain(vertex_epsilon=10.0**-8, displacement = [0.0, 0.0, 0.0], centroid_at_origin=True, maximize_injectivity_radius=True)
      40 finite vertices, 0 ideal vertices; 60 edges; 22 faces

  You can also create a Dirichlet Domain from a file listing matrix generators for the group, in SnapPea’s “% Generator” format, via

  > D = DirichletDomain(generator_file=’test.gens’)

  `face_list`()

    Return a list of faces, each represented as a dictionary with keys ‘vertices’, ‘distance’, ‘closest’, ‘hue’. The distance from the origin is the value for ‘distance’, and the value for ‘closest’ is the orthogonal projection of the origin to the plane containing the face. The vertices of each face are listed in clockwise order, as viewed from outside the polyhedron.

  `in_radius`()

    Return the radius of the largest inscribed sphere.

  `length_spectrum_dicts`()

    Return a list of info objects describing the short geodesics up to the specified cutoff length. The keys are ‘length’, ‘parity’, ‘topology’, and ‘multiplicity’. The length is the complex length; the parity specifies whether orientation is preserved; and topology distinguishes between circles and mirrored intervals.

  `manifold`()

    Returns a Manifold computed directly from the Dirichlet domain, regarded as polyhedron with faces identified in pairs. Only works if this gives a manifold not an orbifold.

        >>> M = Manifold('7_3')
        >>> D = M.dirichlet_domain()
        >>> A = D.manifold()
        >>> M.is_isometric_to(A)
        True

  `num_edges`()

    Return the number of edges.

  `num_faces`()

    Return the number of faces.

  `num_finite_vertices`()

    Return the number of finite (non-ideal) vertices.

  `num_ideal_vertices`()

    Return the number of ideal vertices.

  `num_vertices`()

    Return the number of vertices.

  `out_radius`()

    Return the radius of the smallest circubscribed sphere.

  `pairing_matrices`()

    Returns a list of the O31Matrices which pair the faces of this DirichletDomain.

        >>> M = Manifold('s345')
        >>> D = M.dirichlet_domain()
        >>> matrices = D.pairing_matrices()
        >>> D1 = DirichletDomain(O31_generators=matrices)
        >>> N = D1.manifold()
        >>> M.is_isometric_to(N)
        True

  `save`()

    Save the Dirichlet domain as a text file in “% Generators” format.

  `triangulation`()

    Returns a Triangulation computed directly from the Dirichlet domain, regarded as polyhedron with faces identified in pairs. Only works if this gives a manifold not an orbifold.

        >>> M = Manifold('7_3')
        >>> D = M.dirichlet_domain()
        >>> B = D.triangulation()
        >>> M.is_isometric_to(B.with_hyperbolic_structure())
        True

  `vertex_list`()

    Return a list of the coordinates of the vertices. These are the three space coordinates of a point in the time=1 slice of Minkowski space. That is to say, these are the coordinates of the image of the point under projection into the Klein model.

  `volume`()

    Returns the approximate volume of the DirichletDomain. Because matrices in O(3,1) tend to accumulate roundoff error, it’s hard to get a good bound on the accuracy of the computed volume. Nevertheless, the kernel computes the best value it can, with the hope that it will aid the user in recognizing manifolds defined by a set of generators.

## CuspNeighborhood

class `snappy.``CuspNeighborhood`

  A CuspNeighborhood object represents an equivariant collection of disjoint horoballs that project to cusp neighborhoods.

  Instantiate as M.cusp_neighborhood()

  `Ford_domain`()

    Return a list of pairs of complex numbers describing the endpoints of the segments obtained by projecting the edges of the Ford domain to the xy-plane in the upper half space model.

    If the high_precision flag is set to False (the default), the coordinates are Python complex numbers. Otherwise they are SnapPy Numbers.

  `check_index`()

    Raises an IndexError if the cusp index is invalid.

  `get_displacement`()

    Return the displacement of the horospherical boundary of the specified cusp. The displacement is the hyperbolic distance that the horospherical boundary has been displaced from its “home” position, at which the area of the boundary is 3sqrt(3)/8. (The translates of all of the horospheres are guaranteed to be pairwise disjoint when each cusp has displacement 0.)

  `get_tie`()

    Return True if the specified cusp is a member of the tied group. The displacements of the tied cusps are all the same.

  `horoballs`()

    Return a list of dictionaries describing the horoballs with height at least cutoff. The keys are ‘center’, ‘radius’, ‘index’.

    If the high_precision flag is set to the default value False, these are Python complexes and floats. Otherwise they are SnapPy Numbers.

  `manifold`()

    Return a Manifold built from the current canonical triangulation.

  `max_reach`()

    Return the maximum reach over all cusps.

  `num_cusps`()

    Return the number of cusps.

  `original_index`()

    Returns the index by which the Manifold identifies this cusp.

  `reach`()

    Return the displacement at which the specified cusp neighborhood bumps into itself. (This is twice the distance between nearest horoball lifts.)

  `set_displacement`()

    Set the displacement of the specified cusp.

  `set_tie`()

    Mark the specified cusp as a member of the tied group.

  `stopper`()

    Return the index of the cusp which will be the first one that the specified cusp neighborhood bumps into. (Assumes the other displacements are fixed.)

  `stopping_displacement`()

    Return the displacement at which the specified cusp neighborhood bumps into itself or another cusp neighborhood. (Assumes the other displacements are fixed.)

  `topology`()

    Return the topological type of the specified cusp.

  `translations`()

    Return the (complex) Euclidean translations of the meridian and longitude of the specified cusp.

  `triangulation`()

    Return a list of dictionaries describing the endpoints of the segments obtained by projecting the edges of the triangulation dual to the Ford domain into the xy-plane in the upper half space model. The keys are ‘endpoints’ and ‘indices’.

  `view`()

    Create a 3D picture of the horoball packing. One can specify which cusp to put at infinity and how large of horoballs to look at, e.g.

        >>> M = Manifold('m125')
        >>> C = M.cusp_neighborhood()
        >>> C.view(which_cusp = 1, cutoff=0.2)

  `volume`()

    Return the volume of the horoball neighborhood of the specified cusp.