Opened 3 years ago

Last modified 3 years ago

## #20091 new defect

# .extension with other variables than x

Reported by: | dkrenn | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-7.1 |

Component: | algebra | Keywords: | |

Cc: | Merged in: | ||

Authors: | Reviewers: | ||

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

T.<t> = ZZ.extension(x^2-x+2)

works, where

sage: x.parent() Symbolic Ring

But

sage: X = SR('x') sage: T.<t> = ZZ.extension(X^2-X+2)

does not work:

ValueError: each generator must be integral

It should work with any symbolic variable; error message does not give a hint what is wrong.

**Note:**See TracTickets for help on using tickets.

OK, the problem is this code in EquationOrder?:

So indeed

`x`

is singled out. Naturally, the constructor should work with any univariate polynomial over ZZ and it does because of the conversion rules:but already for univariate polynomials that are not explicitly defined as such things go wrong:

(yes, an empty error message)

The behaviour with "SR" is consistent with this. However,

`x`

shouldn't really have a special role here. How far do we want to go with trying to read`f`

as a univariate polynomial over`ZZ`

? Do we want to special case all kinds of rings (multivariate, SR, etc.) to specially see if, even if there are more generators on the ring, really only one is occurring in`f`

, so we can read it as a univariate polynomial?The "see if we can convert into

`ZZ['x']`

" is really a bit of a poor substitute for what we would really want to do. Input should really be "a univariate polynomial over ZZ", and as such input from SR would be not valid. But that would be impractical.