passagemath-graphs 10.6.1rc1__cp310-cp310-musllinux_1_2_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. passagemath_graphs-10.6.1rc1.dist-info/METADATA +292 -0
  2. passagemath_graphs-10.6.1rc1.dist-info/RECORD +260 -0
  3. passagemath_graphs-10.6.1rc1.dist-info/WHEEL +5 -0
  4. passagemath_graphs-10.6.1rc1.dist-info/top_level.txt +2 -0
  5. passagemath_graphs.libs/libgcc_s-69c45f16.so.1 +0 -0
  6. passagemath_graphs.libs/libgmp-8e78bd9b.so.10.5.0 +0 -0
  7. passagemath_graphs.libs/libstdc++-1f1a71be.so.6.0.33 +0 -0
  8. sage/all__sagemath_graphs.py +39 -0
  9. sage/combinat/abstract_tree.py +2723 -0
  10. sage/combinat/all__sagemath_graphs.py +34 -0
  11. sage/combinat/binary_tree.py +5306 -0
  12. sage/combinat/cluster_algebra_quiver/all.py +22 -0
  13. sage/combinat/cluster_algebra_quiver/cluster_seed.py +5208 -0
  14. sage/combinat/cluster_algebra_quiver/interact.py +124 -0
  15. sage/combinat/cluster_algebra_quiver/mutation_class.py +625 -0
  16. sage/combinat/cluster_algebra_quiver/mutation_type.py +1555 -0
  17. sage/combinat/cluster_algebra_quiver/quiver.py +2290 -0
  18. sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py +2468 -0
  19. sage/combinat/designs/MOLS_handbook_data.py +570 -0
  20. sage/combinat/designs/all.py +58 -0
  21. sage/combinat/designs/bibd.py +1655 -0
  22. sage/combinat/designs/block_design.py +1071 -0
  23. sage/combinat/designs/covering_array.py +269 -0
  24. sage/combinat/designs/covering_design.py +530 -0
  25. sage/combinat/designs/database.py +5615 -0
  26. sage/combinat/designs/design_catalog.py +122 -0
  27. sage/combinat/designs/designs_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
  28. sage/combinat/designs/designs_pyx.pxd +21 -0
  29. sage/combinat/designs/designs_pyx.pyx +993 -0
  30. sage/combinat/designs/difference_family.py +3951 -0
  31. sage/combinat/designs/difference_matrices.py +279 -0
  32. sage/combinat/designs/evenly_distributed_sets.cpython-310-aarch64-linux-gnu.so +0 -0
  33. sage/combinat/designs/evenly_distributed_sets.pyx +661 -0
  34. sage/combinat/designs/ext_rep.py +1064 -0
  35. sage/combinat/designs/gen_quadrangles_with_spread.cpython-310-aarch64-linux-gnu.so +0 -0
  36. sage/combinat/designs/gen_quadrangles_with_spread.pyx +339 -0
  37. sage/combinat/designs/group_divisible_designs.py +361 -0
  38. sage/combinat/designs/incidence_structures.py +2357 -0
  39. sage/combinat/designs/latin_squares.py +581 -0
  40. sage/combinat/designs/orthogonal_arrays.py +2244 -0
  41. sage/combinat/designs/orthogonal_arrays_build_recursive.py +1780 -0
  42. sage/combinat/designs/orthogonal_arrays_find_recursive.cpython-310-aarch64-linux-gnu.so +0 -0
  43. sage/combinat/designs/orthogonal_arrays_find_recursive.pyx +967 -0
  44. sage/combinat/designs/resolvable_bibd.py +815 -0
  45. sage/combinat/designs/steiner_quadruple_systems.py +1306 -0
  46. sage/combinat/designs/subhypergraph_search.cpython-310-aarch64-linux-gnu.so +0 -0
  47. sage/combinat/designs/subhypergraph_search.pyx +530 -0
  48. sage/combinat/designs/twographs.py +306 -0
  49. sage/combinat/finite_state_machine.py +14874 -0
  50. sage/combinat/finite_state_machine_generators.py +2006 -0
  51. sage/combinat/graph_path.py +448 -0
  52. sage/combinat/interval_posets.py +3908 -0
  53. sage/combinat/nu_tamari_lattice.py +269 -0
  54. sage/combinat/ordered_tree.py +1446 -0
  55. sage/combinat/posets/all.py +46 -0
  56. sage/combinat/posets/bubble_shuffle.py +247 -0
  57. sage/combinat/posets/cartesian_product.py +493 -0
  58. sage/combinat/posets/d_complete.py +182 -0
  59. sage/combinat/posets/elements.py +273 -0
  60. sage/combinat/posets/forest.py +30 -0
  61. sage/combinat/posets/hasse_cython.cpython-310-aarch64-linux-gnu.so +0 -0
  62. sage/combinat/posets/hasse_cython.pyx +174 -0
  63. sage/combinat/posets/hasse_diagram.py +3672 -0
  64. sage/combinat/posets/hochschild_lattice.py +158 -0
  65. sage/combinat/posets/incidence_algebras.py +794 -0
  66. sage/combinat/posets/lattices.py +5117 -0
  67. sage/combinat/posets/linear_extension_iterator.cpython-310-aarch64-linux-gnu.so +0 -0
  68. sage/combinat/posets/linear_extension_iterator.pyx +292 -0
  69. sage/combinat/posets/linear_extensions.py +1037 -0
  70. sage/combinat/posets/mobile.py +275 -0
  71. sage/combinat/posets/moebius_algebra.py +776 -0
  72. sage/combinat/posets/poset_examples.py +2178 -0
  73. sage/combinat/posets/posets.py +9360 -0
  74. sage/combinat/rooted_tree.py +1070 -0
  75. sage/combinat/shard_order.py +239 -0
  76. sage/combinat/tamari_lattices.py +384 -0
  77. sage/combinat/yang_baxter_graph.py +923 -0
  78. sage/databases/all__sagemath_graphs.py +1 -0
  79. sage/databases/knotinfo_db.py +1231 -0
  80. sage/ext_data/all__sagemath_graphs.py +1 -0
  81. sage/ext_data/graphs/graph_plot_js.html +330 -0
  82. sage/ext_data/kenzo/CP2.txt +45 -0
  83. sage/ext_data/kenzo/CP3.txt +349 -0
  84. sage/ext_data/kenzo/CP4.txt +4774 -0
  85. sage/ext_data/kenzo/README.txt +49 -0
  86. sage/ext_data/kenzo/S4.txt +20 -0
  87. sage/graphs/all.py +42 -0
  88. sage/graphs/asteroidal_triples.cpython-310-aarch64-linux-gnu.so +0 -0
  89. sage/graphs/asteroidal_triples.pyx +320 -0
  90. sage/graphs/base/all.py +1 -0
  91. sage/graphs/base/boost_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  92. sage/graphs/base/boost_graph.pxd +106 -0
  93. sage/graphs/base/boost_graph.pyx +3045 -0
  94. sage/graphs/base/c_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  95. sage/graphs/base/c_graph.pxd +106 -0
  96. sage/graphs/base/c_graph.pyx +5096 -0
  97. sage/graphs/base/dense_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  98. sage/graphs/base/dense_graph.pxd +28 -0
  99. sage/graphs/base/dense_graph.pyx +801 -0
  100. sage/graphs/base/graph_backends.cpython-310-aarch64-linux-gnu.so +0 -0
  101. sage/graphs/base/graph_backends.pxd +5 -0
  102. sage/graphs/base/graph_backends.pyx +797 -0
  103. sage/graphs/base/overview.py +85 -0
  104. sage/graphs/base/sparse_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  105. sage/graphs/base/sparse_graph.pxd +90 -0
  106. sage/graphs/base/sparse_graph.pyx +1653 -0
  107. sage/graphs/base/static_dense_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  108. sage/graphs/base/static_dense_graph.pxd +5 -0
  109. sage/graphs/base/static_dense_graph.pyx +1032 -0
  110. sage/graphs/base/static_sparse_backend.cpython-310-aarch64-linux-gnu.so +0 -0
  111. sage/graphs/base/static_sparse_backend.pxd +27 -0
  112. sage/graphs/base/static_sparse_backend.pyx +1583 -0
  113. sage/graphs/base/static_sparse_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  114. sage/graphs/base/static_sparse_graph.pxd +37 -0
  115. sage/graphs/base/static_sparse_graph.pyx +1375 -0
  116. sage/graphs/bipartite_graph.py +2732 -0
  117. sage/graphs/centrality.cpython-310-aarch64-linux-gnu.so +0 -0
  118. sage/graphs/centrality.pyx +1038 -0
  119. sage/graphs/cographs.py +519 -0
  120. sage/graphs/comparability.cpython-310-aarch64-linux-gnu.so +0 -0
  121. sage/graphs/comparability.pyx +851 -0
  122. sage/graphs/connectivity.cpython-310-aarch64-linux-gnu.so +0 -0
  123. sage/graphs/connectivity.pxd +157 -0
  124. sage/graphs/connectivity.pyx +4813 -0
  125. sage/graphs/convexity_properties.cpython-310-aarch64-linux-gnu.so +0 -0
  126. sage/graphs/convexity_properties.pxd +16 -0
  127. sage/graphs/convexity_properties.pyx +870 -0
  128. sage/graphs/digraph.py +4754 -0
  129. sage/graphs/digraph_generators.py +1993 -0
  130. sage/graphs/distances_all_pairs.cpython-310-aarch64-linux-gnu.so +0 -0
  131. sage/graphs/distances_all_pairs.pxd +12 -0
  132. sage/graphs/distances_all_pairs.pyx +2938 -0
  133. sage/graphs/domination.py +1363 -0
  134. sage/graphs/dot2tex_utils.py +100 -0
  135. sage/graphs/edge_connectivity.cpython-310-aarch64-linux-gnu.so +0 -0
  136. sage/graphs/edge_connectivity.pyx +1215 -0
  137. sage/graphs/generators/all.py +1 -0
  138. sage/graphs/generators/basic.py +1769 -0
  139. sage/graphs/generators/chessboard.py +538 -0
  140. sage/graphs/generators/classical_geometries.py +1611 -0
  141. sage/graphs/generators/degree_sequence.py +235 -0
  142. sage/graphs/generators/distance_regular.cpython-310-aarch64-linux-gnu.so +0 -0
  143. sage/graphs/generators/distance_regular.pyx +2846 -0
  144. sage/graphs/generators/families.py +4759 -0
  145. sage/graphs/generators/intersection.py +565 -0
  146. sage/graphs/generators/platonic_solids.py +262 -0
  147. sage/graphs/generators/random.py +2623 -0
  148. sage/graphs/generators/smallgraphs.py +5741 -0
  149. sage/graphs/generators/world_map.py +724 -0
  150. sage/graphs/generic_graph.py +26867 -0
  151. sage/graphs/generic_graph_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
  152. sage/graphs/generic_graph_pyx.pxd +34 -0
  153. sage/graphs/generic_graph_pyx.pyx +1673 -0
  154. sage/graphs/genus.cpython-310-aarch64-linux-gnu.so +0 -0
  155. sage/graphs/genus.pyx +622 -0
  156. sage/graphs/graph.py +9645 -0
  157. sage/graphs/graph_coloring.cpython-310-aarch64-linux-gnu.so +0 -0
  158. sage/graphs/graph_coloring.pyx +2284 -0
  159. sage/graphs/graph_database.py +1177 -0
  160. sage/graphs/graph_decompositions/all.py +1 -0
  161. sage/graphs/graph_decompositions/bandwidth.cpython-310-aarch64-linux-gnu.so +0 -0
  162. sage/graphs/graph_decompositions/bandwidth.pyx +428 -0
  163. sage/graphs/graph_decompositions/clique_separators.cpython-310-aarch64-linux-gnu.so +0 -0
  164. sage/graphs/graph_decompositions/clique_separators.pyx +616 -0
  165. sage/graphs/graph_decompositions/cutwidth.cpython-310-aarch64-linux-gnu.so +0 -0
  166. sage/graphs/graph_decompositions/cutwidth.pyx +753 -0
  167. sage/graphs/graph_decompositions/fast_digraph.cpython-310-aarch64-linux-gnu.so +0 -0
  168. sage/graphs/graph_decompositions/fast_digraph.pxd +13 -0
  169. sage/graphs/graph_decompositions/fast_digraph.pyx +212 -0
  170. sage/graphs/graph_decompositions/graph_products.cpython-310-aarch64-linux-gnu.so +0 -0
  171. sage/graphs/graph_decompositions/graph_products.pyx +508 -0
  172. sage/graphs/graph_decompositions/modular_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
  173. sage/graphs/graph_decompositions/modular_decomposition.pxd +27 -0
  174. sage/graphs/graph_decompositions/modular_decomposition.pyx +1536 -0
  175. sage/graphs/graph_decompositions/slice_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
  176. sage/graphs/graph_decompositions/slice_decomposition.pxd +18 -0
  177. sage/graphs/graph_decompositions/slice_decomposition.pyx +1106 -0
  178. sage/graphs/graph_decompositions/tree_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
  179. sage/graphs/graph_decompositions/tree_decomposition.pxd +17 -0
  180. sage/graphs/graph_decompositions/tree_decomposition.pyx +1996 -0
  181. sage/graphs/graph_decompositions/vertex_separation.cpython-310-aarch64-linux-gnu.so +0 -0
  182. sage/graphs/graph_decompositions/vertex_separation.pxd +5 -0
  183. sage/graphs/graph_decompositions/vertex_separation.pyx +1963 -0
  184. sage/graphs/graph_editor.py +82 -0
  185. sage/graphs/graph_generators.py +3314 -0
  186. sage/graphs/graph_generators_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
  187. sage/graphs/graph_generators_pyx.pyx +95 -0
  188. sage/graphs/graph_input.py +812 -0
  189. sage/graphs/graph_latex.py +2064 -0
  190. sage/graphs/graph_list.py +410 -0
  191. sage/graphs/graph_plot.py +1756 -0
  192. sage/graphs/graph_plot_js.py +338 -0
  193. sage/graphs/hyperbolicity.cpython-310-aarch64-linux-gnu.so +0 -0
  194. sage/graphs/hyperbolicity.pyx +1704 -0
  195. sage/graphs/hypergraph_generators.py +364 -0
  196. sage/graphs/independent_sets.cpython-310-aarch64-linux-gnu.so +0 -0
  197. sage/graphs/independent_sets.pxd +13 -0
  198. sage/graphs/independent_sets.pyx +402 -0
  199. sage/graphs/isgci.py +1033 -0
  200. sage/graphs/isoperimetric_inequalities.cpython-310-aarch64-linux-gnu.so +0 -0
  201. sage/graphs/isoperimetric_inequalities.pyx +489 -0
  202. sage/graphs/line_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  203. sage/graphs/line_graph.pyx +743 -0
  204. sage/graphs/lovasz_theta.py +77 -0
  205. sage/graphs/matching.py +1633 -0
  206. sage/graphs/matching_covered_graph.py +3590 -0
  207. sage/graphs/orientations.py +1489 -0
  208. sage/graphs/partial_cube.py +459 -0
  209. sage/graphs/path_enumeration.cpython-310-aarch64-linux-gnu.so +0 -0
  210. sage/graphs/path_enumeration.pyx +2040 -0
  211. sage/graphs/pq_trees.py +1129 -0
  212. sage/graphs/print_graphs.py +201 -0
  213. sage/graphs/schnyder.py +865 -0
  214. sage/graphs/spanning_tree.cpython-310-aarch64-linux-gnu.so +0 -0
  215. sage/graphs/spanning_tree.pyx +1457 -0
  216. sage/graphs/strongly_regular_db.cpython-310-aarch64-linux-gnu.so +0 -0
  217. sage/graphs/strongly_regular_db.pyx +3340 -0
  218. sage/graphs/traversals.cpython-310-aarch64-linux-gnu.so +0 -0
  219. sage/graphs/traversals.pxd +9 -0
  220. sage/graphs/traversals.pyx +1872 -0
  221. sage/graphs/trees.cpython-310-aarch64-linux-gnu.so +0 -0
  222. sage/graphs/trees.pxd +15 -0
  223. sage/graphs/trees.pyx +310 -0
  224. sage/graphs/tutte_polynomial.py +713 -0
  225. sage/graphs/views.cpython-310-aarch64-linux-gnu.so +0 -0
  226. sage/graphs/views.pyx +794 -0
  227. sage/graphs/weakly_chordal.cpython-310-aarch64-linux-gnu.so +0 -0
  228. sage/graphs/weakly_chordal.pyx +604 -0
  229. sage/groups/all__sagemath_graphs.py +1 -0
  230. sage/groups/perm_gps/all__sagemath_graphs.py +1 -0
  231. sage/groups/perm_gps/partn_ref/all__sagemath_graphs.py +1 -0
  232. sage/groups/perm_gps/partn_ref/refinement_graphs.cpython-310-aarch64-linux-gnu.so +0 -0
  233. sage/groups/perm_gps/partn_ref/refinement_graphs.pxd +38 -0
  234. sage/groups/perm_gps/partn_ref/refinement_graphs.pyx +1666 -0
  235. sage/knots/all.py +6 -0
  236. sage/knots/free_knotinfo_monoid.py +507 -0
  237. sage/knots/gauss_code.py +291 -0
  238. sage/knots/knot.py +682 -0
  239. sage/knots/knot_table.py +284 -0
  240. sage/knots/knotinfo.py +2900 -0
  241. sage/knots/link.py +4715 -0
  242. sage/sandpiles/all.py +13 -0
  243. sage/sandpiles/examples.py +225 -0
  244. sage/sandpiles/sandpile.py +6365 -0
  245. sage/topology/all.py +22 -0
  246. sage/topology/cell_complex.py +1214 -0
  247. sage/topology/cubical_complex.py +1976 -0
  248. sage/topology/delta_complex.py +1806 -0
  249. sage/topology/filtered_simplicial_complex.py +744 -0
  250. sage/topology/moment_angle_complex.py +823 -0
  251. sage/topology/simplicial_complex.py +5160 -0
  252. sage/topology/simplicial_complex_catalog.py +92 -0
  253. sage/topology/simplicial_complex_examples.py +1680 -0
  254. sage/topology/simplicial_complex_homset.py +205 -0
  255. sage/topology/simplicial_complex_morphism.py +836 -0
  256. sage/topology/simplicial_set.py +4102 -0
  257. sage/topology/simplicial_set_catalog.py +55 -0
  258. sage/topology/simplicial_set_constructions.py +2954 -0
  259. sage/topology/simplicial_set_examples.py +865 -0
  260. sage/topology/simplicial_set_morphism.py +1464 -0
