@@ -18,6 +18,7 @@ export LieAlgebra,
1818 as_matrix,
1919 LieAlgebraRepresentation,
2020 IrreducibleLieAlgebraRepresentation,
21+ space_basis,
2122 to_irreducible,
2223 IsotypicComponent,
2324 mul,
@@ -410,14 +411,44 @@ to_expressions(
410411 tol:: Float64 = 1e-5
411412) = vcat ([to_expressions (π; tol= tol) for π in ic. irreds]. .. )
412413
414+ struct PolynomialVectorSpace
415+ vars:: Vector{Variable}
416+ degree:: Int
417+ upto:: Bool
418+ end
419+
420+ PolynomialVectorSpace (;
421+ variables:: Vector{Variable} ,
422+ degree:: Int ,
423+ upto:: Bool = true
424+ ) = PolynomialVectorSpace (variables, degree, upto)
425+
426+ variables (V:: PolynomialVectorSpace ) = V. vars
427+ nvariables (V:: PolynomialVectorSpace ) = length (V. vars)
428+ degree (V:: PolynomialVectorSpace ) = V. degree
429+ is_upto (V:: PolynomialVectorSpace ) = V. upto
430+ dim (V:: PolynomialVectorSpace ) = num_mons (nvariables (V), degree (V); upto= is_upto (V))
431+
432+ Base.:(== )(
433+ V:: PolynomialVectorSpace ,
434+ W:: PolynomialVectorSpace
435+ ) = (V. vars == W. vars) && (V. degree == W. degree) && (V. upto == W. upto)
436+
437+ function Base. show (io:: IO , V:: PolynomialVectorSpace )
438+ println (io, " PolynomialVectorSpace of dimension $(dim (V)) " )
439+ print (io, " variables: $(variables (V)) " )
440+ end
441+
413442struct LieAlgebraRepresentation
414443 alg:: LieAlgebra
444+ V:: PolynomialVectorSpace
415445 var_groups:: Vector{Vector{Variable}} # defines an action of a Lie algebra
416446 isotypic:: Vector{IsotypicComponent}
417447end
418448
419449function LieAlgebraRepresentation (
420450 alg:: LieAlgebra ,
451+ V:: PolynomialVectorSpace ,
421452 var_groups:: Vector{Vector{Variable}} ,
422453 irreds:: Vector{IrreducibleLieAlgebraRepresentation}
423454)
@@ -431,10 +462,11 @@ function LieAlgebraRepresentation(
431462 end
432463 end
433464 iso_comps = [IsotypicComponent (alg, hw, iso) for (hw, iso) in iso_dict]
434- return LieAlgebraRepresentation (alg, var_groups, iso_comps)
465+ return LieAlgebraRepresentation (alg, V, var_groups, iso_comps)
435466end
436467
437468algebra (π:: LieAlgebraRepresentation ) = π. alg
469+ space (π:: LieAlgebraRepresentation ) = π. V
438470isotypic_components (π:: LieAlgebraRepresentation ) = π. isotypic
439471irreducible_components (π:: LieAlgebraRepresentation ) = vcat ([irreducible_components (iso) for iso in π. isotypic]. .. )
440472dim (π:: LieAlgebraRepresentation ) = sum ([dim (ic) for ic in isotypic_components (π)])
@@ -462,40 +494,6 @@ function nullspace_as_weight_vectors(
462494 return wvs
463495end
464496
465- function to_irreducible (
466- alg:: LieAlgebra ,
467- var_groups:: Vector{Vector{Variable}} ,
468- weight_module:: WeightModule
469- )
470- πXs = vcat ([as_matrix (pos_root, basis (weight_module), var_groups) for pos_root in positive_roots (alg)]. .. )
471- hw_vectors = nullspace_as_weight_vectors (πXs, weight_structure (weight_module))
472- hw_modules = [HighestWeightModule (basis (weight_module), hwv) for hwv in hw_vectors]
473- return [IrreducibleLieAlgebraRepresentation (alg, var_groups, hwm) for hwm in hw_modules]
474- end
475-
476- struct PolynomialVectorSpace
477- vars:: Vector{Variable}
478- degree:: Int
479- upto:: Bool
480- end
481-
482- PolynomialVectorSpace (;
483- variables:: Vector{Variable} ,
484- degree:: Int ,
485- upto:: Bool = true
486- ) = PolynomialVectorSpace (variables, degree, upto)
487-
488- variables (V:: PolynomialVectorSpace ) = V. vars
489- nvariables (V:: PolynomialVectorSpace ) = length (V. vars)
490- degree (V:: PolynomialVectorSpace ) = V. degree
491- is_upto (V:: PolynomialVectorSpace ) = V. upto
492- dim (V:: PolynomialVectorSpace ) = num_mons (nvariables (V), degree (V); upto= is_upto (V))
493-
494- function Base. show (io:: IO , V:: PolynomialVectorSpace )
495- println (io, " PolynomialVectorSpace of dimension $(dim (V)) " )
496- print (io, " variables: $(variables (V)) " )
497- end
498-
499497function weight_module (
500498 alg:: LieAlgebra ,
501499 variables:: Vector{Vector{Variable}} ,
@@ -509,6 +507,17 @@ function weight_module(
509507 return WeightModule (mons, ws)
510508end
511509
510+ function to_irreducible (
511+ alg:: LieAlgebra ,
512+ var_groups:: Vector{Vector{Variable}} ,
513+ weight_module:: WeightModule
514+ )
515+ πXs = vcat ([as_matrix (pos_root, basis (weight_module), var_groups) for pos_root in positive_roots (alg)]. .. )
516+ hw_vectors = nullspace_as_weight_vectors (πXs, weight_structure (weight_module))
517+ hw_modules = [HighestWeightModule (basis (weight_module), hwv) for hwv in hw_vectors]
518+ return [IrreducibleLieAlgebraRepresentation (alg, var_groups, hwm) for hwm in hw_modules]
519+ end
520+
512521# TODO : supposes that all the vars in V occur in var_groups
513522function LieAlgebraRepresentation (
514523 alg:: LieAlgebra ,
@@ -525,16 +534,11 @@ function LieAlgebraRepresentation(
525534 return LieAlgebraRepresentation (alg, action, irreds)
526535end
527536
528- # Having two representations π₁: g → V and π₂: g → W, computes a
529- # representation π₁ ⊕ π₂: g → V ⊕ W
530- function ⊕ (π₁:: LieAlgebraRepresentation , π₂:: LieAlgebraRepresentation )
531-
532- end
533-
534537Base. randn (alg:: LieAlgebra ) = LieAlgebraElem (randn (ComplexF64, dim (alg)), alg)
535538
536539# Having two representations π₁: g₁ → V and π₂: g₂ → V such that there
537540# actions commute, computes a representation π₁ ⊞ π₂: g₁ ⊕ g₂ → V
538541function ⊞ (π₁:: LieAlgebraRepresentation , π₂:: LieAlgebraRepresentation )
539-
542+ @assert space (π₁) == space (π₂)
543+
540544end
0 commit comments