#20330: hyperbolic_geodesic midpoint bugfix
-------------------------------------+-------------------------------------
Reporter: jhonrubia6 | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-7.2
Component: geometry | Resolution:
Keywords: hyperbolic | Merged in:
geometry, geodesic | Reviewers: Vincent Delecroix
Authors: Javier Honrubia | Work issues:
González | Commit:
Report Upstream: N/A | 2ba1c96e25d7e128adc832bc4c4e4c51e8835b98
Branch: | Stopgaps:
u/jhonrubia6/hyperbolic_geodesic_midpoint_bugfix|
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
One way to check the sign would be to check the embedding in `CC` as
`CC(custom_I) == CC.gen()`.
And an other way to find `I` would be `(-P.one()).sqrt()`... but currently
there is no specification of this `sqrt` operation and sometimes you get a
symbolic element where you do not want to.
{{{
sage: (-QQ.one()).sqrt().parent()
Symbolic Ring
sage: (-RR.one()).sqrt().parent()
Complex Field with 53 bits of precision
sage: (-AA.one()).sqrt().parent()
Algebraic Field
sage: K = QuadraticField(-1)
sage: (-K.one()).sqrt().parent()
Number Field in a with defining polynomial x^2 + 1
sage: K = QuadraticField(2)
sage: (-K.one()).sqrt().parent()
Symbolic Ring
}}}
I guess it is reasonable to have a temporary function in `sage/rings/`
{{{
def imaginary_unit(ring):
r"""
Return the imaginary unit in ``ring`` or in its algebraic closure if
`-1` has no square root.
If ``ring`` has a defined embedding in some complex field, then the
imaginary unit is normalized so that its image in this complex field
is its canonical imaginary unit.
"""
...
}}}
We could make it better later on and possibly remove if we find some other
way. At the same time I would advocate that `.sqrt()` should return an
element in the same ring or, if it is not possible, in its algebraic
closure.
--
Ticket URL: <http://trac.sagemath.org/ticket/20330#comment:47>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.