1
+ export AbstractLieAlgebraRepresentation,
2
+ IrreducibleRepresentation,
3
+ space_basis,
4
+ to_expressions,
5
+ IsotypicComponent,
6
+ mul,
7
+ irreducible_components,
8
+ PolynomialVectorSpace,
9
+ is_upto,
10
+ LieAlgebraRepresentation,
11
+ space,
12
+ isotypic_components
13
+
1
14
abstract type AbstractLieAlgebraRepresentation end
2
15
3
16
struct IrreducibleRepresentation{T<: AbstractLieAlgebraAction } <: AbstractLieAlgebraRepresentation
@@ -52,10 +65,10 @@ struct PolynomialVectorSpace
52
65
end
53
66
54
67
PolynomialVectorSpace (;
55
- variables:: Vector{Variable} ,
68
+ variables:: AbstractArray ,
56
69
degree:: Int ,
57
70
upto:: Bool = true
58
- ) = PolynomialVectorSpace (variables, degree, upto)
71
+ ) = PolynomialVectorSpace (Variable .( collect ( flatten ( variables))) , degree, upto)
59
72
60
73
variables (V:: PolynomialVectorSpace ) = V. vars
61
74
nvariables (V:: PolynomialVectorSpace ) = length (V. vars)
@@ -75,7 +88,9 @@ Base.:(==)(
75
88
76
89
function Base. show (io:: IO , V:: PolynomialVectorSpace )
77
90
println (io, " PolynomialVectorSpace of dimension $(dim (V)) " )
78
- print (io, " variables: $(variables (V)) " )
91
+ println (io, " $(nvariables (V)) variables: " , join (variables (V), " , " ))
92
+ println (io, " degree of polynomials: $(degree (V)) " )
93
+ print (io, " homogeneous: $(! is_upto (V)) " )
79
94
end
80
95
81
96
@@ -85,6 +100,11 @@ struct LieAlgebraRepresentation{T<:AbstractLieAlgebraAction} <: AbstractLieAlgeb
85
100
isotypic:: Vector{IsotypicComponent{T}}
86
101
end
87
102
103
+ LieAlgebraRepresentation (
104
+ action:: T ,
105
+ V:: PolynomialVectorSpace
106
+ ) where {T<: AbstractLieAlgebraAction } = LieAlgebraRepresentation {T} (action, V, [])
107
+
88
108
function LieAlgebraRepresentation (
89
109
alg:: LieAlgebra ,
90
110
V:: PolynomialVectorSpace ,
@@ -104,20 +124,21 @@ function LieAlgebraRepresentation(
104
124
return LieAlgebraRepresentation (alg, V, var_groups, iso_comps)
105
125
end
106
126
107
- algebra (π:: LieAlgebraRepresentation ) = π. alg
127
+ action (π:: LieAlgebraRepresentation ) = π. action
128
+ algebra (π:: LieAlgebraRepresentation ) = algebra (π. action)
108
129
space (π:: LieAlgebraRepresentation ) = π. V
109
130
isotypic_components (π:: LieAlgebraRepresentation ) = π. isotypic
110
131
irreducible_components (π:: LieAlgebraRepresentation ) = vcat ([irreducible_components (iso) for iso in π. isotypic]. .. )
111
- dim (π:: LieAlgebraRepresentation ) = sum ([ dim (ic) for ic in isotypic_components (π)] )
132
+ dim (π:: LieAlgebraRepresentation ) = dim (space (π))
112
133
113
134
# called by Shift+Enter
114
135
function Base. show (io:: IO , mime:: MIME"text/plain" , π:: LieAlgebraRepresentation )
115
136
println (
116
137
io,
117
- " LieAlgebraRepresentation of $(name (π . alg )) " ,
138
+ " LieAlgebraRepresentation of $(name (algebra (π) )) " ,
118
139
" on the $(dim (π)) -dimensional vector space:"
119
140
)
120
- show (io, mime, π . var_groups )
141
+ show (io, mime, action (π) )
121
142
# print(io, " action on variables: $(π.var_groups)")
122
143
end
123
144
@@ -133,6 +154,38 @@ function nullspace_as_weight_vectors(
133
154
return wvs
134
155
end
135
156
157
+ function sym_weight_structure (alg:: LieAlgebra , d:: Integer , mexps:: Vector{<:SparseVector} )
158
+ d = Int (d)
159
+ d == 0 && return WeightStructure ([0 ], [[1 ;;]])
160
+ d == 1 && return weight_structure (alg)
161
+ combs = multiexponents (; degree= d, nvars= nweights (alg))
162
+ new_weights_dict = Dict {Vector{Int}, Vector{typeof(combs[1])}} ()
163
+ for comb in combs
164
+ w = sum ([comb. nzval[i]* weights (alg, comb. nzind[i]) for i in 1 : length (comb. nzind)])
165
+ val = get (new_weights_dict, w, nothing )
166
+ if isnothing (val)
167
+ new_weights_dict[w] = [comb]
168
+ else
169
+ push! (new_weights_dict[w], comb)
170
+ end
171
+ end
172
+ new_weights = [zeros (Int, 0 ) for _ in 1 : length (new_weights_dict)]
173
+ new_weight_spaces = [zeros (ComplexF64, 0 , 0 ) for _ in 1 : length (new_weights_dict)]
174
+ for (i, (weight, combs)) in enumerate (new_weights_dict)
175
+ new_weights[i] = weight
176
+ Ms = [⊙ (weight_spaces (alg, comb. nzind), comb. nzval, mexps) for comb in combs]
177
+ new_weight_spaces[i] = hcat (Ms... )
178
+ end
179
+ return WeightStructure (new_weights, new_weight_spaces)
180
+ end
181
+
182
+ tensor_weight_structure (
183
+ alg:: LieAlgebra ,
184
+ ds:: AbstractVector{<:Integer} ,
185
+ v_mexps:: Vector{<:Vector{<:SparseVector}} ,
186
+ tensor_basis # TODO : add type
187
+ ) = tensor_weight_structure ([sym_weight_structure (alg, d, mexps) for (d, mexps) in zip (ds, v_mexps)], tensor_basis)
188
+
136
189
function weight_module (
137
190
alg:: LieAlgebra ,
138
191
variables:: Vector{Vector{Variable}} ,
159
212
160
213
# TODO : supposes that all the vars in V occur in var_groups
161
214
function LieAlgebraRepresentation (
162
- alg:: LieAlgebra ,
163
- V:: PolynomialVectorSpace ;
164
- action:: Vector{Vector{Variable}}
215
+ action:: LieAlgebraAction ,
216
+ V:: PolynomialVectorSpace
165
217
)
166
218
@assert issetequal (vcat (action... ), variables (V))
167
219
groups_mexps = multiexponents (degree= degree (V), nvars= length (action), upto= is_upto (V))
0 commit comments