-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from kalmarek/enh/dixon
Enh/dixon
- Loading branch information
Showing
16 changed files
with
894 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: CompatHelper | ||
on: | ||
schedule: | ||
- cron: '00 00 * * *' | ||
workflow_dispatch: | ||
jobs: | ||
CompatHelper: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Pkg.add("CompatHelper") | ||
run: julia -e 'using Pkg; Pkg.add("CompatHelper")' | ||
- name: CompatHelper.main() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # optional | ||
run: julia -e 'using CompatHelper; CompatHelper.main()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: TagBot | ||
on: | ||
schedule: | ||
- cron: 0 * * * * | ||
jobs: | ||
TagBot: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: JuliaRegistries/TagBot@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
name = "SymbolicWedderburn" | ||
uuid = "858aa9a9-4c7c-4c62-b466-2421203962a2" | ||
authors = ["tweisser <tillmann.weisser@web.de>"] | ||
authors = ["Marek Kaluba <kalmar@amu.edu.pl>", "tweisser <tillmann.weisser@web.de>"] | ||
version = "0.1.0" | ||
|
||
[deps] | ||
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" | ||
Cyclotomics = "da8f5974-afbb-4dc8-91d8-516d5257c83b" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | ||
PermutationGroups = "8bc5a954-2dfc-11e9-10e6-cd969bffa420" | ||
Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae" | ||
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[compat] | ||
Cyclotomics = "0.1.2" | ||
PermutationGroups = "0.1.2" | ||
Primes = "0.4, 0.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
module SymbolicWedderburn | ||
|
||
using LinearAlgebra | ||
import AbstractAlgebra | ||
using Primes | ||
|
||
using Pkg | ||
Pkg.add(PackageSpec(url="https://github.com/kalmarek/PermutationGroups.jl")) | ||
using PermutationGroups | ||
using Cyclotomics | ||
|
||
include("gf.jl") | ||
include("eigenspacedecomposition.jl") | ||
include("ccmatrix.jl") | ||
|
||
include("characters.jl") | ||
include("powermap.jl") | ||
include("dixon.jl") | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,107 @@ | ||
AbstractAlgebra.exponent(G::AbstractAlgebra.AbstractPermutationGroup) = | ||
AbstractAlgebra.exponent(conjugacy_classes(G)) | ||
AbstractAlgebra.exponent(cclasses::AbstractVector) = | ||
lcm(AbstractAlgebra.order.(first.(cclasses))) | ||
dixon_prime(G::AbstractAlgebra.Group) = | ||
dixon_prime(AbstractAlgebra.order(G), exponent(G)) | ||
Base.exponent(G::AbstractPermutationGroup) = exponent(conjugacy_classes(G)) | ||
Base.exponent(cclasses::AbstractVector) = lcm(order.(first.(cclasses))) | ||
dixon_prime(G::AbstractPermutationGroup) = dixon_prime(order(G), exponent(G)) | ||
|
||
function dixon_prime(cclasses::AbstractVector) | ||
ordG = sum(length, cclasses) | ||
m = AbstractAlgebra.exponent(cclasses) | ||
m = exponent(cclasses) | ||
return dixon_prime(ordG, m) | ||
end | ||
|
||
function dixon_prime(ordG::Integer, exponent::Integer) | ||
p = 2floor(Int, sqrt(ordG)) | ||
p = 2 * floor(Int, sqrt(ordG)) | ||
while true | ||
p = nextprime(p+1) | ||
p = nextprime(p + 1) | ||
isone(p % exponent) && break # we need -1 to be in the field | ||
end | ||
return p | ||
end | ||
|
||
function common_esd(Ns, F::Type{<:FiniteFields.GF}) | ||
@assert !isempty(Ns) | ||
esd = EigenSpaceDecomposition(F.(first(Ns))) | ||
for N in Iterators.rest(Ns, 2) | ||
esd = refine(esd, F.(N)) | ||
@debug N esd.eigspace_ptrs | ||
isdiag(esd) && return esd | ||
end | ||
return esd | ||
end | ||
|
||
characters_dixon(G::AbstractPermutationGroup) = | ||
characters_dixon(conjugacy_classes(G)) | ||
|
||
function characters_dixon(cclasses::AbstractVector{<:AbstractOrbit}) | ||
p = dixon_prime(cclasses) | ||
chars_𝔽p = characters_dixon(cclasses, FiniteFields.GF{p}) | ||
return complex_characters(chars_𝔽p) | ||
end | ||
|
||
function characters_dixon( | ||
cclasses::AbstractVector{<:AbstractOrbit}, | ||
F::Type{<:FiniteFields.GF}, | ||
) | ||
Ns = [CCMatrix(cclasses, i) for i = 1:length(cclasses)] | ||
esd = common_esd(Ns, F) | ||
@assert isdiag(esd) "Class Matricies failed to diagonalize! $esd" | ||
inv_ccls = _inv_of(cclasses) | ||
return [ | ||
normalize!(Character(vec(eigensubspace), inv_ccls, cclasses)) | ||
for eigensubspace in esd | ||
] | ||
end | ||
|
||
function _multiplicities( | ||
chars::AbstractVector{<:Character{F}}, | ||
cclasses = conjugacy_classes(first(chars)), | ||
) where {F<:FiniteFields.GF} | ||
|
||
e = Int(exponent(cclasses)) | ||
ie = inv(F(e)) | ||
ω = FiniteFields.rootofunity(F, e) | ||
|
||
|
||
multiplicities = zeros(Int, length(chars), length(cclasses), e) | ||
powermap = PowerMap(cclasses) | ||
for (i, χ) in enumerate(chars) | ||
for j = 1:length(cclasses), k = 0:e-1 | ||
multiplicities[i, j, k+1] = | ||
Int(ie * sum(χ[powermap[j, l]] * ω^-(k * l) for l = 0:e-1)) | ||
end | ||
end | ||
|
||
return multiplicities | ||
end | ||
|
||
|
||
function complex_characters( | ||
chars::AbstractVector{<:Character{F}}, | ||
) where {F<:FiniteFields.GF} | ||
|
||
cclasses = conjugacy_classes(first(chars)) | ||
lccl = length(cclasses) | ||
mult_c = _multiplicities(chars, cclasses) | ||
e = size(mult_c, 3) # the exponent | ||
|
||
inv_of_cls = first(chars).inv_of | ||
|
||
C = Cyclotomics.Cyclotomic{Int,Cyclotomics.SparseVector{Int,Int}} | ||
# C = typeof(Cyclotomics.E(5)) | ||
|
||
complex_chars = Vector{Character{C,eltype(cclasses)}}(undef, length(chars)) | ||
|
||
|
||
for i = 1:length(complex_chars) | ||
complex_chars[i] = Character( | ||
[ | ||
Cyclotomics.reduced_embedding(sum( | ||
mult_c[i, j, k+1] * E(e, k) for k = 0:e-1 | ||
)) for j = 1:lccl | ||
], | ||
inv_of_cls, | ||
cclasses, | ||
) | ||
end | ||
|
||
return complex_chars | ||
end |
Oops, something went wrong.