Skip to content

Commit 610d3fe

Browse files
committed
In python, when computing fixed points and conjugating matrix by unit upper triangular matrix to avoid division by zero, consider two conjugations.
1 parent 7ddb44c commit 610d3fe

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

python/drilling/test_cases.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
Tests drilling geodesics that are entirely in the 2-skeleton::
3939
4040
>>> M.drill_words(['a','acAADa']).canonical_retriangulation().triangulation_isosig(ignore_orientation=False)
41-
'ivvPQQcfhghgfghfaaaaaaaaa_BabBBbBaBBbabbab'
41+
'ivvPQQcfhghgfghfaaaaaaaaa_BabBBbBaBBaBbbab'
4242
4343
Same test as verified computation::
4444
45-
sage: M.drill_words(['a','acAADa'], verified = True).canonical_retriangulation().triangulation_isosig(ignore_orientation=False)
46-
'ivvPQQcfhghgfghfaaaaaaaaa_BabBBbBaBBbabbab'
45+
sage: M.drill_words(['a','acAADa'], verified = True, bits_prec = 60).canonical_retriangulation().triangulation_isosig(ignore_orientation=False)
46+
'ivvPQQcfhghgfghfaaaaaaaaa_BabBBbBaBBaBbbab'
4747
4848
Test error when drilling something close to core curve::
4949
@@ -70,7 +70,7 @@
7070
handled by 2-3 moves (in particular, commit f9879d04 introduced a bug):
7171
7272
>>> Manifold("m004").drill_words(['CAC','CCbC']).canonical_retriangulation().triangulation_isosig(ignore_orientation=False)
73-
'qLvvLvAMQQQkcgimopkllmpkonnnpixcaelchapewetvrn_bcaaBbBBbaBaBbB'
73+
'qLvvLvAMQQQkcgimopkllmpkonnnpixcaelchapewetvrn_bcaaBbBBbBaaBbB'
7474
7575
7676
An interesting case where geodesic intersects triangulation in only one tetrahedron:
@@ -91,9 +91,9 @@
9191
... except RuntimeError:
9292
... pass
9393
>>> drilled_isosig(Manifold('K11n34(0,1)'), ['iFcdbEiFJ', 'iFJ'])
94-
'zLLvLLwzAwPQMQzzQkcdgijkjplssrnrotqruvwyxyxyhsgnnighueqdniblsipklpxgcr_BcbDbBba'
94+
'zLLvLLwzAwPQMQzzQkcdgijkjplssrnrotqruvwyxyxyhsgnnighueqdniblsipklpxgcr_BcaBbBcB'
9595
>>> drilled_isosig(Manifold('K11n34(0,1)'), ['iFJ', 'iFcdbEiFJ'])
96-
'zLLvLLwzAwPQMQzzQkcdgijkjplssrnrotqruvwyxyxyhsgnnighueqdniblsipklpxgcr_babBbaBcaB'
96+
'zLLvLLwzAwPQMQzzQkcdgijkjplssrnrotqruvwyxyxyhsgnnighueqdniblsipklpxgcr_babBcBBcaB'
9797
>>> sys.setrecursionlimit(original_limit)
9898
9999
Stress test by using large perturbation. In particular, this is testing the
@@ -104,18 +104,18 @@
104104
>>> from snappy.drilling import perturb
105105
>>> original_radius = perturb._tube_developing_radius
106106
>>> perturb._tube_developing_radius = 1
107-
>>> Manifold("m307").drill_word('dadadabCdada', verbose=True).isometry_signature(of_link=True) # doctest: +NUMERIC9
108-
Tubes lower bound injectivity radius: 0.380575727320247
109-
Number of geodesic pieces: [9]
110-
Number of tets after subdividing: 45
107+
>>> Manifold("m209").drill_word('aaaEDBd', verbose=True).isometry_signature(of_link=True) # doctest: +NUMERIC9
108+
Tubes lower bound injectivity radius: 0.505170045966405
109+
Number of geodesic pieces: [12]
110+
Number of tets after subdividing: 69
111111
Shortening geodesic by sweeping across triangle.
112-
'oLLwQvvPQQcbeefgemnllnmnmlhhaaaaaahaaaaah_bBbabaab'
113-
>>> Manifold("m320").drill_word('daaacDA', verbose=True).isometry_signature(of_link=True) # doctest: +NUMERIC9
114-
Tubes lower bound injectivity radius: 0.397319067589326
112+
'mLALzLQMPbcbefjhhijkllxxnnxagbxnhhn_cbBabBcB'
113+
>>> Manifold("m307").drill_word('ADADcBADADAD', verbose=True).isometry_signature(of_link=True) # doctest: +NUMERIC9
114+
Tubes lower bound injectivity radius: 0.380575727319372
115115
Number of geodesic pieces: [9]
116116
Number of tets after subdividing: 49
117117
Shortening geodesic by sweeping across triangle.
118-
'rLLPwAPvvPQQcccdfehgjiqpooqppqoqffaaaaaaaqaaaqaaa_bBbabaab'
118+
'oLLwQvvPQQcbeefgemnllnmnmlhhaaaaaahaaaaah_bBbabaab'
119119
>>> perturb._tube_developing_radius = original_radius
120120
121121
"""

python/geometric_structure/geodesic/fixed_points.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,18 @@ def r13_fixed_points_of_psl2c_matrix(m):
2929
bc = m[1,0] - m[0,1]
3030
ad = m[1,1] - m[0,0]
3131
abs_c_pm_m_pp = _lower_bound_abs(bc + ad)
32+
abs_c_pp_m_pm = _lower_bound_abs(bc - ad)
3233

33-
if abs_c > abs_c_pm_m_pp:
34+
if abs_c > abs_c_pm_m_pp and abs_c > abs_c_pp_m_pm:
3435
return _r13_fixed_points_of_psl2c_matrix(m)
3536

3637
pp = make_matrix([[ 1, 0],[ 1, 1]], ring=m.base_ring())
3738
pm = make_matrix([[ 1, 0],[-1, 1]], ring=m.base_ring())
3839

39-
tinv, t = pm, pp
40+
if abs_c_pm_m_pp > abs_c_pp_m_pm:
41+
tinv, t = pm, pp
42+
else:
43+
tinv, t = pp, pm
4044

4145
pts = _r13_fixed_points_of_psl2c_matrix(tinv * m * t)
4246
o13_t = psl2c_to_o13(t)

0 commit comments

Comments
 (0)