JuliaAlgebra / DynamicPolynomials.jl

Multivariate polynomials implementation of commutative and non-commutative variables
Other
60 stars 20 forks source link

StackOverflowError for Vector{AbstractMonomialLike} #149

Open kbarros opened 6 months ago

kbarros commented 6 months ago
using DynamicPolynomials

@polyvar x
a = x^2
b = x

 # This runs without error
randn(2, 2) * [a, b]

# This throws StackOverflowError
randn(2, 2) * [p for p in (a, b)]

# The importance difference seems to be these types
@assert typeof([a, b]) == Vector{Monomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}}}
@assert typeof([p for p in (a, b)]) == Vector{AbstractMonomialLike}