From 00c532027ea3417d7dffd50d5c7fc5137e79a307 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Mon, 13 Nov 2023 17:28:55 +0100 Subject: [PATCH] don't assume R-module structure on basis (as a set) --- src/group_action_error.jl | 2 +- test/action_permutation.jl | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/group_action_error.jl b/src/group_action_error.jl index e3a8b51..23f741a 100644 --- a/src/group_action_error.jl +++ b/src/group_action_error.jl @@ -92,7 +92,7 @@ function __group_action_right_assoc( xᵍꜝʰ, s_g_h = action(action(hom), h, xᵍ) passed = s_gh == s_g * s_g_h && xᵍʰ == xᵍꜝʰ - return passed, s_gh * xᵍʰ, (s_g * s_g_h) * xᵍꜝʰ + return passed, (s_gh, xᵍʰ), (s_g * s_g_h, xᵍꜝʰ) end function __group_action_right_assoc( diff --git a/test/action_permutation.jl b/test/action_permutation.jl index 51aeed6..ac64584 100644 --- a/test/action_permutation.jl +++ b/test/action_permutation.jl @@ -26,12 +26,24 @@ function SymbolicWedderburn.action( return Word(w.alphabet, [w.letters[i]^p for i in eachindex(w.letters)]) end +struct OnLettersSigned <: SymbolicWedderburn.BySignedPermutations end +function SymbolicWedderburn.action( + ::OnLettersSigned, + p::PermutationGroups.AbstractPermutation, + w::Word, +) + return (Word(w.alphabet, [w.letters[i]^p for i in eachindex(w.letters)]), 1) +end + function allwords(A, radius) words = [Word(A, [i]) for i in 1:length(A)] for r in 2:radius append!( words, - [Word(A, collect(w)) for w in Iterators.product(fill(1:3, r)...)], + [ + Word(A, collect(w)) for + w in Iterators.product(fill(1:length(A), r)...) + ], ) end return words @@ -49,6 +61,10 @@ end end G = PermGroup(perm"(1,2,3)", perm"(1,2)") # G acts on words permuting letters + + @test SymbolicWedderburn.check_group_action(G, OnLetters(), words) + @test SymbolicWedderburn.check_group_action(G, OnLettersSigned(), words) + action = OnLetters() tbl = SymbolicWedderburn.CharacterTable(Rational{Int}, G) ehom = SymbolicWedderburn.CachedExtensionHomomorphism(