@@ -15,13 +15,13 @@ function ws_nullspace(
1515 if all (f -> isapprox (f, zero (f), atol= tol), Bₐ)
1616 return ws
1717 end
18- dim (ws) == 1 && return nothing
18+ dim (ws) == 1 && return nothing # implied by lines 15-17
1919 Cs = zero_combinations (Bₐ; tol= tol, logging= logging)
2020 isempty (Cs) && return nothing
2121 return WeightSpace (
2222 weight (ws),
2323 PolySpace {field_type(ws)} ([div_by_smallest_coeff (sum (c .* B)) for c in Cs])
24- )
24+ )
2525end
2626
2727function common_nullspace_as_weight_vectors (
@@ -38,16 +38,16 @@ function common_nullspace_as_weight_vectors(
3838 for X in Xs
3939 wsₙ = ws_nullspace (X, a, wsₙ)
4040 if isnothing (wsₙ)
41- logging && printstyled (" Found no common nullspace, smth is wrong! \n " , color = :red )
41+ error (" Found no common nullspace, while looking for $(nhwv) highest weight vectors; dim(ws) = $( dim (ws)) " )
4242 return WeightVector[] # error("Didn't find any highest weight vectors, had to find $(nhwv)")
4343 end
4444 end
4545
4646 if dim (wsₙ) != nhwv
4747 error (" Found $(dim (wsₙ)) highest weight vectors, expected $(nhwv) " )
4848 end
49- logging && printstyled (" Found: " , color= :green )
50- logging && printstyled (" $(join (map (repr, basis (space (wsₙ))), " , " )) \n " , color= :green )
49+ # logging && printstyled("Found: ", color=:green)
50+ # logging && printstyled("$(join(map(repr, basis(space(wsₙ))), ", "))\n", color=:green)
5151
5252 return [WeightVector (weight (wsₙ), div_by_smallest_coeff (v)) for v in basis (space (wsₙ))] # TODO : remove div_by_smallest_coeff
5353end
@@ -109,11 +109,19 @@ function irreducibles(
109109
110110 logging && printstyled (" Applying Clebsch-Gordan to decompose $(to_string (V)) into irreducibles...\n " , color= :blue )
111111 sym_ws, cg_decomp = sym_weight_struct (highest_weight (Vb), algebra (action (ρ)), power (V), ws)
112+ @assert Set (weights (sym_ws)) == keys (cg_decomp)
113+
112114 logging && printstyled (to_string (V), " = " , str_irr_decomp (" V" , cg_decomp), " \n " , color= :blue )
113115
114116 Xs = positive_root_elements (algebra (action (ρ)))
115117 hw_vectors = common_nullspace_as_weight_vectors (Xs, action (ρ), sym_ws, cg_decomp; logging= logging)
116- return [IrreducibleRepresentation (action (ρ), hwv) for hwv in hw_vectors]
118+
119+ irrs = [IrreducibleRepresentation (action (ρ), hwv) for hwv in hw_vectors]
120+ logging && println (" sum = " , sum ([dim (space (irr)) for irr in irrs]))
121+ logging && println (" dim(V): " , dim (V), " , dim(Vb): " , dim (Vb), " , power(V): " , power (V))
122+ logging && println (" dim(cg_decomp): " , weyl_dim (cg_decomp, algebra (action (ρ))))
123+ @assert sum ([dim (space (irr)) for irr in irrs]) == dim (V)
124+ return irrs
117125end
118126
119127function irreducibles (
@@ -148,6 +156,8 @@ function irreducibles(
148156 ρᵢ = GroupRepresentation (action (ρ), Vᵢ)
149157 append! (irreds, irreducibles (ρᵢ; logging= logging, decomp_count= decomp_count))
150158 end
159+
160+ @assert sum ([dim (space (irr)) for irr in irreds]) == dim (V)
151161 return irreds
152162end
153163
@@ -173,6 +183,7 @@ function irreducibles(
173183
174184 logging && printstyled (" Applying Clebsch-Gordan to decompose $(to_string (V)) into irreducibles...\n " , color= :blue )
175185 cg_decomp = tensor (hw₁, hw₂, algebra (action (ρ)))
186+
176187 if length (cg_decomp) == 1
177188 logging && printstyled (" The tensor product is irreducible, returning the tensor product of the highest weight vectors\n " , color= :red )
178189 return [IrreducibleRepresentation (action (ρ), hw_vector (V₁)* hw_vector (V₂))]
@@ -184,7 +195,10 @@ function irreducibles(
184195
185196 Xs = positive_root_elements (algebra (action (ρ)))
186197 hw_vectors = common_nullspace_as_weight_vectors (Xs, action (ρ), tensor_ws, cg_decomp; logging= logging)
187- return [IrreducibleRepresentation (action (ρ), hwv) for hwv in hw_vectors]
198+
199+ irrs = [IrreducibleRepresentation (action (ρ), hwv) for hwv in hw_vectors]
200+ @assert sum ([dim (space (irr)) for irr in irrs]) == dim (V)
201+ return irrs
188202end
189203
190204function irreducibles (
@@ -216,12 +230,13 @@ function irreducibles(
216230
217231 irreds = IrreducibleRepresentation{A}[]
218232 for irr₁ in irrs₁, irr₂ in irrs₂
219- V = TensorProduct ([space (irr₁), space (irr₂)])
220- ρV = GroupRepresentation (action (ρ), V )
233+ Vt = TensorProduct ([space (irr₁), space (irr₂)])
234+ ρV = GroupRepresentation (action (ρ), Vt )
221235 irrs = irreducibles (ρV; logging= logging, decomp_count= decomp_count)
222- @assert sum ([dim (space (irr)) for irr in irrs]) == dim (V )
236+ @assert sum ([dim (space (irr)) for irr in irrs]) == dim (Vt )
223237 append! (irreds, irrs)
224238 end
239+ @assert sum ([dim (space (irr)) for irr in irreds]) == dim (V)
225240 return irreds
226241end
227242
0 commit comments