snappy 3.2__cp310-cp310-macosx_10_12_x86_64.whl
Sign up to get free protection for your applications and to get access to all the features.
- snappy/CyOpenGL.cpython-310-darwin.so +0 -0
- snappy/SnapPy.cpython-310-darwin.so +0 -0
- snappy/SnapPy.ico +0 -0
- snappy/SnapPy.png +0 -0
- snappy/SnapPyHP.cpython-310-darwin.so +0 -0
- snappy/__init__.py +760 -0
- snappy/app.py +605 -0
- snappy/app_menus.py +372 -0
- snappy/browser.py +998 -0
- snappy/cache.py +25 -0
- snappy/canonical.py +249 -0
- snappy/cusps/__init__.py +38 -0
- snappy/cusps/cusp_area_matrix.py +101 -0
- snappy/cusps/cusp_areas_from_matrix.py +173 -0
- 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 +454 -0
- snappy/db_utilities.py +79 -0
- snappy/decorated_isosig.py +710 -0
- snappy/dev/__init__.py +0 -0
- snappy/dev/extended_ptolemy/__init__.py +8 -0
- snappy/dev/extended_ptolemy/closed.py +106 -0
- snappy/dev/extended_ptolemy/complexVolumesClosed.py +149 -0
- snappy/dev/extended_ptolemy/direct.py +42 -0
- snappy/dev/extended_ptolemy/extended.py +406 -0
- snappy/dev/extended_ptolemy/giac_helper.py +43 -0
- snappy/dev/extended_ptolemy/giac_rur.py +129 -0
- snappy/dev/extended_ptolemy/gluing.py +46 -0
- snappy/dev/extended_ptolemy/phc_wrapper.py +220 -0
- snappy/dev/extended_ptolemy/printMatrices.py +70 -0
- snappy/dev/vericlosed/__init__.py +1 -0
- snappy/dev/vericlosed/computeApproxHyperbolicStructureNew.py +159 -0
- snappy/dev/vericlosed/computeApproxHyperbolicStructureOrb.py +90 -0
- snappy/dev/vericlosed/computeVerifiedHyperbolicStructure.py +111 -0
- snappy/dev/vericlosed/gimbalLoopFinder.py +130 -0
- snappy/dev/vericlosed/hyperbolicStructure.py +313 -0
- snappy/dev/vericlosed/krawczykCertifiedEdgeLengthsEngine.py +165 -0
- snappy/dev/vericlosed/oneVertexTruncatedComplex.py +122 -0
- snappy/dev/vericlosed/orb/__init__.py +1 -0
- snappy/dev/vericlosed/orb/orb_solution_for_snappea_finite_triangulation_mac +0 -0
- snappy/dev/vericlosed/parseVertexGramMatrixFile.py +47 -0
- snappy/dev/vericlosed/polishApproxHyperbolicStructure.py +61 -0
- snappy/dev/vericlosed/test.py +54 -0
- snappy/dev/vericlosed/truncatedComplex.py +176 -0
- snappy/dev/vericlosed/verificationError.py +58 -0
- snappy/dev/vericlosed/verifyHyperbolicStructureEngine.py +177 -0
- snappy/doc/_images/SnapPy-196.png +0 -0
- snappy/doc/_images/geodesics.jpg +0 -0
- snappy/doc/_images/m004_paper_plane_on_systole.jpg +0 -0
- snappy/doc/_images/m125_paper_plane.jpg +0 -0
- snappy/doc/_images/mac.png +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/_images/plink-action.png +0 -0
- snappy/doc/_images/ubuntu.png +0 -0
- snappy/doc/_images/win7.png +0 -0
- snappy/doc/_sources/additional_classes.rst.txt +40 -0
- snappy/doc/_sources/bugs.rst.txt +14 -0
- snappy/doc/_sources/censuses.rst.txt +51 -0
- snappy/doc/_sources/credits.rst.txt +75 -0
- snappy/doc/_sources/development.rst.txt +259 -0
- snappy/doc/_sources/index.rst.txt +182 -0
- snappy/doc/_sources/installing.rst.txt +247 -0
- snappy/doc/_sources/manifold.rst.txt +6 -0
- snappy/doc/_sources/manifoldhp.rst.txt +46 -0
- snappy/doc/_sources/news.rst.txt +355 -0
- snappy/doc/_sources/other.rst.txt +25 -0
- snappy/doc/_sources/platonic_census.rst.txt +20 -0
- snappy/doc/_sources/plink.rst.txt +102 -0
- snappy/doc/_sources/ptolemy.rst.txt +66 -0
- snappy/doc/_sources/ptolemy_classes.rst.txt +42 -0
- snappy/doc/_sources/ptolemy_examples1.rst.txt +298 -0
- snappy/doc/_sources/ptolemy_examples2.rst.txt +363 -0
- snappy/doc/_sources/ptolemy_examples3.rst.txt +301 -0
- snappy/doc/_sources/ptolemy_examples4.rst.txt +61 -0
- snappy/doc/_sources/ptolemy_prelim.rst.txt +105 -0
- snappy/doc/_sources/screenshots.rst.txt +21 -0
- snappy/doc/_sources/snap.rst.txt +87 -0
- snappy/doc/_sources/snappy.rst.txt +28 -0
- snappy/doc/_sources/spherogram.rst.txt +103 -0
- snappy/doc/_sources/todo.rst.txt +47 -0
- snappy/doc/_sources/triangulation.rst.txt +11 -0
- snappy/doc/_sources/tutorial.rst.txt +49 -0
- snappy/doc/_sources/verify.rst.txt +210 -0
- snappy/doc/_sources/verify_internals.rst.txt +79 -0
- snappy/doc/_static/SnapPy-horizontal-128.png +0 -0
- snappy/doc/_static/SnapPy.ico +0 -0
- snappy/doc/_static/_sphinx_javascript_frameworks_compat.js +123 -0
- snappy/doc/_static/basic.css +925 -0
- snappy/doc/_static/css/badge_only.css +1 -0
- snappy/doc/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- snappy/doc/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- snappy/doc/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- snappy/doc/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- snappy/doc/_static/css/fonts/fontawesome-webfont.eot +0 -0
- snappy/doc/_static/css/fonts/fontawesome-webfont.svg +2671 -0
- snappy/doc/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- snappy/doc/_static/css/fonts/fontawesome-webfont.woff +0 -0
- snappy/doc/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- snappy/doc/_static/css/fonts/lato-bold-italic.woff +0 -0
- snappy/doc/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- snappy/doc/_static/css/fonts/lato-bold.woff +0 -0
- snappy/doc/_static/css/fonts/lato-bold.woff2 +0 -0
- snappy/doc/_static/css/fonts/lato-normal-italic.woff +0 -0
- snappy/doc/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- snappy/doc/_static/css/fonts/lato-normal.woff +0 -0
- snappy/doc/_static/css/fonts/lato-normal.woff2 +0 -0
- snappy/doc/_static/css/theme.css +4 -0
- snappy/doc/_static/doctools.js +156 -0
- snappy/doc/_static/documentation_options.js +13 -0
- snappy/doc/_static/file.png +0 -0
- 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/jquery.js +2 -0
- snappy/doc/_static/js/badge_only.js +1 -0
- snappy/doc/_static/js/theme.js +1 -0
- snappy/doc/_static/js/versions.js +228 -0
- snappy/doc/_static/language_data.js +199 -0
- snappy/doc/_static/minus.png +0 -0
- snappy/doc/_static/plus.png +0 -0
- snappy/doc/_static/pygments.css +75 -0
- snappy/doc/_static/searchtools.js +620 -0
- snappy/doc/_static/snappy_furo.css +33 -0
- snappy/doc/_static/snappy_sphinx_rtd_theme.css +42 -0
- snappy/doc/_static/sphinx_highlight.js +154 -0
- snappy/doc/additional_classes.html +1500 -0
- snappy/doc/bugs.html +132 -0
- snappy/doc/censuses.html +427 -0
- snappy/doc/credits.html +181 -0
- snappy/doc/development.html +384 -0
- snappy/doc/genindex.html +1331 -0
- snappy/doc/index.html +262 -0
- snappy/doc/installing.html +346 -0
- snappy/doc/manifold.html +3452 -0
- snappy/doc/manifoldhp.html +180 -0
- snappy/doc/news.html +388 -0
- snappy/doc/objects.inv +0 -0
- snappy/doc/other.html +161 -0
- snappy/doc/platonic_census.html +375 -0
- snappy/doc/plink.html +210 -0
- snappy/doc/ptolemy.html +254 -0
- snappy/doc/ptolemy_classes.html +1144 -0
- snappy/doc/ptolemy_examples1.html +409 -0
- snappy/doc/ptolemy_examples2.html +471 -0
- snappy/doc/ptolemy_examples3.html +414 -0
- snappy/doc/ptolemy_examples4.html +195 -0
- snappy/doc/ptolemy_prelim.html +248 -0
- snappy/doc/py-modindex.html +165 -0
- snappy/doc/screenshots.html +141 -0
- snappy/doc/search.html +135 -0
- snappy/doc/searchindex.js +1 -0
- snappy/doc/snap.html +202 -0
- snappy/doc/snappy.html +181 -0
- snappy/doc/spherogram.html +1211 -0
- snappy/doc/todo.html +166 -0
- snappy/doc/triangulation.html +1584 -0
- snappy/doc/tutorial.html +159 -0
- snappy/doc/verify.html +330 -0
- snappy/doc/verify_internals.html +1235 -0
- snappy/drilling/__init__.py +456 -0
- snappy/drilling/barycentric.py +103 -0
- snappy/drilling/constants.py +5 -0
- snappy/drilling/crush.py +270 -0
- snappy/drilling/cusps.py +125 -0
- snappy/drilling/debug.py +242 -0
- snappy/drilling/epsilons.py +6 -0
- snappy/drilling/exceptions.py +55 -0
- snappy/drilling/moves.py +620 -0
- snappy/drilling/peripheral_curves.py +210 -0
- snappy/drilling/perturb.py +188 -0
- snappy/drilling/shorten.py +36 -0
- snappy/drilling/subdivide.py +274 -0
- snappy/drilling/test.py +23 -0
- snappy/drilling/test_cases.py +126 -0
- snappy/drilling/tracing.py +351 -0
- snappy/exceptions.py +26 -0
- snappy/export_stl.py +120 -0
- snappy/exterior_to_link/__init__.py +2 -0
- snappy/exterior_to_link/barycentric_geometry.py +463 -0
- snappy/exterior_to_link/exceptions.py +6 -0
- snappy/exterior_to_link/geodesic_map.json +14408 -0
- snappy/exterior_to_link/hyp_utils.py +112 -0
- snappy/exterior_to_link/link_projection.py +323 -0
- snappy/exterior_to_link/main.py +197 -0
- snappy/exterior_to_link/mcomplex_with_expansion.py +261 -0
- snappy/exterior_to_link/mcomplex_with_link.py +687 -0
- snappy/exterior_to_link/mcomplex_with_memory.py +162 -0
- snappy/exterior_to_link/pl_utils.py +491 -0
- snappy/exterior_to_link/put_in_S3.py +156 -0
- snappy/exterior_to_link/rational_linear_algebra.py +123 -0
- snappy/exterior_to_link/rational_linear_algebra_wrapped.py +135 -0
- snappy/exterior_to_link/simplify_to_base_tri.py +114 -0
- snappy/exterior_to_link/stored_moves.py +475 -0
- snappy/exterior_to_link/test.py +31 -0
- snappy/filedialog.py +28 -0
- 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/geometric_structure/geodesic/fixed_points.py +93 -0
- snappy/geometric_structure/geodesic/geodesic_start_point_info.py +435 -0
- 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 +121 -0
- snappy/horoviewer.py +443 -0
- snappy/hyperboloid/__init__.py +212 -0
- 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/info_icon.gif +0 -0
- snappy/infowindow.py +65 -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/manifolds/HTWKnots/alternating.gz +0 -0
- snappy/manifolds/HTWKnots/nonalternating.gz +0 -0
- snappy/manifolds/__init__.py +3 -0
- snappy/math_basics.py +176 -0
- snappy/matrix.py +525 -0
- snappy/number.py +657 -0
- snappy/numeric_output_checker.py +345 -0
- snappy/pari.py +41 -0
- snappy/phone_home.py +57 -0
- snappy/polyviewer.py +259 -0
- snappy/ptolemy/__init__.py +17 -0
- snappy/ptolemy/component.py +103 -0
- snappy/ptolemy/coordinates.py +2290 -0
- snappy/ptolemy/fieldExtensions.py +153 -0
- snappy/ptolemy/findLoops.py +473 -0
- snappy/ptolemy/geometricRep.py +59 -0
- snappy/ptolemy/homology.py +165 -0
- snappy/ptolemy/magma/default.magma_template +229 -0
- snappy/ptolemy/magma/radicalsOfPrimaryDecomposition.magma_template +79 -0
- snappy/ptolemy/manifoldMethods.py +395 -0
- snappy/ptolemy/matrix.py +350 -0
- snappy/ptolemy/numericalSolutionsToGroebnerBasis.py +113 -0
- snappy/ptolemy/polynomial.py +857 -0
- snappy/ptolemy/processComponents.py +173 -0
- snappy/ptolemy/processFileBase.py +247 -0
- snappy/ptolemy/processFileDispatch.py +46 -0
- snappy/ptolemy/processMagmaFile.py +392 -0
- snappy/ptolemy/processRurFile.py +150 -0
- snappy/ptolemy/ptolemyGeneralizedObstructionClass.py +102 -0
- snappy/ptolemy/ptolemyObstructionClass.py +64 -0
- snappy/ptolemy/ptolemyVariety.py +1029 -0
- snappy/ptolemy/ptolemyVarietyPrimeIdealGroebnerBasis.py +140 -0
- snappy/ptolemy/reginaWrapper.py +698 -0
- snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c2.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c3.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c4.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c5.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c6.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files/DT_mcbbiceaibjklmdfgh__sl2_c7.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files_generalized/m003__sl3_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files_generalized/m003__sl3_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files_generalized/m015__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files_generalized/m015__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files_generalized/m015__sl3_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/regina_testing_files_generalized/m015__sl3_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/rur.py +545 -0
- snappy/ptolemy/solutionsToPrimeIdealGroebnerBasis.py +277 -0
- snappy/ptolemy/test.py +1126 -0
- snappy/ptolemy/testing_files/3_1__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/3_1__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/4_1__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/4_1__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/4_1__sl3_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/4_1__sl4_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/4_1__sl4_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/5_2__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/5_2__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c2.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c3.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c4.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c5.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c6.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/DT_mcbbiceaibjklmdfgh__sl2_c7.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/data/pgl2/OrientableCuspedCensus/03_tetrahedra/m019__sl2_c0.magma_out +95 -0
- snappy/ptolemy/testing_files/data/pgl2/OrientableCuspedCensus/03_tetrahedra/m019__sl2_c1.magma_out +95 -0
- snappy/ptolemy/testing_files/m015__sl3_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/m135__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/m135__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/m135__sl2_c2.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/m135__sl2_c3.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/m135__sl2_c4.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/m135__sl2_c5.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/m135__sl2_c6.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/m135__sl2_c7.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/s000__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/s000__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/t00000__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/t00000__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/v0000__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/v0000__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/v0000__sl2_c2.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files/v0000__sl2_c3.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files_generalized/m003__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files_generalized/m003__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files_generalized/m003__sl3_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files_generalized/m003__sl3_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files_generalized/m004__sl2_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files_generalized/m004__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files_generalized/m015__sl2_c1.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files_generalized/m015__sl3_c0.magma_out.bz2 +0 -0
- snappy/ptolemy/testing_files_rur/m052__sl3_c0.rur.bz2 +0 -0
- snappy/ptolemy/utilities.py +236 -0
- 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 +197 -0
- snappy/raytracing/eyeball.py +123 -0
- snappy/raytracing/finite_raytracing_data.py +237 -0
- snappy/raytracing/finite_viewer.py +590 -0
- snappy/raytracing/geodesic_tube_info.py +174 -0
- snappy/raytracing/geodesics.py +246 -0
- snappy/raytracing/geodesics_window.py +258 -0
- snappy/raytracing/gui_utilities.py +293 -0
- snappy/raytracing/hyperboloid_navigation.py +556 -0
- snappy/raytracing/hyperboloid_utilities.py +234 -0
- snappy/raytracing/ideal_raytracing_data.py +592 -0
- snappy/raytracing/inside_viewer.py +974 -0
- snappy/raytracing/pack.py +22 -0
- snappy/raytracing/raytracing_data.py +126 -0
- snappy/raytracing/raytracing_view.py +454 -0
- snappy/raytracing/shaders/Eye.png +0 -0
- snappy/raytracing/shaders/NonGeometric.png +0 -0
- snappy/raytracing/shaders/__init__.py +101 -0
- snappy/raytracing/shaders/fragment.glsl +1744 -0
- snappy/raytracing/test.py +29 -0
- snappy/raytracing/tooltip.py +146 -0
- snappy/raytracing/upper_halfspace_utilities.py +98 -0
- snappy/raytracing/view_scale_controller.py +98 -0
- snappy/raytracing/zoom_slider/__init__.py +263 -0
- snappy/raytracing/zoom_slider/inward.png +0 -0
- snappy/raytracing/zoom_slider/inward18.png +0 -0
- snappy/raytracing/zoom_slider/outward.png +0 -0
- snappy/raytracing/zoom_slider/outward18.png +0 -0
- snappy/raytracing/zoom_slider/test.py +20 -0
- snappy/sage_helper.py +117 -0
- snappy/settings.py +409 -0
- snappy/shell.py +53 -0
- snappy/snap/__init__.py +114 -0
- snappy/snap/character_varieties.py +375 -0
- snappy/snap/find_field.py +372 -0
- snappy/snap/fundamental_polyhedron.py +569 -0
- snappy/snap/generators.py +39 -0
- snappy/snap/interval_reps.py +81 -0
- snappy/snap/kernel_structures.py +128 -0
- snappy/snap/mcomplex_base.py +18 -0
- snappy/snap/nsagetools.py +702 -0
- snappy/snap/peripheral/__init__.py +1 -0
- snappy/snap/peripheral/dual_cellulation.py +219 -0
- snappy/snap/peripheral/link.py +127 -0
- snappy/snap/peripheral/peripheral.py +159 -0
- snappy/snap/peripheral/surface.py +522 -0
- snappy/snap/peripheral/test.py +35 -0
- snappy/snap/polished_reps.py +335 -0
- snappy/snap/shapes.py +152 -0
- snappy/snap/slice_obs_HKL.py +668 -0
- snappy/snap/t3mlite/__init__.py +2 -0
- snappy/snap/t3mlite/arrow.py +243 -0
- snappy/snap/t3mlite/corner.py +22 -0
- snappy/snap/t3mlite/edge.py +172 -0
- snappy/snap/t3mlite/face.py +37 -0
- snappy/snap/t3mlite/files.py +211 -0
- snappy/snap/t3mlite/homology.py +53 -0
- snappy/snap/t3mlite/linalg.py +419 -0
- snappy/snap/t3mlite/mcomplex.py +1499 -0
- snappy/snap/t3mlite/perm4.py +320 -0
- snappy/snap/t3mlite/setup.py +12 -0
- snappy/snap/t3mlite/simplex.py +199 -0
- snappy/snap/t3mlite/spun.py +297 -0
- snappy/snap/t3mlite/surface.py +519 -0
- snappy/snap/t3mlite/test.py +20 -0
- snappy/snap/t3mlite/test_vs_regina.py +86 -0
- snappy/snap/t3mlite/tetrahedron.py +109 -0
- snappy/snap/t3mlite/vertex.py +42 -0
- snappy/snap/test.py +134 -0
- snappy/snap/utilities.py +288 -0
- snappy/test.py +209 -0
- 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 +920 -0
- snappy/twister/__init__.py +20 -0
- snappy/twister/main.py +646 -0
- snappy/twister/surfaces/S_0_1 +3 -0
- snappy/twister/surfaces/S_0_2 +3 -0
- snappy/twister/surfaces/S_0_4 +7 -0
- snappy/twister/surfaces/S_0_4_Lantern +8 -0
- snappy/twister/surfaces/S_1 +3 -0
- snappy/twister/surfaces/S_1_1 +4 -0
- snappy/twister/surfaces/S_1_2 +5 -0
- snappy/twister/surfaces/S_1_2_5 +6 -0
- snappy/twister/surfaces/S_2 +6 -0
- snappy/twister/surfaces/S_2_1 +8 -0
- snappy/twister/surfaces/S_2_heeg +10 -0
- snappy/twister/surfaces/S_3 +8 -0
- snappy/twister/surfaces/S_3_1 +10 -0
- snappy/twister/surfaces/S_4_1 +12 -0
- snappy/twister/surfaces/S_5_1 +14 -0
- snappy/twister/surfaces/heeg_fig8 +9 -0
- snappy/twister/twister_core.cpython-310-darwin.so +0 -0
- snappy/upper_halfspace/__init__.py +146 -0
- snappy/upper_halfspace/ideal_point.py +26 -0
- snappy/verify/__init__.py +13 -0
- snappy/verify/canonical.py +542 -0
- snappy/verify/complex_volume/__init__.py +18 -0
- snappy/verify/complex_volume/adjust_torsion.py +86 -0
- snappy/verify/complex_volume/closed.py +168 -0
- snappy/verify/complex_volume/compute_ptolemys.py +90 -0
- snappy/verify/complex_volume/cusped.py +56 -0
- snappy/verify/complex_volume/extended_bloch.py +201 -0
- snappy/verify/cusp_translations.py +85 -0
- snappy/verify/edge_equations.py +80 -0
- snappy/verify/exceptions.py +254 -0
- snappy/verify/hyperbolicity.py +224 -0
- snappy/verify/interval_newton_shapes_engine.py +523 -0
- snappy/verify/interval_tree.py +400 -0
- snappy/verify/krawczyk_shapes_engine.py +518 -0
- snappy/verify/maximal_cusp_area_matrix/__init__.py +46 -0
- snappy/verify/maximal_cusp_area_matrix/cusp_tiling_engine.py +419 -0
- snappy/verify/maximal_cusp_area_matrix/cusp_translate_engine.py +153 -0
- snappy/verify/real_algebra.py +286 -0
- snappy/verify/shapes.py +25 -0
- snappy/verify/short_slopes.py +200 -0
- snappy/verify/square_extensions.py +1005 -0
- snappy/verify/test.py +78 -0
- snappy/verify/upper_halfspace/__init__.py +9 -0
- snappy/verify/upper_halfspace/extended_matrix.py +100 -0
- snappy/verify/upper_halfspace/finite_point.py +283 -0
- snappy/verify/upper_halfspace/ideal_point.py +426 -0
- snappy/verify/volume.py +128 -0
- snappy/version.py +2 -0
- snappy-3.2.dist-info/METADATA +58 -0
- snappy-3.2.dist-info/RECORD +503 -0
- snappy-3.2.dist-info/WHEEL +5 -0
- snappy-3.2.dist-info/entry_points.txt +2 -0
- snappy-3.2.dist-info/top_level.txt +28 -0
@@ -0,0 +1,406 @@
|
|
1
|
+
"""
|
2
|
+
Computing the extended Ptolemy variety of Goerner-Zickert for N = 2.
|
3
|
+
"""
|
4
|
+
import snappy
|
5
|
+
import snappy.snap.t3mlite as t3m
|
6
|
+
import snappy.snap.peripheral as peripheral
|
7
|
+
from sage.all import ZZ, QQ, GF, gcd, PolynomialRing, cyclotomic_polynomial
|
8
|
+
|
9
|
+
directed_edges = [(a, b) for a in range(4) for b in range(4) if a < b]
|
10
|
+
|
11
|
+
edge_to_var = {e:i for i, e in enumerate(directed_edges)}
|
12
|
+
|
13
|
+
t3m_edge_to_tuple = {t3m.E01:(0,1), t3m.E02:(0,2), t3m.E03:(0,3),
|
14
|
+
t3m.E12:(1,2), t3m.E13:(1,3), t3m.E23:(2,3)}
|
15
|
+
|
16
|
+
to_t3m_edge = {(0,1):t3m.E01, (0,2):t3m.E02, (0,3):t3m.E03,
|
17
|
+
(1,2):t3m.E12, (1,3):t3m.E13, (2,3):t3m.E23}
|
18
|
+
|
19
|
+
|
20
|
+
def arrow(mcomplex, tet, face, edge):
|
21
|
+
return t3m.Arrow(to_t3m_edge[edge], t3m.TwoSubsimplices[face],
|
22
|
+
mcomplex.Tetrahedra[tet])
|
23
|
+
|
24
|
+
|
25
|
+
def faces_around_edge(mcomplex, tet, edge):
|
26
|
+
face = min(set(range(4)) - set(edge))
|
27
|
+
ans = [(tet, face, edge)]
|
28
|
+
A0 = arrow(mcomplex, tet, face, edge)
|
29
|
+
A = A0.copy().next()
|
30
|
+
while A != A0:
|
31
|
+
tet = A.Tetrahedron.Index
|
32
|
+
face = t3m.FaceIndex[A.Face]
|
33
|
+
edge = t3m_edge_to_tuple[A.Edge]
|
34
|
+
ans.append((tet, face, edge))
|
35
|
+
A.next()
|
36
|
+
return ans
|
37
|
+
|
38
|
+
def lex_first_edge_starts(mcomplex):
|
39
|
+
"""
|
40
|
+
Returns a list of containing tuples of the form (tet, face, edge),
|
41
|
+
one at each edge.
|
42
|
+
"""
|
43
|
+
T = mcomplex
|
44
|
+
ans = []
|
45
|
+
for edge in T.Edges:
|
46
|
+
poss_starts = []
|
47
|
+
for C in edge.Corners:
|
48
|
+
t = C.Tetrahedron.Index
|
49
|
+
e = t3m_edge_to_tuple[C.Subsimplex]
|
50
|
+
poss_starts.append((t, e))
|
51
|
+
ans.append(min(poss_starts))
|
52
|
+
return sorted(ans)
|
53
|
+
|
54
|
+
def arrows_around_edges(manifold):
|
55
|
+
T = t3m.Mcomplex(manifold)
|
56
|
+
starts = lex_first_edge_starts(T)
|
57
|
+
ans = []
|
58
|
+
return [faces_around_edge(T, tet, edge) for tet, edge in starts]
|
59
|
+
|
60
|
+
|
61
|
+
def parse_ptolemy_edge(var):
|
62
|
+
c, index, tet = var.split('_')
|
63
|
+
tet = int(tet)
|
64
|
+
edge = tuple(i for i in range(4) if index[i] == '1')
|
65
|
+
return tet, edge
|
66
|
+
|
67
|
+
|
68
|
+
def parse_ptolemy_face(var):
|
69
|
+
s, index, tet = var.split('_')
|
70
|
+
return int(tet), int(index)
|
71
|
+
|
72
|
+
|
73
|
+
class EdgeGluings():
|
74
|
+
def __init__(self, gen_obs_class):
|
75
|
+
assert gen_obs_class._N == 2
|
76
|
+
M = gen_obs_class._manifold
|
77
|
+
n = M.num_tetrahedra()
|
78
|
+
gluings = t3m.files.read_SnapPea_file(data=M._to_string())
|
79
|
+
primary_faces = [parse_ptolemy_face(x[2]) for x in
|
80
|
+
M._ptolemy_equations_identified_face_classes()]
|
81
|
+
ptolemy_idents = M._ptolemy_equations_identified_coordinates(2, gen_obs_class.H2_class)
|
82
|
+
self.edge_gluings = edge_gluings = dict()
|
83
|
+
|
84
|
+
for i, (tet0, face0) in enumerate(primary_faces):
|
85
|
+
for j in range(3):
|
86
|
+
orient_sign, obs_contrib, edge_var_0, edge_var_1 = ptolemy_idents[3*i + j]
|
87
|
+
sign = orient_sign * (-1)**obs_contrib
|
88
|
+
tet0alt, edge0 = parse_ptolemy_edge(edge_var_0)
|
89
|
+
tet1, edge1 = parse_ptolemy_edge(edge_var_1)
|
90
|
+
perm = gluings[tet0][1][face0]
|
91
|
+
face1 = perm[face0]
|
92
|
+
edge_gluings[tet0, face0, edge0] = [(tet1, face1, edge1), sign]
|
93
|
+
edge_gluings[tet1, face1, edge1] = [(tet0, face0, edge0), sign]
|
94
|
+
|
95
|
+
# Sanity checks that our enumeration of the face
|
96
|
+
# idenifications and edges agrees with
|
97
|
+
# "ptolemy_coordinates.c".
|
98
|
+
assert tet0 == tet0alt
|
99
|
+
assert tet1 == gluings[tet0][0][face0]
|
100
|
+
a, b = edge0
|
101
|
+
c, d = edge1
|
102
|
+
if perm[a] == c and perm[b] == d:
|
103
|
+
assert orient_sign == 1
|
104
|
+
else:
|
105
|
+
assert perm[a] == d and perm[b] == c and orient_sign == -1
|
106
|
+
|
107
|
+
def __getitem__(self, index):
|
108
|
+
return self.edge_gluings[index]
|
109
|
+
|
110
|
+
def simplify_equation(poly):
|
111
|
+
"""
|
112
|
+
Simplifies the given polynomial in three ways:
|
113
|
+
|
114
|
+
1. Cancels any M*m and L*l pairs.
|
115
|
+
|
116
|
+
2. Sets a0 = 1.
|
117
|
+
|
118
|
+
3. Since all variables represent non-zero quantities, divides by
|
119
|
+
the gcd of the monomials terms.
|
120
|
+
|
121
|
+
sage: R = PolynomialRing(QQ, ['M', 'L', 'm', 'l', 'a0', 'x', 'y', 'z'])
|
122
|
+
sage: simplify_equation(R('5*M*m^2*L*l^3*x*y + 3*M*m*L*l + 11*M^10*m^3*L^5*l^2*z'))
|
123
|
+
11*M^7*L^3*z + 5*m*l^2*x*y + 3
|
124
|
+
sage: simplify_equation(R('-a0*x + M^7*m^7*x + L^9*l^3*z + a0^2'))
|
125
|
+
L^6*z + 1
|
126
|
+
sage: simplify_equation(R('M^2*L*a0*x - M*L*y^2*x + M*z^2*x'))
|
127
|
+
-L*y^2 + M*L + z^2
|
128
|
+
"""
|
129
|
+
R = poly.parent()
|
130
|
+
ans = R.zero()
|
131
|
+
try:
|
132
|
+
# Should we just permanently commit to c_1100_0
|
133
|
+
poly = poly.subs(a0=1)
|
134
|
+
except:
|
135
|
+
poly = poly.subs(c_1100_0=1)
|
136
|
+
|
137
|
+
for coeff, monomial in list(poly):
|
138
|
+
e = monomial.exponents()[0]
|
139
|
+
M_exp = e[0] - e[2]
|
140
|
+
L_exp = e[1] - e[3]
|
141
|
+
if M_exp >= 0:
|
142
|
+
M_p, M_n = M_exp, 0
|
143
|
+
else:
|
144
|
+
M_p, M_n = 0, -M_exp
|
145
|
+
if L_exp >= 0:
|
146
|
+
L_p, L_n = L_exp, 0
|
147
|
+
else:
|
148
|
+
L_p, L_n = 0, -L_exp
|
149
|
+
ans += coeff * R.monomial(M_p, L_p, M_n, L_n, *e[4:])
|
150
|
+
ans = ans // gcd([mono for coeff, mono in list(ans)])
|
151
|
+
return ans
|
152
|
+
|
153
|
+
def extended_ptolemy_equations(manifold, gen_obs_class=None,
|
154
|
+
nonzero_cond=True, return_full_var_dict = False,
|
155
|
+
notation = 'short'):
|
156
|
+
r"""
|
157
|
+
We assign ptolemy coordinates ['a', 'b', 'c', 'd', 'e', 'f'] to the
|
158
|
+
*directed* edges::
|
159
|
+
|
160
|
+
[(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)]
|
161
|
+
|
162
|
+
|
163
|
+
where recall that the basic orientation convention of t3m and
|
164
|
+
SnapPy is that a positively oriented simplex is as below. ::
|
165
|
+
|
166
|
+
1
|
167
|
+
/|\
|
168
|
+
d / | \ e
|
169
|
+
/ | \
|
170
|
+
/ | \
|
171
|
+
2----|----3 with back edge from 2 to 3 labelled f.
|
172
|
+
\ | /
|
173
|
+
b \ |a / c
|
174
|
+
\ | /
|
175
|
+
\|/
|
176
|
+
0
|
177
|
+
|
178
|
+
sage: M = Manifold('m016')
|
179
|
+
sage: I = extended_ptolemy_equations(M)
|
180
|
+
sage: I.dimension()
|
181
|
+
1
|
182
|
+
"""
|
183
|
+
if gen_obs_class is None:
|
184
|
+
gen_obs_class = manifold.ptolemy_generalized_obstruction_classes(2)[0]
|
185
|
+
|
186
|
+
m_star, l_star = peripheral.peripheral_cohomology_basis(manifold)
|
187
|
+
|
188
|
+
n = manifold.num_tetrahedra()
|
189
|
+
|
190
|
+
if notation == 'short':
|
191
|
+
var_names = ['a', 'b', 'c', 'd', 'e', 'f']
|
192
|
+
first_var_name = 'a0'
|
193
|
+
else:
|
194
|
+
var_names = ['c_1100_',
|
195
|
+
'c_1010_',
|
196
|
+
'c_1001_',
|
197
|
+
'c_0110_',
|
198
|
+
'c_0101_',
|
199
|
+
'c_0011_']
|
200
|
+
first_var_name = 'c_1100_0'
|
201
|
+
|
202
|
+
tet_vars = [x + repr(d) for d in range(n) for x in var_names]
|
203
|
+
|
204
|
+
def var(tet, edge):
|
205
|
+
return tet_vars[6*tet + directed_edges.index(edge)]
|
206
|
+
|
207
|
+
all_arrows = arrows_around_edges(manifold)
|
208
|
+
independent_vars = [var(a[0][0], a[0][2]) for a in all_arrows]
|
209
|
+
assert first_var_name in independent_vars
|
210
|
+
if nonzero_cond:
|
211
|
+
nonzero_cond_vars = [v.swapcase() for v in independent_vars]
|
212
|
+
else:
|
213
|
+
nonzero_cond_vars = []
|
214
|
+
R = PolynomialRing(QQ, ['M', 'L', 'm', 'l'] + independent_vars + nonzero_cond_vars)
|
215
|
+
M, L, m, l= R('M'), R('L'), R('m'), R('l')
|
216
|
+
|
217
|
+
def var(tet, edge):
|
218
|
+
return tet_vars[6*tet + directed_edges.index(edge)]
|
219
|
+
|
220
|
+
in_terms_of_indep_vars = {v:R(v) for v in independent_vars}
|
221
|
+
in_terms_of_indep_vars['M'] = M
|
222
|
+
in_terms_of_indep_vars['L'] = L
|
223
|
+
edge_gluings = EdgeGluings(gen_obs_class)
|
224
|
+
|
225
|
+
in_terms_of_indep_vars_data = { v: (1, 0, 0, v) for v in independent_vars }
|
226
|
+
|
227
|
+
for around_one_edge in arrows_around_edges(manifold):
|
228
|
+
tet0, face0, edge0 = around_one_edge[0]
|
229
|
+
indep_var = R(var(tet0, edge0))
|
230
|
+
sign, m_e, l_e = 1, 0, 0
|
231
|
+
for tet1, face1, edge1 in around_one_edge[:-1]:
|
232
|
+
(tet2, face2, edge2), a_sign = edge_gluings[tet1, face1, edge1]
|
233
|
+
sign = a_sign * sign
|
234
|
+
m_e -= sum(m_star[tet1, t3m.TwoSubsimplices[face1], t3m.ZeroSubsimplices[v]] for v in edge1)
|
235
|
+
l_e -= sum(l_star[tet1, t3m.TwoSubsimplices[face1], t3m.ZeroSubsimplices[v]] for v in edge1)
|
236
|
+
mvar = M if m_e > 0 else m
|
237
|
+
lvar = L if l_e > 0 else l
|
238
|
+
dep_var = var(tet2, edge2)
|
239
|
+
in_terms_of_indep_vars_data[dep_var] = (sign, m_e, l_e, var(tet0, edge0))
|
240
|
+
in_terms_of_indep_vars[dep_var] = sign*(mvar**abs(m_e))*(lvar**abs(l_e))*indep_var
|
241
|
+
|
242
|
+
tet_vars = [in_terms_of_indep_vars[v] for v in tet_vars]
|
243
|
+
rels = [R(first_var_name) - 1, M*m - 1, L*l - 1]
|
244
|
+
for tet in range(n):
|
245
|
+
a, b, c, d, e, f = tet_vars[6*tet:6*(tet+1)]
|
246
|
+
rels.append(simplify_equation(c*d + a*f - b*e))
|
247
|
+
|
248
|
+
# These last equations ensure the ptolemy coordinates are nonzero.
|
249
|
+
# For larger numbers of tetrahedra, this appears to make computing
|
250
|
+
# Groebner basis much faster even though there are extra variables
|
251
|
+
# compared the approach where one uses a single variable.
|
252
|
+
|
253
|
+
if nonzero_cond:
|
254
|
+
for v in independent_vars:
|
255
|
+
rels.append(R(v) * R(v.swapcase()) - 1)
|
256
|
+
|
257
|
+
if return_full_var_dict == 'data':
|
258
|
+
return R.ideal(rels), in_terms_of_indep_vars_data
|
259
|
+
if return_full_var_dict:
|
260
|
+
return R.ideal(rels), in_terms_of_indep_vars
|
261
|
+
else:
|
262
|
+
return R.ideal(rels)
|
263
|
+
|
264
|
+
|
265
|
+
def apoly(manifold, rational_coeff=False, method='sage'):
|
266
|
+
"""
|
267
|
+
Computes the SL(2, C) version of the A-polynomial starting from
|
268
|
+
the extended Ptolemy variety.
|
269
|
+
|
270
|
+
By default, uses Sage (which is to say Singular) to eliminate
|
271
|
+
variables. Surprisingly, Macaulay2 is *much* slower.
|
272
|
+
|
273
|
+
sage: M = Manifold('m003')
|
274
|
+
sage: I = apoly(M)
|
275
|
+
sage: I.gens()
|
276
|
+
[M^4*L^2 + M^3*L^2 - M*L^4 - 2*M^2*L^2 - M^3 + M*L^2 + L^2]
|
277
|
+
"""
|
278
|
+
I = extended_ptolemy_equations(manifold)
|
279
|
+
R = I.ring()
|
280
|
+
if rational_coeff is False:
|
281
|
+
F = GF(31991)
|
282
|
+
R = R.change_ring(F)
|
283
|
+
I = I.change_ring(R)
|
284
|
+
to_elim = [R(x) for x in R.variable_names() if x not in ['M', 'L']]
|
285
|
+
if method == 'sage':
|
286
|
+
return I.elimination_ideal(to_elim)
|
287
|
+
elif method == 'M2':
|
288
|
+
from sage.all import macaulay2
|
289
|
+
I_m2 = macaulay2(I)
|
290
|
+
return I_m2.eliminate('{' + repr(to_elim)[1:-1] + '}').to_sage()
|
291
|
+
else:
|
292
|
+
raise ValueError("method flag should be in ['sage', 'M2']")
|
293
|
+
|
294
|
+
|
295
|
+
def sample_apoly_points_via_giac_rur(manifold, n):
|
296
|
+
import giac_rur
|
297
|
+
I = extended_ptolemy_equations(manifold)
|
298
|
+
R = I.ring()
|
299
|
+
p = cyclotomic_polynomial(n, var=R('M'))
|
300
|
+
I = I + [p]
|
301
|
+
return giac_rur.rational_univariate_representation(I)
|
302
|
+
|
303
|
+
def ptolemy_ideal_for_filled(manifold, nonzero_cond=True, return_full_var_dict=False, notation = 'short'):
|
304
|
+
assert manifold.cusp_info('is_complete') == [False]
|
305
|
+
a, b = [int(x) for x in manifold.cusp_info(0)['filling']]
|
306
|
+
I, var_dict = extended_ptolemy_equations(
|
307
|
+
manifold, nonzero_cond=nonzero_cond,
|
308
|
+
return_full_var_dict = True if not return_full_var_dict else return_full_var_dict,
|
309
|
+
notation = notation)
|
310
|
+
R = I.ring()
|
311
|
+
if (a, b) == (1, 0):
|
312
|
+
new_gens = [p.subs(M=1, m=1) for p in I.gens()] + [R('M - 1'), R('m - 1')]
|
313
|
+
I = R.ideal([p for p in new_gens if p != 0])
|
314
|
+
else:
|
315
|
+
mvar = R('M') if a > 0 else R('m')
|
316
|
+
lvar = R('l') if b > 0 else R('L')
|
317
|
+
I = I + [mvar**abs(a) - lvar**abs(b)]
|
318
|
+
if return_full_var_dict:
|
319
|
+
return I, var_dict
|
320
|
+
else:
|
321
|
+
return I
|
322
|
+
|
323
|
+
def rur_for_dehn_filling(manifold):
|
324
|
+
import giac_rur
|
325
|
+
I = ptolemy_ideal_for_filled(manifold)
|
326
|
+
return giac_rur.rational_univariate_representation(I)
|
327
|
+
|
328
|
+
def test_as_cusped(manifold):
|
329
|
+
import giac_rur
|
330
|
+
for obs in manifold.ptolemy_generalized_obstruction_classes(2):
|
331
|
+
I = extended_ptolemy_equations(manifold, obs)
|
332
|
+
R = I.ring()
|
333
|
+
M, L = R('M'), R('L')
|
334
|
+
I = I + [M - 1, L - 1]
|
335
|
+
if I.dimension() == 0:
|
336
|
+
print(giac_rur.rational_univariate_representation(I))
|
337
|
+
|
338
|
+
def test_direct(manifold):
|
339
|
+
import giac_rur
|
340
|
+
for obs in manifold.ptolemy_generalized_obstruction_classes(2):
|
341
|
+
I = manifold.ptolemy_variety(2, obs).ideal_with_non_zero_condition
|
342
|
+
if I.dimension() == 0:
|
343
|
+
print(giac_rur.rational_univariate_representation(I))
|
344
|
+
|
345
|
+
|
346
|
+
def clean_complex(z, epsilon=1e-14):
|
347
|
+
r, i = abs(z.real), abs(z.imag)
|
348
|
+
if r < epsilon and i < epsilon:
|
349
|
+
return 0.0
|
350
|
+
elif r < epsilon:
|
351
|
+
ans = z.imag*1j
|
352
|
+
elif i < epsilon:
|
353
|
+
ans = z.real
|
354
|
+
else:
|
355
|
+
ans = z
|
356
|
+
assert abs(z - ans) < epsilon
|
357
|
+
return ans
|
358
|
+
|
359
|
+
def shapes_of_SL2C_reps_for_filled(manifold, phc_solver=None):
|
360
|
+
"""
|
361
|
+
Use CyPHC to find the shapes corresponding to SL2C representations
|
362
|
+
of the given closed manifold, as well as those which are
|
363
|
+
boundary-parabolic with respect to the Dehn-filling description.
|
364
|
+
|
365
|
+
sage: M = Manifold('m006(-5, 1)')
|
366
|
+
sage: shape_sets = shapes_of_SL2C_reps_for_filled(M)
|
367
|
+
sage: len(shape_sets)
|
368
|
+
24
|
369
|
+
sage: max(shapes['err'] for shapes in shape_sets) < 1e-13
|
370
|
+
True
|
371
|
+
"""
|
372
|
+
if phc_solver is None:
|
373
|
+
import phc_wrapper
|
374
|
+
phc_solver = phc_wrapper.phc_direct
|
375
|
+
n = manifold.num_tetrahedra()
|
376
|
+
I, var_dict = ptolemy_ideal_for_filled(manifold,
|
377
|
+
nonzero_cond=False, return_full_var_dict=True)
|
378
|
+
sols = phc_solver(I)
|
379
|
+
vars = I.ring().gens()
|
380
|
+
ans = []
|
381
|
+
for sol in sols:
|
382
|
+
indep_values = {v:sol[repr(v)] for v in vars}
|
383
|
+
sol_dict = {v:poly.subs(indep_values) for v, poly in var_dict.items()}
|
384
|
+
shape_dict = {'M':sol_dict['M'], 'L':sol_dict['L']}
|
385
|
+
for i in range(n):
|
386
|
+
i = repr(i)
|
387
|
+
top = sol_dict['b' + i]*sol_dict['e' + i]
|
388
|
+
bottom = sol_dict['c' + i]*sol_dict['d' + i]
|
389
|
+
shape_dict['z' + i] = clean_complex(top/bottom)
|
390
|
+
|
391
|
+
for attr in ['err', 'rco', 'res', 'mult']:
|
392
|
+
shape_dict[attr] = sol[attr]
|
393
|
+
ans.append(shape_dict)
|
394
|
+
return ans
|
395
|
+
|
396
|
+
|
397
|
+
def doctest_globals():
|
398
|
+
import snappy
|
399
|
+
return {'Manifold': snappy.Manifold}
|
400
|
+
|
401
|
+
|
402
|
+
if __name__ == '__main__':
|
403
|
+
from snappy.sage_helper import doctest_modules
|
404
|
+
import sys
|
405
|
+
current_module = sys.modules[__name__]
|
406
|
+
doctest_modules([current_module], extraglobs=doctest_globals())
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"""
|
2
|
+
|
3
|
+
Giac [1] is included in Sage 6.8 (July 2015) and newer with Sage
|
4
|
+
providing a pexpect interpreter interface. Additionally, there is a
|
5
|
+
Cython-based wrapper for Giac [2] with a Sage-specific incarnation [3]
|
6
|
+
which is installable as an optional Sage spkg::
|
7
|
+
|
8
|
+
sage -i giacpy_sage
|
9
|
+
|
10
|
+
This module is to make it easy to access a version of Giac from within
|
11
|
+
Sage, preferring the Cython-based wrapper if available.
|
12
|
+
|
13
|
+
[1] https://www-fourier.ujf-grenoble.fr/~parisse/giac.html
|
14
|
+
[2] https://pypi.org/project/giacpy
|
15
|
+
[3] https://gitlab.math.univ-paris-diderot.fr/han/giacpy-sage
|
16
|
+
|
17
|
+
"""
|
18
|
+
|
19
|
+
from snappy.sage_helper import _within_sage
|
20
|
+
|
21
|
+
giac = None
|
22
|
+
have_giac = False
|
23
|
+
have_giacpy = False
|
24
|
+
|
25
|
+
if _within_sage:
|
26
|
+
try:
|
27
|
+
from giacpy_sage import libgiac as giac
|
28
|
+
have_giac = have_giacpy = True
|
29
|
+
except ImportError:
|
30
|
+
# Older versions of giacpy_sage were called giacpy
|
31
|
+
try:
|
32
|
+
from giacpy import libgiac as giac
|
33
|
+
have_giac = have_giacpy = True
|
34
|
+
except ImportError:
|
35
|
+
try:
|
36
|
+
# Fallback to pexpect interface.
|
37
|
+
from sage.all import giac
|
38
|
+
have_giac = True
|
39
|
+
have_giacpy = False
|
40
|
+
except ImportError as e:
|
41
|
+
raise ImportError(e.args[0] +
|
42
|
+
'Probably your version of SageMath is too old '
|
43
|
+
'to ship with Giac.')
|
@@ -0,0 +1,129 @@
|
|
1
|
+
"""
|
2
|
+
Sage convenience wrapper for Giac's rational univariate representation
|
3
|
+
functionality.
|
4
|
+
"""
|
5
|
+
|
6
|
+
from sage.all import QQ, PolynomialRing, NumberField
|
7
|
+
from .giac_helper import giac
|
8
|
+
|
9
|
+
# The main function of this file is:
|
10
|
+
|
11
|
+
def rational_univariate_representation(ideal):
|
12
|
+
"""
|
13
|
+
Suppose an ideal I in QQ[x_1,...,x_n] is 0 dimensional, and we
|
14
|
+
want to describe all the points of the finite set V(I) in CC^n. A
|
15
|
+
rational univariate representation (RUR) of V(I), is a collection
|
16
|
+
of univariate polynomials h, g_0, g_1, ... , g_n in QQ[t] where
|
17
|
+
deg(h) = #V(I) and deg(g_i) < deg(h) such that the points of V(I)
|
18
|
+
correspond precisely to
|
19
|
+
|
20
|
+
(g_1(z)/g_0(z), (g_2(z)/g_0(z), ... (g_n(z)/g_0(z))
|
21
|
+
|
22
|
+
where z in CC is a root of h.
|
23
|
+
|
24
|
+
In this variant, we factor h into irreducibles return each part of
|
25
|
+
the RUR individually.
|
26
|
+
|
27
|
+
Example:
|
28
|
+
|
29
|
+
sage: R = PolynomialRing(QQ, ['x', 'y', 'z'])
|
30
|
+
sage: x, y, z = R.gens()
|
31
|
+
sage: I = R.ideal([x + y + z*z, x*y*z - 3, x*x + y*y + z*z - 2])
|
32
|
+
sage: ans = rational_univariate_representation(I)
|
33
|
+
sage: len(ans)
|
34
|
+
1
|
35
|
+
sage: K, rep, mult = ans[0]
|
36
|
+
sage: mult
|
37
|
+
1
|
38
|
+
sage: h = K.polynomial(); h
|
39
|
+
x^10 - 2*x^9 - 4*x^8 + 6*x^7 + 7*x^6 - 13*x^5 - 17/2*x^4 + 36*x^3 + 63/2*x^2 + 81/2
|
40
|
+
sage: rep[y]
|
41
|
+
a
|
42
|
+
sage: 1215 * rep[x] # Here g0 = 1215
|
43
|
+
8*a^9 + 8*a^8 - 8*a^7 - 246*a^6 + 128*a^5 + 550*a^4 - 308*a^3 - 636*a^2 + 639*a + 1917
|
44
|
+
sage: I.subs(rep).is_zero()
|
45
|
+
True
|
46
|
+
|
47
|
+
Here is an example using a Ptolemy variety:
|
48
|
+
|
49
|
+
sage: M = Manifold('t00000')
|
50
|
+
sage: obs = M.ptolemy_generalized_obstruction_classes(2)[1]
|
51
|
+
sage: V = M.ptolemy_variety(2, obs)
|
52
|
+
sage: I = V.ideal_with_non_zero_condition
|
53
|
+
sage: ans = rational_univariate_representation(I)
|
54
|
+
sage: ans[0][0].polynomial()
|
55
|
+
x^8 - 4*x^7 - 2*x^6 + 14*x^5 + 14*x^4 - 7*x^3 - 13*x^2 - x + 5
|
56
|
+
|
57
|
+
For more, see:
|
58
|
+
|
59
|
+
https://en.wikipedia.org/wiki/System_of_polynomial_equations#Rational_univariate_representation
|
60
|
+
|
61
|
+
"""
|
62
|
+
R = ideal.ring()
|
63
|
+
|
64
|
+
# A "feature" introduced in Sage-9.4 is that
|
65
|
+
# ideal.gens() vs R.gens()
|
66
|
+
# returns
|
67
|
+
# a <class 'sage.rings.polynomial.multi_polynomial_sequence.PolynomialSequence_generic’>
|
68
|
+
# vs a
|
69
|
+
# <class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular’>
|
70
|
+
# so that giac(_) turns the variable x into x vs sageVARx.
|
71
|
+
#
|
72
|
+
# And giving "gbasis([x],[sageVARx],rur)" instead of "gbasis([x],[x],rur)" doesn't
|
73
|
+
# produce the desired result...
|
74
|
+
#
|
75
|
+
# Thus, we have the following work-around:
|
76
|
+
good_vars = R.ideal(R.gens()).gens()
|
77
|
+
J = giac(ideal.gens())
|
78
|
+
rur = J.gbasis(good_vars, 'rur')
|
79
|
+
# Yikes: giacpy_sage vs the giac interface give different types.
|
80
|
+
# So using repr.
|
81
|
+
if repr(rur[0]) != 'rur':
|
82
|
+
raise ValueError(('Could not find RUR, got %r instead. '
|
83
|
+
'Is the variety 0-dimensional?') % rur[0])
|
84
|
+
|
85
|
+
# [x.sage() for rur[4:]] doesn't work with the giac interface (it tries
|
86
|
+
# to convert the slicing to a giac expression that giac does not understand)
|
87
|
+
#
|
88
|
+
# However, rur.sage()[0] gave some trouble, too.
|
89
|
+
#
|
90
|
+
# So we convert with .sage() after having checked we have rur, but before
|
91
|
+
# we inspect the other items.
|
92
|
+
rur = rur.sage()
|
93
|
+
|
94
|
+
# Defining polynomial of number field, as a symbolic expression.
|
95
|
+
p = rur[2]
|
96
|
+
assert len(p.variables()) == 1
|
97
|
+
v = p.variables()[0]
|
98
|
+
|
99
|
+
S = PolynomialRing(QQ, repr(v))
|
100
|
+
T = PolynomialRing(QQ, 'x')
|
101
|
+
p = T(S(p))
|
102
|
+
p = p/p.leading_coefficient()
|
103
|
+
|
104
|
+
ans = []
|
105
|
+
for q, e in p.factor():
|
106
|
+
K = NumberField(q, 'a')
|
107
|
+
|
108
|
+
def toK(f):
|
109
|
+
return K(T(S(f)))
|
110
|
+
|
111
|
+
denom = toK(rur[3])
|
112
|
+
rep = [toK(f)/denom for f in rur[4:]]
|
113
|
+
sub_dict = dict(zip(R.gens(), rep))
|
114
|
+
assert all(g.subs(sub_dict) == 0 for g in ideal.gens())
|
115
|
+
ans.append((K, sub_dict, e))
|
116
|
+
|
117
|
+
return ans
|
118
|
+
|
119
|
+
|
120
|
+
def doctest_globals():
|
121
|
+
import snappy
|
122
|
+
return {'Manifold': snappy.Manifold}
|
123
|
+
|
124
|
+
|
125
|
+
if __name__ == '__main__':
|
126
|
+
from snappy.sage_helper import doctest_modules
|
127
|
+
import sys
|
128
|
+
current_module = sys.modules[__name__]
|
129
|
+
doctest_modules([current_module], extraglobs=doctest_globals())
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import snappy
|
2
|
+
from sage.all import ZZ, PolynomialRing
|
3
|
+
|
4
|
+
def make_rect_eqn(R, A, B, c, vars_per_tet=1):
|
5
|
+
n = len(A)
|
6
|
+
R_vars = R.gens()
|
7
|
+
if vars_per_tet == 2:
|
8
|
+
Z, W = R_vars[:n], R_vars[n:]
|
9
|
+
else:
|
10
|
+
Z = R_vars
|
11
|
+
left, right = R(1), R(1)
|
12
|
+
for i, a in enumerate(A):
|
13
|
+
term = Z[i]**abs(a)
|
14
|
+
if a > 0:
|
15
|
+
left *= term
|
16
|
+
elif a < 0:
|
17
|
+
right *= term
|
18
|
+
for i, b in enumerate(B):
|
19
|
+
if vars_per_tet==1:
|
20
|
+
term = (1 - Z[i])**abs(b)
|
21
|
+
else:
|
22
|
+
term = W[i]**abs(b)
|
23
|
+
if b > 0:
|
24
|
+
left *= term
|
25
|
+
elif b < 0:
|
26
|
+
right *= term
|
27
|
+
return left - c*right
|
28
|
+
|
29
|
+
def gluing_variety_ideal(manifold, vars_per_tet=1):
|
30
|
+
manifold = manifold.copy()
|
31
|
+
n = manifold.num_tetrahedra()
|
32
|
+
var_names = ['z%d' % i for i in range(n)]
|
33
|
+
ideal_gens = []
|
34
|
+
if vars_per_tet!=1:
|
35
|
+
assert vars_per_tet==2
|
36
|
+
var_names += ['w%d' % i for i in range(n)]
|
37
|
+
R = PolynomialRing(ZZ, var_names)
|
38
|
+
if vars_per_tet==2:
|
39
|
+
ideal_gens += [R('z%d + w%d - 1' % (i, i)) for i in range(n)]
|
40
|
+
eqn_data = snappy.snap.shapes.enough_gluing_equations(manifold)
|
41
|
+
ideal_gens += [make_rect_eqn(R, A, B, c, vars_per_tet) for A, B, c in eqn_data]
|
42
|
+
return R.ideal(ideal_gens)
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|