Skip to content

Univariate Laurent polynomial do not properly handle __call__ #17554

@tscrim

Description

@tscrim

Univariate Laurent polynomials behave very differently with __call__ compared to other polynomials. In particular, the following does not (correctly) work:

sage: R.<t> = LaurentPolynomialRing(ZZ)
sage: f = t^(-2) + t^2
sage: f(t=-1)  # Boom
sage: f(x=-1)  # Boom
sage: f()  # Boom
sage: f(1,2)  # Should be an error
2

The original symptom (which has been fixed by other means, see comment:3) came from

sage: R.<q> = QQ[]
sage: p = q^4 + q^2 - 2*q + 3
sage: L.<x,y> = LaurentPolynomialRing(QQ)
sage: p(q=x)
x^4 + x^2 - 2*x + 3

but if we change things to a univariate Laurent polynomial ring, we get:

sage: L.<x> = LaurentPolynomialRing(QQ)
sage: p(q=x)
...
IndexError: tuple index out of range

See comment:2.

Component: commutative algebra

Keywords: Laurent polynomial, substitution

Author: Travis Scrimshaw

Branch/Commit: 7f41391

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/17554

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions