-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python code for cusp shapes: moving it from verify to cusps.
- Loading branch information
1 parent
812e90e
commit 6c376ed
Showing
6 changed files
with
54 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,38 @@ | ||
""" | ||
Picking cusp neighborhoods and exceptional slopes. | ||
Computing data about cusps such as cusp matrix, shape, translations | ||
and exceptional slopes. | ||
""" | ||
|
||
from ..geometric_structure.cusp_neighborhood.complex_cusp_cross_section import ComplexCuspCrossSection | ||
from ..verify.shapes import compute_hyperbolic_shapes | ||
from ..exceptions import NonorientableManifoldError | ||
|
||
def compute_cusp_shapes(manifold, verified, bits_prec=None): | ||
""" | ||
Compute verified cusp shapes (following the SnapPea kernel convention, | ||
it returns the conjugate of the quotient of the translations | ||
corresponding to the longitude and meridian for each cusp. | ||
>>> M = Manifold('s843') | ||
>>> M.cusp_info('shape', bits_prec = 100) # doctest: +NUMERIC21 | ||
[0.46738227586341496791816972792 + 1.1903600506742881207098973751*I, 0.084187324414612694374797271558 + 1.0506945576790020048456757228*I] | ||
sage: M = Manifold('s843') | ||
sage: M.cusp_info('shape', verified = True) # doctest: +NUMERIC12 | ||
[0.46738227587? + 1.19036005068?*I, 0.0841873244146? + 1.0506945576790?*I] | ||
sage: M.cusp_info('shape', verified = True, bits_prec = 100) # doctest: +NUMERIC21 | ||
[0.4673822758634149679181698? + 1.1903600506742881207098974?*I, 0.084187324414612694374797272? + 1.050694557679002004845675723?*I] | ||
""" | ||
|
||
if not manifold.is_orientable(): | ||
raise NonorientableManifoldError(manifold) | ||
|
||
shapes = compute_hyperbolic_shapes( | ||
manifold, verified=verified, bits_prec=bits_prec) | ||
|
||
# Compute cusp cross section | ||
c = ComplexCuspCrossSection.fromManifoldAndShapes(manifold, shapes) | ||
|
||
# Compute shape | ||
return c.cusp_shapes() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
# Exceptions from the SnapPea kernel | ||
class SnapPeaFatalError(Exception): | ||
""" | ||
This exception is raised by SnapPy when the SnapPea kernel | ||
encounters a fatal error. | ||
Exception raised by SnapPy when the SnapPea kernel encounters a fatal | ||
error. | ||
""" | ||
|
||
|
||
class InsufficientPrecisionError(Exception): | ||
""" | ||
This exception is raised when a computation fails and is likely | ||
to succeed if higher precision is used. | ||
Exception raised when a computation fails and is likely to succeed if | ||
higher precision is used. | ||
""" | ||
|
||
class NonorientableManifoldError(ValueError): | ||
""" | ||
Exception raised when a non-orientable manifold is given to a method | ||
only supporting orientable manifolds. | ||
""" | ||
def __init__(self, manifold): | ||
self.manifold = manifold | ||
|
||
def __str__(self): | ||
return ('Computation only supports orientable manifolds but %s is ' | ||
'non-orientable') % self.manifold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.