@@ -0,0 +1,1231 @@
1
+ # sage_setup: distribution = sagemath-graphs
2
+ r"""
3
+ KnotInfo database
4
+
5
+ This module contains the class :class:`KnotInfoDataBase` and auxiliary classes
6
+ for it, which serves as an interface to the lists of named knots and links provided
7
+ at the web-pages `KnotInfo <https://knotinfo.math.indiana.edu/>`__ and
8
+ `LinkInfo <https://linkinfo.sitehost.iu.edu>`__.
9
+
10
+ To use the database, you need to install the optional :ref:`database_knotinfo
11
+ <spkg_database_knotinfo>` package by the Sage command ::
12
+
13
+ sage -i database_knotinfo
14
+
15
+ EXAMPLES::
16
+
17
+ sage: # optional - database_knotinfo
18
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
19
+ sage: ki_db = KnotInfoDataBase()
20
+ sage: ki_db
21
+ <sage.databases.knotinfo_db.KnotInfoDataBase object at ...>
22
+
23
+ AUTHORS:
24
+
25
+ - Sebastian Oehms (2020-08): initial version
26
+ """
27
+ ##############################################################################
28
+ # Copyright (C) 2020 Sebastian Oehms <seb.oehms@gmail.com>
29
+ #
30
+ # This program is free software: you can redistribute it and/or modify
31
+ # it under the terms of the GNU General Public License as published by
32
+ # the Free Software Foundation, either version 2 of the License, or
33
+ # (at your option) any later version.
34
+ # https://www.gnu.org/licenses/
35
+ ##############################################################################
36
+ import os
37
+ from enum import Enum
38
+
39
+ from sage.structure.sage_object import SageObject
40
+ from sage.structure.unique_representation import UniqueRepresentation
41
+ from sage.misc.persist import save, load
42
+ from sage.misc.verbose import verbose
43
+ from sage.misc.cachefunc import cached_method
44
+
45
+ columns_white_list = ['knot_atlas_anon', 'knotilus_page_anon']
46
+ columns_black_list = ['homfly_polynomial_old']
47
+
48
+
49
+ class KnotInfoColumnTypes(Enum):
50
+ r"""
51
+ Enum class to specify if a column from the table of knots and links provided
52
+ at the web-pages `KnotInfo <https://knotinfo.math.indiana.edu/>`__ and
53
+ `LinkInfo <https://linkinfo.sitehost.iu.edu>`__. is used for knots only,
54
+ links only or both.
55
+
56
+ EXAMPLES::
57
+
58
+ sage: from sage.databases.knotinfo_db import KnotInfoColumnTypes
59
+ sage: [col_type for col_type in KnotInfoColumnTypes]
60
+ [<KnotInfoColumnTypes.OnlyKnots: 'K'>,
61
+ <KnotInfoColumnTypes.OnlyLinks: 'L'>,
62
+ <KnotInfoColumnTypes.KnotsAndLinks: 'B'>]
63
+ """
64
+ OnlyKnots = 'K' # column that is only used in the KnotInfo table
65
+ OnlyLinks = 'L' # column that is only used in the LinkInfo table
66
+ KnotsAndLinks = 'B' # column that is only used in both tables
67
+
68
+
69
+ class KnotInfoColumns(Enum):
70
+ r"""
71
+ Enum class to select a column from the table of knots and links provided
72
+ at the web-pages `KnotInfo <https://knotinfo.math.indiana.edu/>`__ and
73
+ `LinkInfo <https://linkinfo.sitehost.iu.edu>`__.
74
+
75
+ EXAMPLES::
76
+
77
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
78
+ sage: ki_db = KnotInfoDataBase()
79
+ sage: cols = ki_db.columns(); cols
80
+ <enum 'Columns'>
81
+ sage: from sage.databases.knotinfo_db import KnotInfoColumns
82
+ sage: isinstance(cols.name, KnotInfoColumns)
83
+ True
84
+
85
+ sage: def only_links(c):
86
+ ....: return c.column_type() == c.types.OnlyLinks
87
+ sage: [c.column_name() for c in cols if only_links(c)] # optional - database_knotinfo
88
+ ['Name - Unoriented',
89
+ 'Orientation',
90
+ 'Unoriented Rank',
91
+ 'PD Notation (vector)',
92
+ 'PD Notation (KnotTheory)',
93
+ 'Braid Notation',
94
+ 'Quasipositive Braid',
95
+ 'Multivariable Alexander Polynomial',
96
+ 'HOMFLYPT Polynomial',
97
+ 'Khovanov Polynomial',
98
+ 'Unoriented',
99
+ 'Arc Notation',
100
+ 'Linking Matrix',
101
+ 'Rolfsen Name',
102
+ 'Components',
103
+ 'DT code',
104
+ 'Splitting Number',
105
+ 'Nullity',
106
+ 'Unlinking Number',
107
+ 'Weak Splitting Number']
108
+ """
109
+ @property
110
+ def types(self):
111
+ r"""
112
+ Return :class:`KnotInfoColumnTypes` to be used for checks.
113
+
114
+ EXAMPLES::
115
+
116
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
117
+ sage: ki_db = KnotInfoDataBase()
118
+ sage: cols = ki_db.columns()
119
+ sage: cols.dt_code.column_type() == cols.dt_code.types.OnlyLinks
120
+ True
121
+ """
122
+ return KnotInfoColumnTypes
123
+
124
+ def column_name(self):
125
+ r"""
126
+ Return the name of ``self`` displayed on the KnotInfo web-page.
127
+
128
+ EXAMPLES::
129
+
130
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
131
+ sage: ki_db = KnotInfoDataBase()
132
+ sage: cols = ki_db.columns()
133
+ sage: cols.dt_code.column_name()
134
+ 'DT code'
135
+ """
136
+ return self.value[0]
137
+
138
+ def column_type(self):
139
+ r"""
140
+ Return the type of ``self``. That is an instance of ``Enum``
141
+ :class:`KnotInfoColumnTypes`.
142
+
143
+ EXAMPLES::
144
+
145
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
146
+ sage: ki_db = KnotInfoDataBase()
147
+ sage: cols = ki_db.columns()
148
+ sage: cols.homfly_polynomial.column_type()
149
+ <KnotInfoColumnTypes.OnlyKnots: 'K'>
150
+ sage: cols.homflypt_polynomial.column_type()
151
+ <KnotInfoColumnTypes.OnlyLinks: 'L'>
152
+ sage: cols.name.column_type()
153
+ <KnotInfoColumnTypes.KnotsAndLinks: 'B'>
154
+ """
155
+ return self.value[1]
156
+
157
+ def description_webpage(self, new=0, autoraise=True):
158
+ r"""
159
+ Launch the description page of ``self`` in the standard web browser.
160
+
161
+ EXAMPLES::
162
+
163
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
164
+ sage: ki_db = KnotInfoDataBase()
165
+ sage: cols = ki_db.columns()
166
+ sage: cols.pd_notation.description_webpage() # not tested
167
+ True
168
+ sage: cols.homflypt_polynomial.description_webpage() # not tested
169
+ True
170
+ """
171
+ import webbrowser
172
+ if self.column_type() == self.types.OnlyLinks:
173
+ url = KnotInfoFilename.links.description_url(self)
174
+ else:
175
+ url = KnotInfoFilename.knots.description_url(self)
176
+ return webbrowser.open(url, new=new, autoraise=autoraise)
177
+
178
+
179
+ class KnotInfoFilename(Enum):
180
+ r"""
181
+ Enum for the different data files. The following choices are possible:
182
+
183
+ - ``knots`` -- contains the data from KnotInfo
184
+ - ``links`` -- contains the data for proper links from LinkInfo
185
+
186
+ Examples::
187
+
188
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
189
+ sage: ki_db = KnotInfoDataBase()
190
+ sage: ki_db.filename
191
+ <enum 'KnotInfoFilename'>
192
+ """
193
+
194
+ def url(self):
195
+ r"""
196
+ Return the URL to download the data from the web-page.
197
+
198
+ Examples::
199
+
200
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
201
+ sage: ki_db = KnotInfoDataBase()
202
+ sage: ki_db.filename.knots.url()
203
+ 'https://knotinfo.math.indiana.edu/'
204
+ """
205
+ if self == KnotInfoFilename.knots:
206
+ return self.value[0]
207
+ else:
208
+ return self.value[0]
209
+
210
+ def excel(self):
211
+ r"""
212
+ Return the Excel-file name to download the data from the web-page.
213
+
214
+ Examples::
215
+
216
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
217
+ sage: ki_db = KnotInfoDataBase()
218
+ sage: ki_db.filename.knots.excel()
219
+ 'knotinfo_data_complete.xls'
220
+ """
221
+ if self == KnotInfoFilename.knots:
222
+ return '%s.xls' % (self.value[1])
223
+ else:
224
+ return '%s.xlsx' % (self.value[1])
225
+
226
+ def csv(self):
227
+ r"""
228
+ Return the file name under which the data from the web-page
229
+ are stored as csv file.
230
+
231
+ Examples::
232
+
233
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
234
+ sage: ki_db = KnotInfoDataBase()
235
+ sage: ki_db.filename.knots.csv()
236
+ 'knotinfo_data_complete.csv'
237
+ """
238
+ return '%s.csv' % (self.value[1])
239
+
240
+ def num_knots(self, version):
241
+ r"""
242
+ Return the file name under which the number of knots is stored
243
+ in an sobj-file.
244
+
245
+ Examples::
246
+
247
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
248
+ sage: ki_db = KnotInfoDataBase()
249
+ sage: ki_db.filename.knots.num_knots('21.7')
250
+ 'num_knots_21.7.sobj'
251
+ """
252
+ return 'num_knots_%s.sobj' % version
253
+
254
+ def sobj_row(self):
255
+ r"""
256
+ Return the file name under which the row-data of the csv-File
257
+ is stored as python dictionary in a sobj-file.
258
+
259
+ Examples::
260
+
261
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
262
+ sage: ki_db = KnotInfoDataBase()
263
+ sage: ki_db.filename.knots.sobj_row()
264
+ 'row_dict.sobj'
265
+ """
266
+ return 'row_dict.sobj'
267
+
268
+ def sobj_column(self):
269
+ r"""
270
+ Return the file name under which the column-data of the csv-File
271
+ is stored as python dictionary in a sobj-file.
272
+
273
+ Examples::
274
+
275
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
276
+ sage: ki_db = KnotInfoDataBase()
277
+ sage: ki_db.filename.knots.sobj_column()
278
+ 'column_dict.sobj'
279
+ """
280
+ return 'column_dict.sobj'
281
+
282
+ def sobj_data(self, column):
283
+ r"""
284
+ Return the file name under which the data of the given
285
+ column is stored as python list in a sobj-file.
286
+
287
+ Examples::
288
+
289
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
290
+ sage: ki_db = KnotInfoDataBase()
291
+ sage: ki_db.filename.knots.sobj_data(ki_db.columns().braid_notation)
292
+ 'knotinfo_braid_notation'
293
+ """
294
+ if column.column_type() == column.types.OnlyLinks:
295
+ return 'linkinfo_%s' % (column.name)
296
+ else:
297
+ return 'knotinfo_%s' % (column.name)
298
+
299
+ def description_url(self, column):
300
+ r"""
301
+ Return the url of the description page of the given column.
302
+
303
+ Examples::
304
+
305
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
306
+ sage: ki_db = KnotInfoDataBase()
307
+ sage: ki_db.filename.knots.description_url(ki_db.columns().braid_notation)
308
+ 'https://knotinfo.math.indiana.edu/descriptions/braid_notation.html'
309
+ """
310
+ return '%sdescriptions/%s.html' % (self.url(), column.name)
311
+
312
+ def diagram_url(self, fname, single=False):
313
+ r"""
314
+ Return the url of the diagram page of the given link.
315
+
316
+ Examples::
317
+
318
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
319
+ sage: ki_db = KnotInfoDataBase()
320
+ sage: ki_db.filename.knots.diagram_url('3_1-50.png')
321
+ 'https://knotinfo.math.indiana.edu/diagram_display.php?3_1-50.png'
322
+ sage: ki_db.filename.knots.diagram_url('3_1', single=True)
323
+ 'https://knotinfo.math.indiana.edu/diagrams/3_1'
324
+ """
325
+ if single:
326
+ return '%sdiagrams/%s' % (self.url(), fname)
327
+ else:
328
+ return '%sdiagram_display.php?%s' % (self.url(), fname)
329
+
330
+ knots = ['https://knotinfo.math.indiana.edu/', 'knotinfo_data_complete']
331
+ links = ['https://linkinfo.sitehost.iu.edu/', 'linkinfo_data_complete']
332
+
333
+
334
+ #----------------------------------------------------------------------------------------------------------------------------
335
+ # Class to provide data for knots and links from the KnotInfo web-page
336
+ #----------------------------------------------------------------------------------------------------------------------------
337
+ class KnotInfoDataBase(SageObject, UniqueRepresentation):
338
+ r"""
339
+ Database interface to KnotInfo.
340
+
341
+ The original data are obtained from KnotInfo web-page (URL see the example
342
+ below). In order to have these data installed during the build process as
343
+ a sage-package they are converted as csv files into a tarball. This tarball
344
+ has been created using the method :meth:`create_spkg_tarball`.
345
+
346
+ EXAMPLES::
347
+
348
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
349
+ sage: ki_db = KnotInfoDataBase()
350
+ sage: ki_db.filename.knots
351
+ <KnotInfoFilename.knots: ['https://knotinfo.math.indiana.edu/',
352
+ 'knotinfo_data_complete']>
353
+ """
354
+
355
+ filename = KnotInfoFilename
356
+
357
+ def __init__(self, install=False):
358
+ r"""
359
+ Python constructor.
360
+
361
+ EXAMPLES::
362
+
363
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
364
+ sage: ki_db = KnotInfoDataBase()
365
+ sage: ki_db.filename.links
366
+ <KnotInfoFilename.links: ['https://linkinfo.sitehost.iu.edu/',
367
+ 'linkinfo_data_complete']>
368
+ """
369
+ # some constants
370
+ self._names_column = 'name'
371
+ self._components_column = 'components'
372
+ self._knot_prefix = 'K'
373
+
374
+ self._knot_list = None
375
+ self._link_list = None
376
+ self._demo = None
377
+ self._num_knots = None
378
+
379
+ from sage.features.databases import DatabaseKnotInfo
380
+ from sage.env import DOT_SAGE
381
+ self._feature = DatabaseKnotInfo()
382
+ self._sobj_path = os.path.join(DOT_SAGE, 'knotinfo')
383
+
384
+ def create_filecache(self, force=False):
385
+ r"""
386
+ Create the internal files containing the database.
387
+
388
+ INPUT:
389
+
390
+ - ``force`` -- boolean (default: ``False``); if set to ``True`` the
391
+ existing file-cache is overwritten
392
+
393
+ EXAMPLES::
394
+
395
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
396
+ sage: ki_db = KnotInfoDataBase()
397
+ sage: ki_db.create_filecache() # optional - database_knotinfo
398
+ """
399
+ if not self._feature.is_present():
400
+ return
401
+
402
+ if os.path.isdir(self._sobj_path):
403
+ # if it exists then remove it if it belongs to an older version of
404
+ # the database or should be reset by the user because it is damaged.
405
+ test_version = os.path.join(self._sobj_path, self.filename.knots.num_knots(self.version()))
406
+ if force or not os.path.isfile(test_version):
407
+ import shutil
408
+ shutil.rmtree(self._sobj_path)
409
+
410
+ from sage.misc.temporary_file import atomic_dir
411
+ with atomic_dir(self._sobj_path) as d:
412
+ sobj_path = d.name
413
+ num_knots_file = os.path.join(sobj_path, self.filename.knots.num_knots(self.version()))
414
+ knot_list = self.knot_list()
415
+ num_knots = len(knot_list) - 1
416
+ save(num_knots, num_knots_file)
417
+ self._num_knots = num_knots
418
+ self._create_col_dict_sobj(sobj_path=sobj_path)
419
+ self._create_data_sobj(sobj_path=sobj_path)
420
+ return
421
+
422
+ def version(self):
423
+ r"""
424
+ Return the version of the database currently installed on the device.
425
+
426
+ .. NOTE::
427
+
428
+ The development of the original databases on the KnotInfo and
429
+ LinkInfo web-pages is in a continuous flow. The installed version
430
+ can be behind the current available state of these databases. Every
431
+ month a cronjob on the
432
+ `GitHub repository <https://github.com/soehms/database_knotinfo/>`__
433
+ searches for differences and creates a new release on
434
+ `PyPI <https://pypi.org/project/database-knotinfo/>`__ in case of
435
+ success.
436
+
437
+ If you note that your version is behind the version on PyPI
438
+ and would like to have Sage working with that release you should
439
+ first try to upgrade using ``sage -i database_knotinfo``. If this
440
+ is not successful even though you are on the latest Sage release
441
+ please create an issue for that in the GitHub repository.
442
+
443
+ EXAMPLES::
444
+
445
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
446
+ sage: ki_db = KnotInfoDataBase()
447
+ sage: ki_db.version() >= '2021.10.1' # optional database_knotinfo
448
+ True
449
+ """
450
+ self._feature.require()
451
+ from database_knotinfo import version
452
+ return version()
453
+
454
+ def demo_version(self):
455
+ r"""
456
+ Return whether the KnotInfo databases are installed completely or
457
+ just the demo version is used.
458
+
459
+ EXAMPLES::
460
+
461
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
462
+ sage: ki_db = KnotInfoDataBase()
463
+ sage: ki_db.demo_version() # optional - database_knotinfo
464
+ False
465
+ """
466
+ if self._demo is None:
467
+ if self._feature.is_present():
468
+ num_knots_file = os.path.join(self._sobj_path, self.filename.knots.num_knots(self.version()))
469
+ from builtins import FileNotFoundError
470
+ try:
471
+ self._num_knots = load(num_knots_file)
472
+ except FileNotFoundError:
473
+ self.create_filecache()
474
+ self._demo = False
475
+ else:
476
+ self._demo = True
477
+ self._num_knots = len([v for v in row_demo_sample.values() if v[1] == 1])
478
+ return self._demo
479
+
480
+ def knot_list(self):
481
+ r"""
482
+ Return the KnotInfo table rows as Python list.
483
+
484
+ EXAMPLES::
485
+
486
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
487
+ sage: ki_db = KnotInfoDataBase()
488
+ sage: len(ki_db.knot_list()) # not tested (just used on installation)
489
+ """
490
+ if self._knot_list:
491
+ return self._knot_list
492
+
493
+ from database_knotinfo import link_list
494
+ self._knot_list = link_list()
495
+ return self._knot_list
496
+
497
+ def link_list(self):
498
+ r"""
499
+ Return the LinkInfo table rows as Python list.
500
+
501
+ EXAMPLES::
502
+
503
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
504
+ sage: ki_db = KnotInfoDataBase()
505
+ sage: len(ki_db.link_list()) # not tested (just used on installation)
506
+ """
507
+ if self._link_list:
508
+ return self._link_list
509
+
510
+ from database_knotinfo import link_list
511
+ self._link_list = link_list(proper_links=True)
512
+ return self._link_list
513
+
514
+ def _create_col_dict_sobj(self, sobj_path=None):
515
+ r"""
516
+ Create ``sobj`` files containing the number of knots and a dictionary
517
+ for the columns of the table.
518
+
519
+ EXAMPLES::
520
+
521
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
522
+ sage: ki_db = KnotInfoDataBase()
523
+ sage: ki_db._create_col_dict_sobj() # not tested (used on installation)
524
+ """
525
+ knot_list = self.knot_list()
526
+ knot_column_names = knot_list[0]
527
+
528
+ link_list = self.link_list()
529
+ link_column_names = link_list[0]
530
+
531
+ column_dict = {}
532
+
533
+ if not sobj_path:
534
+ sobj_path = self._sobj_path
535
+
536
+ # ----------------------------------------------------------------
537
+ # Columns that exist for knots and links
538
+ # ----------------------------------------------------------------
539
+ for col in knot_column_names:
540
+
541
+ name = knot_column_names[col]
542
+ if not name and col not in columns_white_list:
543
+ # not of interest
544
+ continue
545
+
546
+ if col in columns_black_list:
547
+ # not of interest
548
+ continue
549
+
550
+ col_type = KnotInfoColumnTypes.OnlyKnots
551
+ if col in link_column_names:
552
+ col_type = KnotInfoColumnTypes.KnotsAndLinks
553
+ column_dict[col] = [name, col_type]
554
+
555
+ # ----------------------------------------------------------------
556
+ # Columns that exist for links only
557
+ # ----------------------------------------------------------------
558
+ for col in link_column_names:
559
+
560
+ name = link_column_names[col]
561
+ if not name and col not in columns_white_list:
562
+ # not of interest
563
+ continue
564
+
565
+ if col in columns_black_list:
566
+ # not of interest
567
+ continue
568
+
569
+ if col in knot_column_names:
570
+ # already used
571
+ continue
572
+
573
+ col_type = KnotInfoColumnTypes.OnlyLinks
574
+ column_dict[col] = [name, col_type]
575
+
576
+ save(column_dict, '%s/%s' % (sobj_path, self.filename.knots.sobj_column()))
577
+
578
+ def _create_data_sobj(self, sobj_path=None):
579
+ r"""
580
+ Create ``sobj`` files containing the contents of the whole table.
581
+
582
+ To each column there is created one file containing a list of
583
+ strings giving the entries of the database table.
584
+
585
+ The length of these lists depends on the type of the corresponding
586
+ column. If a column is used in both tables
587
+ (``KnotInfoColumnTypes.KnotsAndLinks``) the list of proper links
588
+ is appended to the list of knots. In both other cases the length
589
+ of the list corresponds to the number of listed knots and proper
590
+ links respectively.
591
+
592
+ EXAMPLES::
593
+
594
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
595
+ sage: ki_db = KnotInfoDataBase()
596
+ sage: ki_db._create_data_sobj() # not tested (just used on installation)
597
+ """
598
+ knot_list = self.knot_list()
599
+ link_list = self.link_list()
600
+ len_knots = len(knot_list)
601
+ len_links = len(link_list)
602
+
603
+ row_dict = {}
604
+
605
+ if not sobj_path:
606
+ sobj_path = self._sobj_path
607
+
608
+ # ----------------------------------------------------------------
609
+ # Columns that exist for knots and links
610
+ # ----------------------------------------------------------------
611
+ column_dict = load('%s/%s' % (sobj_path, self.filename.knots.sobj_column()))
612
+ cols = KnotInfoColumns('ColsTemp', column_dict)
613
+ for col in cols:
614
+ val_list = []
615
+
616
+ if col.column_type() != col.types.OnlyLinks:
617
+ for i in range(1, len_knots):
618
+ if col.name == self._names_column:
619
+ row_dict[self._knot_prefix + knot_list[i][col.name]] = [i - 1, 1]
620
+
621
+ val_list.append(knot_list[i][col.name])
622
+
623
+ if col.column_type() != col.types.OnlyKnots:
624
+ for i in range(1, len_links):
625
+ if col.name == self._names_column:
626
+ link_name = link_list[i][col.name]
627
+ link_name = link_name.replace('{', '_')
628
+ link_name = link_name.replace(',', '_')
629
+ link_name = link_name.replace('}', '')
630
+
631
+ num_comp = int(link_list[i][self._components_column])
632
+ row_dict[link_name] = [i + len_knots - 2, num_comp]
633
+
634
+ val_list.append(link_list[i][col.name])
635
+
636
+ if val_list:
637
+ save(val_list, '%s/%s' % (sobj_path, self.filename.knots.sobj_data(col)))
638
+
639
+ save(row_dict, '%s/%s' % (sobj_path, self.filename.knots.sobj_row()))
640
+
641
+ @cached_method
642
+ def columns(self):
643
+ r"""
644
+ Return the columns ot the database table as instances of enum class
645
+ :class:`KnotInfoColumns`.
646
+
647
+ EXAMPLES::
648
+
649
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
650
+ sage: ki_db = KnotInfoDataBase()
651
+ sage: cols = ki_db.columns()
652
+ sage: [col.column_name() for col in cols if col.name.startswith('pd')] # optional - database_knotinfo
653
+ ['PD Notation', 'PD Notation (vector)', 'PD Notation (KnotTheory)']
654
+ """
655
+ column_dict = self.read_column_dict()
656
+ return KnotInfoColumns('Columns', column_dict)
657
+
658
+ # -------------------------------------------------------------------------------------------------------------
659
+ # read the dictionary for the column names from sobj-file
660
+ # -------------------------------------------------------------------------------------------------------------
661
+ @cached_method
662
+ def read_column_dict(self):
663
+ r"""
664
+ Read the dictionary for the column names from the according sobj-file.
665
+
666
+ OUTPUT: a Python dictionary containing the column names and types
667
+
668
+ EXAMPLES::
669
+
670
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
671
+ sage: ki_db = KnotInfoDataBase()
672
+ sage: len(ki_db.read_column_dict()) > 120 # optional - database_knotinfo
673
+ True
674
+ """
675
+ if self.demo_version():
676
+ return column_demo_sample
677
+ sobj_path = self._sobj_path
678
+ filename = self.filename.knots.sobj_column()
679
+ return load('%s/%s' % (sobj_path, filename))
680
+
681
+ # -------------------------------------------------------------------------------------------------------------
682
+ # read the dictionary for the row names that is the knot and link names from sobj-file
683
+ # -------------------------------------------------------------------------------------------------------------
684
+ @cached_method
685
+ def read_row_dict(self):
686
+ r"""
687
+ Read the dictionary for the row names that is the knot and link names
688
+ from the according sobj-file
689
+
690
+ OUTPUT:
691
+
692
+ A python dictionary containing the names of the knots and links
693
+ together with their table index and the corresponding number of
694
+ components
695
+
696
+ EXAMPLES::
697
+
698
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
699
+ sage: ki_db = KnotInfoDataBase()
700
+ sage: ki_db.read_row_dict()['K7_1']
701
+ [8, 1]
702
+ """
703
+ if self.demo_version():
704
+ return row_demo_sample
705
+ sobj_path = self._sobj_path
706
+ filename = self.filename.knots.sobj_row()
707
+ return load('%s/%s' % (sobj_path, filename))
708
+
709
+ # -------------------------------------------------------------------------------------------------------------
710
+ # return a dictionary to obtain the original name to a row_dict key
711
+ # -------------------------------------------------------------------------------------------------------------
712
+ @cached_method
713
+ def row_names(self):
714
+ r"""
715
+ Return a dictionary to obtain the original name to a row_dict key.
716
+
717
+ OUTPUT: a Python dictionary containing the names of the knots and links
718
+ together with their original names from the database
719
+
720
+ EXAMPLES::
721
+
722
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
723
+ sage: ki_db = KnotInfoDataBase()
724
+ sage: ki_db.row_names()['K7_1'] # optional - database_knotinfo
725
+ '7_1'
726
+ """
727
+ row_dict = self.read_row_dict()
728
+ names = self.read(self.columns().name)
729
+ return {k:names[v[0]] for k, v in row_dict.items()}
730
+
731
+ # -------------------------------------------------------------------------------------------------------------
732
+ # read the number of knots contained in the database (without proper links) from the according sobj-file.
733
+ # -------------------------------------------------------------------------------------------------------------
734
+ def read_num_knots(self):
735
+ r"""
736
+ Read the number of knots contained in the database (without
737
+ proper links) from the according sobj-file.
738
+
739
+ OUTPUT: integer
740
+
741
+ EXAMPLES::
742
+
743
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
744
+ sage: ki_db = KnotInfoDataBase()
745
+ sage: ki_db.read_num_knots() # optional - database_knotinfo
746
+ 12966
747
+ """
748
+ if not self._num_knots:
749
+ self.demo_version()
750
+ return self._num_knots
751
+
752
+ # -------------------------------------------------------------------------------------------------------------
753
+ # read an sobj-file obtained from KnotInfo database
754
+ # -------------------------------------------------------------------------------------------------------------
755
+ @cached_method
756
+ def read(self, column):
757
+ r"""
758
+ Access a column of KnotInfo / LinkInfo.
759
+
760
+ INPUT:
761
+
762
+ - ``column`` -- instance of enum :class:`KnotInfoColumns`
763
+ to select the data to be read in
764
+
765
+ OUTPUT: a Python list containing the data corresponding to the column
766
+
767
+ EXAMPLES::
768
+
769
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
770
+ sage: ki_db = KnotInfoDataBase()
771
+ """
772
+ if not isinstance(column, KnotInfoColumns):
773
+ raise TypeError('column must be an instance of enum %s' % (KnotInfoColumns))
774
+
775
+ if self.demo_version():
776
+ return data_demo_sample[column]
777
+
778
+ sobj_path = self._sobj_path
779
+ if column.column_type() == column.types.OnlyLinks:
780
+ filename = self.filename.links.sobj_data(column)
781
+ else:
782
+ filename = self.filename.knots.sobj_data(column)
783
+
784
+ verbose('loading data library %s ...' % (filename))
785
+ res = load('%s/%s' % (sobj_path, filename))
786
+ verbose('... finished!')
787
+
788
+ return res
789
+
790
+ def _test_database(self, **options):
791
+ r"""
792
+ Method used by TestSuite. Performs :meth:`KnotInfoBase.is_recoverable`.
793
+
794
+ EXAMPLES::
795
+
796
+ sage: from sage.databases.knotinfo_db import KnotInfoDataBase
797
+ sage: ki_db = KnotInfoDataBase()
798
+ sage: TestSuite(ki_db).run() # optional - database_knotinfo, long time, indirect doctest
799
+ """
800
+ from sage.knots.knotinfo import KnotInfo
801
+ from sage.misc.misc import some_tuples
802
+ tester = options['tester']
803
+ max_samples = tester._max_samples
804
+ if not max_samples:
805
+ max_samples = 20
806
+ l = list(KnotInfo)
807
+ sample = some_tuples(l, 1, len(l), max_samples=max_samples)
808
+ tester.assertTrue(all(L.is_recoverable(unique=False) for L, in sample))
809
+
810
+
811
+ column_demo_sample = {
812
+ 'name': ['Name', KnotInfoColumnTypes.KnotsAndLinks],
813
+ 'name_unoriented': ['Name - Unoriented', KnotInfoColumnTypes.OnlyLinks],
814
+ 'dt_notation': ['DT Notation', KnotInfoColumnTypes.OnlyKnots],
815
+ 'gauss_notation': ['Gauss Notation', KnotInfoColumnTypes.KnotsAndLinks],
816
+ 'pd_notation': ['PD Notation', KnotInfoColumnTypes.OnlyKnots],
817
+ 'pd_notation_vector': ['PD Notation (vector)', KnotInfoColumnTypes.OnlyLinks],
818
+ 'crossing_number': ['Crossing Number', KnotInfoColumnTypes.KnotsAndLinks],
819
+ 'braid_index': ['Braid Index', KnotInfoColumnTypes.OnlyKnots],
820
+ 'braid_length': ['Braid Length', KnotInfoColumnTypes.OnlyKnots],
821
+ 'braid_notation': ['Braid Notation', KnotInfoColumnTypes.KnotsAndLinks],
822
+ 'braid_notation_old': ['Braid Notation', KnotInfoColumnTypes.OnlyLinks],
823
+ 'alternating': ['Alternating', KnotInfoColumnTypes.KnotsAndLinks],
824
+ 'alexander_polynomial': ['Alexander', KnotInfoColumnTypes.OnlyKnots],
825
+ 'jones_polynomial': ['Jones', KnotInfoColumnTypes.KnotsAndLinks],
826
+ 'conway_polynomial': ['Conway', KnotInfoColumnTypes.KnotsAndLinks],
827
+ 'homfly_polynomial': ['HOMFLY', KnotInfoColumnTypes.OnlyKnots],
828
+ 'homflypt_polynomial': ['HOMFLYPT Polynomial', KnotInfoColumnTypes.OnlyLinks],
829
+ 'kauffman_polynomial': ['Kauffman', KnotInfoColumnTypes.KnotsAndLinks],
830
+ 'khovanov_polynomial': ['Khovanov', KnotInfoColumnTypes.OnlyLinks],
831
+ 'khovanov_unreduced_integral_polynomial': ['KH Unred Z Poly', KnotInfoColumnTypes.OnlyKnots],
832
+ 'khovanov_reduced_integral_polynomial': ['KH Red Z Poly', KnotInfoColumnTypes.OnlyKnots],
833
+ 'khovanov_reduced_rational_polynomial': ['KH Red Q Poly', KnotInfoColumnTypes.OnlyKnots],
834
+ 'khovanov_reduced_mod2_polynomial': ['KH Red Mod2 Poly', KnotInfoColumnTypes.OnlyKnots],
835
+ 'khovanov_odd_integral_polynomial': ['KH Odd Red Z Poly', KnotInfoColumnTypes.OnlyKnots],
836
+ 'khovanov_odd_rational_polynomial': ['KH Odd Red Q Poly', KnotInfoColumnTypes.OnlyKnots],
837
+ 'khovanov_odd_mod2_polynomial': ['KH Red Odd Mod2 Poly', KnotInfoColumnTypes.OnlyKnots],
838
+ 'determinant': ['Determinant', KnotInfoColumnTypes.KnotsAndLinks],
839
+ 'positive': ['Positive', KnotInfoColumnTypes.OnlyKnots],
840
+ 'fibered': ['Fibered', KnotInfoColumnTypes.OnlyKnots],
841
+ 'unoriented': ['Unoriented', KnotInfoColumnTypes.OnlyLinks],
842
+ 'symmetry_type': ['Symmetry Type', KnotInfoColumnTypes.OnlyKnots],
843
+ 'geometric_type': ['Geometric Type', KnotInfoColumnTypes.OnlyKnots],
844
+ 'cosmetic_crossing': ['Cosmetic Crossing', KnotInfoColumnTypes.OnlyKnots],
845
+ 'width': ['Width', KnotInfoColumnTypes.OnlyKnots],
846
+ 'arc_notation': ['Arc Notation', KnotInfoColumnTypes.OnlyLinks],
847
+ 'dt_code': ['DT code', KnotInfoColumnTypes.OnlyLinks]
848
+ }
849
+
850
+
851
+ row_demo_sample = {
852
+ 'K0_1': [0, 1],
853
+ 'K3_1': [1, 1],
854
+ 'K4_1': [2, 1],
855
+ 'K5_1': [3, 1],
856
+ 'K5_2': [4, 1],
857
+ 'K6_1': [5, 1],
858
+ 'K6_2': [6, 1],
859
+ 'K6_3': [7, 1],
860
+ 'K7_1': [8, 1],
861
+ 'K7_2': [9, 1],
862
+ 'L2a1_0': [10, 2],
863
+ 'L2a1_1': [11, 2],
864
+ 'L4a1_0': [12, 2],
865
+ 'L4a1_1': [13, 2],
866
+ 'L5a1_0': [14, 2],
867
+ 'L5a1_1': [15, 2],
868
+ 'L6a1_0': [16, 2],
869
+ 'L6a1_1': [17, 2],
870
+ 'L6a2_0': [18, 2],
871
+ 'L6a2_1': [19, 2]
872
+ }
873
+
874
+ db = KnotInfoDataBase()
875
+ dc = db.columns()
876
+
877
+
878
+ data_demo_sample = {
879
+ dc.name: ['0_1', '3_1', '4_1', '5_1', '5_2', '6_1', '6_2', '6_3', '7_1', '7_2',
880
+ 'L2a1{0}', 'L2a1{1}', 'L4a1{0}', 'L4a1{1}', 'L5a1{0}', 'L5a1{1}',
881
+ 'L6a1{0}', 'L6a1{1}', 'L6a2{0}', 'L6a2{1}', 'L6a3{0}'
882
+ ],
883
+ dc.name_unoriented: ['L2a1', 'L2a1', 'L4a1', 'L4a1', 'L5a1', 'L5a1', 'L6a1', 'L6a1', 'L6a2', 'L6a2', 'L6a3'],
884
+ dc.crossing_number: ['0', '3', '4', '5', '5', '6', '6', '6', '7', '7', '2', '2', '4', '4', '5', '5', '6', '6', '6', '6', '6'],
885
+ dc.braid_notation: [
886
+ '',
887
+ '{1,1,1}',
888
+ '{1,-2,1,-2}',
889
+ '{1,1,1,1,1}',
890
+ '{1,1,1,2,-1,2}',
891
+ '{1,1,2,-1,-3,2,-3}',
892
+ '{1,1,1,-2,1,-2}',
893
+ '{1,1,-2,1,-2,-2}',
894
+ '{1,1,1,1,1,1,1}',
895
+ '{1,1,1,2,-1,2,3,-2,3}',
896
+ '{2, {-1, -1}}',
897
+ '{2, {1, 1}}',
898
+ '{3, {-2, -2, -1, 2, -1}}',
899
+ '{2, {1, 1, 1, 1}}',
900
+ '{3, {-1, 2, -1, 2, -1}}',
901
+ '{3, {-1, 2, -1, 2, -1}}',
902
+ '{4, {1, -2, 3, -2, 1, -2, -3, -2}}',
903
+ '{3, {2, 2, 2, 1, 1, -2, 1}}',
904
+ '{3, {-1, 2, -1, -2, -2, -1, -1}}',
905
+ '{3, {1, -2, 1, 2, 2, 1, 1}}',
906
+ '{2, {-1, -1, -1, -1, -1, -1}}'
907
+ ],
908
+ dc.braid_notation_old: [
909
+ '{2, {-1, -1}}',
910
+ '{2, {1, 1}}',
911
+ '{4, {1, -2, 3, -2, -1, -2, -3, -2}}',
912
+ '{2, {1, 1, 1, 1}}',
913
+ '{3, {-1, 2, -1, 2, -1}}',
914
+ '{3, {-1, 2, -1, 2, -1}}',
915
+ '{4, {1, -2, 3, -2, 1, -2, -3, -2}}',
916
+ '{4, {1, 2, 3, 2, 2, -1, 2, 2, -3, 2}}',
917
+ '{4, {1, -2, -2, -2, 3, -2, -1, -2, -3, -2}}',
918
+ '{4, {1, 2, -3, 2, -1, 2, 3, 2, 2, 2}}',
919
+ '{2, {-1, -1, -1, -1, -1, -1}}'
920
+ ],
921
+ dc.braid_index: ['1', '2', '3', '2', '3', '4', '3', '3', '2', '4'],
922
+ dc.braid_length: ['', '3', '4', '5', '6', '7', '6', '6', '7', '9'],
923
+ dc.determinant: ['0', '3', '5', '5', '7', '9', '11', '13', '7', '11', '2', '2', '4', '4', '8', '8', '12', '12', '10', '10', '6'],
924
+ dc.positive: ['', 'Y', 'N', 'Y', 'Y', 'N', 'N', 'N', 'Y', 'Y'],
925
+ dc.fibered: ['', 'Y', 'Y', 'Y', 'N', 'N', 'Y', 'Y', 'Y', 'N'],
926
+ dc.unoriented: ['Y', 'N', 'Y', 'N', 'Y', 'N', 'Y', 'N', 'Y', 'N', 'Y'],
927
+ dc.pd_notation: [
928
+ '',
929
+ '[[1,5,2,4],[3,1,4,6],[5,3,6,2]]',
930
+ '[[4,2,5,1],[8,6,1,5],[6,3,7,4],[2,7,3,8]]',
931
+ '[[2,8,3,7],[4,10,5,9],[6,2,7,1],[8,4,9,3],[10,6,1,5]]',
932
+ '[[1,5,2,4],[3,9,4,8],[5,1,6,10],[7,3,8,2],[9,7,10,6]]',
933
+ '[[1,7,2,6],[3,10,4,11],[5,3,6,2],[7,1,8,12],[9,4,10,5],[11,9,12,8]]',
934
+ '[[1,8,2,9],[3,11,4,10],[5,1,6,12],[7,2,8,3],[9,7,10,6],[11,5,12,4]]',
935
+ '[[4,2,5,1],[8,4,9,3],[12,9,1,10],[10,5,11,6],[6,11,7,12],[2,8,3,7]]',
936
+ '[[1,9,2,8],[3,11,4,10],[5,13,6,12],[7,1,8,14],[9,3,10,2],[11,5,12,4],[13,7,14,6]]',
937
+ '[[2,10,3,9],[4,14,5,13],[6,12,7,11],[8,2,9,1],[10,8,11,7],[12,6,13,5],[14,4,1,3]]',
938
+ ],
939
+ dc.pd_notation_vector: [
940
+ '{{4, 1, 3, 2}, {2, 3, 1, 4}}',
941
+ '{{4, 2, 3, 1}, {2, 4, 1, 3}}',
942
+ '{{6, 1, 7, 2}, {8, 3, 5, 4}, {2, 5, 3, 6}, {4, 7, 1, 8}}',
943
+ '{{6, 2, 7, 1}, {8, 4, 5, 3}, {2, 8, 3, 7}, {4, 6, 1, 5}}',
944
+ '{{6, 1, 7, 2}, {10, 7, 5, 8}, {4, 5, 1, 6}, {2, 10, 3, 9}, {8, 4, 9, 3}}',
945
+ '{{8, 2, 9, 1}, {10, 7, 5, 8}, {4, 10, 1, 9}, {2, 5, 3, 6}, {6, 3, 7, 4}}',
946
+ '{{6, 1, 7, 2}, {10, 3, 11, 4}, {12, 8, 5, 7}, {8, 12, 9, 11}, {2, 5, 3, 6}, {4, 9, 1, 10}}',
947
+ '{{10, 2, 11, 1}, {6, 4, 7, 3}, {12, 10, 5, 9}, {8, 6, 9, 5}, {2, 12, 3, 11}, {4, 8, 1, 7}}',
948
+ '{{8, 1, 9, 2}, {12, 5, 7, 6}, {10, 3, 11, 4}, {4, 11, 5, 12}, {2, 7, 3, 8}, {6, 9, 1, 10}}',
949
+ '{{10, 2, 11, 1}, {12, 6, 7, 5}, {8, 4, 9, 3}, {4, 8, 5, 7}, {2, 12, 3, 11}, {6, 10, 1, 9}}',
950
+ '{{8, 1, 9, 2}, {2, 9, 3, 10}, {10, 3, 11, 4}, {12, 5, 7, 6}, {6, 7, 1, 8}, {4, 11, 5, 12}}'
951
+ ],
952
+ dc.dt_notation: [
953
+ '',
954
+ '[4, 6, 2]',
955
+ '[4, 6, 8, 2]',
956
+ '[6, 8, 10, 2, 4]',
957
+ '[4, 8, 10, 2, 6]',
958
+ '[4, 8, 12, 10, 2, 6]',
959
+ '[4, 8, 10, 12, 2, 6]',
960
+ '[4, 8, 10, 2, 12, 6]',
961
+ '[8, 10, 12, 14, 2, 4, 6]',
962
+ '[4, 10, 14, 12, 2, 8, 6]'
963
+ ],
964
+ dc.dt_code: [
965
+ '[{4}, {2}]',
966
+ '[{4}, {2}]',
967
+ '[{6, 8}, {2, 4}]',
968
+ '[{6, 8}, {4, 2}]',
969
+ '[{6, 8}, {4, 10, 2}]',
970
+ '[{8, 6}, {2, 10, 4}]',
971
+ '[{6, 10}, {2, 12, 4, 8}]',
972
+ '[{10, 6}, {8, 4, 12, 2}]',
973
+ '[{8, 10, 12}, {2, 6, 4}]',
974
+ '[{10, 8, 12}, {4, 6, 2}]',
975
+ '[{8, 10, 12}, {6, 2, 4}]'
976
+ ],
977
+ dc.gauss_notation: [
978
+ '',
979
+ '{1, -2, 3, -1, 2, -3}',
980
+ '{-1, 2, -3, 1, -4, 3, -2, 4}',
981
+ '{-1, 2, -3, 4, -5, 1, -2, 3, -4, 5}',
982
+ '{1, -2, 3, -1, 4, -5, 2, -3, 5, -4}',
983
+ '{1, -2, 3, -4, 2, -1, 5, -6, 4, -3, 6, -5}',
984
+ '{1, -2, 3, -4, 5, -6, 2, -1, 6, -3, 4, -5}',
985
+ '{-1, 2, -3, 1, -4, 5, -2, 3, -6, 4, -5, 6}',
986
+ '{1, -2, 3, -4, 5, -6, 7, -1, 2, -3, 4, -5, 6, -7}',
987
+ '{-1, 2, -3, 4, -5, 6, -7, 1, -2, 7, -6, 5, -4, 3}',
988
+ '{{1, -2}, {2, -1}}',
989
+ '{{1, -2}, {2, -1}}',
990
+ '{{1, -3, 2, -4}, {3, -1, 4, -2}}',
991
+ '{{1, -3, 2, -4}, {4, -1, 3, -2}}',
992
+ '{{1, -4, 5, -3}, {3, -1, 2, -5, 4, -2}}',
993
+ '{{1, -4, 5, -3}, {4, -5, 2, -1, 3, -2}}',
994
+ '{{1, -5, 2, -6}, {5, -1, 3, -4, 6, -2, 4, -3}}',
995
+ '{{1, -5, 2, -6}, {4, -2, 6, -4, 3, -1, 5, -3}}',
996
+ '{{1, -5, 3, -4, 2, -6}, {5, -1, 6, -3, 4, -2}}',
997
+ '{{1, -5, 3, -4, 2, -6}, {4, -3, 6, -1, 5, -2}}',
998
+ '{{1, -2, 3, -6, 4, -5}, {5, -1, 2, -3, 6, -4}}'
999
+ ],
1000
+ dc.arc_notation: [
1001
+ '{{4, 2}, {3, 1}, {4, 2}, {1, 3}}',
1002
+ '{{2, 4}, {3, 1}, {2, 4}, {3, 1}}',
1003
+ '{{6, 4}, {3, 5}, {4, 2}, {1, 3}, {2, 6}, {5, 1}}',
1004
+ '{{3, 6}, {2, 5}, {6, 4}, {1, 3}, {5, 2}, {4, 1}}',
1005
+ '{{6, 2}, {1, 4}, {3, 5}, {4, 7}, {2, 6}, {7, 3}, {5, 1}}',
1006
+ '{{3, 5}, {6, 4}, {5, 2}, {7, 3}, {1, 6}, {2, 7}, {4, 1}}',
1007
+ '{{8, 4}, {3, 5}, {4, 2}, {6, 3}, {5, 7}, {1, 6}, {2, 8}, {7, 1}}',
1008
+ '{{2, 8}, {1, 7}, {8, 4}, {5, 3}, {4, 2}, {3, 6}, {7, 5}, {6, 1}}',
1009
+ '{{8, 3}, {2, 7}, {3, 1}, {4, 8}, {5, 2}, {6, 4}, {7, 5}, {1, 6}}',
1010
+ '{{3, 8}, {2, 7}, {8, 4}, {1, 3}, {5, 2}, {4, 6}, {7, 5}, {6, 1}}',
1011
+ '{{8, 2}, {1, 3}, {2, 4}, {3, 5}, {4, 6}, {5, 7}, {6, 8}, {7, 1}}'
1012
+ ],
1013
+ dc.alternating: ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'],
1014
+ dc.symmetry_type: [
1015
+ '',
1016
+ 'reversible',
1017
+ 'fully amphicheiral',
1018
+ 'reversible',
1019
+ 'reversible',
1020
+ 'reversible',
1021
+ 'reversible',
1022
+ 'fully amphicheiral',
1023
+ 'reversible',
1024
+ 'reversible'
1025
+ ],
1026
+ dc.geometric_type: [
1027
+ '',
1028
+ 'torus knot T(2,3)',
1029
+ 'hyperbolic',
1030
+ 'torus knot T(2,5)',
1031
+ 'hyperbolic',
1032
+ 'hyperbolic',
1033
+ 'hyperbolic',
1034
+ 'hyperbolic',
1035
+ 'torus knot T(2,7)',
1036
+ 'hyperbolic'],
1037
+ dc.cosmetic_crossing: ['', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N'],
1038
+ dc.homfly_polynomial: [
1039
+ '',
1040
+ '(2*v^2-v^4)+v^2*z^2',
1041
+ '(v^(-2)-1+v^2)-z^2',
1042
+ '(3*v^4-2*v^6)+(4*v^4-v^6)*z^2+v^4*z^4',
1043
+ '(v^2+v^4-v^6)+(v^2+v^4)*z^2',
1044
+ '(v^(-2)-v^2+v^4)+(-1-v^2)*z^2',
1045
+ '(2-2*v^2+v^4)+(1-3*v^2+v^4)*z^2-v^2*z^4',
1046
+ '(-v^(-2)+3-v^2)+(-v^(-2)+3-v^2)*z^2+z^4',
1047
+ '(4*v^6-3*v^8)+(10*v^6-4*v^8)*z^2+(6*v^6-v^8)*z^4+v^6*z^6',
1048
+ '(v^2+v^6-v^8)+(v^2+v^4+v^6)*z^2'
1049
+ ],
1050
+ dc.homflypt_polynomial: [
1051
+ '1/(v^3*z)-1/(v*z)-z/v',
1052
+ 'v/z-v^3/z + v*z',
1053
+ '1/(v^5*z)-1/(v^3*z)-z/v^3-z/v',
1054
+ 'v^3/z-v^5/z + 3*v^3*z-v^5*z + v^3*z^3',
1055
+ '1/(v*z)-v/z-z/v^3 + (2*z)/v-v*z + z^3/v',
1056
+ '1/(v*z)-v/z-z/v^3 + (2*z)/v-v*z + z^3/v',
1057
+ '1/(v^5*z)-1/(v^3*z)-(2*z)/v^3 + z/v-v*z + z^3/v',
1058
+ 'v^3/z-v^5/z + 2*v^3*z + v^5*z-v^7*z + v^3*z^3 + v^5*z^3',
1059
+ '1/(v^7*z)-1/(v^5*z) + z/v^7-(2*z)/v^5-(2*z)/v^3-z^3/v^5-z^3/v^3',
1060
+ 'v^5/z-v^7/z + 2*v^3*z + 2*v^5*z-v^7*z + v^3*z^3 + v^5*z^3',
1061
+ '1/(v^7*z)-1/(v^5*z) + (3*z)/v^7-(6*z)/v^5 + z^3/v^7-(5*z^3)/v^5-z^5/v^5'
1062
+ ],
1063
+ dc.kauffman_polynomial: [
1064
+ '',
1065
+ '(-a^(-4)-2*a^(-2))*z^(0)+ (a^(-5)+ a^(-3))*z^(1)+ (a^(-4)+ a^(-2))*z^(2)',
1066
+ '(-a^(-2)-1-a^2)*z^(0)+ (-a^(-1)-a)*z^(1)+ (a^(-2)+ 2+ a^2)*z^(2)+ (a^(-1)+ a)*z^(3)',
1067
+ '(2*a^(-6)+ 3*a^(-4))*z^(0)+ (a^(-9)-a^(-7)-2*a^(-5))*z^(1)+ (a^(-8)-3*a^(-6)-4*a^(-4))*z^(2)+ (a^(-7)+ a^(-5))*z^(3)+ (a^(-6)+ a^(-4))*z^(4)',
1068
+ '(a^(-6)+ a^(-4)-a^(-2))*z^(0)+ (-2*a^(-7)-2*a^(-5))*z^(1)+ (-2*a^(-6)-a^(-4)+ a^(-2))*z^(2)+ (a^(-7)+ 2*a^(-5)+ a^(-3))*z^(3)+ (a^(-6)+ a^(-4))*z^(4)',
1069
+ '(a^(-4)+ a^(-2)-a^2)*z^(0)+ (2*a^(-3)+ 2*a^(-1))*z^(1)+ (-3*a^(-4)-4*a^(-2)+ a^2)*z^(2)+ (-3*a^(-3)-2*a^(-1)+ a)*z^(3)+ (a^(-4)+ 2*a^(-2)+ 1)*z^(4)+ (a^(-3)+ a^(-1))*z^(5)',
1070
+ '(a^(-4)+ 2*a^(-2)+ 2)*z^(0)+ (-a^(-5)-a^(-3))*z^(1)+ (a^(-6)-2*a^(-4)-6*a^(-2)-3)*z^(2)+ (2*a^(-5)-2*a^(-1))*z^(3)+ (2*a^(-4)+ 3*a^(-2)+ 1)*z^(4)+ (a^(-3)+ a^(-1))*z^(5)',
1071
+ '(a^(-2)+ 3+ a^2)*z^(0)+ (-a^(-3)-2*a^(-1)-2*a-a^3)*z^(1)+ (-3*a^(-2)-6-3*a^2)*z^(2)+ (a^(-3)+ a^(-1)+ a+ a^3)*z^(3)+ (2*a^(-2)+ 4+ 2*a^2)*z^(4)+ (a^(-1)+ a)*z^(5)',
1072
+ '(-3*a^(-8)-4*a^(-6))*z^(0)+ (a^(-13)-a^(-11)+ a^(-9)+ 3*a^(-7))*z^(1)+ (a^(-12)-2*a^(-10)+ 7*a^(-8)+ 10*a^(-6))*z^(2)+ (a^(-11)-3*a^(-9)-4*a^(-7))*z^(3)+ (a^(-10)-5*a^(-8)-6*a^(-6))*z^(4)+ (a^(-9)+ a^(-7))*z^(5)+ (a^(-8)+ a^(-6))*z^(6)',
1073
+ '(-a^(-8)-a^(-6)-a^(-2))*z^(0)+ (3*a^(-9)+ 3*a^(-7))*z^(1)+ (4*a^(-8)+ 3*a^(-6)+ a^(-2))*z^(2)+ (-4*a^(-9)-6*a^(-7)-a^(-5)+ a^(-3))*z^(3)+ (-4*a^(-8)-3*a^(-6)+ a^(-4))*z^(4)+ (a^(-9)+ 2*a^(-7)+ a^(-5))*z^(5)+ (a^(-8)+ a^(-6))*z^(6)',
1074
+ 'a^2-a/z-a^3/z + a*z + a^3*z',
1075
+ 'a^(-2)-1/(a^3*z)-1/(a*z) + z/a^3 + z/a',
1076
+ '-a^4 + a^3/z + a^5/z + a*z-2*a^3*z-3*a^5*z + a^2*z^2 + a^4*z^2 + a^3*z^3 + a^5*z^3',
1077
+ '-a^(-4) + 1/(a^5*z) + 1/(a^3*z) + z/a^7-(2*z)/a^5-(3*z)/a^3 + z^2/a^6 + z^2/a^4 + z^3/a^5 + z^3/a^3',
1078
+ '-1 + 1/(a*z) + a/z-(2*z)/a-4*a*z-2*a^3*z-z^2 + a^4*z^2 + z^3/a + 3*a*z^3 + 2*a^3*z^3 + z^4 + a^2*z^4',
1079
+ '-1 + 1/(a*z) + a/z-(2*z)/a-4*a*z-2*a^3*z-z^2 + a^4*z^2 + z^3/a + 3*a*z^3 + 2*a^3*z^3 + z^4 + a^2*z^4',
1080
+ '-a^4 + a^3/z + a^5/z-z/a-a^3*z-2*a^5*z-3*z^2-3*a^2*z^2 + z^3/a + a^5*z^3 + 2*z^4 + 3*a^2*z^4 + a^4*z^4 + a*z^5 + a^3*z^5',
1081
+ '-a^(-4) + 1/(a^5*z) + 1/(a^3*z)-z/a^9-z/a^5-(2*z)/a^3-(3*z^2)/a^8-(3*z^2)/a^6 + z^3/a^9 + z^3/a^3 + (2*z^4)/a^8 + (3*z^4)/a^6 + z^4/a^4 + z^5/a^7 + z^5/a^5',
1082
+ 'a^6-a^5/z-a^7/z-2*a^3*z + 3*a^5*z + 3*a^7*z-2*a^9*z-a^4*z^2-2*a^6*z^2-a^8*z^2 + a^3*z^3-2*a^5*z^3-2*a^7*z^3 + a^9*z^3 + a^4*z^4 + 2*a^6*z^4 + a^8*z^4 + a^5*z^5 + a^7*z^5',
1083
+ 'a^(-6)-1/(a^7*z)-1/(a^5*z)-(2*z)/a^9 + (3*z)/a^7 + (3*z)/a^5-(2*z)/a^3-z^2/a^8-(2*z^2)/a^6-z^2/a^4 + z^3/a^9-(2*z^3)/a^7-(2*z^3)/a^5 + z^3/a^3 + z^4/a^8 + (2*z^4)/a^6 + z^4/a^4 + z^5/a^7 + z^5/a^5',
1084
+ 'a^6-a^5/z-a^7/z + 6*a^5*z + 4*a^7*z-a^9*z + a^11*z-3*a^6*z^2-2*a^8*z^2 + a^10*z^2-5*a^5*z^3-4*a^7*z^3 + a^9*z^3 + a^6*z^4 + a^8*z^4 + a^5*z^5 + a^7*z^5'
1085
+ ],
1086
+ dc.jones_polynomial: [
1087
+ '1',
1088
+ 't+ t^3-t^4',
1089
+ 't^(-2)-t^(-1)+ 1-t+ t^2',
1090
+ 't^2+ t^4-t^5+ t^6-t^7',
1091
+ 't-t^2+ 2*t^3-t^4+ t^5-t^6',
1092
+ 't^(-2)-t^(-1)+ 2-2*t+ t^2-t^3+ t^4',
1093
+ 't^(-1)-1+ 2*t-2*t^2+ 2*t^3-2*t^4+ t^5',
1094
+ '-t^(-3)+ 2*t^(-2)-2*t^(-1)+ 3-2*t+ 2*t^2-t^3',
1095
+ 't^3+ t^5-t^6+ t^7-t^8+ t^9-t^10',
1096
+ 't-t^2+ 2*t^3-2*t^4+ 2*t^5-t^6+ t^7-t^8',
1097
+ '-x^(-5)-x^(-1)',
1098
+ '-x-x^5',
1099
+ '-x^(-9)-x^(-5) + x^(-3)-x^(-1)',
1100
+ '-x^3-x^7 + x^9-x^11',
1101
+ 'x^(-7)-2/x^5 + x^(-3)-2/x + x-x^3',
1102
+ 'x^(-7)-2/x^5 + x^(-3)-2/x + x-x^3',
1103
+ '-x^(-9) + x^(-7)-3/x^5 + 2/x^3-2/x + 2*x-x^3',
1104
+ '-x^3 + x^5-3*x^7 + 2*x^9-2*x^11 + 2*x^13-x^15',
1105
+ '-x^(-15) + x^(-13)-2/x^11 + 2/x^9-2/x^7 + x^(-5)-x^(-3)',
1106
+ '-x^3 + x^5-2*x^7 + 2*x^9-2*x^11 + x^13-x^15',
1107
+ '-x^(-17) + x^(-15)-x^(-13) + x^(-11)-x^(-9)-x^(-5)'
1108
+ ],
1109
+ dc.alexander_polynomial: [
1110
+ '1',
1111
+ '1-t+ t^2',
1112
+ '1-3*t+ t^2',
1113
+ '1-t+ t^2-t^3+ t^4',
1114
+ '2-3*t+ 2*t^2',
1115
+ '2-5*t+ 2*t^2',
1116
+ '1-3*t+ 3*t^2-3*t^3+ t^4',
1117
+ '1-3*t+ 5*t^2-3*t^3+ t^4',
1118
+ '1-t+ t^2-t^3+ t^4-t^5+ t^6',
1119
+ '3-5*t+ 3*t^2'],
1120
+ dc.conway_polynomial: [
1121
+ '1',
1122
+ '1+z^2',
1123
+ '1-z^2',
1124
+ '1+3*z^2+z^4',
1125
+ '1+2*z^2',
1126
+ '1-2*z^2',
1127
+ '1-z^2-z^4',
1128
+ '1+z^2+z^4',
1129
+ '1+6*z^2+5*z^4+z^6',
1130
+ '1+3*z^2',
1131
+ '-z',
1132
+ 'z',
1133
+ '-2*z',
1134
+ '2*z + z^3',
1135
+ 'z^3',
1136
+ 'z^3',
1137
+ '-2*z + z^3',
1138
+ '2*z + 2*z^3',
1139
+ '-3*z-2*z^3',
1140
+ '3*z + 2*z^3',
1141
+ '-3*z-4*z^3-z^5'],
1142
+ dc.khovanov_polynomial: [
1143
+ '1 + q^(-2) + 1/(q^6*t^2) + 1/(q^4*t^2)',
1144
+ '1 + q^2 + q^4*t^2 + q^6*t^2',
1145
+ '1 + q^(-2) + 1/(q^10*t^4) + 1/(q^8*t^4) + 1/(q^6*t^2) + 1/(q^2*t)',
1146
+ 'q^2 + q^4 + q^6*t^2 + q^10*t^3 + q^10*t^4 + q^12*t^4',
1147
+ '2 + 2/q^2 + 1/(q^8*t^3) + 1/(q^6*t^2) + 1/(q^4*t^2) + 1/(q^2*t) + t + q^4*t^2',
1148
+ '2 + 2/q^2 + 1/(q^8*t^3) + 1/(q^6*t^2) + 1/(q^4*t^2) + 1/(q^2*t) + t + q^4*t^2',
1149
+ '1 + 2/q^2 + 1/(q^10*t^4) + 1/(q^8*t^4) + 1/(q^8*t^3) + 2/(q^6*t^2) + 1/(q^4*t^2) + 2/(q^2*t) + t + q^2*t + q^4*t^2',
1150
+ 'q^2 + q^4 + q^4*t + 2*q^6*t^2 + q^8*t^2 + 2*q^10*t^3 + 2*q^10*t^4 + q^12*t^4 + q^12*t^5 + q^14*t^5 + q^16*t^6',
1151
+ 'q^(-4) + q^(-2) + 1/(q^16*t^6) + 1/(q^14*t^6) + 1/(q^14*t^5) + 1/(q^12*t^4) + 1/(q^10*t^4) + 1/(q^10*t^3) + 1/(q^8*t^3) + 1/(q^8*t^2) + 1/(q^6*t^2) + 1/(q^4*t)',
1152
+ 'q^2 + q^4 + q^4*t + q^6*t^2 + q^8*t^2 + q^8*t^3 + q^10*t^3 + q^10*t^4 + q^12*t^4 + q^14*t^5 + q^14*t^6 + q^16*t^6',
1153
+ 'q^(-6) + q^(-4) + 1/(q^18*t^6) + 1/(q^16*t^6) + 1/(q^16*t^5) + 1/(q^12*t^4) + 1/(q^12*t^3) + 1/(q^8*t^2)'],
1154
+ dc.khovanov_unreduced_integral_polynomial: [
1155
+ '',
1156
+ 'q + q^(3) + t^(2) q^(5) + t^(3) q^(9) + t^(3) q^(7) T^(2)',
1157
+ 't^(-2) q^(-5) + t^(-1) q^(-1) + q^(-1) + q + t q + t^(2) q^(5) + t^(-1) q^(-3) T^(2) + t^(2) q^(3) T^(2)',
1158
+ 'q^(3) + q^(5) + t^(2) q^(7) + t^(3) q^(11) + t^(4) q^(11) + t^(5) q^(15) + t^(3) q^(9) T^(2) + t^(5) q^(13) T^(2)',
1159
+ 'q + q^(3) + t q^(3) + t^(2) q^(5) + t^(2) q^(7) + t^(3) q^(9) + t^(4) q^(9) + t^(5) q^(13) + t^(2) q^(5) T^(2) + t^(3) q^(7) T^(2) + t^(5) q^(11) T^(2)',
1160
+ 't^(-2) q^(-5) + t^(-1) q^(-1) + 2 q^(-1) + q + t q + t q^(3) + t^(2) q^(5) + t^(3) q^(5) + t^(4) q^(9) + t^(-1) q^(-3) T^(2) + t q T^(2) + t^(2) q^(3) T^(2) + t^(4) q^(7) T^(2)',
1161
+ 't^(-2) q^(-3) + t^(-1) q + 2 q + q^(3) + t q^(3) + t q^(5) + t^(2) q^(5) + t^(2) q^(7) + t^(3) q^(7) + t^(3) q^(9) + t^(4) q^(11) + t^(-1) q^(-1) T^(2) + t q^(3) T^(2) + t^(2) q^(5) T^(2) + t^(3) q^(7) T^(2) + t^(4) q^(9) T^(2)',
1162
+ 't^(-3) q^(-7) + t^(-2) q^(-5) + t^(-2) q^(-3) + t^(-1) q^(-3) + t^(-1) q^(-1) + 2 q^(-1) + 2 q + t q + t q^(3) + t^(2) q^(3) + t^(2) q^(5) + t^(3) q^(7) + t^(-2) q^(-5) T^(2) + t^(-1) q^(-3) T^(2) + q^(-1) T^(2) + t q T^(2) + t^(2) q^(3) T^(2) + t^(3) q^(5) T^(2)',
1163
+ 'q^(5) + q^(7) + t^(2) q^(9) + t^(3) q^(13) + t^(4) q^(13) + t^(5) q^(17) + t^(6) q^(17) + t^(7) q^(21) + t^(3) q^(11) T^(2) + t^(5) q^(15) T^(2) + t^(7) q^(19) T^(2)',
1164
+ 'q + q^(3) + t q^(3) + t^(2) q^(5) + t^(2) q^(7) + t^(3) q^(7) + t^(3) q^(9) + t^(4) q^(9) + t^(4) q^(11) + t^(5) q^(13) + t^(6) q^(13) + t^(7) q^(17) + t^(2) q^(5) T^(2) + t^(3) q^(7) T^(2) + t^(4) q^(9) T^(2) + t^(5) q^(11) T^(2) + t^(7) q^(15) T^(2)'],
1165
+ dc.khovanov_reduced_integral_polynomial: [
1166
+ '',
1167
+ 'q^(2) + t^(2) q^(6) + t^(3) q^(8)',
1168
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 1 + t q^(2) + t^(2) q^(4)',
1169
+ 'q^(4) + t^(2) q^(8) + t^(3) q^(10) + t^(4) q^(12) + t^(5) q^(14)',
1170
+ 'q^(2) + t q^(4) + 2 t^(2) q^(6) + t^(3) q^(8) + t^(4) q^(10) + t^(5) q^(12)',
1171
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 2 + 2 t q^(2) + t^(2) q^(4) + t^(3) q^(6) + t^(4) q^(8)',
1172
+ 't^(-2) q^(-2) + t^(-1) + 2 q^(2) + 2 t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + t^(4) q^(10)',
1173
+ 't^(-3) q^(-6) + 2 t^(-2) q^(-4) + 2 t^(-1) q^(-2) + 3 + 2 t q^(2) + 2 t^(2) q^(4) + t^(3) q^(6)',
1174
+ 'q^(6) + t^(2) q^(10) + t^(3) q^(12) + t^(4) q^(14) + t^(5) q^(16) + t^(6) q^(18) + t^(7) q^(20)',
1175
+ 'q^(2) + t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + 2 t^(4) q^(10) + t^(5) q^(12) + t^(6) q^(14) + t^(7) q^(16)'],
1176
+ dc.khovanov_reduced_rational_polynomial: [
1177
+ '',
1178
+ ' q^(2) + t^(2) q^(6) + t^(3) q^(8)',
1179
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 1 + t q^(2) + t^(2) q^(4)',
1180
+ ' q^(4) + t^(2) q^(8) + t^(3) q^(10) + t^(4) q^(12) + t^(5) q^(14)',
1181
+ ' q^(2) + t q^(4) + 2 t^(2) q^(6) + t^(3) q^(8) + t^(4) q^(10) + t^(5) q^(12)',
1182
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 2 + 2 t q^(2) + t^(2) q^(4) + t^(3) q^(6) + t^(4) q^(8)',
1183
+ 't^(-2) q^(-2) + t^(-1) + 2 q^(2) + 2 t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + t^(4) q^(10)',
1184
+ 't^(-3) q^(-6) + 2 t^(-2) q^(-4) + 2 t^(-1) q^(-2) + 3 + 2 t q^(2) + 2 t^(2) q^(4) + t^(3) q^(6)',
1185
+ ' q^(6) + t^(2) q^(10) + t^(3) q^(12) + t^(4) q^(14) + t^(5) q^(16) + t^(6) q^(18) + t^(7) q^(20)',
1186
+ ' q^(2) + t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + 2 t^(4) q^(10) + t^(5) q^(12) + t^(6) q^(14) + t^(7) q^(16)'],
1187
+ dc.khovanov_reduced_mod2_polynomial: [
1188
+ '',
1189
+ ' q^(2) + t^(2) q^(6) + t^(3) q^(8)',
1190
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 1 + t q^(2) + t^(2) q^(4)',
1191
+ ' q^(4) + t^(2) q^(8) + t^(3) q^(10) + t^(4) q^(12) + t^(5) q^(14)',
1192
+ ' q^(2) + t q^(4) + 2 t^(2) q^(6) + t^(3) q^(8) + t^(4) q^(10) + t^(5) q^(12)',
1193
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 2 + 2 t q^(2) + t^(2) q^(4) + t^(3) q^(6) + t^(4) q^(8)',
1194
+ 't^(-2) q^(-2) + t^(-1) + 2 q^(2) + 2 t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + t^(4) q^(10)',
1195
+ 't^(-3) q^(-6) + 2 t^(-2) q^(-4) + 2 t^(-1) q^(-2) + 3 + 2 t q^(2) + 2 t^(2) q^(4) + t^(3) q^(6)',
1196
+ ' q^(6) + t^(2) q^(10) + t^(3) q^(12) + t^(4) q^(14) + t^(5) q^(16) + t^(6) q^(18) + t^(7) q^(20)',
1197
+ ' q^(2) + t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + 2 t^(4) q^(10) + t^(5) q^(12) + t^(6) q^(14) + t^(7) q^(16)'],
1198
+ dc.khovanov_odd_integral_polynomial: [
1199
+ '',
1200
+ 'q^(2) + t^(2) q^(6) + t^(3) q^(8)',
1201
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 1 + t q^(2) + t^(2) q^(4)',
1202
+ 'q^(4) + t^(2) q^(8) + t^(3) q^(10) + t^(4) q^(12) + t^(5) q^(14)',
1203
+ 'q^(2) + t q^(4) + 2 t^(2) q^(6) + t^(3) q^(8) + t^(4) q^(10) + t^(5) q^(12)',
1204
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 2 + 2 t q^(2) + t^(2) q^(4) + t^(3) q^(6) + t^(4) q^(8)',
1205
+ 't^(-2) q^(-2) + t^(-1) + 2 q^(2) + 2 t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + t^(4) q^(10)',
1206
+ 't^(-3) q^(-6) + 2 t^(-2) q^(-4) + 2 t^(-1) q^(-2) + 3 + 2 t q^(2) + 2 t^(2) q^(4) + t^(3) q^(6)',
1207
+ 'q^(6) + t^(2) q^(10) + t^(3) q^(12) + t^(4) q^(14) + t^(5) q^(16) + t^(6) q^(18) + t^(7) q^(20)',
1208
+ 'q^(2) + t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + 2 t^(4) q^(10) + t^(5) q^(12) + t^(6) q^(14) + t^(7) q^(16)'],
1209
+ dc.khovanov_odd_rational_polynomial: [
1210
+ '',
1211
+ ' q^(2) + t^(2) q^(6) + t^(3) q^(8)',
1212
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 1 + t q^(2) + t^(2) q^(4)',
1213
+ ' q^(4) + t^(2) q^(8) + t^(3) q^(10) + t^(4) q^(12) + t^(5) q^(14)',
1214
+ ' q^(2) + t q^(4) + 2 t^(2) q^(6) + t^(3) q^(8) + t^(4) q^(10) + t^(5) q^(12)',
1215
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 2 + 2 t q^(2) + t^(2) q^(4) + t^(3) q^(6) + t^(4) q^(8)',
1216
+ 't^(-2) q^(-2) + t^(-1) + 2 q^(2) + 2 t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + t^(4) q^(10)',
1217
+ 't^(-3) q^(-6) + 2 t^(-2) q^(-4) + 2 t^(-1) q^(-2) + 3 + 2 t q^(2) + 2 t^(2) q^(4) + t^(3) q^(6)',
1218
+ ' q^(6) + t^(2) q^(10) + t^(3) q^(12) + t^(4) q^(14) + t^(5) q^(16) + t^(6) q^(18) + t^(7) q^(20)',
1219
+ ' q^(2) + t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + 2 t^(4) q^(10) + t^(5) q^(12) + t^(6) q^(14) + t^(7) q^(16)'],
1220
+ dc.khovanov_odd_mod2_polynomial: [
1221
+ '',
1222
+ ' q^(2) + t^(2) q^(6) + t^(3) q^(8)',
1223
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 1 + t q^(2) + t^(2) q^(4)',
1224
+ ' q^(4) + t^(2) q^(8) + t^(3) q^(10) + t^(4) q^(12) + t^(5) q^(14)',
1225
+ ' q^(2) + t q^(4) + 2 t^(2) q^(6) + t^(3) q^(8) + t^(4) q^(10) + t^(5) q^(12)',
1226
+ 't^(-2) q^(-4) + t^(-1) q^(-2) + 2 + 2 t q^(2) + t^(2) q^(4) + t^(3) q^(6) + t^(4) q^(8)',
1227
+ 't^(-2) q^(-2) + t^(-1) + 2 q^(2) + 2 t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + t^(4) q^(10)',
1228
+ 't^(-3) q^(-6) + 2 t^(-2) q^(-4) + 2 t^(-1) q^(-2) + 3 + 2 t q^(2) + 2 t^(2) q^(4) + t^(3) q^(6)',
1229
+ ' q^(6) + t^(2) q^(10) + t^(3) q^(12) + t^(4) q^(14) + t^(5) q^(16) + t^(6) q^(18) + t^(7) q^(20)',
1230
+ ' q^(2) + t q^(4) + 2 t^(2) q^(6) + 2 t^(3) q^(8) + 2 t^(4) q^(10) + t^(5) q^(12) + t^(6) q^(14) + t^(7) q^(16)']
1231
+ }