#11611: Equal ideals have different hashes
-----------------------------+----------------------------------------------
Reporter: jdemeyer | Owner: davidloeffler
Type: defect | Status: new
Priority: major | Milestone: sage-4.7.2
Component: number fields | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
-----------------------------+----------------------------------------------
In the code below, `I` and `I2` are equal ideals with equal HNF but they
have different hashes:
{{{
sage: K.<a> = NumberField(x^2 - x - 1)
sage: I = K.ideal(2 * a - 1)
sage: I2 = I.factor()[0][0]
sage: I == I2
True
sage: print I.__hash__(), I2.__hash__()
-7493989779944505313 -6341068275337658337
sage: print I.pari_hnf(), I2.pari_hnf()
[5, 2; 0, 1] [5, 2; 0, 1]
sage: print I.pari_hnf() == I2.pari_hnf()
True
sage: print I.pari_hnf().__hash__(), I2.pari_hnf().__hash__()
-7493989779944505313 -6341068275337658337
}}}
The `6600000000000003` below looks suspicious:
{{{
sage: I.pari_hnf().debug()
[&=0000000001ded308] MAT(lg=3):2600000000000003 0000000001ded2f0
0000000001ded2c0
mat(1,1) = [&=0000000001ded2d8] INT(lg=3):0200000000000003
(+,lgefint=3):4000000000000003 0000000000000005
mat(1,2) = [&=0000000001ded2a8] INT(lg=3):0200000000000003
(+,lgefint=3):4000000000000003 0000000000000002
mat(2,1) = gen_0
mat(2,2) = [&=0000000001ded290] INT(lg=3):0200000000000003
(+,lgefint=3):4000000000000003 0000000000000001
sage: I2.pari_hnf().debug()
[&=0000000001941938] MAT(lg=3):2600000000000003 0000000001941920
00000000019418f0
mat(1,1) = [&=0000000001941908] INT(lg=3):0200000000000003
(+,lgefint=3):6600000000000003 0000000000000005
mat(1,2) = [&=00000000019418d8] INT(lg=3):0200000000000003
(+,lgefint=3):4000000000000003 0000000000000002
mat(2,1) = gen_0
mat(2,2) = [&=00000000019418c0] INT(lg=3):0200000000000003
(+,lgefint=3):4000000000000003 0000000000000001
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11611>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en.