thofma / Hecke.jl

Computational algebraic number theory
Other
236 stars 65 forks source link

Iterators for matrix_space broken #1299

Open mkirschm opened 11 months ago

mkirschm commented 11 months ago

Iterators for 0-dimensional matrix spaces should not fail but return the zero element and nothing for subsequent calls

julia> k = GF(3);
julia> m = matrix_space(k, 0, 1);
julia> for x in m ; end
ERROR: BoundsError: attempt to access 0-element Vector{Nemo.fpField} at index [1]

Matrix algebras over finite rings should define an iterator:

julia> m = matrix_algebra(k, 1);
julia> for x in m; end
ERROR: MethodError: no method matching iterate(::AlgMat{fpFieldElem, fpMatrix})
fingolfin commented 10 months ago

The first issue really is an issue in AbstractAlgebra; I've posted a fix at https://github.com/Nemocas/AbstractAlgebra.jl/pull/1527

The second issue indeed is indeed Hecke specific.