Opened 10 years ago

# Evaluation and subsitution of multi-variable polynomials

Reported by: Owned by: wuthrich malb major sage-7.4 commutative algebra multi_polynomials, evaluation, substitution N/A

Let f be a polynomial in two variables x and y over a ring R. Consider the following three commands

i) f(2,3)

ii) f(x=2,y=3)

iii) f.subs(x=2,y=3)

They give the same results but not the same type. i) gives an element in R while ii) and iii) are constant polynomials in two variables:

```sage: K.<x,y> = QQ[]
sage: f = x^2 + y^2
sage: f(2,3).parent()
Rational Field
sage: f(x=2,y=3).parent()
Multivariate Polynomial Ring in x, y over Rational Field
sage: f.subs(x=2,y=3).parent()
Multivariate Polynomial Ring in x, y over Rational Field
```

Following the documentation, i) and ii) should give an element in R while iii) is a polynomial.

f(x=2,y=3) is the `__call__` method in `sage.rings.polynomials.multi_polynomial_libsingular.pyx` and there, in the first lines (currently line 1673), it jumps to execute subs.

### comment:1 Changed 10 years ago by wuthrich

This came up when I tried to resolve #10888. But I found a different way of dealing with it there: I changed the troublesome occurriencies of ii) by i).

### comment:2 Changed 8 years ago by jdemeyer

• Milestone changed from sage-5.11 to sage-5.12

### comment:3 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.1 to sage-6.2

### comment:4 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.2 to sage-6.3

### comment:5 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.3 to sage-6.4

### comment:6 Changed 5 years ago by mkoeppe

• Description modified (diff)
• Milestone changed from sage-6.4 to sage-7.4
Note: See TracTickets for help on using tickets.