diff --git a/Project.toml b/Project.toml index f61a4c4..0398304 100644 --- a/Project.toml +++ b/Project.toml @@ -11,10 +11,15 @@ MutableArithmetics = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" +StarAlgebras = "0c0c59c1-dc5f-42e9-9a8b-b5dc384a6cd1" [compat] MacroTools = "0.5" MultivariatePolynomials = "0.5.8" MutableArithmetics = "1" Reexport = "1" +StarAlgebras = "0.3" julia = "1.10" + +[sources] +MultivariatePolynomials = {url = "https://github.com/JuliaAlgebra/MultivariatePolynomials.jl.git", rev = "claude/implement-promote-basis-0gQqp"} diff --git a/src/TypedPolynomials.jl b/src/TypedPolynomials.jl index 79eb06e..a7706fe 100644 --- a/src/TypedPolynomials.jl +++ b/src/TypedPolynomials.jl @@ -36,5 +36,6 @@ include("conversion.jl") include("promotion.jl") include("call.jl") include("macros.jl") +include("sa.jl") end # module diff --git a/src/sa.jl b/src/sa.jl new file mode 100644 index 0000000..8dcdb96 --- /dev/null +++ b/src/sa.jl @@ -0,0 +1,21 @@ +import StarAlgebras as SA + +function SA.promote_with_map( + m::Monomial{V,N}, + all_vars::Tuple{Vararg{Variable}}, + map::MP.ExponentMap, +) where {V,N} + new_exps = map(m.exponents) + M = length(all_vars) + new_mono = Monomial{all_vars,M}(new_exps) + return new_mono, map +end + +function SA.promote_with_map( + v::Variable, + all_vars::Tuple{Vararg{Variable}}, + map::MP.ExponentMap, +) + return SA.promote_with_map(Monomial(v), all_vars, map) +end +