This repository as well as DynamicPolynomials have accumulated a lot of technical depth due to bad design decisions and it is time to get rid of it.
The bad design decisions were
- Try to support
*(::MP.AbstractPolynomialLike, ::Any) this creates a lot of invalidation and promotion rules are a mess. We should only support *(::MP.AbstractPolynomialLike{T}, ::T) and have *(::MP.AbstractPolynomialLike, ::Number) that convert the number to T. Same for other operators like +, - etc..
- Implement
+(p::MP.AbstractPolynomialLike, q::MP.AbstractPolynomialLike) where p and q have different variables. Not simply by first promoting them to the same set of variables and then use a simple implementation of the sum but instead to have some complicated implementation dealing with monomials over different variables. We should just directly promote with StarAlgebras.promote_bases now and only implement + over polynomials of the same algebra
- Having different implementation of polynomials,
MP.Polynomial using a list of terms and DynamicPolynomials.Polynomial having a separate list of coefficients and list of monomials. We should just use StarAlgebras.AlgebraElement now.
So the plan is:
- Move
MP.Term to StarAlgebras.Term, so MP.AbstractTermLike won't be an abstract type anymore but a union of AbstractMonomialLike and SA.Term
- Remove
MP.Polynomial, and replace it by the implementation of polynomials done in MultivariateBases using StarAlgebras. Doing so, we can just merge MultivariateBases into MultivariatePolynomials, MP.AbstractPolynomialLike will then be a union of that StarAlgebras.AlgebraElement and AbstractTermLike.
This repository as well as DynamicPolynomials have accumulated a lot of technical depth due to bad design decisions and it is time to get rid of it.
The bad design decisions were
*(::MP.AbstractPolynomialLike, ::Any)this creates a lot of invalidation and promotion rules are a mess. We should only support*(::MP.AbstractPolynomialLike{T}, ::T)and have*(::MP.AbstractPolynomialLike, ::Number)that convert the number toT. Same for other operators like+,-etc..+(p::MP.AbstractPolynomialLike, q::MP.AbstractPolynomialLike)wherepandqhave different variables. Not simply by first promoting them to the same set of variables and then use a simple implementation of the sum but instead to have some complicated implementation dealing with monomials over different variables. We should just directly promote withStarAlgebras.promote_basesnow and only implement+over polynomials of the same algebraMP.Polynomialusing a list of terms andDynamicPolynomials.Polynomialhaving a separate list of coefficients and list of monomials. We should just use StarAlgebras.AlgebraElement now.So the plan is:
MP.TermtoStarAlgebras.Term, soMP.AbstractTermLikewon't be an abstract type anymore but a union ofAbstractMonomialLikeandSA.TermMP.Polynomial, and replace it by the implementation of polynomials done in MultivariateBases using StarAlgebras. Doing so, we can just merge MultivariateBases into MultivariatePolynomials,MP.AbstractPolynomialLikewill then be a union of that StarAlgebras.AlgebraElement andAbstractTermLike.