Skip to content

Commit

Permalink
consistent ordering of rectangles in the zippered rectangle construction
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Nov 24, 2023
1 parent cf59d8e commit ca3ae4c
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions veerer/veering_triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3190,6 +3190,15 @@ def zippered_rectangles(self, x, y, base_ring=None, check=True):
we consider downward vertical separatrices and extend them until they
touch the union of these horizontal segments.
INPUT:
- ``x``, ``y`` -- list of positive numbers (as many as edges in this veering
triangulation)
- ``base_ring`` -- an optional base ring to build the surface
- ``check`` -- optional boolean (default ``True``)
EXAMPLES::
sage: from veerer import VeeringTriangulation, BLUE, RED
Expand All @@ -3211,9 +3220,18 @@ def zippered_rectangles(self, x, y, base_ring=None, check=True):
sage: B0, B1 = vt.dehn_twists(BLUE)
sage: f = B0 **2 * R0 **3 * B1 * R1 ** 5
sage: a, x, y = f.self_similar_widths_and_heights()
sage: vt.zippered_rectangles(x, y) # optional: sage_flatsurf
sage: S = vt.zippered_rectangles(x, y) # optional: sage_flatsurf
sage: S # optional: sage_flatsurf
Translation Surface built from 6 rectangles
We now check that labelling of the rectangles in ``S`` coincide with
the order of faces in the veering triangulation::
sage: for i, face in enumerate(vt.faces()): # optional: sage_flatsurf
....: e0, e1, e2, e3 = S.polygon(i).erase_marked_vertices().edges()
....: assert any(e0[0] == x[vt._norm(e)] for e in face)
....: assert any(e1[1] == y[vt._norm(e)] for e in face)
TESTS::
sage: from veerer import VeeringTriangulation, BLUE, RED
Expand Down Expand Up @@ -3314,11 +3332,19 @@ def zippered_rectangles(self, x, y, base_ring=None, check=True):
assert all(colouring[left_wedges[i]] == BLUE for i in range(0, 2 * self.num_faces(), 2))
assert all(colouring[left_wedges[i]] == RED for i in range(1, 2 * self.num_faces(), 2))

# In order to have a consistent labelling between the triangles as provided by self.faces()
# and the rectangles we compute the face index associated to each half-edge and use it
# later to order the rectangles
half_edge_face_index = [-1] * self._n
for i, face in enumerate(self.faces()):
for e in face:
half_edge_face_index[e] = i

# There are as many rectangles in the Markov partitions as triangles in
# the veering triangulation
# Each left/right/bottom separatrix has a certain number of cut points
# (on both sides)
rectangles = []
rectangles = [None] * self.num_faces()
for i in range(1, 2 * self.num_faces(), 2):
l = left_wedges[i]
L = ep[l]
Expand Down Expand Up @@ -3377,7 +3403,8 @@ def zippered_rectangles(self, x, y, base_ring=None, check=True):
p6 = (previous_separatrix[R], LEFT, y[r])
p7 = (previous_separatrix[R], LEFT, y[e])

rectangles.append((p0, p1, p2, p3, p4, p5, p6, p7))
j = half_edge_face_index[r]
rectangles[j] = (p0, p1, p2, p3, p4, p5, p6, p7)

from .tatami_decomposition import tatami_decomposition
return tatami_decomposition(rectangles, base_ring)
Expand Down

0 comments on commit ca3ae4c

Please sign in to comment.