snappy 3.0.3__cp38-cp38-macosx_11_0_arm64.whl → 3.2__cp38-cp38-macosx_11_0_arm64.whl
Sign up to get free protection for your applications and to get access to all the features.
- snappy/CyOpenGL.cpython-38-darwin.so +0 -0
- snappy/SnapPy.cpython-38-darwin.so +0 -0
- snappy/SnapPyHP.cpython-38-darwin.so +0 -0
- snappy/__init__.py +373 -426
- snappy/app.py +240 -75
- snappy/app_menus.py +93 -78
- snappy/browser.py +87 -63
- snappy/cache.py +5 -8
- snappy/canonical.py +249 -0
- snappy/{verify/cusp_shapes.py → cusps/__init__.py} +11 -19
- snappy/cusps/cusp_area_matrix.py +101 -0
- snappy/{verify/cusp_areas.py → cusps/cusp_areas_from_matrix.py} +39 -54
- 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 +40 -31
- snappy/db_utilities.py +13 -14
- snappy/decorated_isosig.py +377 -133
- snappy/dev/extended_ptolemy/complexVolumesClosed.py +42 -9
- snappy/dev/extended_ptolemy/extended.py +32 -25
- snappy/dev/extended_ptolemy/giac_rur.py +23 -8
- snappy/dev/extended_ptolemy/phc_wrapper.py +10 -10
- snappy/dev/vericlosed/computeApproxHyperbolicStructureOrb.py +2 -1
- snappy/dev/vericlosed/gimbalLoopFinder.py +5 -5
- snappy/dev/vericlosed/hyperbolicStructure.py +3 -3
- snappy/dev/vericlosed/oneVertexTruncatedComplex.py +2 -2
- snappy/dev/vericlosed/truncatedComplex.py +3 -2
- snappy/dev/vericlosed/verifyHyperbolicStructureEngine.py +4 -3
- 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/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 +1 -0
- snappy/doc/_sources/credits.rst.txt +6 -1
- snappy/doc/_sources/development.rst.txt +69 -50
- snappy/doc/_sources/index.rst.txt +101 -66
- snappy/doc/_sources/installing.rst.txt +148 -165
- snappy/doc/_sources/news.rst.txt +136 -32
- snappy/doc/_sources/ptolemy.rst.txt +1 -1
- snappy/doc/_sources/ptolemy_examples1.rst.txt +9 -8
- snappy/doc/_sources/ptolemy_examples2.rst.txt +3 -3
- snappy/doc/_sources/ptolemy_examples3.rst.txt +14 -14
- snappy/doc/_sources/ptolemy_prelim.rst.txt +1 -1
- snappy/doc/_sources/snap.rst.txt +2 -2
- snappy/doc/_sources/snappy.rst.txt +1 -1
- snappy/doc/_sources/triangulation.rst.txt +3 -2
- snappy/doc/_sources/verify.rst.txt +89 -29
- snappy/doc/_sources/verify_internals.rst.txt +5 -16
- 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 +47 -27
- 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 +107 -274
- snappy/doc/_static/documentation_options.js +6 -5
- 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 -2
- 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 +3 -101
- snappy/doc/_static/pygments.css +1 -0
- snappy/doc/_static/searchtools.js +489 -398
- 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 +688 -263
- snappy/doc/bugs.html +107 -94
- snappy/doc/censuses.html +155 -127
- snappy/doc/credits.html +115 -104
- snappy/doc/development.html +184 -146
- snappy/doc/genindex.html +287 -204
- snappy/doc/index.html +189 -150
- snappy/doc/installing.html +259 -266
- snappy/doc/manifold.html +1626 -592
- snappy/doc/manifoldhp.html +119 -105
- snappy/doc/news.html +198 -104
- snappy/doc/objects.inv +0 -0
- snappy/doc/other.html +117 -105
- snappy/doc/platonic_census.html +161 -114
- snappy/doc/plink.html +113 -105
- snappy/doc/ptolemy.html +131 -108
- snappy/doc/ptolemy_classes.html +242 -223
- snappy/doc/ptolemy_examples1.html +144 -130
- snappy/doc/ptolemy_examples2.html +141 -129
- snappy/doc/ptolemy_examples3.html +148 -132
- snappy/doc/ptolemy_examples4.html +131 -111
- snappy/doc/ptolemy_prelim.html +162 -138
- snappy/doc/py-modindex.html +104 -69
- snappy/doc/screenshots.html +117 -108
- snappy/doc/search.html +115 -84
- snappy/doc/searchindex.js +1 -1
- snappy/doc/snap.html +109 -96
- snappy/doc/snappy.html +134 -97
- snappy/doc/spherogram.html +259 -187
- snappy/doc/todo.html +107 -94
- snappy/doc/triangulation.html +1380 -111
- snappy/doc/tutorial.html +107 -94
- snappy/doc/verify.html +194 -125
- snappy/doc/verify_internals.html +248 -686
- 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 +23 -3
- snappy/export_stl.py +20 -14
- 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/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 +36 -36
- snappy/horoviewer.py +50 -48
- 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/{infodialog.py → infowindow.py} +32 -33
- 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/__init__.py +1 -1
- snappy/math_basics.py +176 -0
- snappy/matrix.py +525 -0
- snappy/number.py +97 -21
- snappy/numeric_output_checker.py +37 -27
- snappy/pari.py +30 -69
- snappy/phone_home.py +25 -20
- snappy/polyviewer.py +39 -37
- snappy/ptolemy/__init__.py +4 -6
- snappy/ptolemy/component.py +14 -12
- snappy/ptolemy/coordinates.py +312 -295
- snappy/ptolemy/fieldExtensions.py +14 -12
- snappy/ptolemy/findLoops.py +43 -31
- snappy/ptolemy/geometricRep.py +24 -26
- snappy/ptolemy/homology.py +12 -7
- snappy/ptolemy/manifoldMethods.py +69 -70
- snappy/ptolemy/matrix.py +65 -26
- snappy/ptolemy/numericalSolutionsToGroebnerBasis.py +18 -14
- snappy/ptolemy/polynomial.py +125 -119
- snappy/ptolemy/processComponents.py +36 -30
- snappy/ptolemy/processFileBase.py +79 -18
- snappy/ptolemy/processFileDispatch.py +13 -14
- snappy/ptolemy/processMagmaFile.py +44 -39
- snappy/ptolemy/processRurFile.py +18 -11
- snappy/ptolemy/ptolemyGeneralizedObstructionClass.py +20 -17
- snappy/ptolemy/ptolemyObstructionClass.py +13 -17
- snappy/ptolemy/ptolemyVariety.py +190 -121
- snappy/ptolemy/ptolemyVarietyPrimeIdealGroebnerBasis.py +20 -19
- snappy/ptolemy/reginaWrapper.py +25 -29
- snappy/ptolemy/rur.py +6 -14
- snappy/ptolemy/solutionsToPrimeIdealGroebnerBasis.py +27 -22
- snappy/ptolemy/test.py +247 -188
- snappy/ptolemy/utilities.py +41 -43
- 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 +10 -6
- snappy/raytracing/eyeball.py +123 -0
- snappy/raytracing/finite_raytracing_data.py +48 -38
- snappy/raytracing/finite_viewer.py +218 -210
- 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 +152 -40
- snappy/raytracing/hyperboloid_navigation.py +102 -52
- snappy/raytracing/hyperboloid_utilities.py +114 -261
- snappy/raytracing/ideal_raytracing_data.py +256 -179
- snappy/raytracing/inside_viewer.py +522 -253
- snappy/raytracing/pack.py +22 -0
- snappy/raytracing/raytracing_data.py +46 -34
- snappy/raytracing/raytracing_view.py +190 -109
- snappy/raytracing/shaders/Eye.png +0 -0
- snappy/raytracing/shaders/NonGeometric.png +0 -0
- snappy/raytracing/shaders/__init__.py +60 -4
- snappy/raytracing/shaders/fragment.glsl +575 -148
- 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 +32 -29
- snappy/raytracing/zoom_slider/test.py +2 -0
- snappy/sage_helper.py +69 -123
- snappy/{preferences.py → settings.py} +167 -145
- snappy/shell.py +4 -0
- snappy/snap/__init__.py +12 -8
- snappy/snap/character_varieties.py +24 -18
- snappy/snap/find_field.py +35 -34
- snappy/snap/fundamental_polyhedron.py +99 -85
- snappy/snap/generators.py +6 -8
- snappy/snap/interval_reps.py +18 -6
- snappy/snap/kernel_structures.py +8 -3
- snappy/snap/mcomplex_base.py +1 -2
- snappy/snap/nsagetools.py +107 -53
- snappy/snap/peripheral/__init__.py +1 -1
- snappy/snap/peripheral/dual_cellulation.py +15 -7
- snappy/snap/peripheral/link.py +20 -16
- snappy/snap/peripheral/peripheral.py +22 -14
- snappy/snap/peripheral/surface.py +47 -50
- snappy/snap/peripheral/test.py +8 -8
- snappy/snap/polished_reps.py +65 -40
- snappy/snap/shapes.py +41 -22
- snappy/snap/slice_obs_HKL.py +64 -25
- snappy/snap/t3mlite/arrow.py +88 -51
- snappy/snap/t3mlite/corner.py +5 -6
- snappy/snap/t3mlite/edge.py +32 -21
- snappy/snap/t3mlite/face.py +7 -9
- snappy/snap/t3mlite/files.py +31 -23
- snappy/snap/t3mlite/homology.py +14 -10
- snappy/snap/t3mlite/linalg.py +158 -56
- snappy/snap/t3mlite/mcomplex.py +739 -291
- snappy/snap/t3mlite/perm4.py +236 -84
- snappy/snap/t3mlite/setup.py +9 -10
- snappy/snap/t3mlite/simplex.py +65 -48
- snappy/snap/t3mlite/spun.py +42 -30
- snappy/snap/t3mlite/surface.py +45 -45
- snappy/snap/t3mlite/test.py +3 -0
- snappy/snap/t3mlite/test_vs_regina.py +17 -13
- snappy/snap/t3mlite/tetrahedron.py +25 -24
- snappy/snap/t3mlite/vertex.py +8 -13
- snappy/snap/test.py +45 -52
- snappy/snap/utilities.py +66 -65
- snappy/test.py +155 -158
- 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 +313 -203
- snappy/twister/main.py +1 -8
- snappy/twister/twister_core.cpython-38-darwin.so +0 -0
- snappy/upper_halfspace/__init__.py +146 -0
- snappy/upper_halfspace/ideal_point.py +26 -0
- snappy/verify/__init__.py +4 -8
- snappy/verify/{verifyCanonical.py → canonical.py} +114 -97
- snappy/verify/complex_volume/__init__.py +3 -2
- snappy/verify/complex_volume/adjust_torsion.py +13 -11
- snappy/verify/complex_volume/closed.py +29 -24
- snappy/verify/complex_volume/compute_ptolemys.py +8 -6
- snappy/verify/complex_volume/cusped.py +10 -9
- snappy/verify/complex_volume/extended_bloch.py +14 -12
- snappy/verify/{cuspTranslations.py → cusp_translations.py} +15 -14
- snappy/verify/edge_equations.py +80 -0
- snappy/verify/exceptions.py +23 -56
- snappy/verify/{verifyHyperbolicity.py → hyperbolicity.py} +19 -15
- snappy/verify/interval_newton_shapes_engine.py +51 -211
- snappy/verify/interval_tree.py +27 -25
- snappy/verify/krawczyk_shapes_engine.py +47 -50
- snappy/verify/maximal_cusp_area_matrix/__init__.py +17 -86
- snappy/verify/maximal_cusp_area_matrix/cusp_tiling_engine.py +58 -48
- snappy/verify/maximal_cusp_area_matrix/cusp_translate_engine.py +53 -57
- snappy/verify/{realAlgebra.py → real_algebra.py} +26 -20
- snappy/verify/shapes.py +10 -7
- snappy/verify/short_slopes.py +41 -42
- snappy/verify/{squareExtensions.py → square_extensions.py} +96 -92
- snappy/verify/test.py +59 -57
- snappy/verify/upper_halfspace/extended_matrix.py +5 -5
- snappy/verify/upper_halfspace/finite_point.py +44 -31
- snappy/verify/upper_halfspace/ideal_point.py +69 -57
- snappy/verify/volume.py +15 -12
- snappy/version.py +2 -3
- {snappy-3.0.3.dist-info → snappy-3.2.dist-info}/METADATA +14 -12
- snappy-3.2.dist-info/RECORD +503 -0
- {snappy-3.0.3.dist-info → snappy-3.2.dist-info}/WHEEL +1 -1
- {snappy-3.0.3.dist-info → snappy-3.2.dist-info}/entry_points.txt +0 -1
- {snappy-3.0.3.dist-info → snappy-3.2.dist-info}/top_level.txt +10 -1
- snappy/doc/_sources/verify_canon.rst.txt +0 -90
- snappy/doc/_static/classic.css +0 -266
- snappy/doc/_static/jquery-3.5.1.js +0 -10872
- snappy/doc/_static/sidebar.js +0 -159
- snappy/doc/_static/underscore-1.13.1.js +0 -2042
- snappy/doc/_static/underscore.js +0 -6
- snappy/doc/verify_canon.html +0 -283
- snappy/ppm_to_png.py +0 -243
- 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/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/verify/cuspCrossSection.py +0 -1413
- snappy/verify/mathHelpers.py +0 -64
- snappy-3.0.3.dist-info/RECORD +0 -360
snappy/ptolemy/test.py
CHANGED
@@ -1,32 +1,37 @@
|
|
1
|
-
|
2
|
-
### Tests the ptolemy module
|
1
|
+
# Tests the ptolemy module
|
3
2
|
###
|
4
|
-
|
5
|
-
|
3
|
+
# Test in sage with precomputed results in testing_files_directory:
|
4
|
+
# sage -python test.py
|
6
5
|
###
|
7
|
-
|
8
|
-
|
6
|
+
# Test in python with precomputed results:
|
7
|
+
# python test.py
|
9
8
|
###
|
10
|
-
|
11
|
-
|
9
|
+
# Test in sage computing the results:
|
10
|
+
# sage -python test.py --compute
|
12
11
|
###
|
13
|
-
|
14
|
-
|
12
|
+
# Test in python computing the results using magma:
|
13
|
+
# python test.py --compute
|
15
14
|
|
16
15
|
from snappy import Manifold, pari, ptolemy
|
16
|
+
from snappy import ptolemy
|
17
17
|
from snappy.ptolemy import solutions_from_magma, Flattenings, parse_solutions
|
18
18
|
from snappy.ptolemy.processFileBase import get_manifold
|
19
19
|
from snappy.ptolemy import __path__ as ptolemy_paths
|
20
20
|
from snappy.ptolemy.coordinates import PtolemyCannotBeCheckedError
|
21
|
-
from snappy.sage_helper import _within_sage
|
21
|
+
from snappy.sage_helper import _within_sage
|
22
|
+
from snappy.testing import doctest_modules
|
22
23
|
from snappy.pari import pari
|
23
24
|
import bz2
|
24
|
-
import os
|
25
|
+
import os
|
26
|
+
import sys
|
27
|
+
import doctest
|
28
|
+
import traceback
|
25
29
|
|
26
30
|
if _within_sage:
|
27
31
|
from sage.misc.sage_eval import sage_eval
|
28
32
|
|
29
33
|
test_regina = '--regina' in sys.argv
|
34
|
+
compute_solutions = '--compute' in sys.argv
|
30
35
|
|
31
36
|
base_path = ptolemy_paths[0]
|
32
37
|
if test_regina:
|
@@ -50,9 +55,10 @@ else:
|
|
50
55
|
|
51
56
|
vol_tet = pari('1.014941606409653625021202554274520285941689307530299792017489106776597476258244022136470354228256695')
|
52
57
|
|
58
|
+
|
53
59
|
def check_volumes(complex_volumes, baseline_complex_volumes,
|
54
|
-
check_real_part_only
|
55
|
-
torsion_imaginary_part
|
60
|
+
check_real_part_only=False,
|
61
|
+
torsion_imaginary_part=6, epsilon=1e-80):
|
56
62
|
|
57
63
|
# add complex volumes from complex conjugation to baseline
|
58
64
|
|
@@ -79,8 +85,7 @@ def check_volumes(complex_volumes, baseline_complex_volumes,
|
|
79
85
|
# check that every base line volume appears in computed volumes
|
80
86
|
for cvol1 in baseline_complex_volumes:
|
81
87
|
|
82
|
-
if not
|
83
|
-
is_close(cvol1, cvol2) for cvol2 in complex_volumes]:
|
88
|
+
if not any(is_close(cvol1, cvol2) for cvol2 in complex_volumes):
|
84
89
|
print("Missing base line volume:", cvol1)
|
85
90
|
|
86
91
|
print("Volumes:")
|
@@ -91,19 +96,20 @@ def check_volumes(complex_volumes, baseline_complex_volumes,
|
|
91
96
|
|
92
97
|
# check that every computed volume is a base line volume
|
93
98
|
for cvol2 in complex_volumes:
|
94
|
-
if not
|
95
|
-
|
99
|
+
if not any(is_close(cvol1, cvol2)
|
100
|
+
for cvol1 in baseline_complex_volumes):
|
96
101
|
print("Extra volume:", cvol2)
|
97
|
-
|
102
|
+
|
98
103
|
print("Volumes:")
|
99
104
|
for i in complex_volumes:
|
100
105
|
print(" ", i)
|
101
|
-
|
106
|
+
|
102
107
|
raise Exception
|
103
108
|
|
104
|
-
|
105
|
-
|
106
|
-
|
109
|
+
|
110
|
+
def testSolutionsForManifold(M, N, solutions, baseline_cvolumes=None,
|
111
|
+
expect_non_zero_dimensional=None,
|
112
|
+
against_geometric=True):
|
107
113
|
|
108
114
|
old_precision = pari.set_real_precision(100)
|
109
115
|
|
@@ -135,14 +141,14 @@ def testSolutionsForManifold(M, N, solutions, baseline_cvolumes = None,
|
|
135
141
|
for numerical_solution in solution.numerical():
|
136
142
|
numerical_solutions.append(numerical_solution)
|
137
143
|
numerical_cross_ratios.append(numerical_solution.cross_ratios())
|
138
|
-
|
144
|
+
|
139
145
|
# check exact cross ratios
|
140
146
|
cross_ratios = solution.cross_ratios()
|
141
147
|
if not test_regina:
|
142
148
|
cross_ratios.check_against_manifold(M)
|
143
149
|
|
144
150
|
assert cross_ratios.N() == N
|
145
|
-
|
151
|
+
|
146
152
|
# compute numerical cross ratios alternatively
|
147
153
|
# (above we converted exact Ptolemy's to numerical and then
|
148
154
|
# converted to cross ratio, here we first compute cross ratios
|
@@ -151,23 +157,23 @@ def testSolutionsForManifold(M, N, solutions, baseline_cvolumes = None,
|
|
151
157
|
|
152
158
|
# check we encountered non-zero dimensional component if that's
|
153
159
|
# expected
|
154
|
-
if
|
160
|
+
if expect_non_zero_dimensional is not None:
|
155
161
|
assert expect_non_zero_dimensional == found_non_zero_dimensional
|
156
162
|
|
157
163
|
# check the numerical solutions against the manifold
|
158
164
|
for s in numerical_solutions:
|
159
|
-
s.check_against_manifold(M, epsilon
|
165
|
+
s.check_against_manifold(M, epsilon=1e-80)
|
160
166
|
|
161
167
|
# check that they make a flattening
|
162
168
|
if not test_regina:
|
163
|
-
s.flattenings_numerical().check_against_manifold(M, epsilon
|
169
|
+
s.flattenings_numerical().check_against_manifold(M, epsilon=1e-80)
|
164
170
|
|
165
171
|
if not test_regina:
|
166
172
|
for s in numerical_cross_ratios:
|
167
|
-
s.check_against_manifold(M, epsilon
|
173
|
+
s.check_against_manifold(M, epsilon=1e-80)
|
168
174
|
|
169
175
|
for s in numerical_cross_ratios_alt:
|
170
|
-
s.check_against_manifold(M, epsilon
|
176
|
+
s.check_against_manifold(M, epsilon=1e-80)
|
171
177
|
|
172
178
|
# compute complex volumes and volumes
|
173
179
|
complex_volumes = [s.complex_volume_numerical() for s in numerical_solutions]
|
@@ -186,8 +192,8 @@ def testSolutionsForManifold(M, N, solutions, baseline_cvolumes = None,
|
|
186
192
|
|
187
193
|
# volumes should be equal
|
188
194
|
assert len(volumes) == len(volumes_alt)
|
189
|
-
volumes.sort(key
|
190
|
-
volumes_alt.sort(key
|
195
|
+
volumes.sort(key=float)
|
196
|
+
volumes_alt.sort(key=float)
|
191
197
|
for vol1, vol2 in zip(volumes, volumes_alt):
|
192
198
|
assert (vol1 - vol2).abs() < 1e-80
|
193
199
|
|
@@ -198,17 +204,19 @@ def testSolutionsForManifold(M, N, solutions, baseline_cvolumes = None,
|
|
198
204
|
abs(geom_vol - vol) < 1e-11 for vol in volumes]
|
199
205
|
|
200
206
|
# check that complex volumes match baseline volumes
|
201
|
-
if
|
207
|
+
if baseline_cvolumes is not None:
|
202
208
|
check_volumes(complex_volumes, baseline_cvolumes)
|
203
209
|
|
204
210
|
pari.set_real_precision(old_precision)
|
205
211
|
|
206
|
-
def testComputeSolutionsForManifold(manifold, N,
|
207
|
-
compute_solutions = False,
|
208
|
-
baseline_cvolumes = None,
|
209
|
-
expect_non_zero_dimensional = None):
|
210
212
|
|
211
|
-
|
213
|
+
def testComputeSolutionsForManifold(manifold, N,
|
214
|
+
compute_solutions=False,
|
215
|
+
baseline_cvolumes=None,
|
216
|
+
expect_non_zero_dimensional=None,
|
217
|
+
print_info=True):
|
218
|
+
|
219
|
+
varieties = manifold.ptolemy_variety(N, obstruction_class="all_original")
|
212
220
|
|
213
221
|
if compute_solutions:
|
214
222
|
def compute(variety):
|
@@ -220,14 +228,15 @@ def testComputeSolutionsForManifold(manifold, N,
|
|
220
228
|
|
221
229
|
solutions = sum([compute(variety) for variety in varieties], [])
|
222
230
|
|
223
|
-
testSolutionsForManifold(manifold, N, solutions,
|
231
|
+
testSolutionsForManifold(manifold, N, solutions,
|
224
232
|
baseline_cvolumes, expect_non_zero_dimensional)
|
225
233
|
|
226
234
|
if manifold.name() == 't00000':
|
227
|
-
testMatrixMethods(manifold, solutions)
|
235
|
+
testMatrixMethods(manifold, solutions, print_info=print_info)
|
236
|
+
|
237
|
+
|
238
|
+
def testMatrixMethods(manifold, solutions, print_info=True):
|
228
239
|
|
229
|
-
def testMatrixMethods(manifold, solutions):
|
230
|
-
|
231
240
|
def matrix_is_diagonal(m):
|
232
241
|
return (
|
233
242
|
m[0][0] - m[1][1] == 0 and
|
@@ -238,14 +247,15 @@ def testMatrixMethods(manifold, solutions):
|
|
238
247
|
return matrix_is_diagonal(m) and (
|
239
248
|
m[0][0] + 1 == 0 or m[0][0] - 1 == 0)
|
240
249
|
|
241
|
-
|
250
|
+
if print_info:
|
251
|
+
print("Testing matrix methods...")
|
242
252
|
|
243
|
-
G = manifold.fundamental_group(simplify_presentation
|
244
|
-
Graw = manifold.fundamental_group(simplify_presentation
|
253
|
+
G = manifold.fundamental_group(simplify_presentation=True)
|
254
|
+
Graw = manifold.fundamental_group(simplify_presentation=False)
|
245
255
|
|
246
256
|
for solution in solutions:
|
247
257
|
if solution.dimension == 0:
|
248
|
-
|
258
|
+
|
249
259
|
solution._testing_check_cocycles()
|
250
260
|
|
251
261
|
cross_ratios = solution.cross_ratios()
|
@@ -281,7 +291,7 @@ def testMatrixMethods(manifold, solutions):
|
|
281
291
|
solution.evaluate_word(rel))
|
282
292
|
assert matrix_is_diagonal(
|
283
293
|
solution.evaluate_word(rel))
|
284
|
-
|
294
|
+
|
285
295
|
|
286
296
|
def test_flattenings_from_tetrahedra_shapes_of_manifold():
|
287
297
|
|
@@ -299,46 +309,52 @@ def test_flattenings_from_tetrahedra_shapes_of_manifold():
|
|
299
309
|
|
300
310
|
from snappy import OrientableCuspedCensus
|
301
311
|
|
302
|
-
for
|
303
|
-
|
312
|
+
for M_database in (list(OrientableCuspedCensus()[0:10]) +
|
313
|
+
list(OrientableCuspedCensus()[10000:10010])):
|
314
|
+
|
315
|
+
# The manifold returned by OrientableCuspedCensus is
|
316
|
+
# a SnapPy.Manifold, not a snappy.Manifold (as is overridden
|
317
|
+
# in python/test.py).
|
318
|
+
M = Manifold(M_database)
|
304
319
|
|
305
320
|
flattening = Flattenings.from_tetrahedra_shapes_of_manifold(M)
|
306
|
-
flattening.check_against_manifold(M, epsilon
|
321
|
+
flattening.check_against_manifold(M, epsilon=1e-80)
|
307
322
|
|
308
323
|
if not is_close(flattening.complex_volume(),
|
309
324
|
M.complex_volume(), # returns only double precision
|
310
|
-
epsilon
|
325
|
+
epsilon=1e-13):
|
311
326
|
raise Exception("Wrong volume")
|
312
|
-
|
327
|
+
|
313
328
|
# test high precision
|
314
329
|
|
315
330
|
M = ManifoldGetter("5_2")
|
316
331
|
flattening = Flattenings.from_tetrahedra_shapes_of_manifold(M)
|
317
|
-
flattening.check_against_manifold(M, epsilon
|
332
|
+
flattening.check_against_manifold(M, epsilon=1e-80)
|
318
333
|
|
319
334
|
if not is_close(flattening.complex_volume(),
|
320
335
|
pari('2.828122088330783162763898809276634942770981317300649477043520327258802548322471630936947017929999108 - 3.024128376509301659719951221694600993984450242270735312503300643508917708286193746506469158300472966*I'),
|
321
|
-
epsilon
|
336
|
+
epsilon=1e-80):
|
322
337
|
raise Exception("Wrong volume")
|
323
338
|
|
324
339
|
pari.set_real_precision(old_precision)
|
325
340
|
|
341
|
+
|
326
342
|
def checkSolutionsForManifoldGeneralizedObstructionClass(
|
327
343
|
solutions_trivial, solutions_non_trivial,
|
328
344
|
manifold, N, baseline_volumes, baseline_dimensions):
|
329
345
|
|
330
346
|
torsionTrivial = pari('Pi^2/6 * I')
|
331
347
|
torsionNonTrivial = pari('Pi^2/18 * I')
|
332
|
-
|
348
|
+
|
333
349
|
solutions = (
|
334
350
|
[ (s, False) for s in solutions_trivial ] +
|
335
|
-
[ (s, True)
|
351
|
+
[ (s, True) for s in solutions_non_trivial ])
|
336
352
|
|
337
353
|
# Dimensions and volumes encountered
|
338
354
|
dimensions = set()
|
339
355
|
volumes = []
|
340
356
|
volumes_2 = []
|
341
|
-
|
357
|
+
|
342
358
|
for solution, sol_is_non_trivial in solutions:
|
343
359
|
# Add the dimension
|
344
360
|
dimensions.add(solution.dimension)
|
@@ -350,19 +366,19 @@ def checkSolutionsForManifoldGeneralizedObstructionClass(
|
|
350
366
|
solution.check_against_manifold(manifold)
|
351
367
|
except PtolemyCannotBeCheckedError:
|
352
368
|
got_exception = True
|
353
|
-
|
369
|
+
|
354
370
|
assert got_exception, (
|
355
371
|
"check_against_manifold should not have passed")
|
356
372
|
else:
|
357
373
|
solution.check_against_manifold(manifold)
|
358
|
-
|
374
|
+
|
359
375
|
fl = solution.flattenings_numerical()
|
360
376
|
for f in fl:
|
361
377
|
if not test_regina:
|
362
378
|
# Not supported yet in regina
|
363
|
-
f.check_against_manifold(epsilon
|
379
|
+
f.check_against_manifold(epsilon=1e-80)
|
364
380
|
|
365
|
-
cvol, modulo = f.complex_volume(with_modulo
|
381
|
+
cvol, modulo = f.complex_volume(with_modulo=True)
|
366
382
|
|
367
383
|
if sol_is_non_trivial and N == 3:
|
368
384
|
assert (modulo - torsionNonTrivial).abs() < 1e-80, (
|
@@ -375,7 +391,7 @@ def checkSolutionsForManifoldGeneralizedObstructionClass(
|
|
375
391
|
|
376
392
|
# Add the volumes
|
377
393
|
volumes += solution.volume_numerical()
|
378
|
-
|
394
|
+
|
379
395
|
# Check that the resulting cross ratios full fill
|
380
396
|
# the gluing equations
|
381
397
|
cross_ratios = solution.cross_ratios()
|
@@ -388,12 +404,12 @@ def checkSolutionsForManifoldGeneralizedObstructionClass(
|
|
388
404
|
def make_unique(L):
|
389
405
|
L.sort()
|
390
406
|
result = L[:1]
|
391
|
-
|
407
|
+
|
392
408
|
for i in L:
|
393
409
|
if not is_close(result[-1], i):
|
394
410
|
result.append(i)
|
395
411
|
return result
|
396
|
-
|
412
|
+
|
397
413
|
volumes = make_unique(volumes)
|
398
414
|
volumes_2 = make_unique(volumes_2)
|
399
415
|
all_expected_volumes = make_unique(baseline_volumes +
|
@@ -409,15 +425,16 @@ def checkSolutionsForManifoldGeneralizedObstructionClass(
|
|
409
425
|
|
410
426
|
assert dimensions == set(baseline_dimensions)
|
411
427
|
|
428
|
+
|
412
429
|
def testComputeSolutionsForManifoldGeneralizedObstructionClass(
|
413
430
|
manifold, N, compute_solutions, baseline_volumes, baseline_dimensions):
|
414
431
|
|
415
432
|
varieties = manifold.ptolemy_variety(N,
|
416
|
-
obstruction_class
|
417
|
-
|
418
|
-
|
433
|
+
obstruction_class="all_generalized"
|
434
|
+
# , simplify = False
|
435
|
+
# , eliminate_fixed_ptolemys = True
|
419
436
|
)
|
420
|
-
|
437
|
+
|
421
438
|
assert len(varieties) == 2
|
422
439
|
|
423
440
|
if compute_solutions:
|
@@ -427,11 +444,11 @@ def testComputeSolutionsForManifoldGeneralizedObstructionClass(
|
|
427
444
|
else:
|
428
445
|
def compute(variety):
|
429
446
|
return compute_using_precomputed_magma(
|
430
|
-
variety, dir
|
447
|
+
variety, dir=testing_files_generalized_directory)
|
431
448
|
|
432
449
|
# Solutions for the trivial obstruction class
|
433
450
|
solutions_trivial = compute(varieties[0])
|
434
|
-
|
451
|
+
|
435
452
|
# Solutions for the non-trivial obstruction class
|
436
453
|
solutions_non_trivial = sum([compute(variety)
|
437
454
|
for variety in varieties[1:]],
|
@@ -441,7 +458,8 @@ def testComputeSolutionsForManifoldGeneralizedObstructionClass(
|
|
441
458
|
solutions_trivial, solutions_non_trivial,
|
442
459
|
manifold, N, baseline_volumes, baseline_dimensions)
|
443
460
|
|
444
|
-
|
461
|
+
|
462
|
+
def testGeneralizedObstructionClass(compute_solutions, print_info = True):
|
445
463
|
|
446
464
|
vols = [
|
447
465
|
pari('0'),
|
@@ -478,16 +496,18 @@ def testGeneralizedObstructionClass(compute_solutions):
|
|
478
496
|
|
479
497
|
for manifold, N, vols, dims in test_cases:
|
480
498
|
|
481
|
-
|
499
|
+
if print_info:
|
500
|
+
print("Checking for", manifold.name(), "N = %d" % N)
|
482
501
|
|
483
502
|
testComputeSolutionsForManifoldGeneralizedObstructionClass(
|
484
503
|
manifold, N, compute_solutions, vols, dims)
|
485
504
|
|
505
|
+
|
486
506
|
def testMapleLikeRur():
|
487
|
-
|
507
|
+
|
488
508
|
M = ManifoldGetter("m052")
|
489
509
|
p = M.ptolemy_variety(3, 0)
|
490
|
-
|
510
|
+
|
491
511
|
sols = parse_solutions(
|
492
512
|
bz2.BZ2File(os.path.join(testing_files_rur_directory,
|
493
513
|
p.filename_base() + '.rur.bz2'),
|
@@ -515,11 +535,11 @@ def testMapleLikeRur():
|
|
515
535
|
|
516
536
|
old_precision = pari.set_real_precision(60)
|
517
537
|
|
518
|
-
sols.numerical().check_against_manifold(epsilon
|
519
|
-
sols.numerical().cross_ratios().check_against_manifold(epsilon
|
520
|
-
cross_ratios.numerical().check_against_manifold(epsilon
|
521
|
-
sol_pur.numerical().check_against_manifold(epsilon
|
522
|
-
cross_ratio_pur.numerical().check_against_manifold(epsilon
|
538
|
+
sols.numerical().check_against_manifold(epsilon=1e-50)
|
539
|
+
sols.numerical().cross_ratios().check_against_manifold(epsilon=1e-50)
|
540
|
+
cross_ratios.numerical().check_against_manifold(epsilon=1e-50)
|
541
|
+
sol_pur.numerical().check_against_manifold(epsilon=1e-50)
|
542
|
+
cross_ratio_pur.numerical().check_against_manifold(epsilon=1e-50)
|
523
543
|
|
524
544
|
expected_cvols = [
|
525
545
|
pari('-0.78247122081308825152609555186377860994691907952043*I'),
|
@@ -557,12 +577,12 @@ def testMapleLikeRur():
|
|
557
577
|
|
558
578
|
cvols = sols.complex_volume_numerical().flatten(2) # Include witnesses
|
559
579
|
|
560
|
-
check_volumes(cvols, expected_cvols, epsilon
|
580
|
+
check_volumes(cvols, expected_cvols, epsilon=1e-40)
|
561
581
|
|
562
582
|
vols = sols.volume_numerical().flatten(2) # Include witnesses
|
563
583
|
|
564
|
-
check_volumes(vols, expected_cvols, check_real_part_only
|
565
|
-
|
584
|
+
check_volumes(vols, expected_cvols, check_real_part_only=True, epsilon=1e-40)
|
585
|
+
|
566
586
|
pari.set_real_precision(old_precision)
|
567
587
|
|
568
588
|
|
@@ -571,13 +591,13 @@ def testNumericalSolutions():
|
|
571
591
|
M = ManifoldGetter("m003")
|
572
592
|
N = 3
|
573
593
|
|
574
|
-
varieties = M.ptolemy_variety(N, obstruction_class
|
594
|
+
varieties = M.ptolemy_variety(N, obstruction_class='all')
|
575
595
|
|
576
|
-
solutions = [
|
596
|
+
solutions = [
|
577
597
|
solutions_from_magma(
|
578
598
|
get_precomputed_magma(variety,
|
579
|
-
dir
|
580
|
-
numerical
|
599
|
+
dir=testing_files_generalized_directory),
|
600
|
+
numerical=True)
|
581
601
|
for variety in varieties ]
|
582
602
|
|
583
603
|
for obstruction_index, obstruction in enumerate(solutions):
|
@@ -585,7 +605,7 @@ def testNumericalSolutions():
|
|
585
605
|
for solution in component:
|
586
606
|
flattenings = solution.flattenings_numerical()
|
587
607
|
if not test_regina:
|
588
|
-
flattenings.check_against_manifold(epsilon
|
608
|
+
flattenings.check_against_manifold(epsilon=1e-80)
|
589
609
|
order = flattenings.get_order()
|
590
610
|
|
591
611
|
if obstruction_index:
|
@@ -594,8 +614,8 @@ def testNumericalSolutions():
|
|
594
614
|
assert order == 2
|
595
615
|
|
596
616
|
cross_ratios = solution.cross_ratios()
|
597
|
-
is_cr = cross_ratios.is_pu_2_1_representation(epsilon
|
598
|
-
epsilon2
|
617
|
+
is_cr = cross_ratios.is_pu_2_1_representation(epsilon=1e-80,
|
618
|
+
epsilon2=1e-10)
|
599
619
|
|
600
620
|
if cross_ratios.volume_numerical().abs() < 1e-10:
|
601
621
|
# Every volume 0 representation of m003 happens to be
|
@@ -612,7 +632,7 @@ def testNumericalSolutions():
|
|
612
632
|
degree_dict = {}
|
613
633
|
|
614
634
|
for component in allComponents:
|
615
|
-
|
635
|
+
|
616
636
|
dim = component.dimension
|
617
637
|
deg = len(component)
|
618
638
|
|
@@ -620,10 +640,10 @@ def testNumericalSolutions():
|
|
620
640
|
degree_dict[deg] = 1 + degree_dict.get(deg, 0)
|
621
641
|
|
622
642
|
assert (dim == 0) ^ (deg == 0)
|
623
|
-
|
643
|
+
|
624
644
|
assert dimension_dict == {0: 4, 1: 2}
|
625
645
|
assert degree_dict == {0 :2, 2: 2, 8: 2}
|
626
|
-
|
646
|
+
|
627
647
|
allSolutions = sum(allComponents, [])
|
628
648
|
|
629
649
|
allCVolumes = [s.complex_volume_numerical() for s in allSolutions]
|
@@ -639,53 +659,59 @@ def testNumericalSolutions():
|
|
639
659
|
|
640
660
|
check_volumes(allCVolumes, expected_cvolumes)
|
641
661
|
|
642
|
-
|
643
|
-
|
662
|
+
|
663
|
+
def testGeometricRep(compute_solutions, print_info=False):
|
664
|
+
|
644
665
|
from snappy.ptolemy import geometricRep
|
645
|
-
|
666
|
+
|
646
667
|
M = Manifold("m019")
|
647
668
|
if compute_solutions:
|
648
669
|
sol = geometricRep.compute_geometric_solution(M)
|
649
670
|
else:
|
650
671
|
from urllib.request import pathname2url
|
651
672
|
url = pathname2url(os.path.abspath(testing_files_directory))
|
652
|
-
sol = geometricRep.retrieve_geometric_solution(
|
673
|
+
sol = geometricRep.retrieve_geometric_solution(
|
674
|
+
M, data_url=url, verbose = print_info)
|
653
675
|
|
654
676
|
# Make sure this is of type Ptolemy
|
655
677
|
sol['c_0011_2']
|
656
678
|
|
657
679
|
assert any(
|
658
|
-
|
680
|
+
abs(vol - 2.9441064867) < 1e-9 for vol in sol.volume_numerical())
|
681
|
+
|
659
682
|
|
660
683
|
def testSageCommandLine():
|
661
684
|
|
662
685
|
sage_eval('Manifold("m004").ptolemy_variety(3,0).compute_solutions().check_against_manifold()',
|
663
686
|
{ 'Manifold' : ManifoldGetter })
|
664
|
-
|
687
|
+
|
688
|
+
|
665
689
|
def get_precomputed_magma(variety, dir):
|
666
|
-
magma_file_name = os.path.join(dir,
|
690
|
+
magma_file_name = os.path.join(dir,
|
667
691
|
variety.filename_base() + '.magma_out.bz2')
|
668
692
|
return bz2.BZ2File(magma_file_name,'r').read().decode('ascii')
|
669
693
|
|
670
|
-
|
694
|
+
|
695
|
+
def compute_using_precomputed_magma(variety, dir=testing_files_directory):
|
671
696
|
return solutions_from_magma(get_precomputed_magma(variety, dir))
|
672
697
|
|
698
|
+
|
673
699
|
def test_induced_representation():
|
674
700
|
|
675
701
|
M = ManifoldGetter("m015")
|
676
|
-
variety__sl2_c1 = M.ptolemy_variety(2, obstruction_class
|
677
|
-
variety__sl3_c0 = M.ptolemy_variety(3, obstruction_class
|
702
|
+
variety__sl2_c1 = M.ptolemy_variety(2, obstruction_class=1)
|
703
|
+
variety__sl3_c0 = M.ptolemy_variety(3, obstruction_class=0)
|
678
704
|
|
679
705
|
solutions__sl2_c1 = compute_using_precomputed_magma(
|
680
|
-
variety__sl2_c1, dir
|
706
|
+
variety__sl2_c1, dir=testing_files_generalized_directory)
|
681
707
|
solutions__sl3_c0 = compute_using_precomputed_magma(
|
682
|
-
variety__sl3_c0, dir
|
708
|
+
variety__sl3_c0, dir=testing_files_generalized_directory)
|
709
|
+
|
710
|
+
# Check that is_real
|
683
711
|
|
684
|
-
# Check that is_real
|
685
|
-
|
686
712
|
got_exception = False
|
687
713
|
try:
|
688
|
-
solutions__sl3_c0[0].cross_ratios().is_real(epsilon
|
714
|
+
solutions__sl3_c0[0].cross_ratios().is_real(epsilon=1e-80)
|
689
715
|
except:
|
690
716
|
got_exception = True
|
691
717
|
assert got_exception, (
|
@@ -699,11 +725,11 @@ def test_induced_representation():
|
|
699
725
|
number_real = 0
|
700
726
|
number_all = 0
|
701
727
|
for z in component.cross_ratios_numerical():
|
702
|
-
if z.is_real(epsilon
|
728
|
+
if z.is_real(epsilon=1e-80):
|
703
729
|
number_real += 1
|
704
730
|
number_all += 1
|
705
731
|
numbers_all_and_real.append((number_all, number_real))
|
706
|
-
|
732
|
+
|
707
733
|
# Bring into canonical form
|
708
734
|
numbers_all_and_real.sort()
|
709
735
|
|
@@ -711,7 +737,7 @@ def test_induced_representation():
|
|
711
737
|
(3, 1), # component has 3 solutions, 1 of them has real cross ratios
|
712
738
|
(4, 2),
|
713
739
|
(6, 0) ]
|
714
|
-
|
740
|
+
|
715
741
|
assert numbers_all_and_real == expected_numbers, (
|
716
742
|
"Order of components and number of real solutions is off")
|
717
743
|
|
@@ -728,16 +754,15 @@ def test_induced_representation():
|
|
728
754
|
number_psl2 = 0
|
729
755
|
|
730
756
|
for component in solutions__sl3_c0:
|
731
|
-
is_induced_from_psl2 = [
|
732
|
-
|
733
|
-
if
|
757
|
+
is_induced_from_psl2 = [z.is_induced_from_psl2(epsilon=1e-80)
|
758
|
+
for z in component.cross_ratios_numerical()]
|
759
|
+
if any(is_induced_from_psl2):
|
734
760
|
number_psl2 += 1
|
735
|
-
assert
|
736
|
-
"Mixed up is_induced_from_psl2")
|
761
|
+
assert all(is_induced_from_psl2), "Mixed up is_induced_from_psl2"
|
737
762
|
|
738
763
|
assert number_psl2 == 1, (
|
739
764
|
"Only one component can come from psl2 (numerically)")
|
740
|
-
|
765
|
+
|
741
766
|
# Check that induced_representation for sl3 throws error
|
742
767
|
got_exception = False
|
743
768
|
try:
|
@@ -767,12 +792,13 @@ def test_induced_representation():
|
|
767
792
|
assert v.abs() < 1e-80 or (v.abs() - 4 * m015_volume).abs() < 1e-80, (
|
768
793
|
"Did not get expected voluem for induced representation")
|
769
794
|
|
795
|
+
|
770
796
|
def test_induced_sl4_representation():
|
771
797
|
M = Manifold("m004")
|
772
798
|
|
773
799
|
z_gl2 = ptolemy.CrossRatios.from_snappy_manifold(M)
|
774
800
|
z_gl4 = z_gl2.induced_representation(4)
|
775
|
-
|
801
|
+
|
776
802
|
G = M.fundamental_group()
|
777
803
|
|
778
804
|
mat = z_gl4.evaluate_word(G.relators()[0], G)
|
@@ -783,7 +809,7 @@ def test_induced_sl4_representation():
|
|
783
809
|
assert abs(entry - 1) < 1e-9
|
784
810
|
else:
|
785
811
|
assert abs(entry) < 1e-9
|
786
|
-
|
812
|
+
|
787
813
|
|
788
814
|
def test_num_obstruction_class_match():
|
789
815
|
from snappy import OrientableCuspedCensus
|
@@ -796,79 +822,69 @@ def test_num_obstruction_class_match():
|
|
796
822
|
|
797
823
|
for i in range(2,6):
|
798
824
|
assert len(M.ptolemy_generalized_obstruction_classes(i)) == len(N.ptolemy_generalized_obstruction_classes(i))
|
799
|
-
|
800
|
-
modules = [ptolemy.component, ptolemy.coordinates, ptolemy.manifoldMethods,
|
801
|
-
ptolemy.matrix, ptolemy.polynomial, ptolemy.processMagmaFile,
|
802
|
-
ptolemy.ptolemyObstructionClass, ptolemy.ptolemyVariety,
|
803
|
-
ptolemy.ptolemyVariety, ptolemy.processFileBase, ptolemy.processRurFile,
|
804
|
-
ptolemy.rur, ptolemy.utilities]
|
805
|
-
if test_regina:
|
806
|
-
modules.append(ptolemy.reginaWrapper)
|
807
825
|
|
808
|
-
def
|
809
|
-
|
826
|
+
def run_ptolemy_tests_raising_exceptions(print_info=True):
|
827
|
+
if print_info:
|
828
|
+
print("Testing in sage:", _within_sage)
|
810
829
|
|
811
|
-
|
812
|
-
print("Testing in sage:", _within_sage)
|
813
|
-
|
814
|
-
print("Testing in regina:", test_regina)
|
815
|
-
|
816
|
-
if doctest:
|
817
|
-
print("Running doctests...")
|
818
|
-
run_doctests(verbose)
|
819
|
-
print()
|
830
|
+
print("Testing in regina:", test_regina)
|
820
831
|
|
821
832
|
if test_regina:
|
822
|
-
|
833
|
+
if print_info:
|
834
|
+
print("Testing that regina agrees with snappy obstruction classes")
|
823
835
|
test_num_obstruction_class_match()
|
824
836
|
|
825
837
|
if not test_regina:
|
826
|
-
|
838
|
+
if print_info:
|
839
|
+
print("Testing Flattenings.from_tetrahedra_shapes_of_manifold...")
|
827
840
|
|
828
841
|
test_flattenings_from_tetrahedra_shapes_of_manifold()
|
829
842
|
|
830
|
-
compute_solutions = False
|
831
|
-
|
832
|
-
if '--compute' in sys.argv:
|
833
|
-
compute_solutions = True
|
834
|
-
|
835
843
|
if test_regina and not compute_solutions:
|
836
844
|
print("regina testing requires --compute")
|
837
845
|
sys.exit(1)
|
838
|
-
|
846
|
+
|
839
847
|
old_precision = pari.set_real_precision(100)
|
840
848
|
|
841
|
-
|
849
|
+
if print_info:
|
850
|
+
print("Testing induced representation...")
|
842
851
|
|
843
852
|
test_induced_representation()
|
844
853
|
|
845
|
-
|
854
|
+
if print_info:
|
855
|
+
print("Testing induced SL(4,C) representation...")
|
846
856
|
|
847
857
|
test_induced_sl4_representation()
|
848
858
|
|
849
|
-
|
859
|
+
if print_info:
|
860
|
+
print("Running manifold tests for generalized obstruction class...")
|
850
861
|
|
851
|
-
testGeneralizedObstructionClass(compute_solutions)
|
862
|
+
testGeneralizedObstructionClass(compute_solutions, print_info=print_info)
|
852
863
|
|
853
864
|
if not test_regina:
|
854
|
-
|
865
|
+
if print_info:
|
866
|
+
print("Testing RUR for m052__sl3_c0.rur")
|
855
867
|
|
856
868
|
testMapleLikeRur()
|
857
869
|
|
858
|
-
|
870
|
+
if print_info:
|
871
|
+
print("Testing numerical solution retrieval method...")
|
859
872
|
|
860
873
|
testNumericalSolutions()
|
861
874
|
|
862
|
-
|
863
|
-
|
875
|
+
if print_info:
|
876
|
+
print("Testing geometricRep...")
|
877
|
+
testGeometricRep(compute_solutions, print_info=print_info)
|
864
878
|
|
865
879
|
if _within_sage:
|
866
|
-
|
880
|
+
if print_info:
|
881
|
+
print("Testing in sage command line...")
|
867
882
|
testSageCommandLine()
|
868
883
|
|
869
|
-
|
884
|
+
if print_info:
|
885
|
+
print("Running manifold tests...")
|
870
886
|
|
871
|
-
|
887
|
+
# Test for a non-hyperbolic manifold
|
872
888
|
|
873
889
|
cvols = [ # Expected Complex volumes
|
874
890
|
pari('0') ]
|
@@ -877,7 +893,7 @@ def main(verbose=False, doctest=True):
|
|
877
893
|
cvols, # expected complex volumes
|
878
894
|
False) # No non-zero dimensional components
|
879
895
|
|
880
|
-
|
896
|
+
# Test for 4_1, amphichiral, expect zero CS
|
881
897
|
|
882
898
|
cvols = [ # Expected Complex volumes
|
883
899
|
2 * vol_tet
|
@@ -887,7 +903,7 @@ def main(verbose=False, doctest=True):
|
|
887
903
|
cvols, # expected complex volumes
|
888
904
|
False) # expect non-zero dimensional components
|
889
905
|
|
890
|
-
|
906
|
+
# N = 3
|
891
907
|
|
892
908
|
cvols = [ # Expected Complex volumes
|
893
909
|
pari(0),
|
@@ -898,7 +914,7 @@ def main(verbose=False, doctest=True):
|
|
898
914
|
cvols, # expected complex volumes
|
899
915
|
False) # expect non-zero dimensional components
|
900
916
|
|
901
|
-
|
917
|
+
# N = 4
|
902
918
|
|
903
919
|
cvols = [ # Expected Complex volumes
|
904
920
|
2 * 10 * vol_tet,
|
@@ -918,10 +934,9 @@ def main(verbose=False, doctest=True):
|
|
918
934
|
cvols, # expected complex volumes
|
919
935
|
True) # expect non-zero dimensional components
|
920
936
|
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
### And one pair of complex embeddings with non-trivial CS
|
937
|
+
# Test for 5_2, expect non-trivial CS
|
938
|
+
# Number field has one real embedding with non-trival CS
|
939
|
+
# And one pair of complex embeddings with non-trivial CS
|
925
940
|
|
926
941
|
cvols = [ # Expected Complex volumes
|
927
942
|
pari('+ 1.113454552473924010022656943451126420312050780921075311799926598907813005362784871512051614741669817*I'),
|
@@ -932,8 +947,8 @@ def main(verbose=False, doctest=True):
|
|
932
947
|
cvols, # expected complex volumes
|
933
948
|
False) # expect no non-zero dimensional components
|
934
949
|
|
935
|
-
|
936
|
-
|
950
|
+
# m015 which is isometric to 5_2
|
951
|
+
# This example is also appearing on the website
|
937
952
|
|
938
953
|
cvols = [ # Expected Complex volumes
|
939
954
|
pari('+ 0.4033353624187061319128390413376061001062613536896471642214173008084760853375773296525240139108027276*I'),
|
@@ -949,8 +964,8 @@ def main(verbose=False, doctest=True):
|
|
949
964
|
cvols, # expected volumes
|
950
965
|
False) # expect no non-zero dimensional components
|
951
966
|
|
952
|
-
|
953
|
-
|
967
|
+
# Test for m135
|
968
|
+
# Ptolemy Variety has one non-zero dimensional component
|
954
969
|
|
955
970
|
cvols = [ # Expected Complex volumes
|
956
971
|
pari('3.66386237670887606021841405972953644309659749712668853706599247848705207910501907791742605170446042499429769047678479831614359521330343623772637894992 + 4.93480220054467930941724549993807556765684970362039531320667468811002241120960262150088670185927611591201295688701157203888617406101502336380530883900*I')
|
@@ -961,9 +976,9 @@ def main(verbose=False, doctest=True):
|
|
961
976
|
cvols, # expected volumes
|
962
977
|
True) # expect a non-zero dimensional component
|
963
978
|
|
964
|
-
|
965
|
-
|
966
|
-
|
979
|
+
# Test for s000
|
980
|
+
# Number field has one real embedding with non-trival CS
|
981
|
+
# And two complex embeddings with non-trivial CS
|
967
982
|
|
968
983
|
cvols = [ # Expected Complex volumes
|
969
984
|
pari('3.296902414326637335562593088559162089146991699269941951875989849869324250860299302482577730785960256 + 0.4908671850777469648812718224097607532197026477625119178645010117072332396428578681905186509136879130*I'),
|
@@ -976,24 +991,23 @@ def main(verbose=False, doctest=True):
|
|
976
991
|
cvols, # expected complex volumes
|
977
992
|
False) # expect non-zero dimensional components
|
978
993
|
|
979
|
-
|
980
|
-
|
981
|
-
|
994
|
+
# Test for v0000
|
995
|
+
# This also tests the case of having more than one (here two)
|
996
|
+
# cusps
|
982
997
|
|
983
998
|
cvols = [ # Expected Complex volumes
|
984
999
|
pari('3.377597408231442496961257171798882829176020069714519460350380851901055794392493960110119513942153791 + 0.3441889979504813554136570264352067044809511501367282461849580661783699588789118851518262199077361427*I'),
|
985
1000
|
pari('1.380586178282342062845519278761524817753278777803238623999221385504661588501960339341800843520223671 + 0.06704451876157525370444676522629959282378632516497136324893149116413190872188833330658100524720353406*I')
|
986
1001
|
]
|
987
|
-
|
1002
|
+
|
988
1003
|
test__v0000__2 = (ManifoldGetter("v0000"), # Manifold
|
989
1004
|
2, # N = 2
|
990
1005
|
cvols, # expected complex volumes
|
991
1006
|
False) # expect non-zero dimensional components
|
992
1007
|
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
### cusps
|
1008
|
+
# Test for t00000
|
1009
|
+
# This also tests the case of having more than one (here two)
|
1010
|
+
# cusps
|
997
1011
|
|
998
1012
|
cvols = [ # Expected Complex volumes
|
999
1013
|
pari('1.801231981344929412976326011175173926741195258454700704383597306674496002389749200442131507334117933 - 0.5490336239273931479260463113980794374780078424892352183284248305887346671477869107359071072271699046*I'),
|
@@ -1001,16 +1015,16 @@ def main(verbose=False, doctest=True):
|
|
1001
1015
|
pari('2.781430316400743786576311128801205534982324055570742403430395886754122643539081915302290955978507418 - 0.1135489194824466736456241002458946823709871812077727407261274931826622024508518397031626436088171650*I'),
|
1002
1016
|
pari('0.6223401945262803853426860070209275705147832620602921139947907237662088851273537136119288228151713940 + 0.06594907226052699343130923275995552293727798462035885627276325301997714628516294342514039299674185799*I')
|
1003
1017
|
]
|
1004
|
-
|
1018
|
+
|
1005
1019
|
test__t00000__2 = (ManifoldGetter("t00000"), # Manifold
|
1006
1020
|
2, # N = 2
|
1007
1021
|
cvols, # expected complex volumes
|
1008
1022
|
False) # expect non-zero dimensional components
|
1009
1023
|
|
1010
|
-
|
1011
|
-
|
1024
|
+
# Check a big link
|
1025
|
+
# Also an example from the website
|
1012
1026
|
|
1013
|
-
magma_file_name = os.path.join(testing_files_directory,
|
1027
|
+
magma_file_name = os.path.join(testing_files_directory,
|
1014
1028
|
'DT_mcbbiceaibjklmdfgh__sl2_c0.magma_out.bz2')
|
1015
1029
|
magma_file = bz2.BZ2File(magma_file_name, 'r').read().decode('ascii')
|
1016
1030
|
M = get_manifold(magma_file)
|
@@ -1050,18 +1064,63 @@ def main(verbose=False, doctest=True):
|
|
1050
1064
|
test__4_1__3,
|
1051
1065
|
test__m015__3,
|
1052
1066
|
test__4_1__4]
|
1053
|
-
|
1067
|
+
|
1054
1068
|
pari.set_real_precision(old_precision)
|
1055
1069
|
|
1056
1070
|
for manifold, N, cvols, expect_non_zero_dim in test_cases:
|
1057
1071
|
|
1058
|
-
|
1072
|
+
if print_info:
|
1073
|
+
print("Checking for", manifold.name(), "N = %d" % N)
|
1059
1074
|
|
1060
1075
|
testComputeSolutionsForManifold(
|
1061
1076
|
manifold, N,
|
1062
|
-
compute_solutions
|
1063
|
-
baseline_cvolumes
|
1064
|
-
expect_non_zero_dimensional
|
1077
|
+
compute_solutions=compute_solutions,
|
1078
|
+
baseline_cvolumes=cvols,
|
1079
|
+
expect_non_zero_dimensional=expect_non_zero_dim,
|
1080
|
+
print_info=print_info)
|
1081
|
+
|
1082
|
+
def run_ptolemy_tests(verbose=False, print_info=True):
|
1083
|
+
try:
|
1084
|
+
run_ptolemy_tests_raising_exceptions(
|
1085
|
+
print_info=print_info)
|
1086
|
+
return doctest.TestResults(failed=0, attempted=1)
|
1087
|
+
except Exception as e:
|
1088
|
+
print()
|
1089
|
+
print("FAILED TEST in Ptolemy. Exception is:")
|
1090
|
+
traceback.print_exc()
|
1091
|
+
print()
|
1092
|
+
return doctest.TestResults(failed=1, attempted=1)
|
1093
|
+
|
1094
|
+
run_ptolemy_tests.__name__ = ptolemy.__name__ + ' (non-doc tests)'
|
1095
|
+
|
1096
|
+
modules = [ptolemy.component,
|
1097
|
+
ptolemy.coordinates,
|
1098
|
+
ptolemy.manifoldMethods,
|
1099
|
+
ptolemy.matrix,
|
1100
|
+
ptolemy.polynomial,
|
1101
|
+
ptolemy.processFileBase,
|
1102
|
+
ptolemy.processMagmaFile,
|
1103
|
+
ptolemy.processRurFile,
|
1104
|
+
ptolemy.ptolemyObstructionClass,
|
1105
|
+
ptolemy.ptolemyVariety,
|
1106
|
+
ptolemy.rur,
|
1107
|
+
ptolemy.utilities]
|
1108
|
+
if test_regina:
|
1109
|
+
modules.append(ptolemy.reginaWrapper)
|
1110
|
+
|
1111
|
+
def run_doctests(verbose=False, print_info=True):
|
1112
|
+
return doctest_modules(
|
1113
|
+
modules,
|
1114
|
+
verbose=verbose, print_info=print_info)
|
1115
|
+
|
1116
|
+
run_doctests.__name__ = ptolemy.__name__
|
1065
1117
|
|
1066
1118
|
if __name__ == '__main__':
|
1067
|
-
|
1119
|
+
verbose = '-v' in sys.argv[1:] or '--verbose' in sys.argv[1:]
|
1120
|
+
|
1121
|
+
result = run_doctests(verbose=verbose, print_info=True)
|
1122
|
+
if result.failed:
|
1123
|
+
sys.exit(result.failed)
|
1124
|
+
|
1125
|
+
result = run_ptolemy_tests(verbose=verbose, print_info=True)
|
1126
|
+
sys.exit(result.failed)
|