snappy 3.2__cp310-cp310-macosx_10_12_x86_64.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (503) hide show
  1. snappy/CyOpenGL.cpython-310-darwin.so +0 -0
  2. snappy/SnapPy.cpython-310-darwin.so +0 -0
  3. snappy/SnapPy.ico +0 -0
  4. snappy/SnapPy.png +0 -0
  5. snappy/SnapPyHP.cpython-310-darwin.so +0 -0
  6. snappy/__init__.py +760 -0
  7. snappy/app.py +605 -0
  8. snappy/app_menus.py +372 -0
  9. snappy/browser.py +998 -0
  10. snappy/cache.py +25 -0
  11. snappy/canonical.py +249 -0
  12. snappy/cusps/__init__.py +38 -0
  13. snappy/cusps/cusp_area_matrix.py +101 -0
  14. snappy/cusps/cusp_areas_from_matrix.py +173 -0
  15. snappy/cusps/maximal_cusp_area_matrix.py +136 -0
  16. snappy/cusps/test.py +21 -0
  17. snappy/cusps/trig_cusp_area_matrix.py +63 -0
  18. snappy/database.py +454 -0
  19. snappy/db_utilities.py +79 -0
  20. snappy/decorated_isosig.py +710 -0
  21. snappy/dev/__init__.py +0 -0
  22. snappy/dev/extended_ptolemy/__init__.py +8 -0
  23. snappy/dev/extended_ptolemy/closed.py +106 -0
  24. snappy/dev/extended_ptolemy/complexVolumesClosed.py +149 -0
  25. snappy/dev/extended_ptolemy/direct.py +42 -0
  26. snappy/dev/extended_ptolemy/extended.py +406 -0
  27. snappy/dev/extended_ptolemy/giac_helper.py +43 -0
  28. snappy/dev/extended_ptolemy/giac_rur.py +129 -0
  29. snappy/dev/extended_ptolemy/gluing.py +46 -0
  30. snappy/dev/extended_ptolemy/phc_wrapper.py +220 -0
  31. snappy/dev/extended_ptolemy/printMatrices.py +70 -0
  32. snappy/dev/vericlosed/__init__.py +1 -0
  33. snappy/dev/vericlosed/computeApproxHyperbolicStructureNew.py +159 -0
  34. snappy/dev/vericlosed/computeApproxHyperbolicStructureOrb.py +90 -0
  35. snappy/dev/vericlosed/computeVerifiedHyperbolicStructure.py +111 -0
  36. snappy/dev/vericlosed/gimbalLoopFinder.py +130 -0
  37. snappy/dev/vericlosed/hyperbolicStructure.py +313 -0
  38. snappy/dev/vericlosed/krawczykCertifiedEdgeLengthsEngine.py +165 -0
  39. snappy/dev/vericlosed/oneVertexTruncatedComplex.py +122 -0
  40. snappy/dev/vericlosed/orb/__init__.py +1 -0
  41. snappy/dev/vericlosed/orb/orb_solution_for_snappea_finite_triangulation_mac +0 -0
  42. snappy/dev/vericlosed/parseVertexGramMatrixFile.py +47 -0
  43. snappy/dev/vericlosed/polishApproxHyperbolicStructure.py +61 -0
  44. snappy/dev/vericlosed/test.py +54 -0
  45. snappy/dev/vericlosed/truncatedComplex.py +176 -0
  46. snappy/dev/vericlosed/verificationError.py +58 -0
  47. snappy/dev/vericlosed/verifyHyperbolicStructureEngine.py +177 -0
  48. snappy/doc/_images/SnapPy-196.png +0 -0
  49. snappy/doc/_images/geodesics.jpg +0 -0
  50. snappy/doc/_images/m004_paper_plane_on_systole.jpg +0 -0
  51. snappy/doc/_images/m125_paper_plane.jpg +0 -0
  52. snappy/doc/_images/mac.png +0 -0
  53. snappy/doc/_images/o9_00000_systole_paper_plane.jpg +0 -0
  54. snappy/doc/_images/o9_00000_systole_paper_plane_closer.jpg +0 -0
  55. snappy/doc/_images/plink-action.png +0 -0
  56. snappy/doc/_images/ubuntu.png +0 -0
  57. snappy/doc/_images/win7.png +0 -0
  58. snappy/doc/_sources/additional_classes.rst.txt +40 -0
  59. snappy/doc/_sources/bugs.rst.txt +14 -0
  60. snappy/doc/_sources/censuses.rst.txt +51 -0
  61. snappy/doc/_sources/credits.rst.txt +75 -0
  62. snappy/doc/_sources/development.rst.txt +259 -0
  63. snappy/doc/_sources/index.rst.txt +182 -0
  64. snappy/doc/_sources/installing.rst.txt +247 -0
  65. snappy/doc/_sources/manifold.rst.txt +6 -0
  66. snappy/doc/_sources/manifoldhp.rst.txt +46 -0
  67. snappy/doc/_sources/news.rst.txt +355 -0
  68. snappy/doc/_sources/other.rst.txt +25 -0
  69. snappy/doc/_sources/platonic_census.rst.txt +20 -0
  70. snappy/doc/_sources/plink.rst.txt +102 -0
  71. snappy/doc/_sources/ptolemy.rst.txt +66 -0
  72. snappy/doc/_sources/ptolemy_classes.rst.txt +42 -0
  73. snappy/doc/_sources/ptolemy_examples1.rst.txt +298 -0
  74. snappy/doc/_sources/ptolemy_examples2.rst.txt +363 -0
  75. snappy/doc/_sources/ptolemy_examples3.rst.txt +301 -0
  76. snappy/doc/_sources/ptolemy_examples4.rst.txt +61 -0
  77. snappy/doc/_sources/ptolemy_prelim.rst.txt +105 -0
  78. snappy/doc/_sources/screenshots.rst.txt +21 -0
  79. snappy/doc/_sources/snap.rst.txt +87 -0
  80. snappy/doc/_sources/snappy.rst.txt +28 -0
  81. snappy/doc/_sources/spherogram.rst.txt +103 -0
  82. snappy/doc/_sources/todo.rst.txt +47 -0
  83. snappy/doc/_sources/triangulation.rst.txt +11 -0
  84. snappy/doc/_sources/tutorial.rst.txt +49 -0
  85. snappy/doc/_sources/verify.rst.txt +210 -0
  86. snappy/doc/_sources/verify_internals.rst.txt +79 -0
  87. snappy/doc/_static/SnapPy-horizontal-128.png +0 -0
  88. snappy/doc/_static/SnapPy.ico +0 -0
  89. snappy/doc/_static/_sphinx_javascript_frameworks_compat.js +123 -0
  90. snappy/doc/_static/basic.css +925 -0
  91. snappy/doc/_static/css/badge_only.css +1 -0
  92. snappy/doc/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
  93. snappy/doc/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
  94. snappy/doc/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
  95. snappy/doc/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
  96. snappy/doc/_static/css/fonts/fontawesome-webfont.eot +0 -0
  97. snappy/doc/_static/css/fonts/fontawesome-webfont.svg +2671 -0
  98. snappy/doc/_static/css/fonts/fontawesome-webfont.ttf +0 -0
  99. snappy/doc/_static/css/fonts/fontawesome-webfont.woff +0 -0
  100. snappy/doc/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
  101. snappy/doc/_static/css/fonts/lato-bold-italic.woff +0 -0
  102. snappy/doc/_static/css/fonts/lato-bold-italic.woff2 +0 -0
  103. snappy/doc/_static/css/fonts/lato-bold.woff +0 -0
  104. snappy/doc/_static/css/fonts/lato-bold.woff2 +0 -0
  105. snappy/doc/_static/css/fonts/lato-normal-italic.woff +0 -0
  106. snappy/doc/_static/css/fonts/lato-normal-italic.woff2 +0 -0
  107. snappy/doc/_static/css/fonts/lato-normal.woff +0 -0
  108. snappy/doc/_static/css/fonts/lato-normal.woff2 +0 -0
  109. snappy/doc/_static/css/theme.css +4 -0
  110. snappy/doc/_static/doctools.js +156 -0
  111. snappy/doc/_static/documentation_options.js +13 -0
  112. snappy/doc/_static/file.png +0 -0
  113. snappy/doc/_static/fonts/Lato/lato-bold.eot +0 -0
  114. snappy/doc/_static/fonts/Lato/lato-bold.ttf +0 -0
  115. snappy/doc/_static/fonts/Lato/lato-bold.woff +0 -0
  116. snappy/doc/_static/fonts/Lato/lato-bold.woff2 +0 -0
  117. snappy/doc/_static/fonts/Lato/lato-bolditalic.eot +0 -0
  118. snappy/doc/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
  119. snappy/doc/_static/fonts/Lato/lato-bolditalic.woff +0 -0
  120. snappy/doc/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
  121. snappy/doc/_static/fonts/Lato/lato-italic.eot +0 -0
  122. snappy/doc/_static/fonts/Lato/lato-italic.ttf +0 -0
  123. snappy/doc/_static/fonts/Lato/lato-italic.woff +0 -0
  124. snappy/doc/_static/fonts/Lato/lato-italic.woff2 +0 -0
  125. snappy/doc/_static/fonts/Lato/lato-regular.eot +0 -0
  126. snappy/doc/_static/fonts/Lato/lato-regular.ttf +0 -0
  127. snappy/doc/_static/fonts/Lato/lato-regular.woff +0 -0
  128. snappy/doc/_static/fonts/Lato/lato-regular.woff2 +0 -0
  129. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
  130. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
  131. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
  132. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
  133. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
  134. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
  135. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
  136. snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
  137. snappy/doc/_static/jquery.js +2 -0
  138. snappy/doc/_static/js/badge_only.js +1 -0
  139. snappy/doc/_static/js/theme.js +1 -0
  140. snappy/doc/_static/js/versions.js +228 -0
  141. snappy/doc/_static/language_data.js +199 -0
  142. snappy/doc/_static/minus.png +0 -0
  143. snappy/doc/_static/plus.png +0 -0
  144. snappy/doc/_static/pygments.css +75 -0
  145. snappy/doc/_static/searchtools.js +620 -0
  146. snappy/doc/_static/snappy_furo.css +33 -0
  147. snappy/doc/_static/snappy_sphinx_rtd_theme.css +42 -0
  148. snappy/doc/_static/sphinx_highlight.js +154 -0
  149. snappy/doc/additional_classes.html +1500 -0
  150. snappy/doc/bugs.html +132 -0
  151. snappy/doc/censuses.html +427 -0
  152. snappy/doc/credits.html +181 -0
  153. snappy/doc/development.html +384 -0
  154. snappy/doc/genindex.html +1331 -0
  155. snappy/doc/index.html +262 -0
  156. snappy/doc/installing.html +346 -0
  157. snappy/doc/manifold.html +3452 -0
  158. snappy/doc/manifoldhp.html +180 -0
  159. snappy/doc/news.html +388 -0
  160. snappy/doc/objects.inv +0 -0
  161. snappy/doc/other.html +161 -0
  162. snappy/doc/platonic_census.html +375 -0
  163. snappy/doc/plink.html +210 -0
  164. snappy/doc/ptolemy.html +254 -0
  165. snappy/doc/ptolemy_classes.html +1144 -0
  166. snappy/doc/ptolemy_examples1.html +409 -0
  167. snappy/doc/ptolemy_examples2.html +471 -0
  168. snappy/doc/ptolemy_examples3.html +414 -0
  169. snappy/doc/ptolemy_examples4.html +195 -0
  170. snappy/doc/ptolemy_prelim.html +248 -0
  171. snappy/doc/py-modindex.html +165 -0
  172. snappy/doc/screenshots.html +141 -0
  173. snappy/doc/search.html +135 -0
  174. snappy/doc/searchindex.js +1 -0
  175. snappy/doc/snap.html +202 -0
  176. snappy/doc/snappy.html +181 -0
  177. snappy/doc/spherogram.html +1211 -0
  178. snappy/doc/todo.html +166 -0
  179. snappy/doc/triangulation.html +1584 -0
  180. snappy/doc/tutorial.html +159 -0
  181. snappy/doc/verify.html +330 -0
  182. snappy/doc/verify_internals.html +1235 -0
  183. snappy/drilling/__init__.py +456 -0
  184. snappy/drilling/barycentric.py +103 -0
  185. snappy/drilling/constants.py +5 -0
  186. snappy/drilling/crush.py +270 -0
  187. snappy/drilling/cusps.py +125 -0
  188. snappy/drilling/debug.py +242 -0
  189. snappy/drilling/epsilons.py +6 -0
  190. snappy/drilling/exceptions.py +55 -0
  191. snappy/drilling/moves.py +620 -0
  192. snappy/drilling/peripheral_curves.py +210 -0
  193. snappy/drilling/perturb.py +188 -0
  194. snappy/drilling/shorten.py +36 -0
  195. snappy/drilling/subdivide.py +274 -0
  196. snappy/drilling/test.py +23 -0
  197. snappy/drilling/test_cases.py +126 -0
  198. snappy/drilling/tracing.py +351 -0
  199. snappy/exceptions.py +26 -0
  200. snappy/export_stl.py +120 -0
  201. snappy/exterior_to_link/__init__.py +2 -0
  202. snappy/exterior_to_link/barycentric_geometry.py +463 -0
  203. snappy/exterior_to_link/exceptions.py +6 -0
  204. snappy/exterior_to_link/geodesic_map.json +14408 -0
  205. snappy/exterior_to_link/hyp_utils.py +112 -0
  206. snappy/exterior_to_link/link_projection.py +323 -0
  207. snappy/exterior_to_link/main.py +197 -0
  208. snappy/exterior_to_link/mcomplex_with_expansion.py +261 -0
  209. snappy/exterior_to_link/mcomplex_with_link.py +687 -0
  210. snappy/exterior_to_link/mcomplex_with_memory.py +162 -0
  211. snappy/exterior_to_link/pl_utils.py +491 -0
  212. snappy/exterior_to_link/put_in_S3.py +156 -0
  213. snappy/exterior_to_link/rational_linear_algebra.py +123 -0
  214. snappy/exterior_to_link/rational_linear_algebra_wrapped.py +135 -0
  215. snappy/exterior_to_link/simplify_to_base_tri.py +114 -0
  216. snappy/exterior_to_link/stored_moves.py +475 -0
  217. snappy/exterior_to_link/test.py +31 -0
  218. snappy/filedialog.py +28 -0
  219. snappy/geometric_structure/__init__.py +212 -0
  220. snappy/geometric_structure/cusp_neighborhood/__init__.py +3 -0
  221. snappy/geometric_structure/cusp_neighborhood/complex_cusp_cross_section.py +697 -0
  222. snappy/geometric_structure/cusp_neighborhood/cusp_cross_section_base.py +484 -0
  223. snappy/geometric_structure/cusp_neighborhood/exceptions.py +42 -0
  224. snappy/geometric_structure/cusp_neighborhood/real_cusp_cross_section.py +298 -0
  225. snappy/geometric_structure/cusp_neighborhood/tiles_for_cusp_neighborhood.py +159 -0
  226. snappy/geometric_structure/cusp_neighborhood/vertices.py +32 -0
  227. snappy/geometric_structure/geodesic/__init__.py +0 -0
  228. snappy/geometric_structure/geodesic/add_core_curves.py +152 -0
  229. snappy/geometric_structure/geodesic/avoid_core_curves.py +369 -0
  230. snappy/geometric_structure/geodesic/canonical_keys.py +52 -0
  231. snappy/geometric_structure/geodesic/check_away_from_core_curve.py +60 -0
  232. snappy/geometric_structure/geodesic/constants.py +6 -0
  233. snappy/geometric_structure/geodesic/exceptions.py +22 -0
  234. snappy/geometric_structure/geodesic/fixed_points.py +93 -0
  235. snappy/geometric_structure/geodesic/geodesic_start_point_info.py +435 -0
  236. snappy/geometric_structure/geodesic/graph_trace_helper.py +67 -0
  237. snappy/geometric_structure/geodesic/line.py +30 -0
  238. snappy/geometric_structure/geodesic/multiplicity.py +127 -0
  239. snappy/geometric_structure/geodesic/tiles_for_geodesic.py +101 -0
  240. snappy/geometric_structure/test.py +22 -0
  241. snappy/gui.py +121 -0
  242. snappy/horoviewer.py +443 -0
  243. snappy/hyperboloid/__init__.py +212 -0
  244. snappy/hyperboloid/distances.py +245 -0
  245. snappy/hyperboloid/horoball.py +19 -0
  246. snappy/hyperboloid/line.py +35 -0
  247. snappy/hyperboloid/point.py +9 -0
  248. snappy/hyperboloid/triangle.py +29 -0
  249. snappy/info_icon.gif +0 -0
  250. snappy/infowindow.py +65 -0
  251. snappy/isometry_signature.py +382 -0
  252. snappy/len_spec/__init__.py +596 -0
  253. snappy/len_spec/geodesic_info.py +110 -0
  254. snappy/len_spec/geodesic_key_info_dict.py +117 -0
  255. snappy/len_spec/geodesic_piece.py +143 -0
  256. snappy/len_spec/geometric_structure.py +182 -0
  257. snappy/len_spec/geometry.py +80 -0
  258. snappy/len_spec/length_spectrum_geodesic_info.py +170 -0
  259. snappy/len_spec/spine.py +206 -0
  260. snappy/len_spec/test.py +24 -0
  261. snappy/len_spec/test_cases.py +69 -0
  262. snappy/len_spec/tile.py +275 -0
  263. snappy/len_spec/word.py +86 -0
  264. snappy/manifolds/HTWKnots/alternating.gz +0 -0
  265. snappy/manifolds/HTWKnots/nonalternating.gz +0 -0
  266. snappy/manifolds/__init__.py +3 -0
  267. snappy/math_basics.py +176 -0
  268. snappy/matrix.py +525 -0
  269. snappy/number.py +657 -0
  270. snappy/numeric_output_checker.py +345 -0
  271. snappy/pari.py +41 -0
  272. snappy/phone_home.py +57 -0
  273. snappy/polyviewer.py +259 -0
  274. snappy/ptolemy/__init__.py +17 -0
  275. snappy/ptolemy/component.py +103 -0
  276. snappy/ptolemy/coordinates.py +2290 -0
  277. snappy/ptolemy/fieldExtensions.py +153 -0
  278. snappy/ptolemy/findLoops.py +473 -0
  279. snappy/ptolemy/geometricRep.py +59 -0
  280. snappy/ptolemy/homology.py +165 -0
  281. snappy/ptolemy/magma/default.magma_template +229 -0
  282. snappy/ptolemy/magma/radicalsOfPrimaryDecomposition.magma_template +79 -0
  283. snappy/ptolemy/manifoldMethods.py +395 -0
  284. snappy/ptolemy/matrix.py +350 -0
  285. snappy/ptolemy/numericalSolutionsToGroebnerBasis.py +113 -0
  286. snappy/ptolemy/polynomial.py +857 -0
  287. snappy/ptolemy/processComponents.py +173 -0
  288. snappy/ptolemy/processFileBase.py +247 -0
  289. snappy/ptolemy/processFileDispatch.py +46 -0
  290. snappy/ptolemy/processMagmaFile.py +392 -0
  291. snappy/ptolemy/processRurFile.py +150 -0
  292. snappy/ptolemy/ptolemyGeneralizedObstructionClass.py +102 -0
  293. snappy/ptolemy/ptolemyObstructionClass.py +64 -0
  294. snappy/ptolemy/ptolemyVariety.py +1029 -0
  295. snappy/ptolemy/ptolemyVarietyPrimeIdealGroebnerBasis.py +140 -0
  296. snappy/ptolemy/reginaWrapper.py +698 -0
  297. snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c0.magma_out.bz2 +0 -0
  298. snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c1.magma_out.bz2 +0 -0
  299. snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c2.magma_out.bz2 +0 -0
  300. snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c3.magma_out.bz2 +0 -0
  301. snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c4.magma_out.bz2 +0 -0
  302. snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c5.magma_out.bz2 +0 -0
  303. snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c6.magma_out.bz2 +0 -0
  304. snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c7.magma_out.bz2 +0 -0
  305. snappy/ptolemy/regina_testing_files_generalized/m003__sl3_c0.magma_out.bz2 +0 -0
  306. snappy/ptolemy/regina_testing_files_generalized/m003__sl3_c1.magma_out.bz2 +0 -0
  307. snappy/ptolemy/regina_testing_files_generalized/m015__sl2_c0.magma_out.bz2 +0 -0
  308. snappy/ptolemy/regina_testing_files_generalized/m015__sl2_c1.magma_out.bz2 +0 -0
  309. snappy/ptolemy/regina_testing_files_generalized/m015__sl3_c0.magma_out.bz2 +0 -0
  310. snappy/ptolemy/regina_testing_files_generalized/m015__sl3_c1.magma_out.bz2 +0 -0
  311. snappy/ptolemy/rur.py +545 -0
  312. snappy/ptolemy/solutionsToPrimeIdealGroebnerBasis.py +277 -0
  313. snappy/ptolemy/test.py +1126 -0
  314. snappy/ptolemy/testing_files/3_1__sl2_c0.magma_out.bz2 +0 -0
  315. snappy/ptolemy/testing_files/3_1__sl2_c1.magma_out.bz2 +0 -0
  316. snappy/ptolemy/testing_files/4_1__sl2_c0.magma_out.bz2 +0 -0
  317. snappy/ptolemy/testing_files/4_1__sl2_c1.magma_out.bz2 +0 -0
  318. snappy/ptolemy/testing_files/4_1__sl3_c0.magma_out.bz2 +0 -0
  319. snappy/ptolemy/testing_files/4_1__sl4_c0.magma_out.bz2 +0 -0
  320. snappy/ptolemy/testing_files/4_1__sl4_c1.magma_out.bz2 +0 -0
  321. snappy/ptolemy/testing_files/5_2__sl2_c0.magma_out.bz2 +0 -0
  322. snappy/ptolemy/testing_files/5_2__sl2_c1.magma_out.bz2 +0 -0
  323. snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c0.magma_out.bz2 +0 -0
  324. snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c1.magma_out.bz2 +0 -0
  325. snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c2.magma_out.bz2 +0 -0
  326. snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c3.magma_out.bz2 +0 -0
  327. snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c4.magma_out.bz2 +0 -0
  328. snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c5.magma_out.bz2 +0 -0
  329. snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c6.magma_out.bz2 +0 -0
  330. snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c7.magma_out.bz2 +0 -0
  331. snappy/ptolemy/testing_files/data/pgl2/OrientableCuspedCensus/03_tetrahedra/m019__sl2_c0.magma_out +95 -0
  332. snappy/ptolemy/testing_files/data/pgl2/OrientableCuspedCensus/03_tetrahedra/m019__sl2_c1.magma_out +95 -0
  333. snappy/ptolemy/testing_files/m015__sl3_c0.magma_out.bz2 +0 -0
  334. snappy/ptolemy/testing_files/m135__sl2_c0.magma_out.bz2 +0 -0
  335. snappy/ptolemy/testing_files/m135__sl2_c1.magma_out.bz2 +0 -0
  336. snappy/ptolemy/testing_files/m135__sl2_c2.magma_out.bz2 +0 -0
  337. snappy/ptolemy/testing_files/m135__sl2_c3.magma_out.bz2 +0 -0
  338. snappy/ptolemy/testing_files/m135__sl2_c4.magma_out.bz2 +0 -0
  339. snappy/ptolemy/testing_files/m135__sl2_c5.magma_out.bz2 +0 -0
  340. snappy/ptolemy/testing_files/m135__sl2_c6.magma_out.bz2 +0 -0
  341. snappy/ptolemy/testing_files/m135__sl2_c7.magma_out.bz2 +0 -0
  342. snappy/ptolemy/testing_files/s000__sl2_c0.magma_out.bz2 +0 -0
  343. snappy/ptolemy/testing_files/s000__sl2_c1.magma_out.bz2 +0 -0
  344. snappy/ptolemy/testing_files/t00000__sl2_c0.magma_out.bz2 +0 -0
  345. snappy/ptolemy/testing_files/t00000__sl2_c1.magma_out.bz2 +0 -0
  346. snappy/ptolemy/testing_files/v0000__sl2_c0.magma_out.bz2 +0 -0
  347. snappy/ptolemy/testing_files/v0000__sl2_c1.magma_out.bz2 +0 -0
  348. snappy/ptolemy/testing_files/v0000__sl2_c2.magma_out.bz2 +0 -0
  349. snappy/ptolemy/testing_files/v0000__sl2_c3.magma_out.bz2 +0 -0
  350. snappy/ptolemy/testing_files_generalized/m003__sl2_c0.magma_out.bz2 +0 -0
  351. snappy/ptolemy/testing_files_generalized/m003__sl2_c1.magma_out.bz2 +0 -0
  352. snappy/ptolemy/testing_files_generalized/m003__sl3_c0.magma_out.bz2 +0 -0
  353. snappy/ptolemy/testing_files_generalized/m003__sl3_c1.magma_out.bz2 +0 -0
  354. snappy/ptolemy/testing_files_generalized/m004__sl2_c0.magma_out.bz2 +0 -0
  355. snappy/ptolemy/testing_files_generalized/m004__sl2_c1.magma_out.bz2 +0 -0
  356. snappy/ptolemy/testing_files_generalized/m015__sl2_c1.magma_out.bz2 +0 -0
  357. snappy/ptolemy/testing_files_generalized/m015__sl3_c0.magma_out.bz2 +0 -0
  358. snappy/ptolemy/testing_files_rur/m052__sl3_c0.rur.bz2 +0 -0
  359. snappy/ptolemy/utilities.py +236 -0
  360. snappy/raytracing/__init__.py +64 -0
  361. snappy/raytracing/additional_horospheres.py +64 -0
  362. snappy/raytracing/additional_len_spec_choices.py +63 -0
  363. snappy/raytracing/cohomology_fractal.py +197 -0
  364. snappy/raytracing/eyeball.py +123 -0
  365. snappy/raytracing/finite_raytracing_data.py +237 -0
  366. snappy/raytracing/finite_viewer.py +590 -0
  367. snappy/raytracing/geodesic_tube_info.py +174 -0
  368. snappy/raytracing/geodesics.py +246 -0
  369. snappy/raytracing/geodesics_window.py +258 -0
  370. snappy/raytracing/gui_utilities.py +293 -0
  371. snappy/raytracing/hyperboloid_navigation.py +556 -0
  372. snappy/raytracing/hyperboloid_utilities.py +234 -0
  373. snappy/raytracing/ideal_raytracing_data.py +592 -0
  374. snappy/raytracing/inside_viewer.py +974 -0
  375. snappy/raytracing/pack.py +22 -0
  376. snappy/raytracing/raytracing_data.py +126 -0
  377. snappy/raytracing/raytracing_view.py +454 -0
  378. snappy/raytracing/shaders/Eye.png +0 -0
  379. snappy/raytracing/shaders/NonGeometric.png +0 -0
  380. snappy/raytracing/shaders/__init__.py +101 -0
  381. snappy/raytracing/shaders/fragment.glsl +1744 -0
  382. snappy/raytracing/test.py +29 -0
  383. snappy/raytracing/tooltip.py +146 -0
  384. snappy/raytracing/upper_halfspace_utilities.py +98 -0
  385. snappy/raytracing/view_scale_controller.py +98 -0
  386. snappy/raytracing/zoom_slider/__init__.py +263 -0
  387. snappy/raytracing/zoom_slider/inward.png +0 -0
  388. snappy/raytracing/zoom_slider/inward18.png +0 -0
  389. snappy/raytracing/zoom_slider/outward.png +0 -0
  390. snappy/raytracing/zoom_slider/outward18.png +0 -0
  391. snappy/raytracing/zoom_slider/test.py +20 -0
  392. snappy/sage_helper.py +117 -0
  393. snappy/settings.py +409 -0
  394. snappy/shell.py +53 -0
  395. snappy/snap/__init__.py +114 -0
  396. snappy/snap/character_varieties.py +375 -0
  397. snappy/snap/find_field.py +372 -0
  398. snappy/snap/fundamental_polyhedron.py +569 -0
  399. snappy/snap/generators.py +39 -0
  400. snappy/snap/interval_reps.py +81 -0
  401. snappy/snap/kernel_structures.py +128 -0
  402. snappy/snap/mcomplex_base.py +18 -0
  403. snappy/snap/nsagetools.py +702 -0
  404. snappy/snap/peripheral/__init__.py +1 -0
  405. snappy/snap/peripheral/dual_cellulation.py +219 -0
  406. snappy/snap/peripheral/link.py +127 -0
  407. snappy/snap/peripheral/peripheral.py +159 -0
  408. snappy/snap/peripheral/surface.py +522 -0
  409. snappy/snap/peripheral/test.py +35 -0
  410. snappy/snap/polished_reps.py +335 -0
  411. snappy/snap/shapes.py +152 -0
  412. snappy/snap/slice_obs_HKL.py +668 -0
  413. snappy/snap/t3mlite/__init__.py +2 -0
  414. snappy/snap/t3mlite/arrow.py +243 -0
  415. snappy/snap/t3mlite/corner.py +22 -0
  416. snappy/snap/t3mlite/edge.py +172 -0
  417. snappy/snap/t3mlite/face.py +37 -0
  418. snappy/snap/t3mlite/files.py +211 -0
  419. snappy/snap/t3mlite/homology.py +53 -0
  420. snappy/snap/t3mlite/linalg.py +419 -0
  421. snappy/snap/t3mlite/mcomplex.py +1499 -0
  422. snappy/snap/t3mlite/perm4.py +320 -0
  423. snappy/snap/t3mlite/setup.py +12 -0
  424. snappy/snap/t3mlite/simplex.py +199 -0
  425. snappy/snap/t3mlite/spun.py +297 -0
  426. snappy/snap/t3mlite/surface.py +519 -0
  427. snappy/snap/t3mlite/test.py +20 -0
  428. snappy/snap/t3mlite/test_vs_regina.py +86 -0
  429. snappy/snap/t3mlite/tetrahedron.py +109 -0
  430. snappy/snap/t3mlite/vertex.py +42 -0
  431. snappy/snap/test.py +134 -0
  432. snappy/snap/utilities.py +288 -0
  433. snappy/test.py +209 -0
  434. snappy/test_cases.py +263 -0
  435. snappy/testing.py +131 -0
  436. snappy/tiling/__init__.py +2 -0
  437. snappy/tiling/canonical_key_dict.py +59 -0
  438. snappy/tiling/dict_based_set.py +79 -0
  439. snappy/tiling/floor.py +49 -0
  440. snappy/tiling/hyperboloid_dict.py +54 -0
  441. snappy/tiling/iter_utils.py +78 -0
  442. snappy/tiling/lifted_tetrahedron.py +22 -0
  443. snappy/tiling/lifted_tetrahedron_set.py +54 -0
  444. snappy/tiling/real_hash_dict.py +164 -0
  445. snappy/tiling/test.py +23 -0
  446. snappy/tiling/tile.py +215 -0
  447. snappy/tiling/triangle.py +33 -0
  448. snappy/tkterminal.py +920 -0
  449. snappy/twister/__init__.py +20 -0
  450. snappy/twister/main.py +646 -0
  451. snappy/twister/surfaces/S_0_1 +3 -0
  452. snappy/twister/surfaces/S_0_2 +3 -0
  453. snappy/twister/surfaces/S_0_4 +7 -0
  454. snappy/twister/surfaces/S_0_4_Lantern +8 -0
  455. snappy/twister/surfaces/S_1 +3 -0
  456. snappy/twister/surfaces/S_1_1 +4 -0
  457. snappy/twister/surfaces/S_1_2 +5 -0
  458. snappy/twister/surfaces/S_1_2_5 +6 -0
  459. snappy/twister/surfaces/S_2 +6 -0
  460. snappy/twister/surfaces/S_2_1 +8 -0
  461. snappy/twister/surfaces/S_2_heeg +10 -0
  462. snappy/twister/surfaces/S_3 +8 -0
  463. snappy/twister/surfaces/S_3_1 +10 -0
  464. snappy/twister/surfaces/S_4_1 +12 -0
  465. snappy/twister/surfaces/S_5_1 +14 -0
  466. snappy/twister/surfaces/heeg_fig8 +9 -0
  467. snappy/twister/twister_core.cpython-310-darwin.so +0 -0
  468. snappy/upper_halfspace/__init__.py +146 -0
  469. snappy/upper_halfspace/ideal_point.py +26 -0
  470. snappy/verify/__init__.py +13 -0
  471. snappy/verify/canonical.py +542 -0
  472. snappy/verify/complex_volume/__init__.py +18 -0
  473. snappy/verify/complex_volume/adjust_torsion.py +86 -0
  474. snappy/verify/complex_volume/closed.py +168 -0
  475. snappy/verify/complex_volume/compute_ptolemys.py +90 -0
  476. snappy/verify/complex_volume/cusped.py +56 -0
  477. snappy/verify/complex_volume/extended_bloch.py +201 -0
  478. snappy/verify/cusp_translations.py +85 -0
  479. snappy/verify/edge_equations.py +80 -0
  480. snappy/verify/exceptions.py +254 -0
  481. snappy/verify/hyperbolicity.py +224 -0
  482. snappy/verify/interval_newton_shapes_engine.py +523 -0
  483. snappy/verify/interval_tree.py +400 -0
  484. snappy/verify/krawczyk_shapes_engine.py +518 -0
  485. snappy/verify/maximal_cusp_area_matrix/__init__.py +46 -0
  486. snappy/verify/maximal_cusp_area_matrix/cusp_tiling_engine.py +419 -0
  487. snappy/verify/maximal_cusp_area_matrix/cusp_translate_engine.py +153 -0
  488. snappy/verify/real_algebra.py +286 -0
  489. snappy/verify/shapes.py +25 -0
  490. snappy/verify/short_slopes.py +200 -0
  491. snappy/verify/square_extensions.py +1005 -0
  492. snappy/verify/test.py +78 -0
  493. snappy/verify/upper_halfspace/__init__.py +9 -0
  494. snappy/verify/upper_halfspace/extended_matrix.py +100 -0
  495. snappy/verify/upper_halfspace/finite_point.py +283 -0
  496. snappy/verify/upper_halfspace/ideal_point.py +426 -0
  497. snappy/verify/volume.py +128 -0
  498. snappy/version.py +2 -0
  499. snappy-3.2.dist-info/METADATA +58 -0
  500. snappy-3.2.dist-info/RECORD +503 -0
  501. snappy-3.2.dist-info/WHEEL +5 -0
  502. snappy-3.2.dist-info/entry_points.txt +2 -0
  503. snappy-3.2.dist-info/top_level.txt +28 -0
