#9439: hyperbolic geometry
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner: vdelecroix
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-6.4
Component: geometry | Resolution:
Keywords: hyperbolic | Merged in:
geometry, Poincare disc, upper | Reviewers: Johan Bosman, Travis
half plane, Beltrami-Klein, | Scrimshaw
hyperboloid model, sd35 | Work issues:
Authors: Vincent | Commit:
Delecroix, Martin Raum, Greg | 37287f35acfced2696dff3126e36cba8578a96f4
Laun, Travis Scrimshaw | Stopgaps:
Report Upstream: N/A |
Branch: |
public/geometry/hyperbolic-9439 |
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Vincent Delecroix, Martin Raum, Greg Laun, Travis
Scrimshaw', 'oldvalue': u'Vincent Delecroix, Martin Raum, Greg Laun'}):
* status: needs_review => needs_info
* reviewer: Johan Bosman => Johan Bosman, Travis Scrimshaw
* commit: b7fa036b162e09cc5500c0fc67633dcc2b9e6786 =>
37287f35acfced2696dff3126e36cba8578a96f4
* branch: public/ticket/9439 => public/geometry/hyperbolic-9439
* author: Vincent Delecroix, Martin Raum, Greg Laun => Vincent Delecroix,
Martin Raum, Greg Laun, Travis Scrimshaw
Comment:
Okay, so I've done a major refactoring in which I move everything into
Sage's category/parent/element framework. In doing so, I figured out why
all of the `@classmethod` bothered me (beyond the somewhat maze-like path
of methods); it was emulating a singleton pattern using classes rather
than instances. To me, this is a bad practice, so I'm now using
`UniqueRepresentation` (although this would benefit from switching to
#15247). So here's the other major points and structure.
* The models are parents using the `WithRealizations` framework, and the
points are the elements. I've setup the maps between the models are
coercions and have methods to also translate the geodesics and isometries.
Geodesics are just `SageObject`'s, but isometries are morphisms.
* I've changed the naming of some of the methods to better reflect their
operation (in particular, `orientation_preserving` to
`preserves_orientation`).
* I've kept most of the ease of implementing new models but by using the
coercions instead of the methods class.
* I've implemented a custom hash for isometries since compared equal but
had different hashes.
* More strict handling of points vs. coordinates and isometries vs.
matrices. This makes the programmers/users take more care about where
things belong and what one can do with them. This adds a little more
burden of wrapping and unwrapping, but it shouldn't make things much
(significant) difference in timings (I didn't check). Yet I would argue
this is a better way of doing things.
* Removed the `**graphic_options` from things like
`perpendicular_bisector` because it seemed out of place and makes it
easier to keep things consistent (plus 2 distinct steps for distinct
operations).
* There is only one big lazy import needed, and that is for
`HyperbolicPlane`, which is the global entry point. I've added a method
`HyperbolicSpace` for the future, but I didn't import it into the global
namespace.
Questions:
* If given an isometry, does one ask if it "is orientation preserving" or
"preserves orientation"?
* Should we keep with the `get_*` (ex. `get_point`) or just drop it to `*`
(ex. `point` resp.)? I'm somewhat in favor of the way it is now, but I
don't have a strong opinion.
Todo for positive review:
* Add doctests to remaining `hyperbolic_coercion.py` methods.
* Fix doctest failures coming from `_to_std_geod`. I'm pretty sure it is
not suppose to return an isometry (which is what causes the doctest
failures). Please advise.
Todos for the future:
* Make custom endosets for each model with the isometries as elements and
coercions implemented once homsets work with the coersion model (#14279
and possibly others).
* Implement a category for metric spaces.
I was quite impressed with the code and the interactions between
everything and hope we can get more of Sage-Manifolds into Sage (piece by
piece). So please test out, look over, and play with the refactored
version (making sure everything works as before).
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=a77a115a2031646a47884db894cc5804e248716c
a77a115]||{{{Merge branch 'public/ticket/9439' of trac.sagemath.org:sage
into public/geometry/hyperbolic-9439}}}||
||[http://git.sagemath.org/sage.git/commit/?id=87f703a2769d26d739c60861e63d0870b34a5635
87f703a]||{{{Some more trivial cleanup.}}}||
||[http://git.sagemath.org/sage.git/commit/?id=2759b74b3ba6d87c0c3b1cab81fd509d76b552d4
2759b74]||{{{Changed global interface to HyperbolicPlane.}}}||
||[http://git.sagemath.org/sage.git/commit/?id=0572434edc03d53f81b087d106fcc5584de248c5
0572434]||{{{About 85% of the refactoring is done and basic functionality
is working.}}}||
||[http://git.sagemath.org/sage.git/commit/?id=b203a5390284a678a4cf79c44f3f3c368c1a9fe9
b203a53]||{{{Some more refactoring and starting to fix doctests.}}}||
||[http://git.sagemath.org/sage.git/commit/?id=5747604de49da1b61dac10f7b42eae3e11f6c3e2
5747604]||{{{Merge branch 'develop' into
public/geometry/hyperbolic-9439}}}||
||[http://git.sagemath.org/sage.git/commit/?id=42f8a7d4b2a1942a558d86cc31fd6106b8bed92f
42f8a7d]||{{{More cleanup work.}}}||
||[http://git.sagemath.org/sage.git/commit/?id=872e453d3b274ee165e9041b4ba0d5751f377f7c
872e453]||{{{Finished refactoring and most doctest pass.}}}||
||[http://git.sagemath.org/sage.git/commit/?id=37287f35acfced2696dff3126e36cba8578a96f4
37287f3]||{{{Some more doctest and bug fixes.}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/9439#comment:52>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.