diff --git a/src/arithmetic.jl b/src/arithmetic.jl index 346a1a4..c25b898 100644 --- a/src/arithmetic.jl +++ b/src/arithmetic.jl @@ -140,23 +140,24 @@ function MA.operate_to!( ::typeof(*), args::Vararg{AlgebraElement,N}, ) where {N} - for arg in args - @assert parent(res) == parent(arg) - end - mstr = mstructure(basis(res)) + mstr = mstructure(parent(res), parent.(args)...) MA.operate_to!(coeffs(res), mstr, coeffs.(args)...) return res end +function mstructure(args::AbstractStarAlgebra...) + for arg in args + @assert arg == first(args) + end + return mstructure(basis(args[1])) +end + function MA.operate!( ::UnsafeAddMul{typeof(*)}, res::AlgebraElement, args::Vararg{AlgebraElement,N}, ) where {N} - for arg in args - @assert parent(res) == parent(arg) - end - mstr = mstructure(basis(res)) + mstr = mstructure(parent(res), parent.(args)...) MA.operate!(UnsafeAddMul(mstr), coeffs(res), coeffs.(args)...) return res end