Ticket #807 (new defect)

Opened 1 year ago

Last modified 7 months ago

construction of function fields

Reported by: nbruin Assigned to: somebody
Priority: major Milestone: sage-3.2.2
Component: basic arithmetic Keywords:
Cc:

Description

The following does not work and it seems to fail in an odd way wrt. the preparser

P1.<t> = QQ[].fraction_field()

There doesn't seem to be a convenient way of constructing a rational function field with a named variable.

Change History

02/18/2008 04:00:26 AM changed by cremona

This works:

sage: P1 = PolynomialRing(QQ,'t').fraction_field()
sage: P1.gen()
t
sage: t=P1.gen()
sage: P1((t+1)/(t-3))
(t + 1)/(t - 3)

Note that the fraction field picks up the display name 't', but that to get the identifier t defined requires the assignment.

I guess this does not qualify for what you wanted, namely to have t assigned automatically on the line defining the field.

Looking into this I found something else peculiar:

sage: t=polygen(QQ)
sage: t
x
sage: t.parent()
Univariate Polynomial Ring in x over Rational Field

I have found polygen to be useful, but now I think that using it is fraught with possible confusion. It causes the PolynomialRing? in 'x' to be created with no choice as to the display string for the variable.

02/18/2008 04:04:12 PM changed by was

I have found polygen to be useful, but now I think that using it is fraught with possible confusion. It causes the PolynomialRing?? in 'x' to be created with no choice as to the display string for the variable.

That's not true. Did you try reading polygen?

sage: t = polygen(QQ,'t')
sage: t
t
sage: t.parent()
Univariate Polynomial Ring in t over Rational Field

05/10/2008 02:45:44 PM changed by was

14:42 < cwitty-rvw3129> I'd be fine with saying 807 is invalid (since it doesn't have any sort of concrete 
                        proposal); wstein-2605, what do you think?
14:43 < wstein-406> It's invalid.
14:43 < wstein-406> It should be an error.
14:43 < wstein-406> He has to give the poly ring variable explicitly; there is no way around htat.
14:44 < mhansen> This is what it preparses to: "P1 = QQ[].fraction_field(names=('t',)); (t,) = 
                 P1._first_ngens(Integer(1))"
14:44 < wstein-406> However, it might be nice for this to work:
14:44 < cwitty-rvw3129> Well, he's trying to give the variable explicitly with the P1.<t> syntax.
14:44 < wstein-406> P1.<t> = QQ['t'].fraction_field()
14:44 < wstein-406> What would happen is that fraction_field would have a names option, and if the
14:44 < wstein-406> names didn't match with the gen names of R (=QQ['t']) then a copy is returned with
14:44 < wstein-406> those variable names.
14:45 < wstein-406> E.g., 
14:45 < wstein-406> P1.<t> = QQ['x'].fraction_field()
14:45 < wstein-406> should work.
14:45 < wstein-406> Too.
14:45 < wstein-406> So I do not think #807 is invalid; it just needs to be changed slightly.