Opened 10 years ago

Closed 7 years ago

#10168 closed defect (fixed)

fraction field of InfinitePolynomialRing

Reported by: chapoton Owned by: malb
Priority: minor Milestone: sage-5.12
Component: commutative algebra Keywords: fraction field; polynomial ring
Cc: sage-combinat Merged in: sage-5.12.beta4
Authors: Frédéric Chapoton Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by chapoton)

I would like to use the fraction field of infinite polynomial ring.

sage: P.<x,y> = InfinitePolynomialRing(QQ, implementation='sparse')
sage: z=P(x[1])
sage: 1/z

So far, one gets

NotImplementedError: Fraction Fields of Infinite Polynomial Rings are not implemented

This seems to be a coercion problem.

Attachments (1)

trac_10168_fractionfield-fc.patch (18.7 KB) - added by chapoton 7 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 10 years ago by ylchapuy

Also note that this seems to work (at least a little bit):

sage: X.<x,y> = InfinitePolynomialRing(QQ, implementation='sparse')
sage: F = FractionField(X)
sage: z = F(x[1])
sage: 1/z
1/x_1
sage: (1/z*x[1]).is_one()
True

comment:2 Changed 10 years ago by chapoton

  • Authors Frederic Chapoton deleted

comment:3 Changed 10 years ago by chapoton

  • Description modified (diff)

comment:4 Changed 10 years ago by chapoton

  • Description modified (diff)

comment:5 Changed 8 years ago by chapoton

It seems now that the example of comment 1 does no longer work.

Here is a proposed patch, that could have worked maybe.

comment:6 Changed 8 years ago by chapoton

  • Cc sage-combinat added
  • Status changed from new to needs_info
  • Work issues set to coercion problem

comment:7 Changed 8 years ago by chapoton

Here is a patch that works (but there is a problem still with reduction)

comment:8 Changed 8 years ago by chapoton

The main problem comes from the gcd :

sage: R.<x>=InfinitePolynomialRing(QQ)
sage: p1=x[0]+x[0]**2
sage: p1.gcd(p1)                      

fails completely.

comment:9 Changed 8 years ago by chapoton

well, it almost works now. I have added a custom gcd procedure.

I am not sure that this is the correct way to handle these problems. If somebody has a better idea ?

comment:10 Changed 8 years ago by chapoton

  • Status changed from needs_info to needs_review

comment:11 Changed 7 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Keywords polynomial ring added
  • Milestone set to sage-6.0
  • Work issues coercion problem deleted

comment:12 Changed 7 years ago by tscrim

I think this is the right way since the gcd needed an implementation. However I have a few comments:

  • Could you add some tests showing that you get something in the fraction field?
  • Now we don't need the # indirect doctest for any method with a leading and trailing underscore.
  • Are you pushing this off to 6.0 because of the large number of changes to the file? I don't think this is really touched often, so I don't expect there to be rebasing problems and we should try to get this into sage-5.12 IMO.

Best,
Travis

Changed 7 years ago by chapoton

comment:13 Changed 7 years ago by chapoton

  • Milestone changed from sage-6.0 to sage-5.12

Hello again,

Thanks for looking at my code. Here is an updated patch.

  • I have removed the "#indirect doctests" in _div_
  • I have added two .parent() tests in _div_
  • I have set back the milestone to 5.12 (I have no good reason to postpone)

comment:14 Changed 7 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

Looks good to me. Thanks Frederic.

comment:15 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.12.beta4
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.