Hi

I use AA(2*cos(pi/n)) for the default embedding in the corresponding
(totally real) NumberField (of which I later take a relative (real) quadratic extension for which I also try to find the "correct"
embedding). -> Ticket #16936, #16976.

I choose "AA" as my "default embedding field" because it coerces nicely
into many fields (in particular into AA).

I do comparisons/signs in many places (e.g. for continued fraction
calculations). The sign should ideally be exact (-1, 0, 1).

The problem with comparison/signs is reoccuring and prevents / slows
down many calculations. :(

What would you suggest I do to get a fast exact sign/comparison?


Best
    Jonas

On 17.09.2014 16:52, John Cremona wrote:
You are doing the right thing, but AA (and QQbar) are very slow at
testing equality -- and hence also at division since the denominator
must be tested for equality with 0.

In this case since el1.minpoly() and el2.minpoly() are the same, and
the roots in RR are very different:

sage: el1.minpoly()
x^4 - 2238072*x^2 + 44133904
sage: el2.minpoly()
x^4 - 2238072*x^2 + 44133904
sage: el2.minpoly().roots(RR)
[(-1496.01212569203, 1),
  (-4.44069616336440, 1),
  (4.44069616336440, 1),
  (1496.01212569203, 1)]

it is hard to believe that there is not a quicker way of doing the
test.  (It is also relevant that
sage: el1.minpoly().is_irreducible()
True

here, since in general during a computation in AA/QQbar, the
polynomials carried around are not factored.  i think.)  Also note
that

sage: el1.minpoly()(el2) ==0
True
!

John

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to