-
-
Notifications
You must be signed in to change notification settings - Fork 656
Description
As reported in this sage-devel thread:
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
Component: algebra
Author: Dave Morris
Branch/Commit: b50426f
Reviewer: Martin Rubey
Issue created by migration from https://trac.sagemath.org/ticket/34733