Skip to content

Commit

Permalink
Some more fixes to the isosig decoration: Removing code that flipped …
Browse files Browse the repository at this point in the history
…slope when there are no matrices. Accounting for the fact that set_peripheral_curves('combinatorial') is not a no-op when the Manifold was just constructed.
  • Loading branch information
unhyperbolic committed Nov 10, 2024
1 parent 7deb777 commit 49ff5e5
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 4 deletions.
4 changes: 4 additions & 0 deletions cython/core/triangulation.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2983,6 +2983,10 @@ cdef class Triangulation():
>>> M.triangulation_isosig(decorated = False, ignore_orientation = False)
'dLQacccnsnk'

Note: the decorated triangulation isosig captures the orientation if
either ``ignore_orientation = False`` or if both ``ignore_curves = False``
and ``ignore_curve_orientations = False``.

Note that a decorated triangulation isosig with the default values
``ignore_orientation = True`` but ``ignore_curve_orientations = False``
still captures the orientations of the triangulation through the
Expand Down
13 changes: 9 additions & 4 deletions python/decorated_isosig.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,6 @@ def candidate_decoration_info(
if ignore_curves:
slopes = [ matrix * slope
for matrix, slope in zip(matrices, slopes) ]
if manifold_orientable:
for slope in slopes:
slope[0] *= isomorphism_orientation
else:
if ignore_curve_orientations:
for matrix, slope in zip(matrices, slopes):
Expand Down Expand Up @@ -345,7 +342,15 @@ def decorated_isosig(manifold, triangulation_class,
return isosig

N = triangulation_class(isosig, remove_finite_vertices=False)
N.set_peripheral_curves('combinatorial')
if not (ignore_cusp_ordering and ignore_curves):
# Note that data_to_triangulation determines the peripheral
# curves before orienting the manifold.
# Thus, we get different peripheral curves when calling
# N.set_peripheral_curves.
# For backwards compatibility (set_peripheral_from_decoration),
# we need to keep callingN.set_peripheral_curves here unless there is
# no decoration.
N.set_peripheral_curves('combinatorial')

manifold_orientable = manifold.is_orientable()
slopes = manifold.cusp_info('filling')
Expand Down
2 changes: 2 additions & 0 deletions python/isometry_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ def drill_manifold_precisions(

def compute_meridian_slopes(isosig, tri):
isosig_tri = Triangulation(isosig, remove_finite_vertices=False)
# Do not call isosig_tri.set_peripheral_curves('combinatorial')
# here.
for iso in tri.isomorphisms_to(isosig_tri):
cusp_map, = iso.cusp_maps()
slope = make_vector([cusp_map[0,0], cusp_map[1,0]])
Expand Down
72 changes: 72 additions & 0 deletions python/test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,58 @@
>>> T.triangulation_isosig()
'gLMzQbcdefffaelaaai_acbBaabCbbabbBC'
Test that slopes are computed correctly.
>>> M=Manifold("L14n63023(-5,1)(5,1)(10,1)")
>>> M.triangulation_isosig(decorated=False, ignore_orientation=False)
'vLLvvLLMALQQzQQceillmnppqrlmrqtruututiivimllaelaqxrvdoxqltt'
The canonical orientation (used to compute the unoriented isosig)
is the reverse of the actual orientation:
>>> M.triangulation_isosig(decorated=False)
'vLLvLLPwPQLAMPQcefikkmnplkopqrsttutuuiixvimqlippawidlabavth'
>>> Mop = M.copy()
>>> Mop.reverse_orientation()
>>> Mop.triangulation_isosig(decorated=False, ignore_orientation=False)
'vLLvLLPwPQLAMPQcefikkmnplkopqrsttutuuiixvimqlippawidlabavth'
It is not just the triangulation that is chiral, the manifold itself is:
>>> isom_sig_pos = M.isometry_signature(ignore_orientation = False)
>>> isom_sig_pos
'KLALvLwLLwMQLQPAMzMzMPzMPcbbeghnklntpqpqvrswtuvxyzABCDEFEGHIJJhhkofnaocnmrlsiaowxfcsaxhxhxhxhjhhhhs'
>>> isom_sig_neg = Mop.isometry_signature(ignore_orientation = False)
>>> isom_sig_neg
'KLAMvMvvAwLvQPPPQMPzMPzMPcbbdegilopoouqtryvuxvwxzzBACDEFEGHIJJhhkhhohahrscaagwxkkgbvwpuxwqxqxwxxxxr'
So we expect the oriented isometry signature to flip when neither the isomorphism
signature nor its decoration capture the orientation.
>>> for ignore_cusp_ordering in [False, True]:
... for ignore_curves in [False, True]:
... for ignore_curve_orientations in [False, True]:
... for ignore_filling_orientations in [False, True]:
... for ignore_orientation in [False, True]:
... isosig = M.triangulation_isosig(
... ignore_cusp_ordering = ignore_cusp_ordering,
... ignore_curves = ignore_curves,
... ignore_curve_orientations = ignore_curve_orientations,
... ignore_filling_orientations = ignore_filling_orientations,
... ignore_orientation = ignore_orientation)
... isom_sig = (
... Manifold(isosig)
... .isometry_signature(ignore_orientation = False))
... does_ignore_orientation = (
... ignore_orientation and
... (ignore_curve_orientations or ignore_curves))
... expected_isom_sig = (
... isom_sig_neg
... if does_ignore_orientation
... else isom_sig_pos)
... if isom_sig != expected_isom_sig:
... print("Bad")
isometry_signature
------------------
Expand Down Expand Up @@ -54,6 +106,26 @@
...
RuntimeError: Could not compute or verify canonical retriangulation of drilled manifold. Geodesic was: abCDaDAd.
Test isometry_signature's ignore_orientation
>>> M = Manifold("m006")
>>> M.isometry_signature(ignore_orientation=False)
'eLMkaccddjgbaj'
>>> M.isometry_signature(ignore_orientation=True)
'eLAkaccddngbak'
>>> M.isometry_signature() # default value
'eLAkaccddngbak'
>>> M.dehn_fill((3,4))
>>> M.isometry_signature(ignore_orientation=False)
'eLMkaccddjgbaj(-1,4)'
>>> M.isometry_signature(ignore_orientation=True)
'eLAkaccddngbak(-3,4)'
Test isometry_signature's of_link and filling.
>>> Manifold("o9_44206(2,3)").isometry_signature(of_link=True)
'jLLvMQQacggfiihhijkkjkehhtb_abBabBbabaab'
Class hierarchy
---------------
Expand Down

0 comments on commit 49ff5e5

Please sign in to comment.