On Mon, Apr 14, 2025 at 10:58 AM Nils Bruin <nbr...@sfu.ca> wrote: > > It looks like a is an element of "Qbar". Elements there are tracked by > keeping track of a way to compute a polynomial it is a root of as well as a > complex "ball" that allows one to distinguish it from other roots of the > polynomial. Certain operations will force the actual computation of the > minimal polynomial. In the process one may discover information about the > number. For instance, one may find it is actually rational or that it is > real. Such info is then kept and may affect how the element prints. The > representation that you get the first time is consistent with the imaginary > part being 0. Computing the minimal polynomial then has the side effect of > discovering that the imaginary part really is 0 rather than "not > distinguished from 0" that you get the first time. > > It looks like the system is working as specified.
One would wish there was a way to tell the system from the beginning that this particular polynomial has only real roots. Perhaps there is an easy way to implement is (a class of real-rooted polynomials), no? Dima > > On Monday, 14 April 2025 at 00:37:12 UTC-7 Georgi Guninski wrote: >> >> I think this is at least one bug on 10.5 on linux, attached is testcase >> >> F=Graph(SNIP) #90 vertices >> spe=F.spectrum() >> a=spe[64] >> print("(1):a=",a) #(1) -1.717980512878350? + 0.?e-60*I #XXX imaginary part >> print("(2):a=",a,"poly=",a.minpoly()) #(2): -1.717980512878350? poly= >> x^4 + 5*x^3 - 19*x - 16 #XXX imaginary part vanishes >> """ >> 1. The spectrum must be real with no imaginary part >> 2. Why the imaginary part disappears after only print() >> """ > > -- > 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 view this discussion visit > https://groups.google.com/d/msgid/sage-devel/16ea668c-b6df-45b2-87fd-d2d76a7d9c68n%40googlegroups.com. -- 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 view this discussion visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq1UUnp8DZDVGbt-Q%2Bdk16Tf2%2B2rWdDnFmtZb-40RJd3MA%40mail.gmail.com.