Hi!
Apparently we use three essentially different ways of comparing
matrices:
sage: def test(K):
....: M1 = Matrix(K,[[1,0,0]])
....: M2 = Matrix(K,[[0,1,0]])
....: M3 = Matrix(K,[[0,1,1]])
....: M4 = Matrix(K,[[0,0,1]])
....: L = [M1,M2,M3,M4]
....: L.sort()
....: return L
....:
First group: Matrices over not too big fields of characteristic 2
sage: K = GF(2)
sage: test(K)
[[1 0 0], [0 1 0], [0 0 1], [0 1 1]]
sage: K = GF(4,'z')
sage: test(K)
[[1 0 0], [0 1 0], [0 0 1], [0 1 1]]
sage: K = GF(2^10,'q')
sage: test(K)
[[1 0 0], [0 1 0], [0 0 1], [0 1 1]]
Second group: Matrices over big finite fields of characteristic 2
sage: K = GF(2^100,'q')
sage: test(K)
[[1 0 0], [0 1 0], [0 1 1], [0 0 1]]
Third group: Matrices over all other rings
sage: K = GF(3)
sage: test(K)
[[0 0 1], [0 1 0], [0 1 1], [1 0 0]]
sage: K = GF(9,'z')
sage: test(K)
[[0 0 1], [0 1 0], [0 1 1], [1 0 0]]
sage: K = GF(3^100,'q')
sage: test(K)
[[0 0 1], [0 1 0], [0 1 1], [1 0 0]]
sage: K = QQ
sage: test(K)
[[0 0 1], [0 1 0], [0 1 1], [1 0 0]]
sage: K = ZZ
sage: test(K)
[[0 0 1], [0 1 0], [0 1 1], [1 0 0]]
sage: K.<x> = GF(2)[]
sage: test(K)
[[0 0 1], [0 1 0], [0 1 1], [1 0 0]]
sage: K.<x> = GF(3)[]
sage: test(K)
[[0 0 1], [0 1 0], [0 1 1], [1 0 0]]
sage: K.<x> = GF(4,'z')[]
sage: test(K)
[[0 0 1], [0 1 0], [0 1 1], [1 0 0]]
sage: K.<x> = GF(2^100,'z')[]
sage: test(K)
[[0 0 1], [0 1 0], [0 1 1], [1 0 0]]
I have opened trac ticket #13179 for the matrix comparison, and #13180
for comparison of elements of finite fields (or more precisely:
comparison of elements of big finite fields of characteristic 2, because
all other cases seem consistent).
Cheers,
Simon