-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
@saraedum For the interface I implemented it as
Does that sound reasonable? |
Documentation preview for this PR is ready! 🎉 |
flatsurf/geometry/surface_objects.py
Outdated
if len(segments) == 1 and segments[0].is_edge(): | ||
label = segments[0].polygon_label() | ||
e = segments[0].edge() | ||
return H((label, e)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened #309
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 |
There was a problem hiding this comment.
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 )
flatsurf/geometry/surface_objects.py
Outdated
n = 10 | ||
while not traj.is_saddle_connection(): | ||
traj.flow(2**n) | ||
n += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* homology of saddle connections | |
* Added homology of saddle connections |
(otherwise I have to modify it later when I do the release ;) )
Implement conversion of saddle connection as element of simplicial homology of the surface.
Checklist
doc/news/
.