Skip to content

Commit

Permalink
Hotpatch free_associative_algebra_type
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 2, 2024
1 parent 9f6869e commit 494b22e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/OscarPatches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/SmashProductLie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 494b22e

Please sign in to comment.