2
2
# Young diagrams, partitions of unity and characters of the symmetric group Sn #
3
3
# ###############################################################################
4
4
5
- typealias Partition Vector{Int64 }
6
- typealias YoungDiagram Array{Int64 ,2 }
5
+ typealias Partition Vector{Int }
6
+ typealias YoungDiagram Array{Int ,2 }
7
7
typealias SkewDiagram Tuple{Partition, Partition}
8
8
9
9
export Partition,
@@ -20,15 +20,15 @@ import Base.\
20
20
# Skew diagrams #
21
21
# ################
22
22
23
- # This uses a very simple internal representation for skew diagrams
23
+ " This uses a very simple internal representation for skew diagrams"
24
24
\ (λ:: Partition , μ:: Partition ) = MakeSkewDiagram (λ, μ)
25
25
function MakeSkewDiagram (λ:: Partition , μ:: Partition )
26
26
m, n = length (λ), length (μ)
27
27
if n> m error (" Cannot construct skew diagram" ) end
28
28
(λ, μ)
29
29
end
30
30
31
- # Checks if skew diagram is a rim hook
31
+ " Checks if skew diagram is a rim hook"
32
32
isrimhook (λ:: Partition , μ:: Partition )= isrimhook (λ \ μ)
33
33
function isrimhook (ξ:: SkewDiagram )
34
34
λ, μ = ξ
@@ -37,7 +37,7 @@ function isrimhook(ξ::SkewDiagram)
37
37
# Construct matrix representation of diagram
38
38
# XXX This is a horribly inefficient way of checking condition 1!
39
39
l = maximum (λ)
40
- youngdiagram= zeros (Int64 , m, l)
40
+ youngdiagram= zeros (Int , m, l)
41
41
for i= 1 : n
42
42
youngdiagram[i, μ[i]+ 1 : λ[i]]= 1
43
43
end
@@ -73,14 +73,14 @@ function isrimhook(ξ::SkewDiagram)
73
73
end
74
74
75
75
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"
77
77
leglength (λ:: Partition , μ:: Partition )= leglength ((λ \ μ))
78
78
function leglength (ξ:: SkewDiagram )
79
79
λ, μ = ξ
80
80
m, n = length (λ), length (μ)
81
81
# Construct matrix representation of diagram
82
82
l = maximum (λ)
83
- youngdiagram= zeros (Int64 , m, l)
83
+ youngdiagram= zeros (Int , m, l)
84
84
for i= 1 : n
85
85
youngdiagram[i, μ[i]+ 1 : λ[i]]= 1
86
86
end
100
100
101
101
" Computes essential part of the partition sequence of lambda"
102
102
function partitionsequence (lambda:: Partition )
103
- Λ▔ = Int64 []
103
+ Λ▔ = Int []
104
104
λ = [lambda; 0 ]
105
105
m = length (lambda)
106
106
for i= m: - 1 : 1
@@ -112,16 +112,16 @@ function partitionsequence(lambda::Partition)
112
112
Λ▔
113
113
end
114
114
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 )
117
117
118
118
119
119
# ############################
120
120
# Character of irreps of Sn #
121
121
# ############################
122
122
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 )
125
125
s= length (R)
126
126
χ:: Integer = 1
127
127
if t<= length (μ)
@@ -145,7 +145,7 @@ function MN1inner(R::Vector{Int64}, T::Dict, μ::Partition, t::Integer)
145
145
χ
146
146
end
147
147
148
- """
148
+ doc """
149
149
Computes character $χ ^λ(μ)$ of the partition μ in the λth irrep of the
150
150
symmetric group $S_n $
151
151
@@ -156,7 +156,7 @@ Implements the Murnaghan-Nakayama algorithm as described in:
156
156
doi:10.1016/j.jsc.2003.11.001
157
157
"""
158
158
function character (λ:: Partition , μ:: Partition )
159
- T = Dict (()=> 0 ) # Sparse array implemented as dict
159
+ T = Dict {Any,Int} (()=> 0 ) # Sparse array implemented as dict
160
160
Λ▔ = partitionsequence (λ)
161
161
MN1inner (Λ▔, T, μ, 1 )
162
162
end
0 commit comments