Oscar.jl icon indicating copy to clipboard operation
Oscar.jl copied to clipboard

Inconsistent behaviour of kernel

Open joschmitt opened this issue 3 years ago • 0 comments

As already discussed in Slack, there is some inconsistency with what kernel returns (and in particular with kernel and nullspace). Sometimes the output just contains the basis, sometimes there are additional zero columns.

julia> M = matrix(GF(2), [ 1 0 1; 1 0 1]);

julia> kernel(M)[2] # calling Hecke
[0   1   0]
[1   0   0]
[0   1   0]

julia> nullspace(M)[2] # calling AbstractAlgebra
[0   1]
[1   0]
[0   1]

Also, the echelon structure is sometimes different:

julia> M = matrix(ZZ, [ 1 0 1; 1 0 1]);

julia> kernel(M)[2] # calling Hecke
[ 1   0]
[ 0   1]
[-1   0]

julia> nullspace(M)[2] # calling AbstractAlgebra
[0    1]
[1    0]
[0   -1]

Regarding the second point: I have the impression that the basis of the kernel is always in a reduced column echelon form, but this is not documented, so one cannot rely on it. Would it be possible to guarantee something here, like that the basis is always in lower-left reduced column echelon form?

joschmitt avatar Feb 08 '22 14:02 joschmitt