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
@@ -1,11 +1,12 @@
|
|
1
1
|
from ...sage_helper import _within_sage
|
2
2
|
|
3
3
|
if _within_sage:
|
4
|
-
from
|
4
|
+
from ...sage_helper import sqrt
|
5
5
|
|
6
6
|
__all__ = ['ExtendedMatrix']
|
7
7
|
|
8
|
-
|
8
|
+
|
9
|
+
class ExtendedMatrix():
|
9
10
|
"""
|
10
11
|
An extended PGL(2,C)-matrix. It consists of a SageMath ``Matrix`` with
|
11
12
|
coefficients in SageMath's ``ComplexIntervalField`` together with a flag
|
@@ -23,7 +24,7 @@ class ExtendedMatrix(object):
|
|
23
24
|
|
24
25
|
"""
|
25
26
|
|
26
|
-
def __init__(self, matrix, isOrientationReversing
|
27
|
+
def __init__(self, matrix, isOrientationReversing=False):
|
27
28
|
if isinstance(matrix, ExtendedMatrix):
|
28
29
|
self.matrix = matrix.matrix
|
29
30
|
self.isOrientationReversing = (
|
@@ -75,7 +76,7 @@ class ExtendedMatrix(object):
|
|
75
76
|
"ExtendedMatrix.")
|
76
77
|
return m.matrix
|
77
78
|
return m
|
78
|
-
|
79
|
+
|
79
80
|
@staticmethod
|
80
81
|
def get_orientation_sign(m):
|
81
82
|
"""
|
@@ -97,4 +98,3 @@ class ExtendedMatrix(object):
|
|
97
98
|
|
98
99
|
m = ExtendedMatrix.extract_matrix_for_orientation_preserving(m)
|
99
100
|
return (m[0,0] + m[1,1]) / sqrt(m.det())
|
100
|
-
|
@@ -1,15 +1,15 @@
|
|
1
1
|
from ...sage_helper import _within_sage
|
2
2
|
|
3
3
|
if _within_sage:
|
4
|
-
import sage
|
5
|
-
from
|
6
|
-
from sage.functions.hyperbolic import arccosh
|
4
|
+
import sage
|
5
|
+
from ...sage_helper import matrix, sqrt, is_RealIntervalFieldElement, Infinity
|
7
6
|
|
8
7
|
from .extended_matrix import ExtendedMatrix
|
9
8
|
|
10
9
|
__all__ = ['FinitePoint']
|
11
10
|
|
12
|
-
|
11
|
+
|
12
|
+
class FinitePoint():
|
13
13
|
"""
|
14
14
|
A point in the upper half space model represented by the quaternion
|
15
15
|
z + t * j with t > 0. For example, the point (1 + 2 * i) + 3 * j is::
|
@@ -62,8 +62,8 @@ class FinitePoint(object):
|
|
62
62
|
FinitePoint(1.4500000000000000? + 0.50000000000000000?*I, 0.75000000000000000?)
|
63
63
|
|
64
64
|
"""
|
65
|
-
|
66
|
-
return self._translate(m, normalize_matrix
|
65
|
+
|
66
|
+
return self._translate(m, normalize_matrix=False)
|
67
67
|
|
68
68
|
def translate_PGL(self, m):
|
69
69
|
"""
|
@@ -80,7 +80,7 @@ class FinitePoint(object):
|
|
80
80
|
|
81
81
|
"""
|
82
82
|
|
83
|
-
return self._translate(m, normalize_matrix
|
83
|
+
return self._translate(m, normalize_matrix=True)
|
84
84
|
|
85
85
|
def _translate(self, m, normalize_matrix):
|
86
86
|
|
@@ -96,7 +96,7 @@ class FinitePoint(object):
|
|
96
96
|
# (a*z + b) * (c*z + d) + a * c * t + t * j
|
97
97
|
# ----------------------------------------------
|
98
98
|
# 2
|
99
|
-
# | c * (z + t*j) + d |
|
99
|
+
# | c * (z + t*j) + d |
|
100
100
|
|
101
101
|
if isinstance(m, ExtendedMatrix):
|
102
102
|
mat = m.matrix
|
@@ -110,29 +110,28 @@ class FinitePoint(object):
|
|
110
110
|
|
111
111
|
if normalize_matrix:
|
112
112
|
mat = mat / sqrt(mat.det())
|
113
|
-
|
113
|
+
|
114
114
|
# a * z + b
|
115
|
-
az_b
|
115
|
+
az_b = mat[0,0] * z + mat[0,1]
|
116
116
|
# c * z + d
|
117
|
-
cz_d
|
117
|
+
cz_d = mat[1,0] * z + mat[1,1]
|
118
118
|
|
119
119
|
# Denominator
|
120
120
|
# | c * (z + t * j) + d |^2 =
|
121
121
|
# | c * z + d + c * t * j | ^2 =
|
122
122
|
# | c * z + d| ^ 2 + |c * t|^2
|
123
123
|
denom = _abs_sqr(cz_d) + _abs_sqr(mat[1,0] * self.t)
|
124
|
-
|
125
|
-
num
|
124
|
+
|
125
|
+
num = ( az_b * cz_d.conjugate() +
|
126
126
|
mat[0,0] * mat[1,0].conjugate() * self.t ** 2)
|
127
127
|
|
128
128
|
return FinitePoint(num / denom, self.t / denom)
|
129
|
-
|
130
|
-
def cosh_dist(self, other):
|
131
129
|
|
130
|
+
def cosh_dist(self, other):
|
132
131
|
"""
|
133
132
|
Returns cosh of the distance of this finite point to another
|
134
133
|
finite point::
|
135
|
-
|
134
|
+
|
136
135
|
sage: from sage.all import *
|
137
136
|
sage: a = FinitePoint(CIF(1,2),RIF(3))
|
138
137
|
sage: b = FinitePoint(CIF(4,5),RIF(6))
|
@@ -142,7 +141,7 @@ class FinitePoint(object):
|
|
142
141
|
"""
|
143
142
|
|
144
143
|
# The distance between two points in the upper half plane model is
|
145
|
-
# given by
|
144
|
+
# given by
|
146
145
|
# 2 2
|
147
146
|
# (x2-x1) + (y2-y1)
|
148
147
|
# dist( (x1,y1), (x2, y2) = arcosh( 1 + --------------------- )
|
@@ -155,11 +154,25 @@ class FinitePoint(object):
|
|
155
154
|
# t and (x2-x1)^2 is the square of the absolute value of the difference
|
156
155
|
# of the two z.
|
157
156
|
|
158
|
-
r = 1 + (((self.t - other.t) ** 2 + _abs_sqr(self.z - other.z))/
|
157
|
+
r = 1 + (((self.t - other.t) ** 2 + _abs_sqr(self.z - other.z)) /
|
159
158
|
(2 * self.t * other.t))
|
159
|
+
|
160
|
+
# Due to rounding-errors, we can get a value that is just slightly
|
161
|
+
# smaller than 1, even though we know that this is mathematically
|
162
|
+
# impossible. This can cause taking arccosh later to fail.
|
163
|
+
#
|
164
|
+
# To avoid this failure, make sure the result is at least 1 - or
|
165
|
+
# in the interval case, ensure that the interval does not contain
|
166
|
+
# values below 1.
|
167
|
+
#
|
160
168
|
RIF = r.parent()
|
161
|
-
|
162
|
-
|
169
|
+
if _within_sage:
|
170
|
+
if is_RealIntervalFieldElement(r):
|
171
|
+
return r.intersection(RIF(1, Infinity))
|
172
|
+
if r < 1.0:
|
173
|
+
return RIF(1.0)
|
174
|
+
return r
|
175
|
+
|
163
176
|
def dist(self, other):
|
164
177
|
"""
|
165
178
|
Returns the distance of this finite point to another finite point::
|
@@ -167,18 +180,18 @@ class FinitePoint(object):
|
|
167
180
|
sage: from sage.all import *
|
168
181
|
sage: a = FinitePoint(CIF(1,2),RIF(3))
|
169
182
|
sage: b = FinitePoint(CIF(4,5),RIF(6))
|
170
|
-
sage: a.dist(b) # doctest: +NUMERIC12
|
183
|
+
sage: a.dist(b) # doctest: +NUMERIC12
|
171
184
|
1.158810360429947?
|
172
185
|
|
173
186
|
"""
|
174
|
-
|
175
187
|
# Note: SageMath 8.1 doesn't compute arccosh correctly for a
|
176
188
|
# complex interval, but at least it does so for a real interval.
|
177
|
-
return
|
178
|
-
|
189
|
+
return self.cosh_dist(other).arccosh()
|
190
|
+
|
179
191
|
def __repr__(self):
|
180
192
|
return 'FinitePoint(%r, %r)' % (self.z, self.t)
|
181
193
|
|
194
|
+
|
182
195
|
###############################################################################
|
183
196
|
# Various helpers
|
184
197
|
|
@@ -189,7 +202,8 @@ def _abs_sqr(z):
|
|
189
202
|
#
|
190
203
|
# TESTING
|
191
204
|
|
192
|
-
|
205
|
+
|
206
|
+
class _FinitePointTester():
|
193
207
|
"""
|
194
208
|
A test rig for FinitePoint.
|
195
209
|
|
@@ -202,18 +216,18 @@ class _FinitePointTester(object):
|
|
202
216
|
def matrix1(self):
|
203
217
|
from sage.all import RIF, CIF, matrix
|
204
218
|
return matrix(
|
205
|
-
[[CIF(RIF(1.3),RIF(-0.4)), CIF(RIF(5.6),RIF(2.3))],
|
219
|
+
[[CIF(RIF(1.3), RIF(-0.4)), CIF(RIF(5.6), RIF(2.3))],
|
206
220
|
[CIF(RIF(-0.3), RIF(0.1)), CIF(1)]])
|
207
|
-
|
221
|
+
|
208
222
|
def extended_matrix1(self, isOrientationReversing):
|
209
223
|
return ExtendedMatrix(self.matrix1(), isOrientationReversing)
|
210
224
|
|
211
225
|
def matrix2(self):
|
212
226
|
from sage.all import RIF, CIF, matrix
|
213
227
|
return matrix(
|
214
|
-
[[CIF(RIF(0.3),RIF(-1.4)), CIF(RIF(3.6),RIF(6.3))],
|
228
|
+
[[CIF(RIF(0.3), RIF(-1.4)), CIF(RIF(3.6), RIF(6.3))],
|
215
229
|
[CIF(RIF(-0.3), RIF(1.1)), CIF(1)]])
|
216
|
-
|
230
|
+
|
217
231
|
def extended_matrix2(self, isOrientationReversing):
|
218
232
|
return ExtendedMatrix(self.matrix2(), isOrientationReversing)
|
219
233
|
|
@@ -235,7 +249,7 @@ class _FinitePointTester(object):
|
|
235
249
|
raise Exception("Expected distance to be RIF")
|
236
250
|
if not isinstance(d_after, RealIntervalFieldElement):
|
237
251
|
raise Exception("Expected distance to be RIF")
|
238
|
-
|
252
|
+
|
239
253
|
if not abs(d_before - d_after) < RIF(1e-12):
|
240
254
|
raise Exception("Distance changed %r %r" % (d_before, d_after))
|
241
255
|
|
@@ -267,4 +281,3 @@ class _FinitePointTester(object):
|
|
267
281
|
self.matrix_multiplication_works([m1o, m1o, m2r, m1o])
|
268
282
|
self.matrix_multiplication_works([m1o, m1r, m2r, m1o])
|
269
283
|
self.matrix_multiplication_works([m2r, m1o, m2r, m1o])
|
270
|
-
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"""
|
2
2
|
We have two representations of a point in the boundary of the upper half space model
|
3
3
|
**H**\\ :sup:`3`:
|
4
|
-
|
4
|
+
|
5
5
|
- :class:`ProjectivePoint` encapsulate it as an element in **CP**\\ :sup:`1`. It uses intervals
|
6
6
|
and can thus represent a neighborhood of infinity.
|
7
7
|
- as a one point compactification of **C**.
|
@@ -17,8 +17,8 @@ and is different from the ``Infinity`` that comes from ``sage.all``.
|
|
17
17
|
from ...sage_helper import _within_sage
|
18
18
|
|
19
19
|
if _within_sage:
|
20
|
-
import
|
21
|
-
from
|
20
|
+
from ...sage_helper import I, matrix
|
21
|
+
from ...sage_helper import Infinity as sage_Infinity
|
22
22
|
|
23
23
|
from .finite_point import *
|
24
24
|
from .extended_matrix import *
|
@@ -37,6 +37,7 @@ __all__ = [
|
|
37
37
|
# This should come from snappy.snap.transferKernelStructuresEngine.
|
38
38
|
Infinity = 'Infinity'
|
39
39
|
|
40
|
+
|
40
41
|
def apply_Moebius(m, z):
|
41
42
|
"""
|
42
43
|
Applies the matrix m to the ideal point z::
|
@@ -60,7 +61,8 @@ def apply_Moebius(m, z):
|
|
60
61
|
if z == Infinity:
|
61
62
|
return m[0,0] / m[1,0]
|
62
63
|
return (m[0,0] * z + m[0,1]) / (m[1,0] * z + m[1,1])
|
63
|
-
|
64
|
+
|
65
|
+
|
64
66
|
def cross_ratio(z0, z1, z2, z3):
|
65
67
|
"""
|
66
68
|
Computes the cross ratio (according to SnapPea conventions) of
|
@@ -72,9 +74,10 @@ def cross_ratio(z0, z1, z2, z3):
|
|
72
74
|
|
73
75
|
"""
|
74
76
|
|
75
|
-
return ((_diff_1_if_inf(z2, z0) * _diff_1_if_inf(z3, z1)) /
|
77
|
+
return ((_diff_1_if_inf(z2, z0) * _diff_1_if_inf(z3, z1)) /
|
76
78
|
(_diff_1_if_inf(z2, z1) * _diff_1_if_inf(z3, z0)))
|
77
79
|
|
80
|
+
|
78
81
|
def compute_midpoint_of_triangle_edge_with_offset(idealPoints, offset):
|
79
82
|
"""
|
80
83
|
The inputs are a list of three IdealPoint's [a, b, c] and an element
|
@@ -84,10 +87,10 @@ def compute_midpoint_of_triangle_edge_with_offset(idealPoints, offset):
|
|
84
87
|
from c perpendicular to the side a b. Call the intersection of the line
|
85
88
|
with the side a b the midpoint. This function returns this point moved
|
86
89
|
towards a by hyperbolic distance log(offset)::
|
87
|
-
|
90
|
+
|
88
91
|
sage: from sage.all import CIF, RIF
|
89
92
|
sage: compute_midpoint_of_triangle_edge_with_offset( # doctest: +NUMERIC12
|
90
|
-
... [ CIF(0), Infinity, CIF(1) ], RIF(5.0))
|
93
|
+
... [ CIF(0), Infinity, CIF(1) ], RIF(5.0))
|
91
94
|
FinitePoint(0, 0.2000000000000000?)
|
92
95
|
|
93
96
|
"""
|
@@ -107,28 +110,30 @@ def compute_midpoint_of_triangle_edge_with_offset(idealPoints, offset):
|
|
107
110
|
|
108
111
|
transformedMidpoint = _compute_midpoint_helper(
|
109
112
|
b, c, offset)
|
110
|
-
|
113
|
+
|
111
114
|
return _translate(transformedMidpoint, inv_sl_matrix)
|
112
115
|
|
116
|
+
|
113
117
|
def compute_midpoint_two_horospheres_from_triangle(
|
114
118
|
idealPoints, intersectionLengths):
|
115
119
|
|
116
120
|
a, b, c = idealPoints
|
117
|
-
la, lb
|
121
|
+
la, lb = intersectionLengths
|
118
122
|
|
119
123
|
if a == Infinity:
|
120
|
-
return _compute_midpoint_helper(b, c,
|
124
|
+
return _compute_midpoint_helper(b, c, (lb / la).sqrt())
|
121
125
|
if b == Infinity:
|
122
|
-
return _compute_midpoint_helper(a, c,
|
126
|
+
return _compute_midpoint_helper(a, c, (la / lb).sqrt())
|
123
127
|
|
124
128
|
(b, c), inv_sl_matrix = (
|
125
129
|
_transform_points_to_make_first_one_infinity_and_inv_sl_matrix(
|
126
130
|
idealPoints))
|
127
131
|
|
128
|
-
transformedMidpoint = _compute_midpoint_helper(b, c,
|
129
|
-
|
132
|
+
transformedMidpoint = _compute_midpoint_helper(b, c, (lb / la).sqrt())
|
133
|
+
|
130
134
|
return _translate(transformedMidpoint, inv_sl_matrix)
|
131
|
-
|
135
|
+
|
136
|
+
|
132
137
|
def compute_incenter_of_triangle(idealPoints):
|
133
138
|
"""
|
134
139
|
Computes incenter of the triangle spanned by three ideal points::
|
@@ -147,12 +152,13 @@ def compute_incenter_of_triangle(idealPoints):
|
|
147
152
|
transformedIdealPoints, inv_sl_matrix = (
|
148
153
|
_transform_points_to_make_one_infinity_and_inv_sl_matrix(idealPoints))
|
149
154
|
|
150
|
-
transformedInCenter =(
|
155
|
+
transformedInCenter = (
|
151
156
|
_compute_incenter_of_triangle_with_one_point_at_infinity(
|
152
157
|
transformedIdealPoints))
|
153
158
|
|
154
159
|
return _translate(transformedInCenter, inv_sl_matrix)
|
155
160
|
|
161
|
+
|
156
162
|
def compute_inradius_and_incenter(idealPoints):
|
157
163
|
"""
|
158
164
|
Computes inradius and incenter of the tetrahedron spanned by four
|
@@ -163,10 +169,10 @@ def compute_inradius_and_incenter(idealPoints):
|
|
163
169
|
sage: z1 = CIF(0)
|
164
170
|
sage: z2 = CIF(1)
|
165
171
|
sage: z3 = CIF(1.2, 1.0)
|
166
|
-
sage: compute_inradius_and_incenter([z0, z1, z2, z3])
|
172
|
+
sage: compute_inradius_and_incenter([z0, z1, z2, z3]) # doctest: +NUMERIC12
|
167
173
|
(0.29186158033099?, FinitePoint(0.771123016231387? + 0.2791850380434060?*I, 0.94311979279000?))
|
168
174
|
"""
|
169
|
-
|
175
|
+
|
170
176
|
if not len(idealPoints) == 4:
|
171
177
|
raise Exception("Expected 4 ideal points.")
|
172
178
|
|
@@ -179,6 +185,7 @@ def compute_inradius_and_incenter(idealPoints):
|
|
179
185
|
|
180
186
|
return inradius, _translate(transformedInCenter, inv_sl_matrix)
|
181
187
|
|
188
|
+
|
182
189
|
def Euclidean_height_of_hyperbolic_triangle(idealPoints):
|
183
190
|
"""
|
184
191
|
Computes the Euclidean height of the hyperbolic triangle spanned by three
|
@@ -191,20 +198,20 @@ def Euclidean_height_of_hyperbolic_triangle(idealPoints):
|
|
191
198
|
sage: z1 = CIF(1)
|
192
199
|
sage: Euclidean_height_of_hyperbolic_triangle([z0, z1, Infinity])
|
193
200
|
[+infinity .. +infinity]
|
194
|
-
|
201
|
+
|
195
202
|
sage: Euclidean_height_of_hyperbolic_triangle([z0, z1, CIF(0.5, 0.8)]) # doctest: +NUMERIC12
|
196
203
|
0.556250000000000?
|
197
|
-
|
204
|
+
|
198
205
|
sage: Euclidean_height_of_hyperbolic_triangle([z0, z1, CIF(10, 0.001)]) # doctest: +NUMERIC12
|
199
206
|
5.000000025000000?
|
200
207
|
|
201
208
|
"""
|
202
|
-
|
209
|
+
|
203
210
|
if Infinity in idealPoints:
|
204
211
|
for idealPoint in idealPoints:
|
205
212
|
if idealPoint != Infinity:
|
206
213
|
RIF = idealPoint.real().parent()
|
207
|
-
return RIF(
|
214
|
+
return RIF(sage_Infinity)
|
208
215
|
|
209
216
|
raise Exception("What?")
|
210
217
|
|
@@ -218,26 +225,25 @@ def Euclidean_height_of_hyperbolic_triangle(idealPoints):
|
|
218
225
|
return lengths[i] / 2
|
219
226
|
|
220
227
|
# a + b + c
|
221
|
-
length_total
|
228
|
+
length_total = sum(lengths)
|
222
229
|
# a * b * c
|
223
|
-
length_product =
|
230
|
+
length_product = lengths[0] * lengths[1] * lengths[2]
|
224
231
|
|
225
|
-
# - a + b + c, a - b + c, a + b - c
|
226
|
-
terms = [ - lengths[0] + lengths[1] + lengths[2],
|
227
|
-
lengths[0] - lengths[1] + lengths[2],
|
228
|
-
lengths[0] + lengths[1] - lengths[2] ]
|
229
|
-
|
230
232
|
# (-a + b + c) * (a - b + c) * (a + b - c)
|
231
|
-
terms_product =
|
233
|
+
terms_product = (
|
234
|
+
(- lengths[0] + lengths[1] + lengths[2]) *
|
235
|
+
( lengths[0] - lengths[1] + lengths[2]) *
|
236
|
+
( lengths[0] + lengths[1] - lengths[2]))
|
232
237
|
|
233
238
|
# Compute circumradius R of Euclidean triangle using
|
234
239
|
# a * b * c / (4 * A) and Heron's formula.
|
235
|
-
return length_product /
|
240
|
+
return length_product / (terms_product * length_total).sqrt()
|
236
241
|
|
237
242
|
################################################################################
|
238
243
|
#
|
239
244
|
# Various helper functions
|
240
245
|
|
246
|
+
|
241
247
|
def _transform_points_to_make_one_infinity_and_inv_sl_matrix(idealPoints):
|
242
248
|
"""
|
243
249
|
Returns a pair (transformedIdealPoints, matrix) where matrix has determinant
|
@@ -253,13 +259,14 @@ def _transform_points_to_make_one_infinity_and_inv_sl_matrix(idealPoints):
|
|
253
259
|
return _transform_points_to_make_first_one_infinity_and_inv_sl_matrix(
|
254
260
|
idealPoints)
|
255
261
|
|
262
|
+
|
256
263
|
def _transform_points_to_make_first_one_infinity_and_inv_sl_matrix(idealPoints):
|
257
264
|
|
258
265
|
# Determine the matrix
|
259
266
|
z = idealPoints[0]
|
260
267
|
CIF = z.parent()
|
261
|
-
gl_matrix = matrix(CIF, [[ 0,
|
262
|
-
sl_matrix = CIF(
|
268
|
+
gl_matrix = matrix(CIF, [[ 0, 1], [ 1, -z]])
|
269
|
+
sl_matrix = CIF(I) * gl_matrix
|
263
270
|
inv_sl_matrix = _adjoint2(sl_matrix)
|
264
271
|
|
265
272
|
# Apply it
|
@@ -267,6 +274,7 @@ def _transform_points_to_make_first_one_infinity_and_inv_sl_matrix(idealPoints):
|
|
267
274
|
[ apply_Moebius(gl_matrix, u) for u in idealPoints[1:] ],
|
268
275
|
inv_sl_matrix)
|
269
276
|
|
277
|
+
|
270
278
|
def _translate(finitePoint, sl_matrix):
|
271
279
|
"""
|
272
280
|
Apply translation if matrix is not None.
|
@@ -276,14 +284,17 @@ def _translate(finitePoint, sl_matrix):
|
|
276
284
|
return finitePoint.translate_PSL(sl_matrix)
|
277
285
|
return finitePoint
|
278
286
|
|
287
|
+
|
279
288
|
def _compute_midpoint_helper(b, c, offset):
|
280
289
|
height = abs(c - b) * offset
|
281
290
|
return FinitePoint(b, height)
|
282
291
|
|
292
|
+
|
283
293
|
def _compute_incenter_of_triangle_with_one_point_at_infinity(nonInfPoints):
|
284
294
|
a, b = nonInfPoints
|
285
295
|
RIF = a.real().parent()
|
286
|
-
return FinitePoint((a + b) / 2, abs(a - b) *
|
296
|
+
return FinitePoint((a + b) / 2, abs(a - b) * RIF(3).sqrt() / 2)
|
297
|
+
|
287
298
|
|
288
299
|
def _compute_inradius_and_incenter_with_one_point_at_infinity(nonInfPoints):
|
289
300
|
"""
|
@@ -293,7 +304,7 @@ def _compute_inradius_and_incenter_with_one_point_at_infinity(nonInfPoints):
|
|
293
304
|
|
294
305
|
if not len(nonInfPoints) == 3:
|
295
306
|
raise Exception("Expects three non-infinite points.")
|
296
|
-
|
307
|
+
|
297
308
|
# Pts contains three complex numbers spanning the ideal tetrahedron
|
298
309
|
# together with infinity.
|
299
310
|
|
@@ -302,28 +313,26 @@ def _compute_inradius_and_incenter_with_one_point_at_infinity(nonInfPoints):
|
|
302
313
|
lengths = [ abs(nonInfPoints[(i+2) % 3] - nonInfPoints[(i+1) % 3])
|
303
314
|
for i in range(3) ]
|
304
315
|
# a + b + c
|
305
|
-
length_total
|
316
|
+
length_total = sum(lengths)
|
306
317
|
# a * b * c
|
307
|
-
length_product =
|
318
|
+
length_product = lengths[0] * lengths[1] * lengths[2]
|
308
319
|
|
309
|
-
# - a + b + c, a - b + c, a + b - c
|
310
|
-
terms = [ - lengths[0] + lengths[1] + lengths[2],
|
311
|
-
lengths[0] - lengths[1] + lengths[2],
|
312
|
-
lengths[0] + lengths[1] - lengths[2] ]
|
313
|
-
|
314
320
|
# (-a + b + c) * (a - b + c) * (a + b - c)
|
315
|
-
terms_product =
|
321
|
+
terms_product = (
|
322
|
+
( - lengths[0] + lengths[1] + lengths[2]) *
|
323
|
+
( lengths[0] - lengths[1] + lengths[2]) *
|
324
|
+
( lengths[0] + lengths[1] - lengths[2]))
|
316
325
|
|
317
326
|
# Heron's formula gives us the area as of the Euclidean triangle as
|
318
327
|
# A = sqrt(length_total * terms_product / 16) = r * length_total / 2
|
319
328
|
# Thus, we can compute the inradius r as:
|
320
|
-
inRadiusSqr
|
321
|
-
inRadius
|
322
|
-
|
329
|
+
inRadiusSqr = terms_product / length_total / 4
|
330
|
+
inRadius = inRadiusSqr.sqrt()
|
331
|
+
|
323
332
|
# The circumradius R of the Euclidean triangle is given by
|
324
333
|
# a * b * c / (4 * A), so we can compute it as:
|
325
|
-
circumRadius = length_product /
|
326
|
-
|
334
|
+
circumRadius = length_product / (terms_product * length_total).sqrt()
|
335
|
+
|
327
336
|
# Euler's formula gives us the distance d between the incenter and the
|
328
337
|
# circumcenter is given d^2 = R^2 - 2 * r * R.
|
329
338
|
# We obtain a Euclidean right triangle formed by the in- and circumcenter
|
@@ -335,19 +344,21 @@ def _compute_inradius_and_incenter_with_one_point_at_infinity(nonInfPoints):
|
|
335
344
|
# R. The other leg of the right triangle which is the Euclidean height h
|
336
345
|
# of the Euclidean center of the inscribed sphere is given by Pythagoras
|
337
346
|
# h^2 + d^2 = (r + R)^2, so h = r^2 + 4 * r * R
|
338
|
-
eHeightSqr
|
339
|
-
eHeight
|
347
|
+
eHeightSqr = inRadiusSqr + 4 * inRadius * circumRadius
|
348
|
+
eHeight = eHeightSqr.sqrt()
|
340
349
|
|
341
350
|
# Next, we compute the Euclidean height of hyperbolic center of the
|
342
351
|
# inscribed sphere
|
343
352
|
# We use the geometric mean of the Euclidean heights of the lowest and
|
344
353
|
# highest point of the inscribed sphere
|
345
354
|
# sqrt( (h + r) * (h - r))
|
346
|
-
|
355
|
+
#
|
356
|
+
# height is also equal to (2 * length_product / length_total).sqrt()
|
357
|
+
height = ( eHeightSqr - inRadiusSqr ).sqrt()
|
347
358
|
|
348
|
-
# Taking the logarithm of the ratio of these two highest gives the
|
359
|
+
# Taking the logarithm of the ratio of these two highest gives the
|
349
360
|
# hyperbolic diameter of the inscribed sphere.
|
350
|
-
radius
|
361
|
+
radius = ( (eHeight + inRadius) / (eHeight - inRadius) ).log() / 2
|
351
362
|
|
352
363
|
# The barycentric coordinates of the circumcenter are simply a : b : c.
|
353
364
|
incenter = sum([ pt * l
|
@@ -355,6 +366,7 @@ def _compute_inradius_and_incenter_with_one_point_at_infinity(nonInfPoints):
|
|
355
366
|
|
356
367
|
return radius, FinitePoint(incenter, height)
|
357
368
|
|
369
|
+
|
358
370
|
def _adjoint2(m):
|
359
371
|
"""
|
360
372
|
Sage matrix.adjoint() produces an unnecessary large interval for
|
@@ -363,6 +375,7 @@ def _adjoint2(m):
|
|
363
375
|
|
364
376
|
return matrix([[m[1,1], -m[0, 1]], [-m[1, 0], m[0, 0]]])
|
365
377
|
|
378
|
+
|
366
379
|
def _diff_1_if_inf(a, b):
|
367
380
|
if a == Infinity or b == Infinity:
|
368
381
|
return 1
|
@@ -372,7 +385,8 @@ def _diff_1_if_inf(a, b):
|
|
372
385
|
#
|
373
386
|
# TESTING
|
374
387
|
|
375
|
-
|
388
|
+
|
389
|
+
class _IdealPointTester():
|
376
390
|
|
377
391
|
"""
|
378
392
|
A test rig for idealPoint
|
@@ -384,8 +398,7 @@ class _IdealPointTester(object):
|
|
384
398
|
"""
|
385
399
|
|
386
400
|
def matrices(self):
|
387
|
-
from
|
388
|
-
|
401
|
+
from ...sage_helper import RIF, CIF
|
389
402
|
return [
|
390
403
|
matrix.identity(CIF, 2),
|
391
404
|
matrix(
|
@@ -396,8 +409,7 @@ class _IdealPointTester(object):
|
|
396
409
|
[CIF(RIF(-0.3), RIF(1.1)), CIF(1)]]) ]
|
397
410
|
|
398
411
|
def run_tests(self):
|
399
|
-
from
|
400
|
-
|
412
|
+
from ...sage_helper import RIF, CIF
|
401
413
|
bias = RIF(1.5)
|
402
414
|
|
403
415
|
triangle = [ CIF(0), Infinity, CIF(1) ]
|
snappy/verify/volume.py
CHANGED
@@ -5,6 +5,7 @@ if _within_sage:
|
|
5
5
|
from sage.rings.complex_interval_field import ComplexIntervalField
|
6
6
|
try:
|
7
7
|
import sage.rings.abc
|
8
|
+
|
8
9
|
def is_ComplexIntervalField(z):
|
9
10
|
return isinstance(z, sage.rings.abc.ComplexIntervalField)
|
10
11
|
except ImportError:
|
@@ -14,7 +15,7 @@ if _within_sage:
|
|
14
15
|
|
15
16
|
__all__ = ['compute_volume']
|
16
17
|
|
17
|
-
from . import
|
18
|
+
from . import hyperbolicity
|
18
19
|
|
19
20
|
# Sage's handling of pari has a bug when it comes to precision and the dilog.
|
20
21
|
# It computes the dilogarithm only to low precision even though higher precision
|
@@ -27,6 +28,7 @@ from . import verifyHyperbolicity
|
|
27
28
|
# We work around this by converting to snappy.Number where a work-around for this was
|
28
29
|
# implemented.
|
29
30
|
|
31
|
+
|
30
32
|
def _unprotected_volume_from_shape(z):
|
31
33
|
"""
|
32
34
|
Computes the Bloch-Wigner dilogarithm for z assuming z is of a type that
|
@@ -55,9 +57,10 @@ def _unprotected_volume_from_shape(z):
|
|
55
57
|
# the interval for the imaginary part of z contains zero if and only if
|
56
58
|
# the imaginary part of 1-z contains zero, so the same branch cut is chosen
|
57
59
|
# for (1-z).arg() and z.polylog(2).
|
58
|
-
|
60
|
+
|
59
61
|
return (1-z).arg() * z.abs().log() + z.polylog(2).imag()
|
60
62
|
|
63
|
+
|
61
64
|
def _volume_from_shape(z):
|
62
65
|
"""
|
63
66
|
Computes the Bloch-Wigner dilogarithm for z which gives the volume of a
|
@@ -75,10 +78,10 @@ def _volume_from_shape(z):
|
|
75
78
|
# Thus, we convert to ComplexBallField here since the arblib
|
76
79
|
# supports a verified interval polylog (albeit giving an interval
|
77
80
|
# that seems to be 300 times larger than necessary).
|
78
|
-
|
81
|
+
|
79
82
|
CBF = ComplexBallField(CIF.precision())
|
80
83
|
RIF = RealIntervalField(CIF.precision())
|
81
|
-
|
84
|
+
|
82
85
|
return RIF(_unprotected_volume_from_shape(CBF(z)))
|
83
86
|
else:
|
84
87
|
z = Number(z)
|
@@ -87,34 +90,34 @@ def _volume_from_shape(z):
|
|
87
90
|
# have to explicitly give a precision to dilog, otherwise you lose
|
88
91
|
# precision.
|
89
92
|
return z.volume()
|
90
|
-
|
91
|
-
|
93
|
+
|
94
|
+
|
95
|
+
def compute_volume(manifold, verified, bits_prec=None):
|
92
96
|
"""
|
93
97
|
Computes the volume of the given manifold. If verified is used,
|
94
98
|
the hyperbolicity is checked rigorously and the volume is given as
|
95
99
|
verified interval.
|
96
100
|
|
97
101
|
>>> M = Manifold('m004')
|
98
|
-
>>> vol = M.volume(bits_prec=100)
|
102
|
+
>>> vol = M.volume(bits_prec=100)
|
99
103
|
>>> vol # doctest: +ELLIPSIS
|
100
104
|
2.029883212819307250042405108...
|
101
|
-
|
105
|
+
|
102
106
|
sage: ver_vol = M.volume(verified=True)
|
103
107
|
sage: vol in ver_vol
|
104
108
|
True
|
105
109
|
sage: 2.02988321283 in ver_vol
|
106
110
|
False
|
107
111
|
"""
|
108
|
-
|
109
112
|
# Compute tetrahedra shapes to arbitrary precision. If requested,
|
110
113
|
# verify that this is indeed a solution to the polynomial gluing
|
111
114
|
# equations.
|
112
115
|
shape_intervals = manifold.tetrahedra_shapes(
|
113
|
-
'rect', bits_prec
|
114
|
-
|
116
|
+
'rect', bits_prec=bits_prec, intervals=verified)
|
117
|
+
|
115
118
|
if verified:
|
116
119
|
# If requested, check it is a valid hyperbolic structure
|
117
|
-
|
120
|
+
hyperbolicity.check_logarithmic_gluing_equations_and_positively_oriented_tets(
|
118
121
|
manifold, shape_intervals)
|
119
122
|
|
120
123
|
# Sum up the volumes of all the tetrahedra
|
snappy/version.py
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
release_date = 'December 2021'
|
1
|
+
version = '3.2'
|
2
|
+
release_date = 'January 2025'
|