On Apr 5, 1:04 pm, Timo <[email protected]> wrote:
> Hello,
>
> I get an error message when trying to compare some algebraic numbers.
>
> Here is the simplest example I could get:
>
> {{{
> #!python
> sage: M = matrix(3, [0,0,1,1,0,1,0,1,0])
> sage: x = vector([0,0,1])
> sage: y = M.eigenvectors_left()[1][1][0]
> sage: z = M.eigenvectors_left()[2][1][0]
> sage: a = abs(x*y)
> sage: b = abs(x*z)
> sage: a
> 0.7548776662466928?
> sage: b
> 0.7548776662466928?
> sage: a == b # crashes
> [...]
> TypeError: Unable to convert number to real interval.
> sage: a*a == a*a # crashes
> [...]
> TypeError: Unable to convert number to real interval.
> sage: a == a #this works
> True
>
> }}}
>
> Thanks in advance,
> Timo
Hmm, it looks as though there is a weird bug in the interplay between
eigenvectors, AlgebraicNumber and abs. When trying to create a
directly by using
{{{
sage: R.<x> = QQbar[x]
sage: exp = x^3 - x - 1
sage: s = exp.roots()[1][0]
sage: a = abs(s)
sage: a*a == a*a
True
}}}
and everything else seems fine too.
In your example above, Sage also breaks when calling a.minpoly(), but
it doesn't in the direct construction. I've opened a bug-ticket for
this error: http://trac.sagemath.org/sage_trac/ticket/11135
Thanks for reporting.
Cheers,
Johan
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org