Skip to content

Substitution in (multivariate) LaurentPolynomialRing is incorrect #41282

@ghseeli

Description

@ghseeli

Steps To Reproduce

I produced the following code using the Cocalc Sage 10.7 kernel.

sage: A = LaurentPolynomialRing(QQ,['t','x1'])
sage: A.inject_variables()
sage: f = x1 + t^(-2)
sage: g = f.subs({t:t**(-1)})
sage: g
t^2 + x1
sage: list(g)
[(1, t^2), (1, x1)]
sage: g.subs({t:0})
0
sage: list(g)
[(1, t^3), (1, t*x1)]

Expected Behavior

g.subs({t:0}) should return x1. Furthermore, list(g) should be unchanged by any call to .subs() method.

Actual Behavior

g.subs({t:0}) returns 0. Furthermore, list(g) changes after calling .subs() method.

Additional Information

No response

Environment

  • OS: Ubuntu 24.04 (Cocalc)
  • Sage Version: 10.7 (Cocalc)

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions