Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBreuer committed Feb 15, 2024
1 parent b217915 commit 9a08bbc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/src/Groups/matgroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ MatrixGroupElem{RE<:RingElem, T<:MatElem{RE}}
base_ring(G::MatrixGroup{RE}) where RE <: RingElem
degree(G::MatrixGroup)
centralizer(G::MatrixGroup{T}, x::MatrixGroupElem{T}) where T <: FinFieldElem
map_entries(R::Ring, G::MatrixGroup)
map_entries(f, G::MatrixGroup)
```

## Elements of matrix groups
Expand Down
30 changes: 12 additions & 18 deletions src/Groups/matrices/MatGrp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,7 @@ function Base.deepcopy_internal(x::MatrixGroupElem, dict::IdDict)
error("$x has neither :X nor :elm")
end

function change_base_ring(R::Ring, G::MatrixGroup)
g = dense_matrix_type(R)[]
for h in gens(G)
push!(g, map_entries(R, h.elm))
end
return matrix_group(g)
end
change_base_ring(R::Ring, G::MatrixGroup) = map_entries(R, G)

########################################################################
#
Expand Down Expand Up @@ -572,6 +566,17 @@ julia> order(map_entries(GF(3), G))
3
```
"""
function map_entries(f, G::MatrixGroup)
Ggens = gens(G)
if length(Ggens) == 0
z = f(zero(base_ring(G)))
return matrix_group(parent(z), degree(G), MatrixGroupElem[])
else
imgs = [map_entries(f, matrix(x)) for x in gens(G)]
return matrix_group(imgs)
end
end

function map_entries(R::Ring, G::MatrixGroup)
imgs = [map_entries(R, matrix(x)) for x in gens(G)]
return matrix_group(R, degree(G), imgs)
Expand All @@ -582,17 +587,6 @@ function map_entries(mp::Map, G::MatrixGroup)
return matrix_group(codomain(mp), degree(G), imgs)
end

function map_entries(f::Function, G::MatrixGroup)
Ggens = gens(G)
if length(Ggens) == 0
o = map_entries(f, matrix(one(G)))
return matrix_group(base_ring(o), degree(G), typeof(o)[])
else
imgs = [map_entries(f, matrix(x)) for x in gens(G)]
return matrix_group(imgs)
end
end


########################################################################
#
Expand Down

0 comments on commit 9a08bbc

Please sign in to comment.