-
-
Notifications
You must be signed in to change notification settings - Fork 658
Description
On sage 9.3, the following code unexpectedly prints False
:
Q.<i,j,k> = QuaternionAlgebra(-1,-19)
I = Q.maximal_order().unit_ideal()
print(I.scale(1) == I)
(This behaviour was discovered by Jana Sotáková.)
Cause: The .scale()
method for QuaternionFractionalIdeal_rational
passes the set of generators of the scaled ideal to the parent algebra's .ideal()
method as a list
, whereas other code seems to assume that the basis is stored as a tuple
. In particular, the __eq__
method for QuaternionFractionalIdeal_rational
simply compares the __basis
members, and since a list is never equal to a tuple, the equality tested in the snippet above fails even though scaling an ideal by 1 clearly shouldn't change anything.
Fix: Compare HNF bases everywhere (see the discussion below).
Depends on #31582
CC: @slel
Component: algebra
Keywords: quaternion ideals
Stopgaps: mathematically_wrong
Author: Lorenz Panny, Peter Bruin
Branch/Commit: 7159ed8
Reviewer: Samuel Lelièvre
Issue created by migration from https://trac.sagemath.org/ticket/32245