#21105: abs for number field element
------------------------------+-----------------------------
Reporter: vdelecroix | Type: enhancement
Status: new | Priority: major
Milestone: sage-7.3 | Component: number fields
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
------------------------------+-----------------------------
For a number field element `a`, `abs(a)` currently returns a floating
point real number
{{{
sage: K.<cbrt2> = NumberField(x^3 - 2, 'a', embedding=1.26)
sage: abs(cbrt2)
1.25992104989487
sage: parent(_)
Real Field with 53 bits of precision
}}}
If a coercion embedding is defined with value in `RR`, the absolute value
can be defined internally as it is the case for `AA`
{{{
sage: abs(AA(2).sqrt() - AA(2))
0.5857864376269049?
}}}
We propose to change the behavior for embedded number fields. Namely make
`abs` an internal operation.
As a (minor) consequence of the current behavior, the inequalities from
`sage.geometry.polyhedron.representation.Inequality` gets badly displayed
{{{
sage: K.<cbrt2> = NumberField(x^3 - 2, 'a', embedding=1.26)
sage: P = Polyhedron(vertices=[(1,1,cbrt2),(cbrt2,1,1)])
sage: P.inequalities()
(An inequality (-cbrt2^2 - cbrt2 - 1, 0, 0) x + 4.84732210186307 >= 0,
An inequality (cbrt2^2 + cbrt2 + 1, 0, 0) x - 3.84732210186307 >= 0)
}}}
--
Ticket URL: <https://trac.sagemath.org/ticket/21105>
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.