diff --git a/src/OscarPatches.jl b/src/OscarPatches.jl index 94c1d01..a5f0a60 100644 --- a/src/OscarPatches.jl +++ b/src/OscarPatches.jl @@ -19,3 +19,11 @@ end function tensor_power_obj(V::LieAlgebraModule, k::Int) return tensor_power(V, k)[1] end + +if !isdefined(Oscar, :free_associative_algebra_type) + free_associative_algebra_type(::Type{T}) where T<:RingElement = Generic.FreeAssociativeAlgebra{T} + + free_associative_algebra_type(::Type{S}) where S<:Ring = free_associative_algebra_type(elem_type(S)) + free_associative_algebra_type(x) = free_associative_algebra_type(typeof(x)) # to stop this method from eternally recursing on itself, we better add ... + free_associative_algebra_type(::Type{T}) where T = throw(ArgumentError("Type `$T` must be subtype of `RingElement`.")) +end diff --git a/src/SmashProductLie.jl b/src/SmashProductLie.jl index a3a32ee..35d94db 100644 --- a/src/SmashProductLie.jl +++ b/src/SmashProductLie.jl @@ -29,7 +29,7 @@ base_module(Sp::SmashProductLie{C, LieC, LieT}) where {C <: RingElem, LieC <: Fi underlying_algebra( Sp::SmashProductLie{C, LieC, LieT}, -) where {C <: RingElem, LieC <: FieldElem, LieT <: LieAlgebraElem{LieC}} = Sp.alg::Generic.FreeAssAlgebra{C} # TODO: add free_ass_algebra_type or something like that +) where {C <: RingElem, LieC <: FieldElem, LieT <: LieAlgebraElem{LieC}} = Sp.alg::free_associative_algebra_type(C) ngens(Sp::SmashProductLie) = ngens(underlying_algebra(Sp)) function ngens(Sp::SmashProductLie, part::Symbol)