Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

homology of saddle connection #308

Merged
merged 8 commits into from
Nov 18, 2024

Conversation

videlec
Copy link
Collaborator

@videlec videlec commented Nov 16, 2024

Implement conversion of saddle connection as element of simplicial homology of the surface.

Checklist

  • Added an entry in doc/news/.
  • Added a test for this change.

@videlec
Copy link
Collaborator Author

videlec commented Nov 16, 2024

@saraedum For the interface I implemented it as

class SaddleConnection:
    def _homology_(self, H):
        ....

class Homology:
    def _element_constructor_(self, x):
        return x._homology_(self)

Does that sound reasonable?

Copy link

github-actions bot commented Nov 16, 2024

Documentation preview for this PR is ready! 🎉
Built with commit: b2648b2

Comment on lines 1179 to 1182
if len(segments) == 1 and segments[0].is_edge():
label = segments[0].polygon_label()
e = segments[0].edge()
return H((label, e))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary or just an optimization?

Copy link
Collaborator Author

@videlec videlec Nov 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary : the segment has a start in the polygon on the left side of the edge and the end on its right side. The generic code afterwards does not work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example

sage: S = translation_surfaces.mcmullen_L(1,1,1,1)
sage: traj = S.tangent_vector(0, (0, 0), (1, 0)).straight_line_trajectory()
sage: traj.flow(1)
sage: s = traj.segments()[0]
sage: s
Segment in polygon 0 starting at (0, 0) and ending at (1, 1)

Let me notice that the string representation of the segment is quite confusing : it would better have been ending at (1,0). The reason is that (0, 0) refers to polygon 0 while (1, 1) refers to polygon 1. This becomes apparent when looking at the start and end

sage: s.start()
SimilaritySurfaceTangentVector in polygon 0 based at (0, 0) with vector (1, 0)
sage: s.end()
SimilaritySurfaceTangentVector in polygon 1 based at (1, 1) with vector (-1, 0)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #309

Comment on lines +1184 to +1211
h = H.zero()
for s in segments:
label = s.polygon_label()
n = len(surface.polygon(label).vertices())

start = s.start()
if start.position().is_in_edge_interior():
# pick the next vertex clockwise
i = (start.position().get_edge() + 1) % n
else:
assert start.position().is_vertex()
i = start.vertex()

end = s.end()
if end.position().is_in_edge_interior():
# pick the previous vertex clockwise
j = end.position().get_edge()
else:
assert end.position().is_vertex()
j = end.vertex()

if i < j:
h += sum(H((label, e)) for e in range(i, j))
else:
h += sum(H((label, e)) for e in range(i, n))
h += sum(H((label, e)) for e in range(j))

return h
Copy link
Member

@saraedum saraedum Nov 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually, we could do the conversion via libflatsurf because there the saddle connections have a chain() naturally. (Especially with connections coming out of the flow decomposition code this won't work out anymore but let's do this in a 2.0 )

Comment on lines 1173 to 1176
n = 10
while not traj.is_saddle_connection():
traj.flow(2**n)
n += 1
Copy link
Member

@saraedum saraedum Nov 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
n = 10
while not traj.is_saddle_connection():
traj.flow(2**n)
n += 1
traj.flow(oo)

I think that also works actually.

@@ -0,0 +1,3 @@
**Added:**

* homology of saddle connections
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* homology of saddle connections
* Added homology of saddle connections

(otherwise I have to modify it later when I do the release ;) )

@videlec videlec merged commit 1a11d1f into flatsurf:master Nov 18, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants