Dear Sage team,

consider the following example (in Sage 3.1.2):
sage: R.<t>=ZZ[]
sage: P=(1 + 4*t + 8*t^2 + 10*t^3 + 12*t^4 + 13*t^5 + 16*t^6 + 20*t^7
+ 16*t^8 + 13*t^9 + 12*t^10 + 10*t^11 + 8*t^12 + 4*t^13 + t^14)
sage: Q=(1-t^8)^2
sage:
p=t^12+2*t^11+3*t^10+2*t^9+5*t^8+t^7+9*t^6+t^5+5*t^4+2*t^3+3*t^2+2*t+1
sage: q=(t-1)^2*(t^2+1)^2*(t^4+1)^2

P and Q are just multiples of p and q:
sage: P/(t+1)^2==p
True
sage: Q/(t+1)^2==q
True

So, the quotients should be the same, right? But Sage claims they
aren't:
sage: P/Q == p/q
False
sage: (p*(t+1)^2)/(q*(t+1)^2)==p/q
False


It seems that the gcd is broken as well (perhaps this is the reason
for the above error):
sage: P.gcd(Q)
t^2 + 2*t + 1   # hence, it finds the common factor (t+1)^2
sage: p.gcd(q)
t^2 - 2*t + 1    # hence, this should be a factor of p*(t+1)^2, too
sage: (t^2-2*t+1).divides(P)
False             # ... but it isn't

Even worse:
sage: (p.gcd(q)).divides(p)
False

Hence, the gcd is not a divisor!?!

Nevertheless, the quotient seems fine:
sage: p/p.gcd(q)
t^10 + 4*t^9 + 10*t^8 + 18*t^7 + 31*t^6 + 45*t^5 + 68*t^4 + 92*t^3 +
121*t^2 + 152*t + 186

... but not after multiplying with (t+1)^2:
sage: (p*(t+1)^2)/p.gcd(q)
(t^14 + 4*t^13 + 8*t^12 + 10*t^11 + 12*t^10 + 13*t^9 + 16*t^8 + 20*t^7
+ 16*t^6 + 13*t^5 + 12*t^4 + 10*t^3 + 8*t^2 + 4*t + 1)/(t^2 - 2*t + 1)

Shall I open a ticket?
Or has anybody a quick work around?
E.g., is there something like good old polynomial division implemented
in Sage?

Yours
       Simon

--~--~---------~--~----~------------~-------~--~----~
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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to