curver.kernel.triangulation.Triangulation¶

class
curver.kernel.triangulation.
Triangulation
(triangles)[source]¶ Bases:
object
This represents a triangulation of a punctured surface.
It is specified by a list of Triangles. Its edges must be numbered 0, 1, …

all_encodings
(num_flips)[source]¶ Yield all encodings that can be made using at most the given number of flips.
Runs in exp(num_flips) time.

curve_from_cut_sequence
(sequence)[source]¶ Return a new curve on this surface based on the sequence of edges that this Curve crosses.
WARNING: Be extremely careful with this method since it does NOT check that this produces a curve.

cut_sequence_intersections
(sequence)[source]¶ Return the list of intersections with edges of this triangulation given by a cut sequence.

disjoint_sum
(laminations)[source]¶ An efficient way of summing multiple disjoint laminations without computing intermediate values.
laminations can either be a dictionary mapping lamination –> multiplictiy or an iterable of laminations.

dual_tree
(avoid=None)[source]¶ Return a set of indices corresponding to a maximal tree in 1–skeleton of the dual of this triangulation.
Note that when this surface is disconnected this tree is actually a forest. To make this unique / welldefined we return the numerically first one.
If avoid is provided then none of these indices will appear in the dual tree.

edge_arcs
()[source]¶ Return a list containing the Arc representing each Edge.
As these fill, by Alexander’s trick a mapping class is the identity if and only if it fixes all of them.

edge_curve
(edge)[source]¶ Return the curve partial N(edge).
If edge connects a vertex to itself then there are two candidate curves in which case the one to the right of the (oriented) edge is returned.

encode
(sequence)[source]¶ Return the encoding given by a sequence of Moves.
There are several conventions that allow these to be specified by a smaller amount of information:
 An integer x represents EdgeFlip(…, edge_label=x)
 A dictionary which has i or ~i as a key (for every i) represents a relabelling.
 A dictionary which is missing i and ~i (for some i) represents an isometry back to this triangulation.
 A pair (e, p) represents a Twist or HalfTwist to the power p, depending on whether the edge e connects distinct vertices.
 None represents the identity isometry.
This sequence is read in reverse in order to respect composition. For example:
self.encode([1, {1: ~2}, 2, 3, ~4])is the mapping class which: flips edge ~4, then 3, then 2, then relabels back to the starting triangulation via the isometry which takes 1 to ~2 and then finally flips edge 1.

encode_flip
(edge)[source]¶ Return an encoding of the effect of flipping the given edge.
The given edge must be flippable.

encode_multiflip
(edges)[source]¶ Return an encoding of the effect of flipping the given edges.
The given edges must be flippable and have disjoint support.

encode_pachner_1_3
(triangles=None)[source]¶ Return an Encoding which corresponds to performing a 1 –> 3 Pachner move on the requested triangles.
By default, this is performed on all triangles.

encode_relabel_edges
(label_map)[source]¶ Return an encoding of the effect of relabelling the edges according to label_map.
label_map[index] or label_map[~index] must be defined for each index.

find_isometry
(other, label_map)[source]¶ Return the isometry from this triangulation to other defined by label_map.
label_map must be a dictionary mapping self.labels to other.labels. Labels may be omitted if they are determined by other given ones and these will be found automatically. Additionally, if an entire component is omitted then we assume that the map is the identity on it.
This isometry must exists and be is unique.

classmethod
from_tuple
(*edge_labels)[source]¶ Return an Triangulation from a list of triples of edge labels.
Let T be an ideal triangulations of the punctured (oriented) surface S. Orient and edge e of T and assign an index i(e) in 0, …, zeta1. Now to each triangle t of T associate the triple j(t) := (j(e_1), j(e_2), j(e_3)) where:
 e_1, e_2, e_3 are the edges of t, ordered according to the orientation of t, and
 j(e) = { i(e) if the orientation of e agrees with that of t, and
 { ~i(e) otherwise.
Here ~x := 1  x, the two’s complement of x.
We may describe T by the list [j(t) for t in T]. This function reconstructs T from such a list.
edge_labels must be a list of triples of integers and each of 0, …, zeta1, ~0, …, ~(zeta1) must occur exactly once.

is_flippable
(edge)[source]¶ Return whether the given edge is flippable.
An edge is flippable if and only if it lies in two distinct triangles.

is_isometric_to
(other)[source]¶ Return whether there are any orientation preserving isometries from this triangulation to other.

lamination
(weights, promote=True)[source]¶ Return a new lamination on this surface assigning the specified weight to each edge.

lamination_from_cut_sequence
(sequence)[source]¶ Return a new lamination on this surface based on the sequence of edges that this Curve / Arc crosses.

package
()[source]¶ Return a small amount of info that create_triangulation can use to reconstruct this triangulation.

square
(edge)[source]¶ Return the four edges around the given edge and the diagonal.
The given edge must be flippable.
