snappy 3.1.1__cp38-cp38-win_amd64.whl → 3.2__cp38-cp38-win_amd64.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.
- snappy/CyOpenGL.cp38-win_amd64.pyd +0 -0
- snappy/SnapPy.cp38-win_amd64.pyd +0 -0
- snappy/SnapPyHP.cp38-win_amd64.pyd +0 -0
- snappy/__init__.py +299 -402
- snappy/app.py +70 -20
- snappy/browser.py +18 -17
- snappy/canonical.py +249 -0
- snappy/{verify/cusp_shapes.py → cusps/__init__.py} +8 -18
- snappy/cusps/cusp_area_matrix.py +101 -0
- snappy/{verify/cusp_areas.py → cusps/cusp_areas_from_matrix.py} +23 -39
- snappy/cusps/maximal_cusp_area_matrix.py +136 -0
- snappy/cusps/test.py +21 -0
- snappy/cusps/trig_cusp_area_matrix.py +63 -0
- snappy/database.py +10 -9
- snappy/decorated_isosig.py +337 -114
- snappy/dev/extended_ptolemy/complexVolumesClosed.py +40 -7
- snappy/dev/extended_ptolemy/extended.py +3 -3
- snappy/dev/extended_ptolemy/phc_wrapper.py +10 -10
- snappy/dev/vericlosed/oneVertexTruncatedComplex.py +1 -1
- snappy/doc/_images/m004_paper_plane_on_systole.jpg +0 -0
- snappy/doc/_images/m125_paper_plane.jpg +0 -0
- snappy/doc/_images/o9_00000_systole_paper_plane.jpg +0 -0
- snappy/doc/_images/o9_00000_systole_paper_plane_closer.jpg +0 -0
- snappy/doc/_sources/additional_classes.rst.txt +40 -40
- snappy/doc/_sources/bugs.rst.txt +14 -14
- snappy/doc/_sources/censuses.rst.txt +51 -51
- snappy/doc/_sources/credits.rst.txt +75 -75
- snappy/doc/_sources/development.rst.txt +259 -239
- snappy/doc/_sources/index.rst.txt +182 -115
- snappy/doc/_sources/installing.rst.txt +247 -264
- snappy/doc/_sources/manifold.rst.txt +6 -6
- snappy/doc/_sources/manifoldhp.rst.txt +46 -46
- snappy/doc/_sources/news.rst.txt +355 -283
- snappy/doc/_sources/other.rst.txt +25 -25
- snappy/doc/_sources/platonic_census.rst.txt +20 -20
- snappy/doc/_sources/plink.rst.txt +102 -102
- snappy/doc/_sources/ptolemy.rst.txt +66 -66
- snappy/doc/_sources/ptolemy_classes.rst.txt +42 -42
- snappy/doc/_sources/ptolemy_examples1.rst.txt +298 -297
- snappy/doc/_sources/ptolemy_examples2.rst.txt +363 -363
- snappy/doc/_sources/ptolemy_examples3.rst.txt +301 -301
- snappy/doc/_sources/ptolemy_examples4.rst.txt +61 -61
- snappy/doc/_sources/ptolemy_prelim.rst.txt +105 -105
- snappy/doc/_sources/screenshots.rst.txt +21 -21
- snappy/doc/_sources/snap.rst.txt +87 -87
- snappy/doc/_sources/snappy.rst.txt +28 -28
- snappy/doc/_sources/spherogram.rst.txt +103 -103
- snappy/doc/_sources/todo.rst.txt +47 -47
- snappy/doc/_sources/triangulation.rst.txt +11 -11
- snappy/doc/_sources/tutorial.rst.txt +49 -49
- snappy/doc/_sources/verify.rst.txt +210 -150
- snappy/doc/_sources/verify_internals.rst.txt +79 -90
- snappy/doc/_static/basic.css +924 -902
- snappy/doc/_static/css/badge_only.css +1 -1
- snappy/doc/_static/css/theme.css +1 -1
- snappy/doc/_static/doctools.js +1 -1
- snappy/doc/_static/documentation_options.js +12 -13
- snappy/doc/_static/fonts/Lato/lato-bold.eot +0 -0
- snappy/doc/_static/fonts/Lato/lato-bold.ttf +0 -0
- snappy/doc/_static/fonts/Lato/lato-bold.woff +0 -0
- snappy/doc/_static/fonts/Lato/lato-bold.woff2 +0 -0
- snappy/doc/_static/fonts/Lato/lato-bolditalic.eot +0 -0
- snappy/doc/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
- snappy/doc/_static/fonts/Lato/lato-bolditalic.woff +0 -0
- snappy/doc/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
- snappy/doc/_static/fonts/Lato/lato-italic.eot +0 -0
- snappy/doc/_static/fonts/Lato/lato-italic.ttf +0 -0
- snappy/doc/_static/fonts/Lato/lato-italic.woff +0 -0
- snappy/doc/_static/fonts/Lato/lato-italic.woff2 +0 -0
- snappy/doc/_static/fonts/Lato/lato-regular.eot +0 -0
- snappy/doc/_static/fonts/Lato/lato-regular.ttf +0 -0
- snappy/doc/_static/fonts/Lato/lato-regular.woff +0 -0
- snappy/doc/_static/fonts/Lato/lato-regular.woff2 +0 -0
- snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
- snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
- snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
- snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
- snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
- snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
- snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
- snappy/doc/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
- snappy/doc/_static/js/versions.js +228 -0
- snappy/doc/_static/language_data.js +199 -199
- snappy/doc/_static/pygments.css +74 -73
- snappy/doc/_static/searchtools.js +125 -71
- snappy/doc/_static/snappy_furo.css +33 -33
- snappy/doc/_static/snappy_sphinx_rtd_theme.css +42 -42
- snappy/doc/_static/sphinx_highlight.js +13 -3
- snappy/doc/additional_classes.html +1499 -1330
- snappy/doc/bugs.html +131 -134
- snappy/doc/censuses.html +426 -445
- snappy/doc/credits.html +180 -183
- snappy/doc/development.html +383 -363
- snappy/doc/genindex.html +1330 -1409
- snappy/doc/index.html +261 -206
- snappy/doc/installing.html +345 -363
- snappy/doc/manifold.html +3451 -2839
- snappy/doc/manifoldhp.html +179 -182
- snappy/doc/news.html +387 -329
- snappy/doc/objects.inv +0 -0
- snappy/doc/other.html +160 -162
- snappy/doc/platonic_census.html +374 -377
- snappy/doc/plink.html +209 -212
- snappy/doc/ptolemy.html +253 -255
- snappy/doc/ptolemy_classes.html +1143 -1146
- snappy/doc/ptolemy_examples1.html +408 -410
- snappy/doc/ptolemy_examples2.html +470 -473
- snappy/doc/ptolemy_examples3.html +413 -416
- snappy/doc/ptolemy_examples4.html +194 -197
- snappy/doc/ptolemy_prelim.html +247 -250
- snappy/doc/py-modindex.html +164 -167
- snappy/doc/screenshots.html +140 -142
- snappy/doc/search.html +134 -137
- snappy/doc/searchindex.js +1 -1
- snappy/doc/snap.html +201 -204
- snappy/doc/snappy.html +180 -182
- snappy/doc/spherogram.html +1210 -1213
- snappy/doc/todo.html +165 -168
- snappy/doc/triangulation.html +1583 -1474
- snappy/doc/tutorial.html +158 -161
- snappy/doc/verify.html +329 -275
- snappy/doc/verify_internals.html +1234 -1691
- snappy/drilling/__init__.py +153 -235
- snappy/drilling/barycentric.py +103 -0
- snappy/drilling/constants.py +0 -2
- snappy/drilling/crush.py +56 -130
- snappy/drilling/cusps.py +12 -6
- snappy/drilling/debug.py +2 -1
- snappy/drilling/exceptions.py +7 -40
- snappy/drilling/moves.py +302 -243
- snappy/drilling/perturb.py +63 -37
- snappy/drilling/shorten.py +36 -0
- snappy/drilling/subdivide.py +0 -5
- snappy/drilling/test.py +23 -0
- snappy/drilling/test_cases.py +126 -0
- snappy/drilling/tracing.py +9 -37
- snappy/exceptions.py +18 -5
- snappy/exterior_to_link/barycentric_geometry.py +2 -4
- snappy/exterior_to_link/main.py +8 -7
- snappy/exterior_to_link/mcomplex_with_link.py +2 -2
- snappy/exterior_to_link/rational_linear_algebra.py +1 -1
- snappy/exterior_to_link/rational_linear_algebra_wrapped.py +1 -1
- snappy/exterior_to_link/test.py +21 -33
- snappy/geometric_structure/__init__.py +212 -0
- snappy/geometric_structure/cusp_neighborhood/__init__.py +3 -0
- snappy/geometric_structure/cusp_neighborhood/complex_cusp_cross_section.py +697 -0
- snappy/geometric_structure/cusp_neighborhood/cusp_cross_section_base.py +484 -0
- snappy/geometric_structure/cusp_neighborhood/exceptions.py +42 -0
- snappy/geometric_structure/cusp_neighborhood/real_cusp_cross_section.py +298 -0
- snappy/geometric_structure/cusp_neighborhood/tiles_for_cusp_neighborhood.py +159 -0
- snappy/geometric_structure/cusp_neighborhood/vertices.py +32 -0
- snappy/geometric_structure/geodesic/__init__.py +0 -0
- snappy/geometric_structure/geodesic/add_core_curves.py +152 -0
- snappy/geometric_structure/geodesic/avoid_core_curves.py +369 -0
- snappy/geometric_structure/geodesic/canonical_keys.py +52 -0
- snappy/geometric_structure/geodesic/check_away_from_core_curve.py +60 -0
- snappy/geometric_structure/geodesic/constants.py +6 -0
- snappy/geometric_structure/geodesic/exceptions.py +22 -0
- snappy/{drilling → geometric_structure/geodesic}/fixed_points.py +34 -9
- snappy/{drilling/geodesic_info.py → geometric_structure/geodesic/geodesic_start_point_info.py} +139 -180
- snappy/geometric_structure/geodesic/graph_trace_helper.py +67 -0
- snappy/geometric_structure/geodesic/line.py +30 -0
- snappy/geometric_structure/geodesic/multiplicity.py +127 -0
- snappy/geometric_structure/geodesic/tiles_for_geodesic.py +101 -0
- snappy/geometric_structure/test.py +22 -0
- snappy/gui.py +23 -13
- snappy/horoviewer.py +7 -7
- snappy/hyperboloid/__init__.py +96 -31
- snappy/hyperboloid/distances.py +245 -0
- snappy/hyperboloid/horoball.py +19 -0
- snappy/hyperboloid/line.py +35 -0
- snappy/hyperboloid/point.py +9 -0
- snappy/hyperboloid/triangle.py +29 -0
- snappy/isometry_signature.py +382 -0
- snappy/len_spec/__init__.py +596 -0
- snappy/len_spec/geodesic_info.py +110 -0
- snappy/len_spec/geodesic_key_info_dict.py +117 -0
- snappy/len_spec/geodesic_piece.py +143 -0
- snappy/len_spec/geometric_structure.py +182 -0
- snappy/len_spec/geometry.py +80 -0
- snappy/len_spec/length_spectrum_geodesic_info.py +170 -0
- snappy/len_spec/spine.py +206 -0
- snappy/len_spec/test.py +24 -0
- snappy/len_spec/test_cases.py +69 -0
- snappy/len_spec/tile.py +275 -0
- snappy/len_spec/word.py +86 -0
- snappy/math_basics.py +39 -13
- snappy/matrix.py +52 -9
- snappy/number.py +12 -6
- snappy/numeric_output_checker.py +2 -3
- snappy/pari.py +8 -4
- snappy/phone_home.py +2 -1
- snappy/polyviewer.py +8 -8
- snappy/ptolemy/__init__.py +1 -1
- snappy/ptolemy/component.py +2 -2
- snappy/ptolemy/coordinates.py +25 -25
- snappy/ptolemy/findLoops.py +9 -9
- snappy/ptolemy/manifoldMethods.py +27 -29
- snappy/ptolemy/polynomial.py +50 -57
- snappy/ptolemy/processFileBase.py +60 -0
- snappy/ptolemy/ptolemyVariety.py +109 -41
- snappy/ptolemy/reginaWrapper.py +4 -4
- snappy/ptolemy/rur.py +1 -1
- snappy/ptolemy/solutionsToPrimeIdealGroebnerBasis.py +9 -9
- snappy/ptolemy/test.py +99 -54
- snappy/ptolemy/utilities.py +1 -1
- snappy/raytracing/__init__.py +64 -0
- snappy/raytracing/additional_horospheres.py +64 -0
- snappy/raytracing/additional_len_spec_choices.py +63 -0
- snappy/raytracing/cohomology_fractal.py +0 -3
- snappy/raytracing/eyeball.py +123 -0
- snappy/raytracing/finite_raytracing_data.py +17 -17
- snappy/raytracing/finite_viewer.py +15 -15
- snappy/raytracing/geodesic_tube_info.py +93 -63
- snappy/raytracing/geodesics.py +94 -64
- snappy/raytracing/geodesics_window.py +56 -34
- snappy/raytracing/gui_utilities.py +21 -6
- snappy/raytracing/hyperboloid_navigation.py +29 -4
- snappy/raytracing/hyperboloid_utilities.py +73 -73
- snappy/raytracing/ideal_raytracing_data.py +121 -91
- snappy/raytracing/inside_viewer.py +199 -66
- snappy/raytracing/pack.py +22 -0
- snappy/raytracing/raytracing_data.py +37 -25
- snappy/raytracing/raytracing_view.py +70 -65
- snappy/raytracing/shaders/Eye.png +0 -0
- snappy/raytracing/shaders/NonGeometric.png +0 -0
- snappy/raytracing/shaders/__init__.py +39 -3
- snappy/raytracing/shaders/fragment.glsl +451 -133
- snappy/raytracing/test.py +29 -0
- snappy/raytracing/tooltip.py +146 -0
- snappy/raytracing/upper_halfspace_utilities.py +42 -9
- snappy/sage_helper.py +67 -134
- snappy/settings.py +90 -77
- snappy/shell.py +2 -0
- snappy/snap/character_varieties.py +2 -2
- snappy/snap/find_field.py +4 -3
- snappy/snap/fundamental_polyhedron.py +2 -2
- snappy/snap/kernel_structures.py +5 -1
- snappy/snap/nsagetools.py +9 -8
- snappy/snap/peripheral/dual_cellulation.py +4 -3
- snappy/snap/peripheral/peripheral.py +2 -2
- snappy/snap/peripheral/surface.py +5 -5
- snappy/snap/peripheral/test.py +1 -1
- snappy/snap/polished_reps.py +8 -8
- snappy/snap/slice_obs_HKL.py +16 -14
- snappy/snap/t3mlite/arrow.py +3 -3
- snappy/snap/t3mlite/edge.py +3 -3
- snappy/snap/t3mlite/homology.py +2 -2
- snappy/snap/t3mlite/mcomplex.py +3 -3
- snappy/snap/t3mlite/simplex.py +12 -0
- snappy/snap/t3mlite/spun.py +18 -17
- snappy/snap/t3mlite/test_vs_regina.py +4 -4
- snappy/snap/test.py +37 -53
- snappy/snap/utilities.py +4 -5
- snappy/test.py +121 -138
- snappy/test_cases.py +263 -0
- snappy/testing.py +131 -0
- snappy/tiling/__init__.py +2 -0
- snappy/tiling/canonical_key_dict.py +59 -0
- snappy/tiling/dict_based_set.py +79 -0
- snappy/tiling/floor.py +49 -0
- snappy/tiling/hyperboloid_dict.py +54 -0
- snappy/tiling/iter_utils.py +78 -0
- snappy/tiling/lifted_tetrahedron.py +22 -0
- snappy/tiling/lifted_tetrahedron_set.py +54 -0
- snappy/tiling/real_hash_dict.py +164 -0
- snappy/tiling/test.py +23 -0
- snappy/tiling/tile.py +215 -0
- snappy/tiling/triangle.py +33 -0
- snappy/tkterminal.py +113 -84
- snappy/twister/main.py +1 -7
- snappy/twister/twister_core.cp38-win_amd64.pyd +0 -0
- snappy/upper_halfspace/__init__.py +78 -17
- snappy/verify/__init__.py +3 -7
- snappy/verify/{verifyCanonical.py → canonical.py} +78 -70
- snappy/verify/complex_volume/adjust_torsion.py +1 -2
- snappy/verify/complex_volume/closed.py +13 -13
- snappy/verify/complex_volume/cusped.py +6 -6
- snappy/verify/complex_volume/extended_bloch.py +5 -8
- snappy/verify/{cuspTranslations.py → cusp_translations.py} +1 -1
- snappy/verify/edge_equations.py +80 -0
- snappy/verify/exceptions.py +0 -55
- snappy/verify/{verifyHyperbolicity.py → hyperbolicity.py} +3 -3
- snappy/verify/interval_newton_shapes_engine.py +7 -5
- snappy/verify/interval_tree.py +5 -5
- snappy/verify/krawczyk_shapes_engine.py +17 -18
- snappy/verify/maximal_cusp_area_matrix/__init__.py +7 -74
- snappy/verify/maximal_cusp_area_matrix/cusp_tiling_engine.py +3 -4
- snappy/verify/maximal_cusp_area_matrix/cusp_translate_engine.py +1 -1
- snappy/verify/{realAlgebra.py → real_algebra.py} +1 -1
- snappy/verify/shapes.py +5 -3
- snappy/verify/short_slopes.py +39 -41
- snappy/verify/{squareExtensions.py → square_extensions.py} +14 -11
- snappy/verify/test.py +57 -60
- snappy/verify/upper_halfspace/extended_matrix.py +1 -1
- snappy/verify/upper_halfspace/finite_point.py +3 -4
- snappy/verify/upper_halfspace/ideal_point.py +9 -9
- snappy/verify/volume.py +2 -2
- snappy/version.py +2 -2
- {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/METADATA +14 -10
- snappy-3.2.dist-info/RECORD +503 -0
- {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/WHEEL +1 -1
- {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/top_level.txt +6 -1
- snappy/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/__pycache__/browser.cpython-38.pyc +0 -0
- snappy/__pycache__/cache.cpython-38.pyc +0 -0
- snappy/__pycache__/database.cpython-38.pyc +0 -0
- snappy/__pycache__/db_utilities.cpython-38.pyc +0 -0
- snappy/__pycache__/decorated_isosig.cpython-38.pyc +0 -0
- snappy/__pycache__/exceptions.cpython-38.pyc +0 -0
- snappy/__pycache__/export_stl.cpython-38.pyc +0 -0
- snappy/__pycache__/filedialog.cpython-38.pyc +0 -0
- snappy/__pycache__/gui.cpython-38.pyc +0 -0
- snappy/__pycache__/horoviewer.cpython-38.pyc +0 -0
- snappy/__pycache__/math_basics.cpython-38.pyc +0 -0
- snappy/__pycache__/matrix.cpython-38.pyc +0 -0
- snappy/__pycache__/number.cpython-38.pyc +0 -0
- snappy/__pycache__/numeric_output_checker.cpython-38.pyc +0 -0
- snappy/__pycache__/pari.cpython-38.pyc +0 -0
- snappy/__pycache__/polyviewer.cpython-38.pyc +0 -0
- snappy/__pycache__/sage_helper.cpython-38.pyc +0 -0
- snappy/__pycache__/version.cpython-38.pyc +0 -0
- snappy/doc/_sources/verify_canon.rst.txt +0 -90
- snappy/doc/_static/jquery-3.6.0.js +0 -10881
- snappy/doc/_static/js/html5shiv-printshiv.min.js +0 -4
- snappy/doc/_static/js/html5shiv.min.js +0 -4
- snappy/doc/_static/underscore-1.13.1.js +0 -2042
- snappy/doc/_static/underscore.js +0 -6
- snappy/doc/verify_canon.html +0 -304
- snappy/drilling/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/constants.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/crush.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/cusps.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/debug.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/epsilons.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/exceptions.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/fixed_points.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/geodesic_info.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/geodesic_tube.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/geometric_structure.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/line.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/moves.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/peripheral_curves.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/perturb.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/quotient_space.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/spatial_dict.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/subdivide.cpython-38.pyc +0 -0
- snappy/drilling/__pycache__/tracing.cpython-38.pyc +0 -0
- snappy/drilling/geodesic_tube.py +0 -441
- snappy/drilling/geometric_structure.py +0 -366
- snappy/drilling/line.py +0 -122
- snappy/drilling/quotient_space.py +0 -94
- snappy/drilling/spatial_dict.py +0 -128
- snappy/exterior_to_link/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/barycentric_geometry.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/exceptions.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/hyp_utils.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/link_projection.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/main.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/mcomplex_with_expansion.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/mcomplex_with_link.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/mcomplex_with_memory.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/pl_utils.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/put_in_S3.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/rational_linear_algebra.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/simplify_to_base_tri.cpython-38.pyc +0 -0
- snappy/exterior_to_link/__pycache__/stored_moves.cpython-38.pyc +0 -0
- snappy/hyperboloid/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/manifolds/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/component.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/coordinates.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/fieldExtensions.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/findLoops.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/homology.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/manifoldMethods.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/matrix.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/numericalSolutionsToGroebnerBasis.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/polynomial.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/processComponents.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/processFileBase.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/processFileDispatch.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/processMagmaFile.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/processRurFile.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/ptolemyGeneralizedObstructionClass.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/ptolemyObstructionClass.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/ptolemyVariety.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/ptolemyVarietyPrimeIdealGroebnerBasis.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/rur.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/solutionsToPrimeIdealGroebnerBasis.cpython-38.pyc +0 -0
- snappy/ptolemy/__pycache__/utilities.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/character_varieties.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/fundamental_polyhedron.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/interval_reps.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/kernel_structures.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/mcomplex_base.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/nsagetools.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/polished_reps.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/shapes.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/slice_obs_HKL.cpython-38.pyc +0 -0
- snappy/snap/__pycache__/utilities.cpython-38.pyc +0 -0
- snappy/snap/peripheral/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/snap/peripheral/__pycache__/dual_cellulation.cpython-38.pyc +0 -0
- snappy/snap/peripheral/__pycache__/link.cpython-38.pyc +0 -0
- snappy/snap/peripheral/__pycache__/peripheral.cpython-38.pyc +0 -0
- snappy/snap/peripheral/__pycache__/surface.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/arrow.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/corner.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/edge.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/face.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/files.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/homology.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/linalg.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/mcomplex.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/perm4.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/simplex.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/spun.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/surface.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/tetrahedron.cpython-38.pyc +0 -0
- snappy/snap/t3mlite/__pycache__/vertex.cpython-38.pyc +0 -0
- snappy/togl/__init__.py +0 -3
- snappy/togl/darwin-tk8.6/Togl2.1/LICENSE +0 -28
- snappy/togl/darwin-tk8.6/Togl2.1/libTogl2.1.dylib +0 -0
- snappy/togl/darwin-tk8.6/Togl2.1/pkgIndex.tcl +0 -5
- snappy/togl/darwin-tk8.7/Togl2.1/LICENSE +0 -28
- snappy/togl/darwin-tk8.7/Togl2.1/libTogl2.1.dylib +0 -0
- snappy/togl/darwin-tk8.7/Togl2.1/pkgIndex.tcl +0 -5
- snappy/togl/linux2-x86_64-tk8.6/Togl2.1/LICENSE +0 -28
- snappy/togl/linux2-x86_64-tk8.6/Togl2.1/libTogl2.1.so +0 -0
- snappy/togl/linux2-x86_64-tk8.6/Togl2.1/pkgIndex.tcl +0 -5
- snappy/togl/win32VC-tk8.6/Togl2.1/LICENSE +0 -28
- snappy/togl/win32VC-tk8.6/Togl2.1/Togl21.dll +0 -0
- snappy/togl/win32VC-tk8.6/Togl2.1/Togl21.lib +0 -0
- snappy/togl/win32VC-tk8.6/Togl2.1/pkgIndex.tcl +0 -6
- snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/LICENSE +0 -28
- snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/Togl21.dll +0 -0
- snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/Togl21.lib +0 -0
- snappy/togl/win32VC-x86_64-tk8.6/Togl2.1/pkgIndex.tcl +0 -6
- snappy/twister/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/twister/__pycache__/main.cpython-38.pyc +0 -0
- snappy/upper_halfspace/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/upper_halfspace/__pycache__/ideal_point.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/cuspCrossSection.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/cuspTranslations.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/cusp_areas.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/cusp_shapes.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/exceptions.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/interval_newton_shapes_engine.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/interval_tree.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/krawczyk_shapes_engine.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/realAlgebra.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/shapes.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/short_slopes.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/squareExtensions.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/verifyCanonical.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/verifyHyperbolicity.cpython-38.pyc +0 -0
- snappy/verify/__pycache__/volume.cpython-38.pyc +0 -0
- snappy/verify/complex_volume/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/verify/complex_volume/__pycache__/adjust_torsion.cpython-38.pyc +0 -0
- snappy/verify/complex_volume/__pycache__/closed.cpython-38.pyc +0 -0
- snappy/verify/complex_volume/__pycache__/compute_ptolemys.cpython-38.pyc +0 -0
- snappy/verify/complex_volume/__pycache__/cusped.cpython-38.pyc +0 -0
- snappy/verify/complex_volume/__pycache__/extended_bloch.cpython-38.pyc +0 -0
- snappy/verify/cuspCrossSection.py +0 -1422
- snappy/verify/maximal_cusp_area_matrix/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/verify/maximal_cusp_area_matrix/__pycache__/cusp_tiling_engine.cpython-38.pyc +0 -0
- snappy/verify/maximal_cusp_area_matrix/__pycache__/cusp_translate_engine.cpython-38.pyc +0 -0
- snappy/verify/upper_halfspace/__pycache__/__init__.cpython-38.pyc +0 -0
- snappy/verify/upper_halfspace/__pycache__/extended_matrix.cpython-38.pyc +0 -0
- snappy/verify/upper_halfspace/__pycache__/finite_point.cpython-38.pyc +0 -0
- snappy/verify/upper_halfspace/__pycache__/ideal_point.cpython-38.pyc +0 -0
- snappy-3.1.1.dist-info/RECORD +0 -575
- {snappy-3.1.1.dist-info → snappy-3.2.dist-info}/entry_points.txt +0 -0
snappy/ptolemy/polynomial.py
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
import re
|
2
2
|
import operator
|
3
3
|
from fractions import Fraction
|
4
|
-
import sys
|
5
|
-
|
6
|
-
long = int
|
7
|
-
unicode = str
|
8
4
|
|
9
5
|
#######################################################
|
10
6
|
# Public Definitions of Monomial and Polynomial class
|
@@ -21,7 +17,7 @@ class Monomial():
|
|
21
17
|
@classmethod
|
22
18
|
def from_variable_name(cls, var):
|
23
19
|
"""Construct a monomial with a single variable given as a string."""
|
24
|
-
assert isinstance(var, str)
|
20
|
+
assert isinstance(var, str)
|
25
21
|
return Monomial(1, ((var, 1),))
|
26
22
|
|
27
23
|
# Constructs a constant monomial
|
@@ -47,7 +43,7 @@ class Monomial():
|
|
47
43
|
else:
|
48
44
|
assert isinstance(vars, tuple)
|
49
45
|
for var, expo in vars:
|
50
|
-
assert isinstance(var, str)
|
46
|
+
assert isinstance(var, str)
|
51
47
|
assert isinstance(expo, int)
|
52
48
|
assert expo > 0
|
53
49
|
self._vars = vars
|
@@ -124,7 +120,7 @@ class Monomial():
|
|
124
120
|
|
125
121
|
# Compute the variables
|
126
122
|
var_dict = _combine_dicts(
|
127
|
-
[dict(self._vars),dict(other._vars)],
|
123
|
+
[dict(self._vars), dict(other._vars)],
|
128
124
|
operator.add)
|
129
125
|
|
130
126
|
return Monomial(coefficient, var_dict)
|
@@ -138,9 +134,9 @@ class Monomial():
|
|
138
134
|
return Monomial.constant_monomial(1)
|
139
135
|
if other == 1:
|
140
136
|
return self
|
141
|
-
if other % 2
|
142
|
-
return self * (self ** (other-1))
|
143
|
-
return (self * self) ** (other//2)
|
137
|
+
if other % 2:
|
138
|
+
return self * (self ** (other - 1))
|
139
|
+
return (self * self) ** (other // 2)
|
144
140
|
|
145
141
|
def __neg__(self):
|
146
142
|
"""Negate this monomial."""
|
@@ -166,7 +162,7 @@ class Monomial():
|
|
166
162
|
|
167
163
|
def split_variable(self, variable):
|
168
164
|
"""Split the specified variable from the others."""
|
169
|
-
remaining_terms = {
|
165
|
+
remaining_terms = {}
|
170
166
|
exponent = 0
|
171
167
|
for var, expo in self._vars:
|
172
168
|
if var == variable:
|
@@ -258,12 +254,12 @@ class Polynomial():
|
|
258
254
|
@classmethod
|
259
255
|
def constant_polynomial(cls, constant):
|
260
256
|
"""Construct a constant polynomial."""
|
261
|
-
return Polynomial(
|
257
|
+
return Polynomial((Monomial.constant_monomial(constant),))
|
262
258
|
|
263
259
|
@classmethod
|
264
260
|
def from_variable_name(cls, var):
|
265
261
|
"""Construct a polynomial consisting of a single variable."""
|
266
|
-
return Polynomial(
|
262
|
+
return Polynomial((Monomial.from_variable_name(var),))
|
267
263
|
|
268
264
|
# constructor takes a tuple of polynomials which are combined
|
269
265
|
|
@@ -279,7 +275,7 @@ class Polynomial():
|
|
279
275
|
# and value being the coefficient
|
280
276
|
|
281
277
|
list_of_vars_coeff_dicts = [
|
282
|
-
{
|
278
|
+
{monomial.get_vars(): monomial.get_coefficient()}
|
283
279
|
for monomial in monomials]
|
284
280
|
|
285
281
|
# combine the dictionaries using sum
|
@@ -327,9 +323,9 @@ class Polynomial():
|
|
327
323
|
return Polynomial((Monomial.constant_monomial(1),))
|
328
324
|
if other == 1:
|
329
325
|
return self
|
330
|
-
if other % 2
|
331
|
-
return self * (self ** (other-1))
|
332
|
-
return (self * self) ** (other//2)
|
326
|
+
if other % 2:
|
327
|
+
return self * (self ** (other - 1))
|
328
|
+
return (self * self) ** (other // 2)
|
333
329
|
|
334
330
|
def __mul__(self, other):
|
335
331
|
monomials = []
|
@@ -352,7 +348,7 @@ class Polynomial():
|
|
352
348
|
|
353
349
|
other = other.convert_coefficients(Fraction)
|
354
350
|
other = other * Polynomial.constant_polynomial(
|
355
|
-
Fraction(1,1) / other.leading_coefficient())
|
351
|
+
Fraction(1, 1) / other.leading_coefficient())
|
356
352
|
|
357
353
|
variable = other.variables()[0]
|
358
354
|
assert ((not other.variables())
|
@@ -392,8 +388,8 @@ class Polynomial():
|
|
392
388
|
"""Convert all coefficients using conversion_function."""
|
393
389
|
|
394
390
|
return Polynomial(tuple(
|
395
|
-
|
396
|
-
|
391
|
+
[monomial.convert_coefficient(conversion_function)
|
392
|
+
for monomial in self._monomials]))
|
397
393
|
|
398
394
|
def substitute(self, d):
|
399
395
|
"""
|
@@ -417,11 +413,11 @@ class Polynomial():
|
|
417
413
|
|
418
414
|
for var, expo in vars:
|
419
415
|
if var not in d:
|
420
|
-
new_vars.append((var,expo))
|
416
|
+
new_vars.append((var, expo))
|
421
417
|
|
422
418
|
poly = Polynomial((
|
423
|
-
|
424
|
-
|
419
|
+
Monomial(monomial.get_coefficient(),
|
420
|
+
tuple(new_vars)),))
|
425
421
|
|
426
422
|
for var, expo in vars:
|
427
423
|
if var in d:
|
@@ -430,7 +426,7 @@ class Polynomial():
|
|
430
426
|
return poly
|
431
427
|
|
432
428
|
return sum([substitute_monomial(monomial)
|
433
|
-
|
429
|
+
for monomial in self._monomials], Polynomial(()))
|
434
430
|
|
435
431
|
def variables(self):
|
436
432
|
"""Return a list of all variables in the polynomial."""
|
@@ -478,11 +474,11 @@ class Polynomial():
|
|
478
474
|
"""Assert univariance; return True iff this polynomial is monic."""
|
479
475
|
return self.leading_coefficient() == 1
|
480
476
|
|
481
|
-
def get_coefficients(self, conversion_function=lambda x:x):
|
477
|
+
def get_coefficients(self, conversion_function=lambda x: x):
|
482
478
|
"""Assert univariance; return the coefficients in degree order."""
|
483
479
|
assert self.is_univariate()
|
484
480
|
degree = self.degree()
|
485
|
-
list_of_coefficients = (degree + 1) * [
|
481
|
+
list_of_coefficients = (degree + 1) * [conversion_function(0)]
|
486
482
|
for monomial in self._monomials:
|
487
483
|
list_of_coefficients[degree - monomial.degree()] = (
|
488
484
|
conversion_function(monomial.get_coefficient()))
|
@@ -533,7 +529,7 @@ class Polynomial():
|
|
533
529
|
|
534
530
|
def factor_out_variables(self):
|
535
531
|
|
536
|
-
if self._monomials
|
532
|
+
if not self._monomials:
|
537
533
|
return self
|
538
534
|
|
539
535
|
def intersect(lists):
|
@@ -543,22 +539,21 @@ class Polynomial():
|
|
543
539
|
return s
|
544
540
|
|
545
541
|
non_trivial_variables = intersect(
|
546
|
-
[
|
542
|
+
[monomial.variables() for monomial in self._monomials])
|
547
543
|
|
548
|
-
lowest_powers =
|
544
|
+
lowest_powers = {var: 1000000 for var in non_trivial_variables}
|
549
545
|
|
550
|
-
def safe_dict(d,var):
|
546
|
+
def safe_dict(d, var):
|
551
547
|
if var in d:
|
552
548
|
return d[var]
|
553
|
-
|
554
|
-
return 0
|
549
|
+
return 0
|
555
550
|
|
556
551
|
for monomial in self._monomials:
|
557
552
|
for var, expo in monomial.get_vars():
|
558
|
-
lowest_powers[var] = min(safe_dict(lowest_powers,var), expo)
|
553
|
+
lowest_powers[var] = min(safe_dict(lowest_powers, var), expo)
|
559
554
|
|
560
|
-
return Polynomial(tuple([
|
561
|
-
|
555
|
+
return Polynomial(tuple([monomial.reduce_exponents(lowest_powers)
|
556
|
+
for monomial in self._monomials]))
|
562
557
|
|
563
558
|
###############################################################
|
564
559
|
# Default functions for parsing and printing the coefficients
|
@@ -568,7 +563,7 @@ class Polynomial():
|
|
568
563
|
|
569
564
|
|
570
565
|
def parse_int_coefficient(s):
|
571
|
-
coeff, rest = re.match('([0-9]*)(.*)',s).groups()
|
566
|
+
coeff, rest = re.match('([0-9]*)(.*)', s).groups()
|
572
567
|
if coeff:
|
573
568
|
coeff = int(coeff)
|
574
569
|
else:
|
@@ -577,7 +572,7 @@ def parse_int_coefficient(s):
|
|
577
572
|
|
578
573
|
|
579
574
|
def parse_int_or_fraction(s):
|
580
|
-
m = re.match('([0-9]+/[0-9]+)(.*)',s)
|
575
|
+
m = re.match('([0-9]+/[0-9]+)(.*)', s)
|
581
576
|
if m:
|
582
577
|
frac, rest = m.groups()
|
583
578
|
return Fraction(frac), rest
|
@@ -623,9 +618,9 @@ def _storage_type_policy(type_a, type_b):
|
|
623
618
|
assert isinstance(type_a, type)
|
624
619
|
assert isinstance(type_b, type)
|
625
620
|
|
626
|
-
if type_a in [int
|
621
|
+
if type_a in [int]:
|
627
622
|
return type_b
|
628
|
-
if type_b in [int
|
623
|
+
if type_b in [int]:
|
629
624
|
return type_a
|
630
625
|
|
631
626
|
if not type_a == type_b:
|
@@ -642,9 +637,9 @@ def _operator_type_policy(obj_a, obj_b, op=operator.add):
|
|
642
637
|
|
643
638
|
if type(obj_a) == type(obj_b):
|
644
639
|
return op(obj_a, obj_b)
|
645
|
-
if type(obj_a) in [int
|
640
|
+
if type(obj_a) in [int]:
|
646
641
|
return op(type(obj_b)(obj_a), obj_b)
|
647
|
-
if type(obj_b) in [int
|
642
|
+
if type(obj_b) in [int]:
|
648
643
|
return op(type(obj_a)(obj_b), obj_a)
|
649
644
|
|
650
645
|
raise Exception
|
@@ -660,23 +655,21 @@ def _operator_type_policy(obj_a, obj_b, op=operator.add):
|
|
660
655
|
|
661
656
|
|
662
657
|
_operators = {
|
663
|
-
'+'
|
664
|
-
'-'
|
665
|
-
'*'
|
666
|
-
'^'
|
667
|
-
}
|
658
|
+
'+': operator.add,
|
659
|
+
'-': operator.sub,
|
660
|
+
'*': operator.mul,
|
661
|
+
'^': operator.pow}
|
668
662
|
|
669
663
|
_operator_precedence = {
|
670
|
-
None
|
671
|
-
'+'
|
672
|
-
'-'
|
673
|
-
'*'
|
674
|
-
'^'
|
675
|
-
}
|
664
|
+
None: 0,
|
665
|
+
'+': 1,
|
666
|
+
'-': 1,
|
667
|
+
'*': 2,
|
668
|
+
'^': 3}
|
676
669
|
|
677
670
|
|
678
671
|
def _apply_operator(op, l, r):
|
679
|
-
return _operators[op](l,r)
|
672
|
+
return _operators[op](l, r)
|
680
673
|
|
681
674
|
# Helper functions for parsing
|
682
675
|
|
@@ -690,7 +683,7 @@ def _coefficient_is_non_trivial(c):
|
|
690
683
|
|
691
684
|
|
692
685
|
def _parse_variable(s):
|
693
|
-
r = re.match(r'([_A-Za-z][_A-Za-z0-9]*)(.*)$',s)
|
686
|
+
r = re.match(r'([_A-Za-z][_A-Za-z0-9]*)(.*)$', s)
|
694
687
|
if r:
|
695
688
|
return r.groups()
|
696
689
|
else:
|
@@ -709,7 +702,7 @@ def _parse_polynomial_from_string(s, parse_coefficient_function):
|
|
709
702
|
|
710
703
|
# Has there been an operand since the opening parenthesis
|
711
704
|
# e.g. parse things like "(+ x)"
|
712
|
-
no_operand_since_opening_parenthesis = [
|
705
|
+
no_operand_since_opening_parenthesis = [True]
|
713
706
|
|
714
707
|
def debug_print(s):
|
715
708
|
print("=" * 75)
|
@@ -730,7 +723,7 @@ def _parse_polynomial_from_string(s, parse_coefficient_function):
|
|
730
723
|
|
731
724
|
# or if the top operator is not preceding
|
732
725
|
if (_operator_precedence[top_operator] <
|
733
|
-
|
726
|
+
_operator_precedence[operator]):
|
734
727
|
return
|
735
728
|
|
736
729
|
top_operator = operator_stack.pop()
|
@@ -766,7 +759,7 @@ def _parse_polynomial_from_string(s, parse_coefficient_function):
|
|
766
759
|
|
767
760
|
next_char, rest = s[0], s[1:]
|
768
761
|
|
769
|
-
if next_char in
|
762
|
+
if next_char in _operators:
|
770
763
|
operator = next_char
|
771
764
|
eval_preceding_operators_on_stack(operator)
|
772
765
|
operator_stack.append(operator)
|
@@ -1,11 +1,28 @@
|
|
1
1
|
import re
|
2
2
|
|
3
3
|
from . import utilities
|
4
|
+
from .ptolemyObstructionClass import PtolemyObstructionClass
|
4
5
|
|
5
6
|
"""
|
6
7
|
Basic functions to read a ptolemy solutions file.
|
7
8
|
"""
|
8
9
|
|
10
|
+
class PtolemyPrecomputedObstructionClassMismatchError(Exception):
|
11
|
+
def __init__(self, index, actual_class, precomputed_class):
|
12
|
+
|
13
|
+
msg = (
|
14
|
+
"The obstruction class in the pre-computed file does not match "
|
15
|
+
"the obstruction class of the Ptolemy variety (index %d). "
|
16
|
+
"The underlying reason is that the pari's implementation of the "
|
17
|
+
"Smith normal form has changed affecting the order in which we "
|
18
|
+
"list the cohomology classes or the cocycles we use as "
|
19
|
+
"representatives. A pre-computed file for the new cocycle has "
|
20
|
+
"not yet been computed.") % index
|
21
|
+
|
22
|
+
Exception.__init__(self, msg)
|
23
|
+
self.index = index
|
24
|
+
self.actual_class = actual_class
|
25
|
+
self.precomputed_class = precomputed_class
|
9
26
|
|
10
27
|
def find_section(text, name):
|
11
28
|
"""
|
@@ -139,6 +156,49 @@ def get_py_eval(text):
|
|
139
156
|
utilities.join_long_lines(
|
140
157
|
find_unique_section(text, "PY=EVAL=SECTION")))
|
141
158
|
|
159
|
+
# A dict-like object we can feed into the variable dict
|
160
|
+
# function in the pre-computed solution file.
|
161
|
+
#
|
162
|
+
# It is sufficient to evaluate the obstruction class but
|
163
|
+
# returns 1 for all other keys.
|
164
|
+
#
|
165
|
+
class _DummyDict:
|
166
|
+
def __getitem__(self, key):
|
167
|
+
if key == '1' or key[0] == 'c':
|
168
|
+
return 1
|
169
|
+
raise KeyError(key)
|
170
|
+
|
171
|
+
def check_obstruction_class_for_variable_dict_function(
|
172
|
+
variable_dict_function, obstruction_class):
|
173
|
+
|
174
|
+
if not isinstance(obstruction_class, PtolemyObstructionClass):
|
175
|
+
# Note that no obstruction class has always been
|
176
|
+
# corresponding to index 0 ("c0" in file name).
|
177
|
+
# So nothing to check.
|
178
|
+
#
|
179
|
+
# We also don't check for the generalized
|
180
|
+
# obstruction class.
|
181
|
+
#
|
182
|
+
# We should double check that our solutions
|
183
|
+
# for PSL(n,C) with n>2 are still fine...
|
184
|
+
#
|
185
|
+
return
|
186
|
+
|
187
|
+
variable_dict = variable_dict_function(_DummyDict())
|
188
|
+
precomputed_class = [
|
189
|
+
variable_dict[var_name]
|
190
|
+
for var_name in obstruction_class._explain_basis ]
|
191
|
+
|
192
|
+
# Obstruction class contains element in Z/2 as additive group.
|
193
|
+
# We need to convert it to be in multiplicative group {-1, 1}.
|
194
|
+
actual_class = [
|
195
|
+
(-1) ** i for i in obstruction_class._H2_element ]
|
196
|
+
|
197
|
+
if actual_class != precomputed_class:
|
198
|
+
raise PtolemyPrecomputedObstructionClassMismatchError(
|
199
|
+
obstruction_class._index,
|
200
|
+
actual_class,
|
201
|
+
precomputed_class)
|
142
202
|
|
143
203
|
def get_manifold_thunk(text):
|
144
204
|
"""
|
snappy/ptolemy/ptolemyVariety.py
CHANGED
@@ -5,6 +5,7 @@ from .ptolemyObstructionClass import PtolemyObstructionClass
|
|
5
5
|
from .ptolemyGeneralizedObstructionClass import PtolemyGeneralizedObstructionClass
|
6
6
|
from .ptolemyVarietyPrimeIdealGroebnerBasis import PtolemyVarietyPrimeIdealGroebnerBasis
|
7
7
|
from . import processFileBase, processFileDispatch, processMagmaFile
|
8
|
+
from .processFileBase import PtolemyPrecomputedObstructionClassMismatchError
|
8
9
|
from . import utilities
|
9
10
|
from string import Template
|
10
11
|
import signal
|
@@ -34,6 +35,18 @@ class PtolemyFileMissingError(Exception):
|
|
34
35
|
def __init__(self, message):
|
35
36
|
Exception.__init__(self, message)
|
36
37
|
|
38
|
+
class PtolemyMissingFileForObstructionClass(Exception):
|
39
|
+
def __init__(self, index):
|
40
|
+
|
41
|
+
msg = (
|
42
|
+
"Pari's implementation of the Smith normal form has changed "
|
43
|
+
"affecting the order in which the cohomology classes are listed "
|
44
|
+
"and the cocycles used to represent them. Unfortunately, the "
|
45
|
+
"pre-computed file uses a cocycle that no longer matches and "
|
46
|
+
"a file matching the new cocycle has not yet been produced. "
|
47
|
+
"Please report the manifold and index (%d)." % index)
|
48
|
+
Exception.__init__(self, msg)
|
49
|
+
self.index = index
|
37
50
|
|
38
51
|
class PtolemyVariety():
|
39
52
|
"""
|
@@ -125,7 +138,7 @@ class PtolemyVariety():
|
|
125
138
|
N, manifold.num_tetrahedra(),
|
126
139
|
isinstance(obstruction_class, PtolemyObstructionClass)))
|
127
140
|
|
128
|
-
self.equations =
|
141
|
+
self.equations = list(self._ptolemy_relations)
|
129
142
|
|
130
143
|
order_of_u = 1
|
131
144
|
|
@@ -471,7 +484,7 @@ class PtolemyVariety():
|
|
471
484
|
dir,
|
472
485
|
'%02d_tetrahedra' % tets])
|
473
486
|
|
474
|
-
def _solution_file_url(self,
|
487
|
+
def _solution_file_url(self, alt=0, ext='magma_out', data_url=None):
|
475
488
|
|
476
489
|
if data_url is None:
|
477
490
|
from . import DATA_URL as data_url
|
@@ -486,47 +499,91 @@ class PtolemyVariety():
|
|
486
499
|
if not data_url[-1] == '/':
|
487
500
|
data_url = data_url + '/'
|
488
501
|
|
489
|
-
if
|
490
|
-
|
502
|
+
if alt > 0:
|
503
|
+
suffix = '_alt%d' % alt
|
491
504
|
else:
|
492
|
-
|
505
|
+
suffix = ''
|
493
506
|
|
494
|
-
filename = self.filename_base() + ext
|
507
|
+
filename = self.filename_base() + suffix + "." + ext
|
495
508
|
|
496
509
|
return data_url + self.path_to_file() + '/' + urlquote(filename)
|
497
510
|
|
498
|
-
def
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
try:
|
510
|
-
return _retrieve_url(url)
|
511
|
+
def _retrieve_solution_file_alt(self,
|
512
|
+
alt=0,
|
513
|
+
data_url=None,
|
514
|
+
exts=['magma_out', 'rur'],
|
515
|
+
verbose=False):
|
516
|
+
for i, ext in enumerate(exts):
|
517
|
+
url = self._solution_file_url(alt=alt,
|
518
|
+
data_url=data_url,
|
519
|
+
ext=ext)
|
520
|
+
if verbose:
|
521
|
+
print("Trying to retrieve solutions from %s ..." % url)
|
511
522
|
|
512
|
-
|
523
|
+
try:
|
524
|
+
return _retrieve_url(url)
|
525
|
+
except PtolemyFileMissingError as e:
|
526
|
+
if i == len(exts) - 1:
|
527
|
+
raise
|
513
528
|
|
514
|
-
|
515
|
-
|
529
|
+
def _retrieve_solution_file(self,
|
530
|
+
data_url=None,
|
531
|
+
exts=['magma_out', 'rur'],
|
532
|
+
verbose=False):
|
516
533
|
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
534
|
+
num_alts = 3
|
535
|
+
|
536
|
+
for alt in range(num_alts):
|
537
|
+
try:
|
538
|
+
text = self._retrieve_solution_file_alt(alt=alt,
|
539
|
+
data_url=data_url,
|
540
|
+
exts=exts,
|
541
|
+
verbose=verbose)
|
542
|
+
self._check_obstruction_class_for_precomputed_file(text)
|
543
|
+
return text
|
544
|
+
except PtolemyPrecomputedObstructionClassMismatchError as e:
|
545
|
+
if alt == num_alts - 1:
|
546
|
+
raise
|
547
|
+
except PtolemyFileMissingError as e:
|
548
|
+
if alt == 0:
|
549
|
+
raise
|
550
|
+
else:
|
551
|
+
raise PtolemyMissingFileForObstructionClass(
|
552
|
+
self._obstruction_class._index if self._obstruction_class else 0)
|
553
|
+
|
554
|
+
def _check_obstruction_class_for_precomputed_file(
|
555
|
+
self, text):
|
556
|
+
|
557
|
+
# Grab the PY=EVAL=SECTION
|
558
|
+
# Note that this will be evaluated again later.
|
559
|
+
# But it is cheap enough that the double evaluation should not matter.
|
560
|
+
py_eval = processFileBase.get_py_eval(text)
|
561
|
+
|
562
|
+
# Now get the function that takes a dictionary-like object with
|
563
|
+
# the solutions to the variety and expands it to a dictionary
|
564
|
+
# assigning a value to all Ptolemy coordinates and obstruction class
|
565
|
+
# variables.
|
566
|
+
variable_dict_function = py_eval['variable_dict']
|
567
|
+
|
568
|
+
# As noticed by Nathan, the obstruction classes used for producing
|
569
|
+
# the pre-computed solutions do not match the obstruction classes
|
570
|
+
# we compute now.
|
571
|
+
# This is due to pari changing the code for computing the
|
572
|
+
# Smith normal form in version 2.13 (see
|
573
|
+
# http://pari.math.u-bordeaux.fr/archives/pari-announce-20/msg00006.html)
|
574
|
+
#
|
575
|
+
# We thus check here explicitly that the obstruction class still
|
576
|
+
# matches.
|
577
|
+
#
|
578
|
+
processFileBase.check_obstruction_class_for_variable_dict_function(
|
579
|
+
variable_dict_function,
|
580
|
+
self._obstruction_class)
|
522
581
|
|
523
582
|
def retrieve_decomposition(self, data_url=None, verbose=True):
|
524
583
|
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
text = _retrieve_url(url)
|
584
|
+
text = self._retrieve_solution_file(data_url,
|
585
|
+
exts=['magma_out'],
|
586
|
+
verbose=verbose)
|
530
587
|
|
531
588
|
if verbose:
|
532
589
|
print("Parsing...")
|
@@ -542,9 +599,14 @@ class PtolemyVariety():
|
|
542
599
|
data_url=None,
|
543
600
|
verbose=True):
|
544
601
|
|
602
|
+
exts = ['magma_out.gz', 'magma_out', 'rur']
|
603
|
+
if prefer_rur:
|
604
|
+
exts = exts[::-1]
|
605
|
+
|
545
606
|
text = self._retrieve_solution_file(data_url=data_url,
|
546
|
-
|
607
|
+
exts=exts,
|
547
608
|
verbose=verbose)
|
609
|
+
|
548
610
|
if verbose:
|
549
611
|
print("Parsing...")
|
550
612
|
|
@@ -819,7 +881,7 @@ def _identified_variables_canonize(identified_variables):
|
|
819
881
|
|
820
882
|
return dict1
|
821
883
|
|
822
|
-
all_variables = {
|
884
|
+
all_variables = {}
|
823
885
|
|
824
886
|
for sign, power, var1, var2 in identified_variables:
|
825
887
|
all_variables[var1] = { var1 : (+1, 0) }
|
@@ -830,10 +892,10 @@ def _identified_variables_canonize(identified_variables):
|
|
830
892
|
new_dict = merge_two_dicts(sign, power, var1, var2,
|
831
893
|
all_variables[var1],
|
832
894
|
all_variables[var2])
|
833
|
-
for var in new_dict
|
895
|
+
for var in new_dict:
|
834
896
|
all_variables[var] = new_dict
|
835
897
|
|
836
|
-
result = {
|
898
|
+
result = {}
|
837
899
|
|
838
900
|
for variable, variable_dict in all_variables.items():
|
839
901
|
if variable not in result:
|
@@ -884,7 +946,7 @@ def _canonical_representative_to_polynomial_substituition(
|
|
884
946
|
|
885
947
|
def _retrieve_url(url):
|
886
948
|
|
887
|
-
overview_url = "
|
949
|
+
overview_url = "https://ptolemy.unhyperbolic.org/data/overview.html"
|
888
950
|
|
889
951
|
try:
|
890
952
|
# Remember SnapPy's SIGALRM handler (defined in app.py)
|
@@ -910,10 +972,10 @@ def _retrieve_url(url):
|
|
910
972
|
"is not configured correctly: %s. Also see %s" % (
|
911
973
|
e, overview_url))
|
912
974
|
|
913
|
-
except
|
975
|
+
except OSError as e:
|
914
976
|
# IOError: this means the file wasn't there or we couldn't connect
|
915
977
|
# to the server
|
916
|
-
if url
|
978
|
+
if url.startswith('http:') or url.startswith('https'):
|
917
979
|
# IOError for http means we could not connect to server
|
918
980
|
raise RuntimeError(
|
919
981
|
"Problem connecting to server while retrieving %s: "
|
@@ -931,10 +993,16 @@ def _retrieve_url(url):
|
|
931
993
|
if sigalrm_handler: # Not supported under windows
|
932
994
|
signal.signal(signal.SIGALRM, sigalrm_handler)
|
933
995
|
|
996
|
+
text = s.read()
|
997
|
+
|
998
|
+
if url.endswith('.gz'):
|
999
|
+
import gzip
|
1000
|
+
text = gzip.decompress(text)
|
1001
|
+
|
934
1002
|
# Read the text
|
935
|
-
text =
|
1003
|
+
text = text.decode('ascii').replace('\r\n', '\n')
|
936
1004
|
|
937
|
-
if url
|
1005
|
+
if not (url.startswith('http:') or url.startswith('https')):
|
938
1006
|
# If this is a normal file, we are done
|
939
1007
|
return text
|
940
1008
|
|
snappy/ptolemy/reginaWrapper.py
CHANGED
@@ -40,7 +40,7 @@ class NTriangulationForPtolemy(NTriangulation):
|
|
40
40
|
"""
|
41
41
|
Constructor - takes same arguments as NTriangulation.
|
42
42
|
"""
|
43
|
-
super(
|
43
|
+
super().__init__(*args, **kwargs)
|
44
44
|
|
45
45
|
# Make sure we are oriented
|
46
46
|
if not self.isOriented():
|
@@ -146,10 +146,10 @@ class NTriangulationForPtolemy(NTriangulation):
|
|
146
146
|
|
147
147
|
* Stavros Garoufalidis, Dyland Thurston, Christian K. Zickert:
|
148
148
|
"The Complex Volume of SL(n,C)-Representations of 3-Manifolds"
|
149
|
-
(
|
149
|
+
(https://arxiv.org/abs/1111.2828)
|
150
150
|
* Stavros Garoufalidis, Matthias Goerner, Christian K. Zickert:
|
151
151
|
"Gluing Equations for PGL(n,C)-Representations of 3-Manifolds "
|
152
|
-
(
|
152
|
+
(https://arxiv.org/abs/1207.6711)
|
153
153
|
|
154
154
|
The variety can be exported to magma or sage and solved there. The
|
155
155
|
solutions can be processed to compute invariants.
|
@@ -439,7 +439,7 @@ class NTriangulationForPtolemy(NTriangulation):
|
|
439
439
|
# Following Remark 5.7 of
|
440
440
|
# Garoufalidis, Goerner, Zickert:
|
441
441
|
# Gluing Equations for PGL(n,C)-Representations of 3-Manifolds
|
442
|
-
#
|
442
|
+
# https://arxiv.org/abs/1207.6711
|
443
443
|
# we discard all even entries and get a permutation called
|
444
444
|
# "effective_perm" here.
|
445
445
|
effective_perm = []
|
snappy/ptolemy/rur.py
CHANGED
@@ -443,7 +443,7 @@ class RUR():
|
|
443
443
|
return
|
444
444
|
|
445
445
|
def term_to_expand_fraction_by(old_terms):
|
446
|
-
result =
|
446
|
+
result = list(new_denominator_terms)
|
447
447
|
for p, e in old_terms:
|
448
448
|
if e < 0:
|
449
449
|
subtract_denominator_from_list(p, e, result)
|