Skip to content

Commit

Permalink
Fix identity rep (#4)
Browse files Browse the repository at this point in the history
* Fix identity representation

* Update NumericalRepresentationTheory.jl

* Update Project.toml
  • Loading branch information
dlfivefifty authored Nov 17, 2023
1 parent 3fe9ea5 commit e78da23
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NumericalRepresentationTheory"
uuid = "6b7c1d51-ecee-4149-97a8-50646b514dce"
authors = ["Sheehan Olver <[email protected]>"]
version = "0.1.0"
version = "0.1.1"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
10 changes: 8 additions & 2 deletions src/NumericalRepresentationTheory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,14 @@ diagm(A::Vector{<:Representation}) = Representation(blockdiag.(generators.(A)...
(A::Representation...) = Representation(blockdiag.(generators.(A)...))


(R::Representation)(P::AbstractPermutation) =
*(map(i -> R.generators[i], CoxeterDecomposition(P).terms)...)
function (R::Representation)(P::AbstractPermutation)
if isempty(CoxeterDecomposition(P).terms)
# Identity
one(first(R.generators))
else
*(map(i -> R.generators[i], CoxeterDecomposition(P).terms)...)
end
end

# determine multiplicities of eigs on diagonal, assuming sorted
function eigmults::Vector{Int})
Expand Down
18 changes: 12 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using NumericalRepresentationTheory, LinearAlgebra, Test
using NumericalRepresentationTheory, Permutations, LinearAlgebra, Test
import NumericalRepresentationTheory: gelfandbasis

@testset "Representations" begin
Expand Down Expand Up @@ -36,12 +36,18 @@ import NumericalRepresentationTheory: gelfandbasis
@test multiplicities(ρ̃) == multiplicities(ρ)
@test abs.(blockdiagonalize(ρ̃)[2]) abs.(Matrix(Q))
end

@testset "Rico Bug" begin
ρ = Representation(2,1)
g = Permutation([1,2,3])
@test ρ(g) == I(2)
end
end


basis = gelfandbasis(Representation(Partition([3,2,1])).generators)
Λ = Matrix{Int}(undef, size(basis[1],1), length(basis))
for k in axes(Λ,1), j in axes(Λ,2)
Λ[k,j] = round(Int,basis[j][k,k])
end
# basis = gelfandbasis(Representation(Partition([3,2,1])).generators)
# Λ = Matrix{Int}(undef, size(basis[1],1), length(basis))
# for k in axes(Λ,1), j in axes(Λ,2)
# Λ[k,j] = round(Int,basis[j][k,k])
# end

2 comments on commit e78da23

@dlfivefifty
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95482

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.1 -m "<description of version>" e78da236bdb052f760c2bc04a93327b87a8daf6b
git push origin v0.1.1

Please sign in to comment.