curver.kernel.triangulation module¶
A module for representing a triangulation of a punctured surface.
-
class
curver.kernel.triangulation.
Edge
(label)[source]¶ Bases:
object
This represents an oriented edge, labelled with an integer.
It is specified by its label and its inverse edge is labelled with ~its label.
These are really just integers but with fancy printing and indexing set up on them.
-
index
¶
-
label
¶
-
-
class
curver.kernel.triangulation.
Triangle
(edges, rotate=None)[source]¶ Bases:
object
This represents a triangle.
It is specified by a list of three edges, ordered anticlockwise. It builds its corners automatically.
-
edges
¶
-
indices
¶
-
labels
¶
-
-
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.
-
disjoint_sum
(laminations)[source]¶ An efficient way of summing multiple disjoint laminations without computing intermediate values.
-
dual_tree
(avoid=None)[source]¶ Return a maximal tree in 1–skeleton of the dual of this triangulation.
This are given as lists of Booleans signaling if each edge is in the tree. Note that when this surface is disconnected this tree is actually a forest. To make this unique / well-defined we return the numerically first one.
If avoid is provided then none of these indices will be set 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.
-
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_relabel_edges
(label_map)[source]¶ Return an encoding of the effect of relabelling the edges according to label_map.
Assumes that label_map[index] or label_map[~index] is 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.
Assumes that such an isometry exists and 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, …, zeta-1. 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, …, zeta-1, ~0, …, ~(zeta-1) must occur exactly once.
-
is_flippable
(edge)[source]¶ Return if 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 if 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.
-