[Bug report] quaternionic polynomial division gives incorrect results

40 views
Skip to first unread message

Przemysław Koprowski

unread,
Nov 8, 2022, 5:20:51 AM11/8/22
to sage-devel
Hello everyone,

I just discovered a bug in the polynomial division over quaternion algebras. I don't see it discussed anywhere on the internet, so I believe this is a proper place to report it.

Bug description: the quo_rem method for polynomials with quaternionic coefficients outputs incorrect results. Moreover, there is no way to specify whether we want a right or left division. Here is a specific example.

# Take the quaternion algebra (-1, -1)_QQ and the ring of polynomials over it:
HH = QuaternionAlgebra(QQ, -1, -1)
P.<x> = HH[]
# Take two polynomials
f = x^3 + HH.0*x + (HH.1 + 2*HH.2); print("f =", f)
g = HH.2*x + HH.1 + 3; print("g =", g)
# Try to compute the quotient and remainder
q, r = f.quo_rem(g)
# Check the correctness of the result assuming that this is RIGHT division
print(q*g + r == f)
# Check the correctness of the result assuming that this is LEFT division
print(g*q + r == f)

Both tests output False. Tested on Sage 9.5.

Mathematical background: the division with the remainder for polynomials over division rings is well known and fully described e.g. in [1] even in a more general setting when the variable does not commute with the coefficients (in our case it does commute). So it is just a matter of proper implementation.

[1] Ore, Oystein. Theory of non-commutative polynomials. Ann. of Math. (2) 34 (1933), no. 3, 480--508. MR1503119



dmo...@deductivepress.ca

unread,
Nov 8, 2022, 2:27:42 PM11/8/22
to sage-devel
Thanks for reporting the bug. I opened trac ticket #34733 for this.
Reply all
Reply to author
Forward
0 new messages