snappy 3.1__cp38-cp38-win_amd64.whl → 3.2__cp38-cp38-win_amd64.whl

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