@@ -0,0 +1,1211 @@
1
+
2
+
3
+ <!DOCTYPE html>
4
+ <html class="writer-html5" lang="en" data-content_root="./">
5
+ <head>
6
+ <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
7
+
8
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
+ <title>Links: planar diagrams and invariants &mdash; SnapPy 3.2 documentation</title>
10
+ <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
11
+ <link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
12
+ <link rel="stylesheet" type="text/css" href="_static/snappy_sphinx_rtd_theme.css?v=1b8ec2a8" />
13
+
14
+
15
+ <link rel="shortcut icon" href="_static/SnapPy.ico"/>
16
+ <script src="_static/jquery.js?v=5d32c60e"></script>
17
+ <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
18
+ <script src="_static/documentation_options.js?v=828ea960"></script>
19
+ <script src="_static/doctools.js?v=9a2dae69"></script>
20
+ <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
21
+ <script src="_static/js/theme.js"></script>
22
+ <link rel="index" title="Index" href="genindex.html" />
23
+ <link rel="search" title="Search" href="search.html" />
24
+ <link rel="next" title="Number theory of hyperbolic 3-manifolds" href="snap.html" />
25
+ <link rel="prev" title="Using SnapPy’s link editor" href="plink.html" />
26
+ </head>
27
+
28
+ <body class="wy-body-for-nav">
29
+ <div class="wy-grid-for-nav">
30
+ <nav data-toggle="wy-nav-shift" class="wy-nav-side">
31
+ <div class="wy-side-scroll">
32
+ <div class="wy-side-nav-search" >
33
+
34
+
35
+
36
+ <a href="index.html" class="icon icon-home">
37
+ SnapPy
38
+ <img src="_static/SnapPy-horizontal-128.png" class="logo" alt="Logo"/>
39
+ </a>
40
+ <div role="search">
41
+ <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
42
+ <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
43
+ <input type="hidden" name="check_keywords" value="yes" />
44
+ <input type="hidden" name="area" value="default" />
45
+ </form>
46
+ </div>
47
+ </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
48
+ <ul class="current">
49
+ <li class="toctree-l1"><a class="reference internal" href="installing.html">Installing SnapPy</a></li>
50
+ <li class="toctree-l1"><a class="reference internal" href="screenshots.html">Screenshots: SnapPy in action</a></li>
51
+ <li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial</a></li>
52
+ <li class="toctree-l1"><a class="reference internal" href="snappy.html">The snappy module and its classes</a></li>
53
+ <li class="toctree-l1"><a class="reference internal" href="plink.html">Using SnapPy’s link editor</a></li>
54
+ <li class="toctree-l1 current"><a class="current reference internal" href="#">Links: planar diagrams and invariants</a><ul>
55
+ <li class="toctree-l2"><a class="reference internal" href="#tutorial">Tutorial</a></li>
56
+ <li class="toctree-l2"><a class="reference internal" href="#random-links">Random Links</a><ul>
57
+ <li class="toctree-l3"><a class="reference internal" href="#spherogram.random_link"><code class="docutils literal notranslate"><span class="pre">random_link()</span></code></a></li>
58
+ </ul>
59
+ </li>
60
+ <li class="toctree-l2"><a class="reference internal" href="#the-link-class">The Link class</a><ul>
61
+ <li class="toctree-l3"><a class="reference internal" href="#spherogram.Link"><code class="docutils literal notranslate"><span class="pre">Link</span></code></a><ul>
62
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.DT_code"><code class="docutils literal notranslate"><span class="pre">Link.DT_code()</span></code></a></li>
63
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.KLPProjection"><code class="docutils literal notranslate"><span class="pre">Link.KLPProjection()</span></code></a></li>
64
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.PD_code"><code class="docutils literal notranslate"><span class="pre">Link.PD_code()</span></code></a></li>
65
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.alexander_matrix"><code class="docutils literal notranslate"><span class="pre">Link.alexander_matrix()</span></code></a></li>
66
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.alexander_poly"><code class="docutils literal notranslate"><span class="pre">Link.alexander_poly()</span></code></a></li>
67
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.alexander_polynomial"><code class="docutils literal notranslate"><span class="pre">Link.alexander_polynomial()</span></code></a></li>
68
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.all_crossings_oriented"><code class="docutils literal notranslate"><span class="pre">Link.all_crossings_oriented()</span></code></a></li>
69
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.alternating"><code class="docutils literal notranslate"><span class="pre">Link.alternating()</span></code></a></li>
70
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.backtrack"><code class="docutils literal notranslate"><span class="pre">Link.backtrack()</span></code></a></li>
71
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.black_graph"><code class="docutils literal notranslate"><span class="pre">Link.black_graph()</span></code></a></li>
72
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.braid_word"><code class="docutils literal notranslate"><span class="pre">Link.braid_word()</span></code></a></li>
73
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.connected_sum"><code class="docutils literal notranslate"><span class="pre">Link.connected_sum()</span></code></a></li>
74
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.copy"><code class="docutils literal notranslate"><span class="pre">Link.copy()</span></code></a></li>
75
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.crossing_entries"><code class="docutils literal notranslate"><span class="pre">Link.crossing_entries()</span></code></a></li>
76
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.crossing_strands"><code class="docutils literal notranslate"><span class="pre">Link.crossing_strands()</span></code></a></li>
77
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.deconnect_sum"><code class="docutils literal notranslate"><span class="pre">Link.deconnect_sum()</span></code></a></li>
78
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.determinant"><code class="docutils literal notranslate"><span class="pre">Link.determinant()</span></code></a></li>
79
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.digraph"><code class="docutils literal notranslate"><span class="pre">Link.digraph()</span></code></a></li>
80
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.dual_graph"><code class="docutils literal notranslate"><span class="pre">Link.dual_graph()</span></code></a></li>
81
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.exterior"><code class="docutils literal notranslate"><span class="pre">Link.exterior()</span></code></a></li>
82
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.faces"><code class="docutils literal notranslate"><span class="pre">Link.faces()</span></code></a></li>
83
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.goeritz_matrix"><code class="docutils literal notranslate"><span class="pre">Link.goeritz_matrix()</span></code></a></li>
84
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.is_alternating"><code class="docutils literal notranslate"><span class="pre">Link.is_alternating()</span></code></a></li>
85
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.is_planar"><code class="docutils literal notranslate"><span class="pre">Link.is_planar()</span></code></a></li>
86
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.jones_polynomial"><code class="docutils literal notranslate"><span class="pre">Link.jones_polynomial()</span></code></a></li>
87
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.knot_floer_homology"><code class="docutils literal notranslate"><span class="pre">Link.knot_floer_homology()</span></code></a></li>
88
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.knot_group"><code class="docutils literal notranslate"><span class="pre">Link.knot_group()</span></code></a></li>
89
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.linking_matrix"><code class="docutils literal notranslate"><span class="pre">Link.linking_matrix()</span></code></a></li>
90
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.linking_number"><code class="docutils literal notranslate"><span class="pre">Link.linking_number()</span></code></a></li>
91
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.mirror"><code class="docutils literal notranslate"><span class="pre">Link.mirror()</span></code></a></li>
92
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.morse_diagram"><code class="docutils literal notranslate"><span class="pre">Link.morse_diagram()</span></code></a></li>
93
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.morse_number"><code class="docutils literal notranslate"><span class="pre">Link.morse_number()</span></code></a></li>
94
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.optimize_overcrossings"><code class="docutils literal notranslate"><span class="pre">Link.optimize_overcrossings()</span></code></a></li>
95
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.overstrands"><code class="docutils literal notranslate"><span class="pre">Link.overstrands()</span></code></a></li>
96
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.peer_code"><code class="docutils literal notranslate"><span class="pre">Link.peer_code()</span></code></a></li>
97
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.sage_link"><code class="docutils literal notranslate"><span class="pre">Link.sage_link()</span></code></a></li>
98
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.seifert_matrix"><code class="docutils literal notranslate"><span class="pre">Link.seifert_matrix()</span></code></a></li>
99
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.signature"><code class="docutils literal notranslate"><span class="pre">Link.signature()</span></code></a></li>
100
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.simplify"><code class="docutils literal notranslate"><span class="pre">Link.simplify()</span></code></a></li>
101
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.split_link_diagram"><code class="docutils literal notranslate"><span class="pre">Link.split_link_diagram()</span></code></a></li>
102
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.sublink"><code class="docutils literal notranslate"><span class="pre">Link.sublink()</span></code></a></li>
103
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.view"><code class="docutils literal notranslate"><span class="pre">Link.view()</span></code></a></li>
104
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.white_graph"><code class="docutils literal notranslate"><span class="pre">Link.white_graph()</span></code></a></li>
105
+ <li class="toctree-l4"><a class="reference internal" href="#spherogram.Link.writhe"><code class="docutils literal notranslate"><span class="pre">Link.writhe()</span></code></a></li>
106
+ </ul>
107
+ </li>
108
+ </ul>
109
+ </li>
110
+ <li class="toctree-l2"><a class="reference internal" href="#the-closedbraid-class">The ClosedBraid class</a><ul>
111
+ <li class="toctree-l3"><a class="reference internal" href="#spherogram.ClosedBraid"><code class="docutils literal notranslate"><span class="pre">ClosedBraid</span></code></a></li>
112
+ </ul>
113
+ </li>
114
+ </ul>
115
+ </li>
116
+ <li class="toctree-l1"><a class="reference internal" href="snap.html">Number theory of hyperbolic 3-manifolds</a></li>
117
+ <li class="toctree-l1"><a class="reference internal" href="verify.html">Verified computations</a></li>
118
+ <li class="toctree-l1"><a class="reference internal" href="other.html">Other components</a></li>
119
+ <li class="toctree-l1"><a class="reference internal" href="news.html">News</a></li>
120
+ <li class="toctree-l1"><a class="reference internal" href="credits.html">Credits</a></li>
121
+ <li class="toctree-l1"><a class="reference internal" href="bugs.html">Reporting bugs and other problems</a></li>
122
+ <li class="toctree-l1"><a class="reference internal" href="todo.html">To Do List</a></li>
123
+ <li class="toctree-l1"><a class="reference internal" href="development.html">Development Basics</a></li>
124
+ </ul>
125
+
126
+ </div>
127
+ </div>
128
+ </nav>
129
+
130
+ <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
131
+ <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
132
+ <a href="index.html">SnapPy</a>
133
+ </nav>
134
+
135
+ <div class="wy-nav-content">
136
+ <div class="rst-content">
137
+ <div role="navigation" aria-label="Page navigation">
138
+ <ul class="wy-breadcrumbs">
139
+ <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
140
+ <li class="breadcrumb-item active">Links: planar diagrams and invariants</li>
141
+ <li class="wy-breadcrumbs-aside">
142
+ </li>
143
+ </ul>
144
+ <hr/>
145
+ </div>
146
+ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
147
+ <div itemprop="articleBody">
148
+
149
+ <section id="links-planar-diagrams-and-invariants">
150
+ <span id="module-spherogram"></span><h1>Links: planar diagrams and invariants<a class="headerlink" href="#links-planar-diagrams-and-invariants" title="Link to this heading"></a></h1>
151
+ <section id="tutorial">
152
+ <h2>Tutorial<a class="headerlink" href="#tutorial" title="Link to this heading"></a></h2>
153
+ <p>SnapPy includes the <a class="reference external" href="https://github.com/3-manifolds/Spherogram">Spherogram</a> module which allows one to
154
+ create links programmatically. The graphical conventions used are
155
+ <a class="reference external" href="https://github.com/3-manifolds/Spherogram/raw/master/spherogram_src/links/doc.pdf">summarized here</a>.</p>
156
+ <p>First, here is the figure-8 knot assembled manually from four crossings, with conventions similar to those used by <a class="reference external" href="http://katlas.org/wiki/Planar_Diagrams">KnotTheory</a>:</p>
157
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">d</span> <span class="o">=</span> <span class="p">[</span><span class="n">Crossing</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="s1">&#39;abcd&#39;</span><span class="p">]</span>
158
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">a</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">a</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">a</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="n">c</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">d</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">b</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">b</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
159
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">b</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="n">d</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
160
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">c</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">d</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">d</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
161
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([</span><span class="n">a</span><span class="p">,</span><span class="n">b</span><span class="p">,</span><span class="n">c</span><span class="p">,</span><span class="n">d</span><span class="p">])</span>
162
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">E</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">exterior</span><span class="p">()</span>
163
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="o">.</span><span class="n">volume</span><span class="p">()</span>
164
+ <span class="go">2.029883212819</span>
165
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">Manifold</span><span class="p">(</span><span class="s1">&#39;4_1&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">is_isometric_to</span><span class="p">(</span><span class="n">E</span><span class="p">)</span>
166
+ <span class="go">True</span>
167
+ </pre></div>
168
+ </div>
169
+ <p>We can also give the same knot as a rational tangle:</p>
170
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">RationalTangle</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span><span class="o">.</span><span class="n">denominator_closure</span><span class="p">()</span>
171
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">PD_code</span><span class="p">()</span>
172
+ <span class="go">[[6, 3, 7, 4], [4, 2, 5, 1], [0, 6, 1, 5], [2, 7, 3, 0]]</span>
173
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">DT_code</span><span class="p">(</span><span class="kc">True</span><span class="p">)</span>
174
+ <span class="go">&#39;DT[dadCDAB]&#39;</span>
175
+ </pre></div>
176
+ </div>
177
+ <p>The natural algebra of tangles <a class="reference external" href="https://github.com/3-manifolds/Spherogram/raw/master/spherogram_src/links/doc.pdf">shown here</a>
178
+ all works. For instance, we can build the (-2, 3, 7) pretzel knot by
179
+ adding together three rational tangles:</p>
180
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">T</span> <span class="o">=</span> <span class="n">RationalTangle</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="n">RationalTangle</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span> <span class="o">+</span> <span class="n">RationalTangle</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">7</span><span class="p">)</span>
181
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">T</span><span class="o">.</span><span class="n">numerator_closure</span><span class="p">()</span>
182
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">Manifold</span><span class="p">(</span><span class="s1">&#39;m016&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">is_isometric_to</span><span class="p">(</span><span class="n">L</span><span class="o">.</span><span class="n">exterior</span><span class="p">())</span>
183
+ <span class="go">True</span>
184
+ </pre></div>
185
+ </div>
186
+ <p>To create the figure-8 knot as a closed braid, we first mash tangles
187
+ together horizontally using “|” to make the standard braid generators;
188
+ then multiplication in the braid group is just tangle multiplication:</p>
189
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">C</span><span class="p">,</span> <span class="n">Id</span> <span class="o">=</span> <span class="n">RationalTangle</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span> <span class="n">IdentityBraid</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
190
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">sigma_1</span> <span class="o">=</span> <span class="n">C</span> <span class="o">|</span> <span class="n">Id</span>
191
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">sigma_2_inverse</span> <span class="o">=</span> <span class="n">Id</span> <span class="o">|</span> <span class="o">-</span><span class="n">C</span>
192
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="o">*</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">denominator_closure</span><span class="p">()</span>
193
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">E</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">exterior</span><span class="p">()</span>
194
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">Manifold</span><span class="p">(</span><span class="s1">&#39;4_1&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">is_isometric_to</span><span class="p">(</span><span class="n">E</span><span class="p">)</span>
195
+ <span class="go">True</span>
196
+ </pre></div>
197
+ </div>
198
+ <p>Here’s the minimally-twisted five chain from Figure 2 of <a class="reference external" href="http://arxiv.org/abs/math.GT/0209214">this paper</a>:</p>
199
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">twisted_chain</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">k</span><span class="p">):</span>
200
+ <span class="n">T</span> <span class="o">=</span> <span class="n">RationalTangle</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
201
+ <span class="n">m</span> <span class="o">=</span> <span class="p">(</span><span class="n">n</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="o">//</span><span class="mi">2</span>
202
+ <span class="n">base</span> <span class="o">=</span> <span class="p">(</span><span class="n">m</span><span class="o">*</span><span class="p">[</span><span class="n">T</span><span class="p">,</span> <span class="o">-</span><span class="n">T</span><span class="p">])[:</span><span class="n">n</span><span class="p">]</span>
203
+ <span class="n">tangles</span> <span class="o">=</span> <span class="n">base</span> <span class="o">+</span> <span class="p">[</span><span class="n">RationalTangle</span><span class="p">(</span><span class="n">k</span><span class="p">)]</span>
204
+ <span class="k">return</span> <span class="nb">sum</span><span class="p">(</span><span class="n">tangles</span><span class="p">,</span> <span class="n">RationalTangle</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="p">)</span><span class="o">.</span><span class="n">bridge_closure</span><span class="p">()</span>
205
+
206
+ <span class="o">&gt;&gt;&gt;</span> <span class="n">L</span> <span class="o">=</span> <span class="n">twisted_chain</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
207
+ <span class="o">&gt;&gt;&gt;</span> <span class="n">L</span><span class="o">.</span><span class="n">exterior</span><span class="p">()</span><span class="o">.</span><span class="n">volume</span><span class="p">()</span>
208
+ <span class="mf">10.14941606410</span>
209
+ </pre></div>
210
+ </div>
211
+ <p>Spherogram includes ways to create very large random links, see below.
212
+ When used inside <a class="reference external" href="http://sagemath.org">Sage</a>, one can compute many
213
+ basic link invariants, including the Jones polynomial. See the
214
+ complete list of Link methods below.</p>
215
+ </section>
216
+ <section id="random-links">
217
+ <h2>Random Links<a class="headerlink" href="#random-links" title="Link to this heading"></a></h2>
218
+ <dl class="py function">
219
+ <dt class="sig sig-object py" id="spherogram.random_link">
220
+ <span class="sig-prename descclassname"><span class="pre">spherogram.</span></span><span class="sig-name descname"><span class="pre">random_link</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">crossings</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num_components</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'any'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initial_map_gives_link</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">alternating</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">consistent_twist_regions</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">simplify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'basic'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prime_decomposition</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">return_all_pieces</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_tries</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">100</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.random_link" title="Link to this definition"></a></dt>
221
+ <dd><p>Generates a random link from a model that starts with a random
222
+ 4-valent planar graph sampled with the uniform distribution by
223
+ Schaeffer’s <a class="reference external" href="http://www.lix.polytechnique.fr/~schaeffe/PagesWeb/PlanarMap/index-en.html">PlanarMap program.</a></p>
224
+ <p>The <code class="docutils literal notranslate"><span class="pre">crossings</span></code> argument specifies the number of vertices of the
225
+ initial planar graph G; the number of crossing in the returned knot
226
+ will typically be less. The meanings of the optional arguments are as
227
+ follows:</p>
228
+ <ol class="arabic">
229
+ <li><p><code class="docutils literal notranslate"><span class="pre">num_components</span></code>: The number of components of the returned link.
230
+ The link naively associated to G may have too few or too many
231
+ components. The former situation is resolved by picking another G,
232
+ and the latter by either</p>
233
+ <ol class="loweralpha simple">
234
+ <li><p>Taking the sublink consisting of the components with the largest
235
+ self-crossing numbers.</p></li>
236
+ <li><p>Resampling G until the desired number of components is achieved;
237
+ this can take a very long time as the expected number of
238
+ components associated to G grows linearly in the number of
239
+ vertices.</p></li>
240
+ </ol>
241
+ <p>When the argument <code class="docutils literal notranslate"><span class="pre">initial_map_gives_link</span></code> is <code class="docutils literal notranslate"><span class="pre">False</span></code> the
242
+ program does (a) and this is the default behavior. If you want (b)
243
+ set this argument to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
244
+ <p>To get the entire link associated to G, set <code class="docutils literal notranslate"><span class="pre">num_components</span></code> to
245
+ <code class="docutils literal notranslate"><span class="pre">`any`</span></code>, which is also the default.</p>
246
+ </li>
247
+ <li><p>The 4-valent vertices of G are turned into crossings by flipping a
248
+ fair coin. If you want the unique alternating diagram associated to
249
+ G, pass <code class="docutils literal notranslate"><span class="pre">alternating=True</span></code>. If you want there to be no
250
+ obvious Type II Reidemeister moves, pass
251
+ <code class="docutils literal notranslate"><span class="pre">consistent_twist_regions=True</span></code>.</p></li>
252
+ <li><p><code class="docutils literal notranslate"><span class="pre">simplify</span></code>: Whether and how to try to reduce the number of
253
+ crossings of the link via Reidemeister moves using the method
254
+ <code class="docutils literal notranslate"><span class="pre">Link.simplify</span></code>. For no simplification, set <code class="docutils literal notranslate"><span class="pre">simplify=None</span></code>;
255
+ otherwise set <code class="docutils literal notranslate"><span class="pre">simplify</span></code> to be the appropriate mode for
256
+ <code class="docutils literal notranslate"><span class="pre">Link.simplify</span></code>, for example <code class="docutils literal notranslate"><span class="pre">basic</span></code> (the default), <code class="docutils literal notranslate"><span class="pre">level</span></code>,
257
+ or <code class="docutils literal notranslate"><span class="pre">global</span></code>.</p></li>
258
+ <li><p><code class="docutils literal notranslate"><span class="pre">prime_decomposition</span></code>: The initial link generated from G may not
259
+ be prime (and typically isn’t if <code class="docutils literal notranslate"><span class="pre">initial_map_gives_link</span></code> is
260
+ <code class="docutils literal notranslate"><span class="pre">False</span></code>). When set (the default), the program undoes any connect
261
+ sums that are “diagrammatic obvious”, simplifies the result, and
262
+ repeats until pieces are “diagrammatically prime”. If
263
+ <code class="docutils literal notranslate"><span class="pre">return_all_pieces</span></code> is <code class="docutils literal notranslate"><span class="pre">False</span></code> (the default) then only the
264
+ largest (apparently) prime component is returned; otherwise all
265
+ summands are returned as a list.</p>
266
+ <p>Warning: If <code class="docutils literal notranslate"><span class="pre">prime_decomposition=True</span></code> and
267
+ <code class="docutils literal notranslate"><span class="pre">return_all_pieces=False</span></code>, then the link returned may have
268
+ fewer components than requested. This is because a prime piece
269
+ can have fewer components than the link as a whole.</p>
270
+ </li>
271
+ </ol>
272
+ <p>Some examples:</p>
273
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">random_link</span><span class="p">(</span><span class="mi">25</span><span class="p">,</span> <span class="n">num_components</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">initial_map_gives_link</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">alternating</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
274
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
275
+ <span class="go">&lt;Link: 1 comp; 25 cross&gt;</span>
276
+ </pre></div>
277
+ </div>
278
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">=</span> <span class="n">random_link</span><span class="p">(</span><span class="mi">30</span><span class="p">,</span> <span class="n">consistent_twist_regions</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">simplify</span> <span class="o">=</span> <span class="s1">&#39;global&#39;</span><span class="p">)</span>
279
+ <span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">random_link</span><span class="p">(</span><span class="mi">30</span><span class="p">,</span> <span class="n">return_all_pieces</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span> <span class="nb">list</span><span class="p">)</span>
280
+ <span class="go">True</span>
281
+ </pre></div>
282
+ </div>
283
+ </dd></dl>
284
+
285
+ </section>
286
+ <section id="the-link-class">
287
+ <h2>The Link class<a class="headerlink" href="#the-link-class" title="Link to this heading"></a></h2>
288
+ <dl class="py class">
289
+ <dt class="sig sig-object py" id="spherogram.Link">
290
+ <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">spherogram.</span></span><span class="sig-name descname"><span class="pre">Link</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">crossings</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">braid_closure</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">check_planarity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">build</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link" title="Link to this definition"></a></dt>
291
+ <dd><p>Links are made from Crossings. The general model is that of the PD
292
+ diagrams used in <a class="reference external" href="http://katlas.org/wiki/Planar_Diagrams">KnotTheory</a>.</p>
293
+ <p>See the file “doc.pdf” for the conventions, which can be accessed
294
+ via “spherogram.pdf_docs()”, and the <a class="reference external" href="http://www.math.uic.edu/t3m/SnapPy/spherogram.html">Spherogram tutorial</a>
295
+ for some examples of creating links.</p>
296
+ <p>Here are two ways of creating the figure-8 knot, first via a PD code</p>
297
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K1</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([[</span><span class="mi">8</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">4</span><span class="p">],[</span><span class="mi">2</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">5</span><span class="p">],[</span><span class="mi">6</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">1</span><span class="p">],[</span><span class="mi">4</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">8</span><span class="p">]])</span>
298
+ </pre></div>
299
+ </div>
300
+ <p>and by directly gluing up Crossings:</p>
301
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">d</span> <span class="o">=</span> <span class="p">[</span><span class="n">Crossing</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="s1">&#39;abcd&#39;</span><span class="p">]</span>
302
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">a</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">a</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">a</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="n">c</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">d</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">b</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">b</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
303
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">b</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="n">d</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
304
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">c</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">d</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">d</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
305
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K2</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([</span><span class="n">a</span><span class="p">,</span><span class="n">b</span><span class="p">,</span><span class="n">c</span><span class="p">,</span><span class="n">d</span><span class="p">])</span>
306
+ </pre></div>
307
+ </div>
308
+ <p>Some families of named links are available, such a torus knots</p>
309
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Link</span><span class="p">(</span><span class="s1">&#39;T(4, 2)&#39;</span><span class="p">)</span>
310
+ <span class="go">&lt;Link: 2 comp; 6 cross&gt;</span>
311
+ </pre></div>
312
+ </div>
313
+ <p>You can also construct a link by taking the closure of a braid.</p>
314
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Link</span><span class="p">(</span><span class="n">braid_closure</span><span class="o">=</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">])</span>
315
+ <span class="go">&lt;Link: 1 comp; 4 cross&gt;</span>
316
+ </pre></div>
317
+ </div>
318
+ <p>WARNING: In SnapPy 3.0, the convention for braids changed. See
319
+ the “doc.pdf” file for details.</p>
320
+ <p>DT codes, in their many forms, are also accepted:</p>
321
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L1</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;DT: [(4,6,2)]&#39;</span><span class="p">)</span>
322
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L2</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;DT: cacbca.001&#39;</span><span class="p">)</span>
323
+ </pre></div>
324
+ </div>
325
+ <p>You can also access the links from the Rolfsen and
326
+ Hoste-Thistlethwaite tables by name.</p>
327
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Link</span><span class="p">(</span><span class="s1">&#39;8_20&#39;</span><span class="p">)</span>
328
+ <span class="go">&lt;Link 8_20: 1 comp; 8 cross&gt;</span>
329
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K12a123&#39;</span><span class="p">)</span>
330
+ <span class="go">&lt;Link K12a123: 1 comp; 12 cross&gt;</span>
331
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">Link</span><span class="p">(</span><span class="s1">&#39;L12n123&#39;</span><span class="p">)</span>
332
+ <span class="go">&lt;Link L12n123: 2 comp; 12 cross&gt;</span>
333
+ </pre></div>
334
+ </div>
335
+ <p>You can also convert to and from SageMath braid and link types,
336
+ see the documentation for the “sage_link” method for details.</p>
337
+ <dl class="py method">
338
+ <dt class="sig sig-object py" id="spherogram.Link.DT_code">
339
+ <span class="sig-name descname"><span class="pre">DT_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">DT_alpha</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flips</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.DT_code" title="Link to this definition"></a></dt>
340
+ <dd><p>The Dowker-Thistlethwaite code for the link in either numerical or
341
+ alphabetical form.</p>
342
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K8n1&#39;</span><span class="p">)</span>
343
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">DT_code</span><span class="p">(</span><span class="n">DT_alpha</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">flips</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
344
+ <span class="go">&#39;DT[hahCHeAgbdf.11101000]&#39;</span>
345
+ </pre></div>
346
+ </div>
347
+ <p>In the alphabetical form, the first letter determines the
348
+ number C of crossings, the second the number L of link
349
+ components, and the next L gives the number of crossings on
350
+ each component; subsequent letters describe each crossing with
351
+ ‘a’ being 2, ‘A’ being -2, etc.</p>
352
+ </dd></dl>
353
+
354
+ <dl class="py method">
355
+ <dt class="sig sig-object py" id="spherogram.Link.KLPProjection">
356
+ <span class="sig-name descname"><span class="pre">KLPProjection</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.KLPProjection" title="Link to this definition"></a></dt>
357
+ <dd></dd></dl>
358
+
359
+ <dl class="py method">
360
+ <dt class="sig sig-object py" id="spherogram.Link.PD_code">
361
+ <span class="sig-name descname"><span class="pre">PD_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">KnotTheory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">min_strand_index</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.PD_code" title="Link to this definition"></a></dt>
362
+ <dd><p>The planar diagram code for the link. When reconstructing a link
363
+ from its PD code, it will not change the ordering of the
364
+ components, and will preserve their orientation except
365
+ possibly for components with only two crossings.</p>
366
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;L13n11308&#39;</span><span class="p">)</span>
367
+ <span class="gp">&gt;&gt;&gt; </span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">L</span><span class="o">.</span><span class="n">link_components</span><span class="p">]</span>
368
+ <span class="go">[4, 4, 4, 6, 8]</span>
369
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L_copy</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="n">L</span><span class="o">.</span><span class="n">PD_code</span><span class="p">())</span>
370
+ <span class="gp">&gt;&gt;&gt; </span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">L_copy</span><span class="o">.</span><span class="n">link_components</span><span class="p">]</span>
371
+ <span class="go">[4, 4, 4, 6, 8]</span>
372
+ </pre></div>
373
+ </div>
374
+ </dd></dl>
375
+
376
+ <dl class="py method">
377
+ <dt class="sig sig-object py" id="spherogram.Link.alexander_matrix">
378
+ <span class="sig-name descname"><span class="pre">alexander_matrix</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mv</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.alexander_matrix" title="Link to this definition"></a></dt>
379
+ <dd><p>Returns the Alexander matrix of the link:</p>
380
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;3_1&#39;</span><span class="p">)</span>
381
+ <span class="n">sage</span><span class="p">:</span> <span class="n">A</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">alexander_matrix</span><span class="p">()</span>
382
+ <span class="n">sage</span><span class="p">:</span> <span class="n">A</span> <span class="c1"># doctest: +SKIP</span>
383
+ <span class="p">([</span> <span class="o">-</span><span class="mi">1</span> <span class="n">t</span> <span class="mi">1</span> <span class="o">-</span> <span class="n">t</span><span class="p">]</span>
384
+ <span class="p">[</span><span class="mi">1</span> <span class="o">-</span> <span class="n">t</span> <span class="o">-</span><span class="mi">1</span> <span class="n">t</span><span class="p">]</span>
385
+ <span class="p">[</span> <span class="n">t</span> <span class="mi">1</span> <span class="o">-</span> <span class="n">t</span> <span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="n">t</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">t</span><span class="p">])</span>
386
+
387
+ <span class="n">sage</span><span class="p">:</span> <span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([(</span><span class="mi">4</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">2</span><span class="p">),(</span><span class="mi">1</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">)])</span>
388
+ <span class="n">sage</span><span class="p">:</span> <span class="n">A</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">alexander_matrix</span><span class="p">()</span>
389
+ <span class="n">sage</span><span class="p">:</span> <span class="n">A</span> <span class="c1"># doctest: +SKIP</span>
390
+ <span class="p">([</span> <span class="o">-</span><span class="mi">1</span> <span class="o">+</span> <span class="n">t1</span><span class="o">^-</span><span class="mi">1</span> <span class="n">t1</span><span class="o">^-</span><span class="mi">1</span><span class="o">*</span><span class="n">t2</span> <span class="o">-</span> <span class="n">t1</span><span class="o">^-</span><span class="mi">1</span><span class="p">]</span>
391
+ <span class="p">[</span><span class="n">t1</span><span class="o">*</span><span class="n">t2</span><span class="o">^-</span><span class="mi">1</span> <span class="o">-</span> <span class="n">t2</span><span class="o">^-</span><span class="mi">1</span> <span class="o">-</span><span class="mi">1</span> <span class="o">+</span> <span class="n">t2</span><span class="o">^-</span><span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="n">t2</span><span class="p">,</span> <span class="n">t1</span><span class="p">])</span>
392
+ </pre></div>
393
+ </div>
394
+ </dd></dl>
395
+
396
+ <dl class="py method">
397
+ <dt class="sig sig-object py" id="spherogram.Link.alexander_poly">
398
+ <span class="sig-name descname"><span class="pre">alexander_poly</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.alexander_poly" title="Link to this definition"></a></dt>
399
+ <dd><p>Please use the “alexander_polynomial” method instead.</p>
400
+ </dd></dl>
401
+
402
+ <dl class="py method">
403
+ <dt class="sig sig-object py" id="spherogram.Link.alexander_polynomial">
404
+ <span class="sig-name descname"><span class="pre">alexander_polynomial</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">multivar</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">v</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'no'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">method</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">norm</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">factored</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.alexander_polynomial" title="Link to this definition"></a></dt>
405
+ <dd><p>Calculates the Alexander polynomial of the link.</p>
406
+ <p>For links with one component,
407
+ can evaluate the alexander polynomial at v:</p>
408
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;4_1&#39;</span><span class="p">)</span>
409
+ <span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">.</span><span class="n">alexander_polynomial</span><span class="p">()</span>
410
+ <span class="n">t</span><span class="o">^</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">3</span><span class="o">*</span><span class="n">t</span> <span class="o">+</span> <span class="mi">1</span>
411
+ <span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">.</span><span class="n">alexander_polynomial</span><span class="p">(</span><span class="n">v</span><span class="o">=</span><span class="p">[</span><span class="mi">4</span><span class="p">])</span>
412
+ <span class="mi">5</span>
413
+
414
+ <span class="n">sage</span><span class="p">:</span> <span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;L7n1&#39;</span><span class="p">)</span>
415
+ <span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">.</span><span class="n">alexander_polynomial</span><span class="p">(</span><span class="n">norm</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
416
+ <span class="n">t1</span><span class="o">^-</span><span class="mi">1</span><span class="o">*</span><span class="n">t2</span><span class="o">^-</span><span class="mi">1</span> <span class="o">+</span> <span class="n">t1</span><span class="o">^-</span><span class="mi">2</span><span class="o">*</span><span class="n">t2</span><span class="o">^-</span><span class="mi">4</span>
417
+ </pre></div>
418
+ </div>
419
+ <p>The default algorithm for <em>knots</em> is Bar-Natan’s super-fast
420
+ tangle-based algorithm. For links, we apply Fox calculus to a
421
+ Wirtinger presentation for the link:</p>
422
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K13n123&#39;</span><span class="p">)</span>
423
+ <span class="n">sage</span><span class="p">:</span> <span class="n">L</span><span class="o">.</span><span class="n">alexander_polynomial</span><span class="p">()</span> <span class="o">==</span> <span class="n">L</span><span class="o">.</span><span class="n">alexander_polynomial</span><span class="p">(</span><span class="n">method</span><span class="o">=</span><span class="s1">&#39;wirtinger&#39;</span><span class="p">)</span>
424
+ <span class="kc">True</span>
425
+ </pre></div>
426
+ </div>
427
+ </dd></dl>
428
+
429
+ <dl class="py method">
430
+ <dt class="sig sig-object py" id="spherogram.Link.all_crossings_oriented">
431
+ <span class="sig-name descname"><span class="pre">all_crossings_oriented</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.all_crossings_oriented" title="Link to this definition"></a></dt>
432
+ <dd></dd></dl>
433
+
434
+ <dl class="py method">
435
+ <dt class="sig sig-object py" id="spherogram.Link.alternating">
436
+ <span class="sig-name descname"><span class="pre">alternating</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.alternating" title="Link to this definition"></a></dt>
437
+ <dd><p>Returns the alternating link with the same planar graph. No attempt
438
+ is made to preserve the order of the link components or ensure
439
+ that the DT code of the result has all positive entries (as
440
+ opposed to all negative).</p>
441
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;L14n12345&#39;</span><span class="p">)</span>
442
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">alternating</span><span class="p">()</span>
443
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">exterior</span><span class="p">()</span><span class="o">.</span><span class="n">identify</span><span class="p">()</span>
444
+ <span class="go">[L14a5150(0,0)(0,0)]</span>
445
+ </pre></div>
446
+ </div>
447
+ </dd></dl>
448
+
449
+ <dl class="py method">
450
+ <dt class="sig sig-object py" id="spherogram.Link.backtrack">
451
+ <span class="sig-name descname"><span class="pre">backtrack</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">steps</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">10</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prob_type_1</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prob_type_2</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.3</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.backtrack" title="Link to this definition"></a></dt>
452
+ <dd><p>Performs a sequence of Reidemeister moves which increase or maintain
453
+ the number of crossings in a diagram. The number of such
454
+ moves is the parameter steps. The diagram is modified in place.</p>
455
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;L14a7689&#39;</span><span class="p">)</span>
456
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
457
+ <span class="go">&lt;Link L14a7689: 2 comp; 14 cross&gt;</span>
458
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">backtrack</span><span class="p">(</span><span class="n">steps</span> <span class="o">=</span> <span class="mi">5</span><span class="p">,</span> <span class="n">prob_type_1</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="n">prob_type_2</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span>
459
+ <span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">K</span><span class="o">.</span><span class="n">crossings</span><span class="p">)</span>
460
+ <span class="go">19</span>
461
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">backtrack</span><span class="p">(</span><span class="n">steps</span> <span class="o">=</span> <span class="mi">5</span><span class="p">,</span> <span class="n">prob_type_1</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">prob_type_2</span> <span class="o">=</span> <span class="mi">1</span><span class="p">)</span>
462
+ <span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">K</span><span class="o">.</span><span class="n">crossings</span><span class="p">)</span>
463
+ <span class="go">29</span>
464
+ </pre></div>
465
+ </div>
466
+ </dd></dl>
467
+
468
+ <dl class="py method">
469
+ <dt class="sig sig-object py" id="spherogram.Link.black_graph">
470
+ <span class="sig-name descname"><span class="pre">black_graph</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.black_graph" title="Link to this definition"></a></dt>
471
+ <dd><p>Returns the black graph of K.</p>
472
+ <p>If the black graph is disconnected (which can only happen for
473
+ a split link diagram), returns one connected component. The
474
+ edges are labeled by the crossings they correspond to.</p>
475
+ <p>Example:</p>
476
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">=</span><span class="n">Link</span><span class="p">(</span><span class="s1">&#39;5_1&#39;</span><span class="p">)</span>
477
+ <span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">.</span><span class="n">black_graph</span><span class="p">()</span>
478
+ <span class="n">Subgraph</span> <span class="n">of</span> <span class="p">():</span> <span class="n">Multi</span><span class="o">-</span><span class="n">graph</span> <span class="n">on</span> <span class="mi">2</span> <span class="n">vertices</span>
479
+ </pre></div>
480
+ </div>
481
+ <p>WARNING: While there is also a “white_graph” method, it need
482
+ not be the case that these two graphs are complementary in the
483
+ expected way.</p>
484
+ </dd></dl>
485
+
486
+ <dl class="py method">
487
+ <dt class="sig sig-object py" id="spherogram.Link.braid_word">
488
+ <span class="sig-name descname"><span class="pre">braid_word</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">as_sage_braid</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.braid_word" title="Link to this definition"></a></dt>
489
+ <dd><p>Return a list of integers which defines a braid word whose closure is the
490
+ given link. The natural numbers 1, 2, 3, etc are the generators and the
491
+ negatives are the inverses.</p>
492
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K6a2&#39;</span><span class="p">)</span>
493
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">word</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">braid_word</span><span class="p">()</span>
494
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="n">braid_closure</span><span class="o">=</span><span class="n">word</span><span class="p">)</span>
495
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">exterior</span><span class="p">()</span><span class="o">.</span><span class="n">identify</span><span class="p">()</span>
496
+ <span class="go">[m289(0,0), 6_2(0,0), K5_19(0,0), K6a2(0,0)]</span>
497
+ </pre></div>
498
+ </div>
499
+ <p>Within Sage, you can get the answer as an element of the
500
+ appropriate BraidGroup and also check our earlier work:</p>
501
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K6a2&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">braid_word</span><span class="p">(</span><span class="n">as_sage_braid</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
502
+ <span class="p">(</span><span class="n">s0</span><span class="o">*</span><span class="n">s1</span><span class="o">^-</span><span class="mi">1</span><span class="p">)</span><span class="o">^</span><span class="mi">2</span><span class="o">*</span><span class="n">s0</span><span class="o">^</span><span class="mi">2</span>
503
+ <span class="n">sage</span><span class="p">:</span> <span class="n">L</span><span class="o">.</span><span class="n">signature</span><span class="p">(),</span> <span class="n">B</span><span class="o">.</span><span class="n">signature</span><span class="p">()</span>
504
+ <span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
505
+ </pre></div>
506
+ </div>
507
+ <p>Implementation follows P. Vogel, “Representation of links by
508
+ braids, a new algorithm”.</p>
509
+ </dd></dl>
510
+
511
+ <dl class="py method">
512
+ <dt class="sig sig-object py" id="spherogram.Link.connected_sum">
513
+ <span class="sig-name descname"><span class="pre">connected_sum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other_knot</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.connected_sum" title="Link to this definition"></a></dt>
514
+ <dd><p>Returns the connected sum of two knots.</p>
515
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">fig8</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">1</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">6</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">7</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">5</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">1</span><span class="p">)]</span>
516
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="n">fig8</span><span class="p">)</span>
517
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">connected_sum</span><span class="p">(</span><span class="n">K</span><span class="p">)</span>
518
+ <span class="go">&lt;Link: 1 comp; 8 cross&gt;</span>
519
+ </pre></div>
520
+ </div>
521
+ </dd></dl>
522
+
523
+ <dl class="py method">
524
+ <dt class="sig sig-object py" id="spherogram.Link.copy">
525
+ <span class="sig-name descname"><span class="pre">copy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">recursively</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.copy" title="Link to this definition"></a></dt>
526
+ <dd><p>Returns a copy of the link.</p>
527
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;L14n467&#39;</span><span class="p">)</span>
528
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">copy</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">copy</span><span class="p">();</span> <span class="n">copy</span>
529
+ <span class="go">&lt;Link L14n467: 2 comp; 14 cross&gt;</span>
530
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">PD_code</span><span class="p">()</span> <span class="o">==</span> <span class="n">copy</span><span class="o">.</span><span class="n">PD_code</span><span class="p">()</span>
531
+ <span class="go">True</span>
532
+ </pre></div>
533
+ </div>
534
+ </dd></dl>
535
+
536
+ <dl class="py method">
537
+ <dt class="sig sig-object py" id="spherogram.Link.crossing_entries">
538
+ <span class="sig-name descname"><span class="pre">crossing_entries</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.crossing_entries" title="Link to this definition"></a></dt>
539
+ <dd></dd></dl>
540
+
541
+ <dl class="py method">
542
+ <dt class="sig sig-object py" id="spherogram.Link.crossing_strands">
543
+ <span class="sig-name descname"><span class="pre">crossing_strands</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.crossing_strands" title="Link to this definition"></a></dt>
544
+ <dd></dd></dl>
545
+
546
+ <dl class="py method">
547
+ <dt class="sig sig-object py" id="spherogram.Link.deconnect_sum">
548
+ <span class="sig-name descname"><span class="pre">deconnect_sum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">destroy_original</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.deconnect_sum" title="Link to this definition"></a></dt>
549
+ <dd><p>Undoes all connect sums that are diagramatically obvious,
550
+ i.e. those where there is a circle which meets the projection
551
+ in two points.</p>
552
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K5a1</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">9</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">6</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">9</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">8</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">4</span><span class="p">),</span> <span class="p">(</span><span class="mi">7</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">0</span><span class="p">)]</span>
553
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="n">K5a1</span><span class="p">)</span>
554
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">connected_sum</span><span class="p">(</span><span class="n">K</span><span class="p">);</span> <span class="n">L</span>
555
+ <span class="go">&lt;Link: 1 comp; 10 cross&gt;</span>
556
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">deconnect_sum</span><span class="p">()</span>
557
+ <span class="go">[&lt;Link: 1 comp; 5 cross&gt;, &lt;Link: 1 comp; 5 cross&gt;]</span>
558
+ </pre></div>
559
+ </div>
560
+ </dd></dl>
561
+
562
+ <dl class="py method">
563
+ <dt class="sig sig-object py" id="spherogram.Link.determinant">
564
+ <span class="sig-name descname"><span class="pre">determinant</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'goeritz'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.determinant" title="Link to this definition"></a></dt>
565
+ <dd><p>Returns the determinant of the link, a non-negative integer.</p>
566
+ <p>Possible methods are ‘wirt’, using the Wirtinger presentation; ‘goeritz’,
567
+ using the Goeritz matrix, and ‘color’, using the ‘colorability matrix’, or
568
+ anything else, to compute the Alexander polynomial at -1. Example:</p>
569
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span> <span class="p">[(</span><span class="mi">4</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">2</span><span class="p">),(</span><span class="mi">6</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">3</span><span class="p">),(</span><span class="mi">8</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">6</span><span class="p">),(</span><span class="mi">2</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">7</span><span class="p">)]</span> <span class="p">)</span> <span class="c1"># Figure 8 knot</span>
570
+ <span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">.</span><span class="n">determinant</span><span class="p">()</span>
571
+ <span class="mi">5</span>
572
+ </pre></div>
573
+ </div>
574
+ </dd></dl>
575
+
576
+ <dl class="py method">
577
+ <dt class="sig sig-object py" id="spherogram.Link.digraph">
578
+ <span class="sig-name descname"><span class="pre">digraph</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.digraph" title="Link to this definition"></a></dt>
579
+ <dd><p>The underlying directed graph for the link diagram.</p>
580
+ </dd></dl>
581
+
582
+ <dl class="py method">
583
+ <dt class="sig sig-object py" id="spherogram.Link.dual_graph">
584
+ <span class="sig-name descname"><span class="pre">dual_graph</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.dual_graph" title="Link to this definition"></a></dt>
585
+ <dd><p>The dual graph to a link diagram D, whose vertices correspond to
586
+ complementary regions (faces) of D and whose edges are dual to the
587
+ edges of D.</p>
588
+ </dd></dl>
589
+
590
+ <dl class="py method">
591
+ <dt class="sig sig-object py" id="spherogram.Link.exterior">
592
+ <span class="sig-name descname"><span class="pre">exterior</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">with_hyperbolic_structure</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">remove_finite_vertices</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.exterior" title="Link to this definition"></a></dt>
593
+ <dd><p>The exterior or complement of the link L, that is, S^3 minus L.</p>
594
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;4_1&#39;</span><span class="p">)</span>
595
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">exterior</span><span class="p">()</span>
596
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">volume</span><span class="p">()</span>
597
+ <span class="go">2.02988321</span>
598
+ </pre></div>
599
+ </div>
600
+ <p>By default, SnapPy will try to find a hyperbolic structure on the
601
+ exterior. To return a Triangulation instead of a Manifold, set the
602
+ flag with_hyperbolic_structure to False. If you want to get the
603
+ intermediate triangulation with extra vertices above and below the
604
+ projection plane, set the flag remove_finite_vertices to False.</p>
605
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">exterior</span><span class="p">(</span><span class="kc">False</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
606
+ <span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">M</span><span class="o">.</span><span class="n">num_cusps</span><span class="p">(),</span> <span class="n">M</span><span class="o">.</span><span class="n">_num_fake_cusps</span><span class="p">())</span>
607
+ <span class="go">(1, 2)</span>
608
+ </pre></div>
609
+ </div>
610
+ </dd></dl>
611
+
612
+ <dl class="py method">
613
+ <dt class="sig sig-object py" id="spherogram.Link.faces">
614
+ <span class="sig-name descname"><span class="pre">faces</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.faces" title="Link to this definition"></a></dt>
615
+ <dd><p>The faces are the complementary regions of the link diagram. Each face
616
+ is given as a list of corners of crossings as one goes around
617
+ <em>clockwise</em>. These corners are recorded as CrossingStrands,
618
+ where CrossingStrand(c, j) denotes the corner of the face
619
+ abutting crossing c between strand j and j + 1.</p>
620
+ <p>Alternatively, the sequence of CrossingStrands can be regarded
621
+ as the <em>heads</em> of the oriented edges of the face.</p>
622
+ </dd></dl>
623
+
624
+ <dl class="py method">
625
+ <dt class="sig sig-object py" id="spherogram.Link.goeritz_matrix">
626
+ <span class="sig-name descname"><span class="pre">goeritz_matrix</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">return_graph</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.goeritz_matrix" title="Link to this definition"></a></dt>
627
+ <dd><p>Call self.white_graph() and return the Goeritz matrix of the result.
628
+ If the return_graph flag is set, also return the graph:</p>
629
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">=</span><span class="n">Link</span><span class="p">(</span><span class="s1">&#39;4_1&#39;</span><span class="p">)</span>
630
+ <span class="n">sage</span><span class="p">:</span> <span class="nb">abs</span><span class="p">(</span><span class="n">K</span><span class="o">.</span><span class="n">goeritz_matrix</span><span class="p">()</span><span class="o">.</span><span class="n">det</span><span class="p">())</span>
631
+ <span class="mi">5</span>
632
+ </pre></div>
633
+ </div>
634
+ </dd></dl>
635
+
636
+ <dl class="py method">
637
+ <dt class="sig sig-object py" id="spherogram.Link.is_alternating">
638
+ <span class="sig-name descname"><span class="pre">is_alternating</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.is_alternating" title="Link to this definition"></a></dt>
639
+ <dd><p>Returns whether or not this link diagram is alternating.</p>
640
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K9a1&#39;</span><span class="p">)</span>
641
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K10n1&#39;</span><span class="p">)</span>
642
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">is_alternating</span><span class="p">(),</span> <span class="n">L</span><span class="o">.</span><span class="n">is_alternating</span><span class="p">()</span>
643
+ <span class="go">(True, False)</span>
644
+ </pre></div>
645
+ </div>
646
+ <p>Of course, this is a property of the <em>diagram</em> not the isotopy
647
+ class. Here is the Hopf link with two silly extra crossings:</p>
648
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">T</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([(</span><span class="mi">4</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">5</span><span class="p">),(</span><span class="mi">3</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">),(</span><span class="mi">6</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">2</span><span class="p">),(</span><span class="mi">1</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">7</span><span class="p">)])</span>
649
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">T</span><span class="o">.</span><span class="n">is_alternating</span><span class="p">()</span>
650
+ <span class="go">False</span>
651
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">T</span><span class="o">.</span><span class="n">simplify</span><span class="p">()</span>
652
+ <span class="go">True</span>
653
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">T</span><span class="o">.</span><span class="n">is_alternating</span><span class="p">()</span>
654
+ <span class="go">True</span>
655
+ </pre></div>
656
+ </div>
657
+ </dd></dl>
658
+
659
+ <dl class="py method">
660
+ <dt class="sig sig-object py" id="spherogram.Link.is_planar">
661
+ <span class="sig-name descname"><span class="pre">is_planar</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.is_planar" title="Link to this definition"></a></dt>
662
+ <dd><p>Whether the 4-valent graph underlying the link projection is planar.</p>
663
+ <p>Should always be <code class="docutils literal notranslate"><span class="pre">True</span></code> for any actual Link.</p>
664
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">c</span> <span class="o">=</span> <span class="n">Crossing</span><span class="p">()</span>
665
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">c</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">c</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="c1"># Punctured torus gluing</span>
666
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">bad</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([</span><span class="n">c</span><span class="p">],</span> <span class="n">check_planarity</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
667
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">bad</span><span class="o">.</span><span class="n">is_planar</span><span class="p">()</span>
668
+ <span class="go">False</span>
669
+ </pre></div>
670
+ </div>
671
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([(</span><span class="mi">1</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">6</span><span class="p">),</span> <span class="p">(</span><span class="mi">7</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">5</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">9</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">9</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">1</span><span class="p">)])</span>
672
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">is_planar</span><span class="p">()</span>
673
+ <span class="go">True</span>
674
+ </pre></div>
675
+ </div>
676
+ <p>A valid split link:
677
+ &gt;&gt;&gt; S = Link([(1, 1, 2, 2), (3, 3, 4, 4)])
678
+ &gt;&gt;&gt; S.is_planar()
679
+ True
680
+ &gt;&gt;&gt; len(S.split_link_diagram())
681
+ 2</p>
682
+ <p>A split link with one component planar and the other nonplanar
683
+ &gt;&gt;&gt; a, b = Crossing(), Crossing()
684
+ &gt;&gt;&gt; a[0], a[2] = a[1], a[3]
685
+ &gt;&gt;&gt; b[0], b[1] = b[2], b[3]
686
+ &gt;&gt;&gt; N = Link([a, b], check_planarity=False)
687
+ &gt;&gt;&gt; N.is_planar()
688
+ False
689
+ &gt;&gt;&gt; sorted(C.is_planar() for C in N.split_link_diagram())
690
+ [False, True]</p>
691
+ </dd></dl>
692
+
693
+ <dl class="py method">
694
+ <dt class="sig sig-object py" id="spherogram.Link.jones_polynomial">
695
+ <span class="sig-name descname"><span class="pre">jones_polynomial</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">variable</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">new_convention</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.jones_polynomial" title="Link to this definition"></a></dt>
696
+ <dd><p>Returns the Jones polynomial of the link, following the
697
+ conventions of <a class="reference external" href="https://arxiv.org/abs/math/0201043">https://arxiv.org/abs/math/0201043</a></p>
698
+ <p>In particular, it obeys the oriented skein relation:</p>
699
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">q</span><span class="o">^</span><span class="mi">2</span> <span class="n">V</span><span class="p">(</span><span class="n">L</span><span class="o">-</span><span class="p">)</span> <span class="o">-</span> <span class="n">q</span><span class="o">^-</span><span class="mi">2</span> <span class="n">V</span><span class="p">(</span><span class="n">L</span><span class="o">+</span><span class="p">)</span> <span class="o">=</span> <span class="p">(</span><span class="n">q</span> <span class="o">-</span> <span class="n">q</span><span class="o">^-</span><span class="mi">1</span><span class="p">)</span> <span class="n">V</span><span class="p">(</span><span class="n">L0</span><span class="p">)</span>
700
+ </pre></div>
701
+ </div>
702
+ <p>and V(n-component unlink) = (q + q^-1)^(n-1).</p>
703
+ <p>WARNING: The default conventions changed in SnapPy 3.0. You
704
+ can recover the old conventions as illustrated below:</p>
705
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;8_5&#39;</span><span class="p">)</span>
706
+ <span class="n">sage</span><span class="p">:</span> <span class="n">J</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">jones_polynomial</span><span class="p">();</span> <span class="n">J</span>
707
+ <span class="mi">1</span> <span class="o">-</span> <span class="n">q</span><span class="o">^</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">3</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">6</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">8</span> <span class="o">-</span> <span class="mi">4</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">10</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">12</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">14</span> <span class="o">+</span> <span class="n">q</span><span class="o">^</span><span class="mi">16</span>
708
+ <span class="n">sage</span><span class="p">:</span> <span class="n">Jold</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">jones_polynomial</span><span class="p">(</span><span class="n">new_convention</span><span class="o">=</span><span class="kc">False</span><span class="p">);</span> <span class="n">Jold</span>
709
+ <span class="mi">1</span> <span class="o">-</span> <span class="n">q</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">3</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">4</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">5</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">6</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">q</span><span class="o">^</span><span class="mi">7</span> <span class="o">+</span> <span class="n">q</span><span class="o">^</span><span class="mi">8</span>
710
+ </pre></div>
711
+ </div>
712
+ <p>Here are the values one unlinks with 4 and 5 components:</p>
713
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">U4</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="n">braid_closure</span><span class="o">=</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="o">-</span><span class="mi">3</span><span class="p">])</span>
714
+ <span class="n">sage</span><span class="p">:</span> <span class="n">U5</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="n">braid_closure</span><span class="o">=</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="o">-</span><span class="mi">4</span><span class="p">])</span>
715
+ <span class="n">sage</span><span class="p">:</span> <span class="n">U4</span><span class="o">.</span><span class="n">jones_polynomial</span><span class="p">()</span><span class="o">.</span><span class="n">factor</span><span class="p">()</span>
716
+ <span class="p">(</span><span class="n">q</span><span class="o">^-</span><span class="mi">3</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">q</span><span class="o">^</span><span class="mi">2</span><span class="p">)</span><span class="o">^</span><span class="mi">3</span>
717
+ <span class="n">sage</span><span class="p">:</span> <span class="n">U5</span><span class="o">.</span><span class="n">jones_polynomial</span><span class="p">()</span><span class="o">.</span><span class="n">factor</span><span class="p">()</span>
718
+ <span class="p">(</span><span class="n">q</span><span class="o">^-</span><span class="mi">4</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">q</span><span class="o">^</span><span class="mi">2</span><span class="p">)</span><span class="o">^</span><span class="mi">4</span>
719
+ <span class="n">sage</span><span class="p">:</span> <span class="n">U4</span><span class="o">.</span><span class="n">jones_polynomial</span><span class="p">(</span><span class="n">new_convention</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span><span class="o">.</span><span class="n">factor</span><span class="p">()</span>
720
+ <span class="p">(</span><span class="o">-</span><span class="n">q</span><span class="o">^-</span><span class="mi">2</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">q</span><span class="p">)</span><span class="o">^</span><span class="mi">3</span>
721
+ <span class="n">sage</span><span class="p">:</span> <span class="n">U5</span><span class="o">.</span><span class="n">jones_polynomial</span><span class="p">(</span><span class="n">new_convention</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span><span class="o">.</span><span class="n">factor</span><span class="p">()</span>
722
+ <span class="p">(</span><span class="n">q</span><span class="o">^-</span><span class="mi">2</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">q</span><span class="p">)</span><span class="o">^</span><span class="mi">4</span>
723
+ </pre></div>
724
+ </div>
725
+ </dd></dl>
726
+
727
+ <dl class="py method">
728
+ <dt class="sig sig-object py" id="spherogram.Link.knot_floer_homology">
729
+ <span class="sig-name descname"><span class="pre">knot_floer_homology</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">prime</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">complex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.knot_floer_homology" title="Link to this definition"></a></dt>
730
+ <dd><p>Uses Zoltán Szabó’s HFK Calculator to compute the knot Floer
731
+ homology. This also gives the Seifert genus, whether the knot
732
+ fibers, etc:</p>
733
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K3a1&#39;</span><span class="p">)</span>
734
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">knot_floer_homology</span><span class="p">()</span>
735
+ <span class="go">{&#39;L_space_knot&#39;: True,</span>
736
+ <span class="go"> &#39;epsilon&#39;: 1,</span>
737
+ <span class="go"> &#39;fibered&#39;: True,</span>
738
+ <span class="go"> &#39;modulus&#39;: 2,</span>
739
+ <span class="go"> &#39;nu&#39;: 1,</span>
740
+ <span class="go"> &#39;ranks&#39;: {(-1, -2): 1, (0, -1): 1, (1, 0): 1},</span>
741
+ <span class="go"> &#39;seifert_genus&#39;: 1,</span>
742
+ <span class="go"> &#39;tau&#39;: 1,</span>
743
+ <span class="go"> &#39;total_rank&#39;: 3}</span>
744
+ </pre></div>
745
+ </div>
746
+ <p>The homology itself is encoded by ‘ranks’, with the form:</p>
747
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">(</span><span class="n">Alexander</span> <span class="n">grading</span><span class="p">,</span> <span class="n">Maslov</span> <span class="n">grading</span><span class="p">):</span> <span class="n">dimension</span>
748
+ </pre></div>
749
+ </div>
750
+ <p>For example, here is the Conway knot, which has Alexander
751
+ polynomial 1 and genus 3:</p>
752
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K11n34&#39;</span><span class="p">)</span>
753
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">ranks</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">knot_floer_homology</span><span class="p">()[</span><span class="s1">&#39;ranks&#39;</span><span class="p">]</span>
754
+ <span class="gp">&gt;&gt;&gt; </span><span class="p">[(</span><span class="n">a</span><span class="p">,</span> <span class="n">m</span><span class="p">)</span> <span class="k">for</span> <span class="n">a</span><span class="p">,</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">ranks</span> <span class="k">if</span> <span class="n">a</span> <span class="o">==</span> <span class="mi">3</span><span class="p">]</span>
755
+ <span class="go">[(3, 3), (3, 4)]</span>
756
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">ranks</span><span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">],</span> <span class="n">ranks</span><span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">]</span>
757
+ <span class="go">(1, 1)</span>
758
+ </pre></div>
759
+ </div>
760
+ <p>Computation is done over F_2 by default, other primes less
761
+ than 2^15 can be used instead via the optional “prime”
762
+ parameter.</p>
763
+ <p>If the parameter <cite>complex</cite> is set to True, then the simplified
764
+ “UV = 0” knot Floer chain complex is returned. This complex is
765
+ computed over the ring F[U,V]/(UV = 0), where F is the integers
766
+ mod the chosen prime; this corresponds to only the horizontal and
767
+ vertical arrows in the full knot Floer complex. The complex is
768
+ specified by:</p>
769
+ <ul class="simple">
770
+ <li><p>generators: a dictionary from the generator names to their
771
+ (Alexander, Maslov) gradings. The number of generators is
772
+ equal to the total_rank.</p></li>
773
+ <li><p>differential: a dictionary whose value on (a, b) is an integer
774
+ specifying the coefficient on the differential from generator a
775
+ to generator b, where only nonzero differentials are
776
+ recorded. (The coefficient on the differential is really an
777
+ element of F[U,V]/(UV = 0), but the power of U or V can be
778
+ recovered from the gradings on a and b so only the element of F
779
+ is recorded.)</p></li>
780
+ </ul>
781
+ <p>For example, to compute the vertical differential, whose homology
782
+ is HFhat(S^3), you can do:</p>
783
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">data</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">knot_floer_homology</span><span class="p">(</span><span class="n">prime</span><span class="o">=</span><span class="mi">31991</span><span class="p">,</span> <span class="nb">complex</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
784
+ <span class="n">sage</span><span class="p">:</span> <span class="n">gens</span><span class="p">,</span> <span class="n">diff</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s1">&#39;generators&#39;</span><span class="p">],</span> <span class="n">data</span><span class="p">[</span><span class="s1">&#39;differentials&#39;</span><span class="p">]</span>
785
+ <span class="n">sage</span><span class="p">:</span> <span class="n">vert</span> <span class="o">=</span> <span class="p">{(</span><span class="n">i</span><span class="p">,</span><span class="n">j</span><span class="p">):</span><span class="n">diff</span><span class="p">[</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">]</span> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">j</span> <span class="ow">in</span> <span class="n">diff</span>
786
+ <span class="o">...</span> <span class="k">if</span> <span class="n">gens</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="n">gens</span><span class="p">[</span><span class="n">j</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="mi">1</span><span class="p">}</span>
787
+ <span class="n">sage</span><span class="p">:</span> <span class="kn">from</span> <span class="nn">sage.all</span> <span class="kn">import</span> <span class="n">matrix</span><span class="p">,</span> <span class="n">GF</span>
788
+ <span class="n">sage</span><span class="p">:</span> <span class="n">M</span> <span class="o">=</span> <span class="n">matrix</span><span class="p">(</span><span class="n">GF</span><span class="p">(</span><span class="mi">31991</span><span class="p">),</span> <span class="nb">len</span><span class="p">(</span><span class="n">gens</span><span class="p">),</span> <span class="nb">len</span><span class="p">(</span><span class="n">gens</span><span class="p">),</span> <span class="n">vert</span><span class="p">,</span> <span class="n">sparse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
789
+ <span class="n">sage</span><span class="p">:</span> <span class="n">M</span><span class="o">*</span><span class="n">M</span> <span class="o">==</span> <span class="mi">0</span>
790
+ <span class="kc">True</span>
791
+ <span class="n">sage</span><span class="p">:</span> <span class="n">M</span><span class="o">.</span><span class="n">right_kernel</span><span class="p">()</span><span class="o">.</span><span class="n">rank</span><span class="p">()</span> <span class="o">-</span> <span class="n">M</span><span class="o">.</span><span class="n">rank</span><span class="p">()</span>
792
+ <span class="mi">1</span>
793
+ </pre></div>
794
+ </div>
795
+ </dd></dl>
796
+
797
+ <dl class="py method">
798
+ <dt class="sig sig-object py" id="spherogram.Link.knot_group">
799
+ <span class="sig-name descname"><span class="pre">knot_group</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.knot_group" title="Link to this definition"></a></dt>
800
+ <dd><p>Computes the knot group using the Wirtinger presentation.</p>
801
+ <p>Returns a finitely presented group:</p>
802
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>sage: K = Link(&#39;3_1&#39;)
803
+ sage: G = K.knot_group()
804
+ sage: type(G)
805
+ &lt;class &#39;sage.groups.finitely_presented.FinitelyPresentedGroup_with_category&#39;&gt;
806
+ </pre></div>
807
+ </div>
808
+ </dd></dl>
809
+
810
+ <dl class="py method">
811
+ <dt class="sig sig-object py" id="spherogram.Link.linking_matrix">
812
+ <span class="sig-name descname"><span class="pre">linking_matrix</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.linking_matrix" title="Link to this definition"></a></dt>
813
+ <dd><p>Calculates the linking number for each pair of link components.</p>
814
+ <p>Returns a linking matrix, in which the (i,j)th component is the
815
+ linking number of the ith and jth link components.</p>
816
+ </dd></dl>
817
+
818
+ <dl class="py method">
819
+ <dt class="sig sig-object py" id="spherogram.Link.linking_number">
820
+ <span class="sig-name descname"><span class="pre">linking_number</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.linking_number" title="Link to this definition"></a></dt>
821
+ <dd><p>Returns the linking number of self if self has two components;
822
+ or the sum of the linking numbers of all pairs of components
823
+ in general.</p>
824
+ </dd></dl>
825
+
826
+ <dl class="py method">
827
+ <dt class="sig sig-object py" id="spherogram.Link.mirror">
828
+ <span class="sig-name descname"><span class="pre">mirror</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.mirror" title="Link to this definition"></a></dt>
829
+ <dd><p>Returns the mirror image of the link, preserving link orientations and
830
+ component order.</p>
831
+ </dd></dl>
832
+
833
+ <dl class="py method">
834
+ <dt class="sig sig-object py" id="spherogram.Link.morse_diagram">
835
+ <span class="sig-name descname"><span class="pre">morse_diagram</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.morse_diagram" title="Link to this definition"></a></dt>
836
+ <dd><p>Returns a MorseLinkDiagram of this link diagram, that is a choice
837
+ of height function which realizes the Morse number:</p>
838
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;L8n2&#39;</span><span class="p">)</span>
839
+ <span class="n">sage</span><span class="p">:</span> <span class="n">D</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">morse_diagram</span><span class="p">()</span>
840
+ <span class="n">sage</span><span class="p">:</span> <span class="n">D</span><span class="o">.</span><span class="n">morse_number</span> <span class="o">==</span> <span class="n">L</span><span class="o">.</span><span class="n">morse_number</span><span class="p">()</span>
841
+ <span class="kc">True</span>
842
+ <span class="n">sage</span><span class="p">:</span> <span class="n">D</span><span class="o">.</span><span class="n">is_bridge</span><span class="p">()</span>
843
+ <span class="kc">True</span>
844
+ <span class="n">sage</span><span class="p">:</span> <span class="n">B</span> <span class="o">=</span> <span class="n">D</span><span class="o">.</span><span class="n">bridge</span><span class="p">()</span>
845
+ <span class="n">sage</span><span class="p">:</span> <span class="nb">len</span><span class="p">(</span><span class="n">B</span><span class="o">.</span><span class="n">bohua_code</span><span class="p">())</span>
846
+ <span class="mi">64</span>
847
+ </pre></div>
848
+ </div>
849
+ </dd></dl>
850
+
851
+ <dl class="py method">
852
+ <dt class="sig sig-object py" id="spherogram.Link.morse_number">
853
+ <span class="sig-name descname"><span class="pre">morse_number</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">solver</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'GLPK'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.morse_number" title="Link to this definition"></a></dt>
854
+ <dd><p>The <em>Morse number</em> of a planar link diagram D is</p>
855
+ <blockquote>
856
+ <div><p>m(D) = min { # of maxima of h on D }</p>
857
+ </div></blockquote>
858
+ <p>where h is a height function on R^2 which is generic on D; alternatively,
859
+ this is the minimum number of cups/caps in a <a class="reference external" href="http://katlas.math.toronto.edu/wiki/MorseLink_Presentations">MorseLink presentation</a>
860
+ of the diagram D. The Morse number is very closely related to the more
861
+ traditional bridge number. Examples:</p>
862
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;5_2&#39;</span><span class="p">)</span>
863
+ <span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">.</span><span class="n">morse_number</span><span class="p">()</span>
864
+ <span class="mi">2</span>
865
+ <span class="n">sage</span><span class="p">:</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;6^3_2&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">morse_number</span><span class="p">()</span>
866
+ <span class="mi">3</span>
867
+ </pre></div>
868
+ </div>
869
+ </dd></dl>
870
+
871
+ <dl class="py method">
872
+ <dt class="sig sig-object py" id="spherogram.Link.optimize_overcrossings">
873
+ <span class="sig-name descname"><span class="pre">optimize_overcrossings</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.optimize_overcrossings" title="Link to this definition"></a></dt>
874
+ <dd><p>Minimizes the number of crossings of a strand which crosses entirely
875
+ above the diagram by finding the path crossing over the diagram with
876
+ the least number of overcrossings. It begins with the longest
877
+ overcrossing, and continues with smaller ones until it successfully
878
+ reduces the number of crossings. Returns number of crossings removed.</p>
879
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span>
880
+ <span class="gp">... </span> <span class="p">(</span><span class="mi">7</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span>
881
+ <span class="gp">... </span> <span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="mi">5</span><span class="p">),</span>
882
+ <span class="gp">... </span> <span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">9</span><span class="p">),</span>
883
+ <span class="gp">... </span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">7</span><span class="p">),</span>
884
+ <span class="gp">... </span> <span class="p">(</span><span class="mi">11</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">1</span><span class="p">)])</span>
885
+ <span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">L</span><span class="p">)</span>
886
+ <span class="go">6</span>
887
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">simplify</span><span class="p">(</span><span class="n">mode</span><span class="o">=</span><span class="s1">&#39;level&#39;</span><span class="p">)</span>
888
+ <span class="go">False</span>
889
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">optimize_overcrossings</span><span class="p">()</span>
890
+ <span class="go">1</span>
891
+ </pre></div>
892
+ </div>
893
+ </dd></dl>
894
+
895
+ <dl class="py method">
896
+ <dt class="sig sig-object py" id="spherogram.Link.overstrands">
897
+ <span class="sig-name descname"><span class="pre">overstrands</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.overstrands" title="Link to this definition"></a></dt>
898
+ <dd><p>Returns a list of the sequences of overcrossings (which are lists of
899
+ CrossingEntryPoints), sorted in descending order of length.</p>
900
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;L14n1000&#39;</span><span class="p">)</span>
901
+ <span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">L</span><span class="o">.</span><span class="n">overstrands</span><span class="p">()[</span><span class="mi">0</span><span class="p">])</span>
902
+ <span class="go">3</span>
903
+ </pre></div>
904
+ </div>
905
+ </dd></dl>
906
+
907
+ <dl class="py method">
908
+ <dt class="sig sig-object py" id="spherogram.Link.peer_code">
909
+ <span class="sig-name descname"><span class="pre">peer_code</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.peer_code" title="Link to this definition"></a></dt>
910
+ <dd></dd></dl>
911
+
912
+ <dl class="py method">
913
+ <dt class="sig sig-object py" id="spherogram.Link.sage_link">
914
+ <span class="sig-name descname"><span class="pre">sage_link</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.sage_link" title="Link to this definition"></a></dt>
915
+ <dd><p>Convert to a SageMath Knot or Link:</p>
916
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K10n11&#39;</span><span class="p">)</span> <span class="c1"># Spherogram link</span>
917
+ <span class="n">sage</span><span class="p">:</span> <span class="n">K</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">sage_link</span><span class="p">();</span> <span class="n">K</span>
918
+ <span class="n">Knot</span> <span class="n">represented</span> <span class="n">by</span> <span class="mi">10</span> <span class="n">crossings</span>
919
+ <span class="n">sage</span><span class="p">:</span> <span class="n">L</span><span class="o">.</span><span class="n">alexander_polynomial</span><span class="p">()</span><span class="o">/</span><span class="n">K</span><span class="o">.</span><span class="n">alexander_polynomial</span><span class="p">()</span> <span class="c1"># Agree up to units</span>
920
+ <span class="o">-</span><span class="n">t</span><span class="o">^</span><span class="mi">3</span>
921
+ <span class="n">sage</span><span class="p">:</span> <span class="n">L</span><span class="o">.</span><span class="n">signature</span><span class="p">(),</span> <span class="n">K</span><span class="o">.</span><span class="n">signature</span><span class="p">()</span>
922
+ <span class="p">(</span><span class="o">-</span><span class="mi">4</span><span class="p">,</span> <span class="o">-</span><span class="mi">4</span><span class="p">)</span>
923
+ </pre></div>
924
+ </div>
925
+ <p>Can also go the other way:</p>
926
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K11n11&#39;</span><span class="p">)</span>
927
+ <span class="n">sage</span><span class="p">:</span> <span class="n">M</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="n">L</span><span class="o">.</span><span class="n">sage_link</span><span class="p">())</span>
928
+ <span class="n">sage</span><span class="p">:</span> <span class="n">L</span><span class="o">.</span><span class="n">signature</span><span class="p">(),</span> <span class="n">M</span><span class="o">.</span><span class="n">signature</span><span class="p">()</span>
929
+ <span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
930
+ </pre></div>
931
+ </div>
932
+ <p>Can also take a braid group perspective.</p>
933
+ <blockquote>
934
+ <div><p>sage: B = BraidGroup(4)
935
+ sage: a, b, c = B.gens()
936
+ sage: Link(braid_closure=(a**-3) * (b**4) * (c**2) * a * b * c )
937
+ &lt;Link: 2 comp; 12 cross&gt;
938
+ sage: L = Link(a * b * c); L
939
+ &lt;Link: 1 comp; 3 cross&gt;
940
+ sage: S = L.sage_link(); S
941
+ Knot represented by 3 crossings
942
+ sage: Link(S)
943
+ &lt;Link: 1 comp; 3 cross&gt;</p>
944
+ </div></blockquote>
945
+ </dd></dl>
946
+
947
+ <dl class="py method">
948
+ <dt class="sig sig-object py" id="spherogram.Link.seifert_matrix">
949
+ <span class="sig-name descname"><span class="pre">seifert_matrix</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.seifert_matrix" title="Link to this definition"></a></dt>
950
+ <dd><p>Returns the Seifert matrix of the link:</p>
951
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K10n11&#39;</span><span class="p">)</span>
952
+ <span class="n">sage</span><span class="p">:</span> <span class="n">A</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">seifert_matrix</span><span class="p">()</span>
953
+ <span class="n">sage</span><span class="p">:</span> <span class="n">alex</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">alexander_polynomial</span><span class="p">()</span>
954
+ <span class="n">sage</span><span class="p">:</span> <span class="n">t</span> <span class="o">=</span> <span class="n">alex</span><span class="o">.</span><span class="n">parent</span><span class="p">()</span><span class="o">.</span><span class="n">gen</span><span class="p">()</span>
955
+ <span class="n">sage</span><span class="p">:</span> <span class="n">B</span> <span class="o">=</span> <span class="n">t</span><span class="o">*</span><span class="n">A</span> <span class="o">-</span> <span class="n">A</span><span class="o">.</span><span class="n">transpose</span><span class="p">()</span>
956
+ <span class="n">sage</span><span class="p">:</span> <span class="n">t</span><span class="o">**</span><span class="mi">4</span> <span class="o">*</span> <span class="n">alex</span> <span class="o">==</span> <span class="o">-</span><span class="n">B</span><span class="o">.</span><span class="n">det</span><span class="p">()</span>
957
+ <span class="kc">True</span>
958
+ </pre></div>
959
+ </div>
960
+ <p>Uses the algorithm described in</p>
961
+ <p>J. Collins, “An algorithm for computing the Seifert matrix of a link
962
+ from a braid representation.” (2007).</p>
963
+ <p>after first making the link isotopic to a braid closure.</p>
964
+ </dd></dl>
965
+
966
+ <dl class="py method">
967
+ <dt class="sig sig-object py" id="spherogram.Link.signature">
968
+ <span class="sig-name descname"><span class="pre">signature</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">new_convention</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.signature" title="Link to this definition"></a></dt>
969
+ <dd><p>Returns the signature of the link, computed from the Goeritz matrix using
970
+ the algorithm of Gordon and Litherland:</p>
971
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;4a1&#39;</span><span class="p">)</span>
972
+ <span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">.</span><span class="n">signature</span><span class="p">()</span>
973
+ <span class="mi">0</span>
974
+ <span class="n">sage</span><span class="p">:</span> <span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;9^3_12&#39;</span><span class="p">)</span>
975
+ <span class="n">sage</span><span class="p">:</span> <span class="n">Lbar</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">mirror</span><span class="p">()</span>
976
+ <span class="n">sage</span><span class="p">:</span> <span class="n">L</span><span class="o">.</span><span class="n">signature</span><span class="p">()</span> <span class="o">+</span> <span class="n">Lbar</span><span class="o">.</span><span class="n">signature</span><span class="p">()</span>
977
+ <span class="mi">0</span>
978
+ <span class="n">sage</span><span class="p">:</span> <span class="n">M</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="n">braid_closure</span><span class="o">=</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">])</span>
979
+ <span class="n">sage</span><span class="p">:</span> <span class="n">M</span><span class="o">.</span><span class="n">signature</span><span class="p">()</span>
980
+ <span class="o">-</span><span class="mi">6</span>
981
+ </pre></div>
982
+ </div>
983
+ <p>SnapPy 3.0 switched the sign convention for the signature so
984
+ that “positive knots have negative signatures”. You can
985
+ recover the previous default by:</p>
986
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;3a1&#39;</span><span class="p">)</span>
987
+ <span class="n">sage</span><span class="p">:</span> <span class="n">L</span><span class="o">.</span><span class="n">signature</span><span class="p">()</span>
988
+ <span class="o">-</span><span class="mi">2</span>
989
+ <span class="n">sage</span><span class="p">:</span> <span class="n">L</span><span class="o">.</span><span class="n">signature</span><span class="p">(</span><span class="n">new_convention</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
990
+ <span class="mi">2</span>
991
+ </pre></div>
992
+ </div>
993
+ </dd></dl>
994
+
995
+ <dl class="py method">
996
+ <dt class="sig sig-object py" id="spherogram.Link.simplify">
997
+ <span class="sig-name descname"><span class="pre">simplify</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'basic'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type_III_limit</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">100</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.simplify" title="Link to this definition"></a></dt>
998
+ <dd><p>Tries to simplify the link projection. Returns whether it succeeded
999
+ in reducing the number of crossings. Modifies the link in
1000
+ place, and unknot components which are also unlinked may be
1001
+ silently discarded. The ordering of <code class="docutils literal notranslate"><span class="pre">link_components</span></code> is not
1002
+ always preserved.</p>
1003
+ <p>The following strategies can be employed.</p>
1004
+ <ol class="arabic simple">
1005
+ <li><p>In the default <code class="docutils literal notranslate"><span class="pre">basic</span></code> mode, it does Reidemeister I and II moves
1006
+ until none are possible.</p></li>
1007
+ <li><p>In <code class="docutils literal notranslate"><span class="pre">level</span></code> mode, it does random Reidemeister III moves, reducing
1008
+ the number of crossings via type I and II moves whenever possible.
1009
+ The process stops when it has done <code class="docutils literal notranslate"><span class="pre">type_III_limit</span></code> <em>consecutive</em>
1010
+ type III moves without any simplification.</p></li>
1011
+ <li><p>In <code class="docutils literal notranslate"><span class="pre">pickup</span></code> mode, it also minimizes the number of crossings of
1012
+ strands which cross entirely above (or below) the diagram by
1013
+ finding the path crossing over the diagram with the least number of
1014
+ overcrossings (or undercrossings); this has the effect of doing
1015
+ “picking up” strands and putting them down elsewhere.</p></li>
1016
+ <li><p>Finally, the <code class="docutils literal notranslate"><span class="pre">global</span></code> mode is the combination of 2 and 3.</p></li>
1017
+ </ol>
1018
+ <p>Some examples:</p>
1019
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([(</span><span class="mi">13</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">14</span><span class="p">,</span><span class="mi">11</span><span class="p">),</span> <span class="p">(</span><span class="mi">11</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">12</span><span class="p">,</span><span class="mi">4</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">13</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">12</span><span class="p">),</span>
1020
+ <span class="gp">... </span><span class="p">(</span><span class="mi">9</span><span class="p">,</span><span class="mi">14</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">6</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">8</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="mi">9</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">8</span><span class="p">)])</span>
1021
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
1022
+ <span class="go">&lt;Link: 1 comp; 7 cross&gt;</span>
1023
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">simplify</span><span class="p">(</span><span class="s1">&#39;basic&#39;</span><span class="p">)</span>
1024
+ <span class="go">True</span>
1025
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span>
1026
+ <span class="go">&lt;Link: 1 comp; 4 cross&gt;</span>
1027
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">simplify</span><span class="p">(</span><span class="s1">&#39;basic&#39;</span><span class="p">)</span> <span class="c1"># Already done all it can</span>
1028
+ <span class="go">False</span>
1029
+ </pre></div>
1030
+ </div>
1031
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([(</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">14</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">15</span><span class="p">,</span><span class="mi">4</span><span class="p">),</span> <span class="p">(</span><span class="mi">10</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">11</span><span class="p">,</span><span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">7</span><span class="p">,</span><span class="mi">12</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">11</span><span class="p">),</span>
1032
+ <span class="gp">... </span><span class="p">(</span><span class="mi">17</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">14</span><span class="p">,</span><span class="mi">9</span><span class="p">),</span> <span class="p">(</span><span class="mi">12</span><span class="p">,</span><span class="mi">9</span><span class="p">,</span><span class="mi">13</span><span class="p">,</span><span class="mi">8</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">13</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">10</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">16</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">15</span><span class="p">),</span> <span class="p">(</span><span class="mi">16</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">17</span><span class="p">,</span><span class="mi">7</span><span class="p">)])</span>
1033
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span>
1034
+ <span class="go">&lt;Link: 3 comp; 9 cross&gt;</span>
1035
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">simplify</span><span class="p">(</span><span class="s1">&#39;basic&#39;</span><span class="p">)</span>
1036
+ <span class="go">False</span>
1037
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">simplify</span><span class="p">(</span><span class="s1">&#39;level&#39;</span><span class="p">)</span>
1038
+ <span class="go">True</span>
1039
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="c1"># Trivial unlinked component has been discarded!</span>
1040
+ <span class="go">&lt;Link: 2 comp; 2 cross&gt;</span>
1041
+ </pre></div>
1042
+ </div>
1043
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;K14n2345&#39;</span><span class="p">)</span>
1044
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">backtrack</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
1045
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">simplify</span><span class="p">(</span><span class="s1">&#39;global&#39;</span><span class="p">)</span>
1046
+ <span class="go">True</span>
1047
+ </pre></div>
1048
+ </div>
1049
+ </dd></dl>
1050
+
1051
+ <dl class="py method">
1052
+ <dt class="sig sig-object py" id="spherogram.Link.split_link_diagram">
1053
+ <span class="sig-name descname"><span class="pre">split_link_diagram</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">destroy_original</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.split_link_diagram" title="Link to this definition"></a></dt>
1054
+ <dd><p>Breaks the given link diagram into pieces, one for each connected
1055
+ component of the underlying 4-valent graph.</p>
1056
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">([(</span><span class="mi">2</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">4</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">)],</span> <span class="n">check_planarity</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
1057
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">split_link_diagram</span><span class="p">()</span>
1058
+ <span class="go">[&lt;Link: 1 comp; 1 cross&gt;, &lt;Link: 1 comp; 1 cross&gt;]</span>
1059
+ </pre></div>
1060
+ </div>
1061
+ </dd></dl>
1062
+
1063
+ <dl class="py method">
1064
+ <dt class="sig sig-object py" id="spherogram.Link.sublink">
1065
+ <span class="sig-name descname"><span class="pre">sublink</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">components</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.sublink" title="Link to this definition"></a></dt>
1066
+ <dd><p>Returns the sublink consisting of the specified components; see the
1067
+ example below for the various accepted forms.</p>
1068
+ <p>Warnings: Components in the sublink that are both unknotted
1069
+ and unlinked may be silently thrown away. The order of the
1070
+ components in the sublink need not correspond to their order
1071
+ in the original link.</p>
1072
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="s1">&#39;L14n64110&#39;</span><span class="p">)</span>
1073
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span>
1074
+ <span class="go">&lt;Link L14n64110: 5 comp; 14 cross&gt;</span>
1075
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">sublink</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">])</span>
1076
+ <span class="go">&lt;Link: 4 comp; 10 cross&gt;</span>
1077
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">comps</span> <span class="o">=</span> <span class="n">L</span><span class="o">.</span><span class="n">link_components</span>
1078
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">sublink</span><span class="p">([</span><span class="n">comps</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">comps</span><span class="p">[</span><span class="mi">1</span><span class="p">]])</span>
1079
+ <span class="go">&lt;Link: 2 comp; 2 cross&gt;</span>
1080
+ </pre></div>
1081
+ </div>
1082
+ <p>If you just want one component you can do this:</p>
1083
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">L11a127</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">17</span><span class="p">,</span><span class="mi">9</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">8</span><span class="p">),</span> <span class="p">(</span><span class="mi">7</span><span class="p">,</span><span class="mi">12</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">13</span><span class="p">),</span> <span class="p">(</span><span class="mi">9</span><span class="p">,</span><span class="mi">17</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">16</span><span class="p">),</span> <span class="p">(</span><span class="mi">11</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">12</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span>
1084
+ <span class="gp">... </span><span class="p">(</span><span class="mi">19</span><span class="p">,</span><span class="mi">14</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">15</span><span class="p">),</span> <span class="p">(</span><span class="mi">21</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">18</span><span class="p">,</span><span class="mi">5</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="mi">18</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">19</span><span class="p">),</span> <span class="p">(</span><span class="mi">15</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">16</span><span class="p">,</span><span class="mi">21</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">11</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">10</span><span class="p">),</span>
1085
+ <span class="gp">... </span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">7</span><span class="p">),</span> <span class="p">(</span><span class="mi">13</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">14</span><span class="p">,</span><span class="mi">1</span><span class="p">)]</span>
1086
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span><span class="n">L11a127</span><span class="p">)</span>
1087
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">sublink</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
1088
+ <span class="go">&lt;Link: 1 comp; 7 cross&gt;</span>
1089
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">L</span><span class="o">.</span><span class="n">sublink</span><span class="p">(</span><span class="n">L</span><span class="o">.</span><span class="n">link_components</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
1090
+ <span class="go">&lt;Link: 0 comp; 0 cross&gt;</span>
1091
+ </pre></div>
1092
+ </div>
1093
+ <p>The last answer is empty because the second component is unknotted.</p>
1094
+ </dd></dl>
1095
+
1096
+ <dl class="py method">
1097
+ <dt class="sig sig-object py" id="spherogram.Link.view">
1098
+ <span class="sig-name descname"><span class="pre">view</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">viewer</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_crossing_labels</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.view" title="Link to this definition"></a></dt>
1099
+ <dd><p>Opens a Plink link viewer window displaying the current link.
1100
+ The strands of the links are unions of edges in the standard
1101
+ integer grid, following the work of <a class="reference external" href="https://dx.doi.org/10.1137/0216030">Tamassia</a> and <a class="reference external" href="ftp://ftp.cs.brown.edu/pub/techreports/99/cs99-04.pdf">Bridgeman
1102
+ et. al.</a></p>
1103
+ </dd></dl>
1104
+
1105
+ <dl class="py method">
1106
+ <dt class="sig sig-object py" id="spherogram.Link.white_graph">
1107
+ <span class="sig-name descname"><span class="pre">white_graph</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.white_graph" title="Link to this definition"></a></dt>
1108
+ <dd><p>Return the white graph of a non-split link projection.</p>
1109
+ <p>This method generates a multigraph whose vertices correspond
1110
+ to the faces of the diagram, with an edge joining two
1111
+ vertices whenever the corresponding faces contain opposite
1112
+ corners at some crossing. To avoid hashability issues, the
1113
+ vertex corresponding to a face is the index of the face in the
1114
+ list returned by Link.faces().</p>
1115
+ <p>According to the conventions of “Gordon, C. McA. and
1116
+ Litherland, R. A, ‘On the signature of a link’, Inventiones
1117
+ math. 47, 23-69 (1978)”, in a checkerboard coloring of a link
1118
+ diagram the unbounded region is always the first white region.
1119
+ Of course, the choice of which region is unbounded is
1120
+ arbitrary; it is just a matter of which region on S^2 contains
1121
+ the point at infinity. In this method an equivalent arbitrary
1122
+ choice is made by just returning the second component of the
1123
+ multigraph, as determined by Graph.connected_components().
1124
+ (Empirically, the second component tends to be smaller than
1125
+ the first.)</p>
1126
+ <p>Note that this may produce a meaningless result in the case of
1127
+ a split link diagram. Consequently if the diagram is split,
1128
+ i.e if the multigraph has more than 2 components, a ValueError
1129
+ is raised:</p>
1130
+ <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">=</span><span class="n">Link</span><span class="p">(</span><span class="s1">&#39;5_1&#39;</span><span class="p">)</span>
1131
+ <span class="n">sage</span><span class="p">:</span> <span class="n">K</span><span class="o">.</span><span class="n">white_graph</span><span class="p">()</span>
1132
+ <span class="n">Subgraph</span> <span class="n">of</span> <span class="p">():</span> <span class="n">Multi</span><span class="o">-</span><span class="n">graph</span> <span class="n">on</span> <span class="mi">2</span> <span class="n">vertices</span>
1133
+ </pre></div>
1134
+ </div>
1135
+ <p>WARNING: While there is also a “black_graph” method, it need
1136
+ not be the case that these two graphs are complementary in the
1137
+ expected way.</p>
1138
+ </dd></dl>
1139
+
1140
+ <dl class="py method">
1141
+ <dt class="sig sig-object py" id="spherogram.Link.writhe">
1142
+ <span class="sig-name descname"><span class="pre">writhe</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.Link.writhe" title="Link to this definition"></a></dt>
1143
+ <dd><p>Finds the writhe of a knot.</p>
1144
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">K</span> <span class="o">=</span> <span class="n">Link</span><span class="p">(</span> <span class="p">[(</span><span class="mi">4</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">8</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">6</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">7</span><span class="p">)]</span> <span class="p">)</span> <span class="c1"># Figure 8 knot</span>
1145
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">K</span><span class="o">.</span><span class="n">writhe</span><span class="p">()</span>
1146
+ <span class="go">0</span>
1147
+ </pre></div>
1148
+ </div>
1149
+ </dd></dl>
1150
+
1151
+ </dd></dl>
1152
+
1153
+ </section>
1154
+ <section id="the-closedbraid-class">
1155
+ <h2>The ClosedBraid class<a class="headerlink" href="#the-closedbraid-class" title="Link to this heading"></a></h2>
1156
+ <p>The ClosedBraid class provides an alternative way to construct links
1157
+ as closed braids. It is a subclass of Link, and currently defines
1158
+ the same methods and attributes.</p>
1159
+ <dl class="py class">
1160
+ <dt class="sig sig-object py" id="spherogram.ClosedBraid">
1161
+ <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">spherogram.</span></span><span class="sig-name descname"><span class="pre">ClosedBraid</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spherogram.ClosedBraid" title="Link to this definition"></a></dt>
1162
+ <dd><p>This is a convenience class for constructing closed braids.</p>
1163
+ <p>The constructor accepts either a single argument, which should be a list of
1164
+ integers to be passed to the Link constructor as the braid_closure
1165
+ parameter, or one or more integer arguments which will be packaged as a list
1166
+ and used as the braid_closure parameter.</p>
1167
+ <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">ClosedBraid</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">)</span>
1168
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">B</span>
1169
+ <span class="go">ClosedBraid(1, -2, 3)</span>
1170
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">ClosedBraid</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">]</span><span class="o">*</span><span class="mi">3</span><span class="p">)</span>
1171
+ <span class="gp">&gt;&gt;&gt; </span><span class="n">B</span>
1172
+ <span class="go">ClosedBraid(1, -2, 3, 1, -2, 3, 1, -2, 3)</span>
1173
+ </pre></div>
1174
+ </div>
1175
+ </dd></dl>
1176
+
1177
+ </section>
1178
+ </section>
1179
+
1180
+
1181
+ </div>
1182
+ </div>
1183
+ <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
1184
+ <a href="plink.html" class="btn btn-neutral float-left" title="Using SnapPy’s link editor" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
1185
+ <a href="snap.html" class="btn btn-neutral float-right" title="Number theory of hyperbolic 3-manifolds" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
1186
+ </div>
1187
+
1188
+ <hr/>
1189
+
1190
+ <div role="contentinfo">
1191
+ <p>&#169; Copyright 2009-2025, by Marc Culler, Nathan Dunfield, Matthias Goerner, Jeffrey Weeks and others.</p>
1192
+ </div>
1193
+
1194
+ Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
1195
+ <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
1196
+ provided by <a href="https://readthedocs.org">Read the Docs</a>.
1197
+
1198
+
1199
+ </footer>
1200
+ </div>
1201
+ </div>
1202
+ </section>
1203
+ </div>
1204
+ <script>
1205
+ jQuery(function () {
1206
+ SphinxRtdTheme.Navigation.enable(true);
1207
+ });
1208
+ </script>
1209
+
1210
+ </body>
1211
+ </html>