Skip to content

Commit

Permalink
allow specifying index type for CachedExtensionHomomorphism
Browse files Browse the repository at this point in the history
  • Loading branch information
kalmarek committed Nov 13, 2023
1 parent e710eda commit 02fad62
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/ext_homomorphisms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ StarAlgebras.basis(h::CachedExtensionHomomorphism) = basis(h.ehom)
action(h::CachedExtensionHomomorphism) = action(h.ehom)

function CachedExtensionHomomorphism(
::Type{I},
G::Group,
action::Action,
basis;
precompute = false,
)
hom = ExtensionHomomorphism(action, basis)
) where {I}
hom = ExtensionHomomorphism(I, action, basis)
S = typeof(induce(hom, one(G)))
chom = CachedExtensionHomomorphism{eltype(G),S}(hom)
@sync if precompute
Expand All @@ -96,6 +97,21 @@ function CachedExtensionHomomorphism(
return chom
end

function CachedExtensionHomomorphism(
G::Group,
action::Action,
basis;
precompute = false,
)
return CachedExtensionHomomorphism(
_int_type(ExtensionHomomorphism),
G,
action,
basis;
precompute = precompute,
)
end

function induce(ac::Action, chom::CachedExtensionHomomorphism, g::GroupElement)
return _induce(ac, chom, g)
end
Expand Down
11 changes: 11 additions & 0 deletions test/action_permutation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,23 @@ end
action = OnLetters()
tbl = SymbolicWedderburn.CharacterTable(Rational{Int}, G)
ehom = SymbolicWedderburn.CachedExtensionHomomorphism(
Int32,
G,
action,
words;
precompute = true,
)
@test all(g keys(ehom.cache) for g in G) # we actually cached
@test typeof(SymbolicWedderburn.induce(ehom, one(G))) == Perm{Int32}

ehom = SymbolicWedderburn.CachedExtensionHomomorphism(
G,
action,
words;
precompute = true,
)
@test all(g keys(ehom.cache) for g in G) # we actually cached
@test typeof(SymbolicWedderburn.induce(ehom, one(G))) == Perm{UInt16}

ψ = SymbolicWedderburn.action_character(ehom, tbl)
@test SymbolicWedderburn.constituents(ψ) == [40, 22, 18]
Expand Down

0 comments on commit 02fad62

Please sign in to comment.