22# Young diagrams, partitions of unity and characters of the symmetric group Sn #
33# ###############################################################################
44
5- typealias Partition Vector{Int64 }
6- typealias YoungDiagram Array{Int64 ,2 }
5+ typealias Partition Vector{Int }
6+ typealias YoungDiagram Array{Int ,2 }
77typealias SkewDiagram Tuple{Partition, Partition}
88
99export Partition,
@@ -20,15 +20,15 @@ import Base.\
2020# Skew diagrams #
2121# ################
2222
23- # This uses a very simple internal representation for skew diagrams
23+ " This uses a very simple internal representation for skew diagrams"
2424\ (λ:: Partition , μ:: Partition ) = MakeSkewDiagram (λ, μ)
2525function MakeSkewDiagram (λ:: Partition , μ:: Partition )
2626 m, n = length (λ), length (μ)
2727 if n> m error (" Cannot construct skew diagram" ) end
2828 (λ, μ)
2929end
3030
31- # Checks if skew diagram is a rim hook
31+ " Checks if skew diagram is a rim hook"
3232isrimhook (λ:: Partition , μ:: Partition )= isrimhook (λ \ μ)
3333function isrimhook (ξ:: SkewDiagram )
3434 λ, μ = ξ
@@ -37,7 +37,7 @@ function isrimhook(ξ::SkewDiagram)
3737 # Construct matrix representation of diagram
3838 # XXX This is a horribly inefficient way of checking condition 1!
3939 l = maximum (λ)
40- youngdiagram= zeros (Int64 , m, l)
40+ youngdiagram= zeros (Int , m, l)
4141 for i= 1 : n
4242 youngdiagram[i, μ[i]+ 1 : λ[i]]= 1
4343 end
@@ -73,14 +73,14 @@ function isrimhook(ξ::SkewDiagram)
7373end
7474
7575
76- # Strictly speaking, defined for rim hook only, but here we define it for all skew diagrams
76+ " Strictly speaking, defined for rim hook only, but here we define it for all skew diagrams"
7777leglength (λ:: Partition , μ:: Partition )= leglength ((λ \ μ))
7878function leglength (ξ:: SkewDiagram )
7979 λ, μ = ξ
8080 m, n = length (λ), length (μ)
8181 # Construct matrix representation of diagram
8282 l = maximum (λ)
83- youngdiagram= zeros (Int64 , m, l)
83+ youngdiagram= zeros (Int , m, l)
8484 for i= 1 : n
8585 youngdiagram[i, μ[i]+ 1 : λ[i]]= 1
8686 end
100100
101101" Computes essential part of the partition sequence of lambda"
102102function partitionsequence (lambda:: Partition )
103- Λ▔ = Int64 []
103+ Λ▔ = Int []
104104 λ = [lambda; 0 ]
105105 m = length (lambda)
106106 for i= m: - 1 : 1
@@ -112,16 +112,16 @@ function partitionsequence(lambda::Partition)
112112 Λ▔
113113end
114114
115- # This takes two elements of a partition sequence, with a to the left of b
116- isrimhook (a:: Int64 , b:: Int64 ) = (a== 1 ) && (b== 0 )
115+ " Takes two elements of a partition sequence, with a to the left of b"
116+ isrimhook (a:: Int , b:: Int ) = (a== 1 ) && (b== 0 )
117117
118118
119119# ############################
120120# Character of irreps of Sn #
121121# ############################
122122
123- # Computes recursively using the Murnaghan-Nakayama rule.
124- function MN1inner (R:: Vector{Int64 } , T:: Dict , μ:: Partition , t:: Integer )
123+ " Computes recursively using the Murnaghan-Nakayama rule."
124+ function MN1inner (R:: Vector{Int } , T:: Dict , μ:: Partition , t:: Integer )
125125 s= length (R)
126126 χ:: Integer = 1
127127 if t<= length (μ)
@@ -145,7 +145,7 @@ function MN1inner(R::Vector{Int64}, T::Dict, μ::Partition, t::Integer)
145145 χ
146146end
147147
148- """
148+ doc """
149149Computes character $χ ^λ(μ)$ of the partition μ in the λth irrep of the
150150symmetric group $S_n $
151151
@@ -156,7 +156,7 @@ Implements the Murnaghan-Nakayama algorithm as described in:
156156 doi:10.1016/j.jsc.2003.11.001
157157"""
158158function character (λ:: Partition , μ:: Partition )
159- T = Dict (()=> 0 ) # Sparse array implemented as dict
159+ T = Dict {Any,Int} (()=> 0 ) # Sparse array implemented as dict
160160 Λ▔ = partitionsequence (λ)
161161 MN1inner (Λ▔, T, μ, 1 )
162162end
0 commit comments