Skip to content

Mix of polynomial vars and non commutative polynomials vars causes Stackoverflow Error #401

Closed

Description

@freemin7
@polyvar x[1:8]
@ncpolyvar s

x[1]*s
Warning: detected a stack overflow; program state may be corrupted, so further execution might be unreliable.
ERROR: StackOverflowError:
Stacktrace:
 ┌    [1] map_exponents(f::Function, m1::DynamicPolynomials.Monomial{…}, m2::DynamicPolynomials.Monomial{…})
 │      @ MultivariatePolynomials C:\Users\user\.julia\packages\MultivariatePolynomials\KeIuI\src\monomial.jl:147
 ╰─────── repeated 79984 times
Some type information was truncated. Use `show(err)` to see complete types.

I expect to be able to get to build a polynomial like x[1]*s*(x[2]+3x[2])*s*(x[2]+3x[2])*s*x[1] which won't simplify away.

Activity

  1. blegat commented on Nov 9, 2026

    @blegat
    Member

    You cannot mix commutative and noncommutative variables. The error message should be improved, thanks for reporting this

  2. freemin7 commented on Nov 9, 2026

    @freemin7
    Author

    You cannot mix commutative and noncommutative variables.

    Why is that?

    I see it is not compatible with the current code. Are there some principled objections against doing that (with another polynomial implementation)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions