The main snappy class, namely Manifold, is derived from more basic class below.
A Triangulation object represents a compact 3-manifold with torus boundary components, given as an ideal triangulation of the manifold’s interior. A Dehn-filling can be specified for each boundary component, allowing the description of closed 3-manifolds and some orbifolds. For non-orientable 3-manifolds, the boundary components can also be Klein bottles. Two Triangulations are equal (‘==’) if they represent combinatorially isomorphic triangulations. A Triangulation does not have any geometric structure, and usually one works with the subclass Manifold which adds this. Here’s a quick example:
>>> M = Triangulation('9_42')
>>> M.num_tetrahedra()
5
>>> M.is_orientable()
True
A Triangulation can be specified in a number of ways, e.g.
In general, the specification can be from among the below, with information on Dehn fillings added.
SnapPea cusped census manifolds: e.g. ‘m123’, ‘s123’, ‘v123’.
Once-punctured torus bundles: e.g. ‘b++LLR’, ‘b+-llR’, ‘bo-RRL’, ‘bn+LRLR’
Fibered manifold associated to a braid: ‘braid[1,2,-3,4]’
Here, the braid is thought of as a mapping class of the punctured disc, and this manifold is the corresponding mapping torus. If you want the braid closure, do (1,0) filling of the last cusp.
From mapping class group data using Twister:
‘Bundle(S_{1,1}, [a_0, B_1])’ or ‘Splitting(S_{1,0}, [b_1, A_0], [a_0,B_1])’
See the help for ‘twister’ function for more.
A SnapPea triangulation or link projection file: ‘filename’
The file will be loaded if found in the current directory or the path given by the shell variable SNAPPEA_MANIFOLD_DIRECTORY.
A string containing the contents of a SnapPea triangulation or link projection file.
Returns a copy of the triangulation.
>>> M = Triangulation('m125')
>>> N = M.copy()
Returns a Triangulation representing the finite cover specified by a transitive permutation representation. The representation is specified by a list of permutations, one for each generator of the simplified presentation of the fundamental group. Each permutation is specified as a list P such that set(P) == set(range(d)) where d is the degree of the cover.
>>> M = Triangulation('m004')
>>> N0 = M.cover([[1, 3, 0, 4, 2], [0, 2, 1, 4, 3]])
>>> N0.homology()
Z + Z + Z
Within Sage the permutations can also be of type PermutationGroupElement, in which case they act on the set range(1, d + 1). Or, you can specify a GAP or Magma subgroup of the fundamental group. For examples, see the docstring for Manifold.cover
Returns a list of Triangulations corresponding to all of the finite covers of the given degree.
WARNING: If the degree is large this might take a very, very, very long time.
>>> M = Triangulation('m003')
>>> covers = M.covers(4)
>>> [(N, N.homology()) for N in covers]
[(m003~irr~0(0,0)(0,0), Z/5 + Z + Z), (m003~cyc~1(0,0), Z/3 + Z/15 + Z)]
You can also look just at cyclic covers, which is much faster.
>>> covers = M.covers(4, cover_type='cyclic')
>>> [(N, N.homology()) for N in covers]
[(m003~cyc~0(0,0), Z/3 + Z/15 + Z)]
If you are using Sage, you can use GAP to find the subgroups, which is often much faster, by specifying the optional argument
method = ‘gap’
If in addition you have Magma installed, you can use it to do the heavy-lifting by specifying method = ‘magma’.
Returns an info object containing information about the given cusp. Usage:
>>> M = Triangulation('v3227(0,0)(1,2)(3,2)')
>>> M.cusp_info(1)
Cusp 1 : torus cusp with Dehn filling coeffients (M, L) = (1.0, 2.0)
>>> c = M.cusp_info(1)
>>> c.is_complete
False
>>> c.keys()
['index', 'filling', 'is_complete', 'topology']
You can get information about multiple cusps at once:
>>> M.cusp_info()
[Cusp 0 : torus cusp, not filled,
Cusp 1 : torus cusp with Dehn filling coeffients (M, L) = (1.0, 2.0),
Cusp 2 : torus cusp with Dehn filling coeffients (M, L) = (3.0, 2.0)]
>>> M.cusp_info('is_complete')
[True, False, False]
Set the Dehn filling coefficients of the cusps. This can be specified in the following ways, where the cusps are numbered by 0,1,...,(num_cusps - 1).
Fill cusp 2:
>>> M = Triangulation('8^4_1')
>>> M.dehn_fill((2,3), 2)
>>> M
L408001(0,0)(0,0)(2,3)(0,0)
Fill the last cusp:
>>> M.dehn_fill((1,5), -1)
>>> M
L408001(0,0)(0,0)(2,3)(1,5)
Fill the first two cusps:
>>> M.dehn_fill( [ (3,0), (1, -4) ])
>>> M
L408001(3,0)(1,-4)(2,3)(1,5)
When there is only one cusp, there’s a shortcut
>>> N = Triangulation('m004')
>>> N.dehn_fill( (-3,4) )
>>> N
m004(-3,4)
Does not return a new Triangulation.
Returns a dictionary whose keys are the valences of the edges in the triangulation, and the value associated to a key is the number of edges of that valence.
>>> M = Triangulation('v3227')
>>> M.edge_valences()
{10: 1, 4: 1, 5: 2, 6: 3}
Return a new manifold where the specified cusps have been permanently filled in. Examples:
Filling all the cusps:
>>> M = Triangulation('m125(1,2)(3,4)')
>>> N = M.filled_triangulation()
>>> N.num_cusps()
0
Filling cusps 0 and 2 :
>>> M = Triangulation('v3227(1,2)(3,4)(5,6)')
>>> M.filled_triangulation([0,2])
v3227_filled(3,4)
Returns a FundamentalGroup object representing the fundamental group of the manifold. If integer Dehn surgery parameters have been set, then the corresponding peripheral elements are killed.
>>> M = Triangulation('m004')
>>> G = M.fundamental_group()
>>> G
Generators:
a,b
Relators:
aaabABBAb
>>> G.peripheral_curves()
[('ab', 'aBAbABab')]
There are three optional arguments all of which default to True:
>>> M.fundamental_group(False, False, False)
Generators:
a,b,c
Relators:
CbAcB
BacA
In the default mode, this function returns a matrix with rows of the form
a b c d e f ...
which means
a*log(z0) + b*log(1/(1-z0)) + c*log((z0-1)/z0) + d*log(z1) +... = 2 pi i
for an edge equation, and (same) = 1 for a cusp equation. Here, the cusp equations come at the bottom of the matrix, and are listed in the form: meridian of cusp 0, longitude of cusp 0, meridian of cusp 1, longitude of cusp 1,...
In terms of the tetrahedra, a is the invariant of the edge (2,3), b the invariant of the edge (0,2) and c is the invariant of the edge (1,2). See kernel_code/edge_classes.c for a detailed account of the convention used.
If the optional argument form=’rect’ is given, then this function returns a list of tuples of the form:
( [a0, a1,..,a_n], [b_0, b_1,...,b_n], c)
where this corresponds to the equation
z0^a0 (1 - z0)^b0 z1^a1(1 - z1)^b1 ... = c
where c = 1 or -1.
>>> M = Triangulation('m004(2,3)')
>>> M.gluing_equations()
matrix([[ 2, 1, 0, 1, 0, 2],
[ 0, 1, 2, 1, 2, 0],
[ 2, 0, 0, 0, -8, 6]])
>>> M.gluing_equations(form='rect')
[([2, -1], [-1, 2], 1), ([-2, 1], [1, -2], 1), ([2, -6], [0, 14], 1)]
Returns an AbelianGroup representing the first integral homology group of the underlying (Dehn filled) manifold.
>>> M = Triangulation('m003')
>>> M.homology()
Z/5 + Z
Return whether the underlying 3-manifold is orientable.
>>> M = Triangulation('x124')
>>> M.is_orientable()
False
Return the name of the triangulation.
>>> M = Triangulation('4_1')
>>> M.name()
'L104001'
Return the total number of cusps. By giving the optional argument ‘orientable’ or ‘nonorientable’ it will only count cusps of that type.
>>> M = Triangulation('m125')
>>> M.num_cusps()
2
Return the number of tetrahedra in the triangulation.
>>> M = Triangulation('m004')
>>> M.num_tetrahedra()
2
For a non-orientable manifold, returns the 2-fold cover which is orientable.
>>> X = Triangulation('x123')
>>> Y = X.orientation_cover()
>>> (X.is_orientable(), Y.is_orientable())
(False, True)
>>> Y
x123~(0,0)(0,0)
Brings the corresponding link editor window to the front, if there is one.
Perform random Pachner moves on the underlying triangulation.
>>> M = Triangulation('braid[1,2,-3,-3,1,2]')
>>> M.randomize()
Reverses the orientation of the Triangulation, presuming that it is orientable.
>>> M = Manifold('m015')
>>> cs = M.chern_simons()
>>> M.reverse_orientation()
>>> cs + M.chern_simons()
0.0
Save the triangulation as a SnapPea triangulation file.
>>> M = Triangulation('m004')
>>> M.save('fig-eight.tri')
Give the triangulation a new name.
>>> M = Triangulation('4_1')
>>> M.set_name('figure-eight-comp')
>>> M
figure-eight-comp(0,0)
Try to simplify the triangulation by doing Pachner moves.
>>> M = Triangulation('12n123')
>>> M.simplify()
Add a (possibly degenerate) hyperbolic structure, turning the Triangulation into a Manifold.
>>> M = Triangulation('m004')
>>> N = M.with_hyperbolic_structure()
>>> N.volume()
2.02988321282