Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conversion of power series with zero bigoh to polynomials #15707

Closed
rwst opened this issue Jan 22, 2014 · 12 comments
Closed

conversion of power series with zero bigoh to polynomials #15707

rwst opened this issue Jan 22, 2014 · 12 comments

Comments

@rwst
Copy link

rwst commented Jan 22, 2014

sage: R.<x> = PowerSeriesRing(ZZ)
sage: P.<x> = ZZ[]
sage: r=R([1,1,1,1])
sage: r
1 + x + x^2 + x^3
sage: P(r)
TypeError: unable to coerce <type 'sage.rings.power_series_poly.PowerSeries_poly'> to an integer

Sage power series can have zero bigoh term, and such series are identical to polynomials, so coercion should be no problem.

If we should allow zero bigoh in power series is another matter.

Component: algebra

Author: Ralf Stephan

Branch/Commit: u/rws/ticket/15707 @ 4ea4963

Reviewer: Travis Scrimshaw

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

@rwst rwst added this to the sage-6.1 milestone Jan 22, 2014
@rwst rwst self-assigned this Jan 22, 2014
@pjbruin
Copy link
Contributor

pjbruin commented Jan 22, 2014

comment:2

This should be fixed, probably also for series with finite precision, i.e. that do have an O(xn) term. There is already the method r.polynomial() which returns exactly the desired result; we just have to tell P(r) to use this.

@nbruin
Copy link
Contributor

nbruin commented Jan 22, 2014

comment:4

Note that this is a conversion problem, not a coercion problem. There should be no coercion from PowerSeriesRing to PolynomialRing at all.
In fact, it may even be acceptable to let conversion from PowerSeriestoPolynomials` simply be truncation: conversion is allowed to just be best effort (this is all completely compatible with Peter's comment above).

@nbruin nbruin changed the title coercion of power series with zero bigoh to polynomials conversion of power series with zero bigoh to polynomials Jan 22, 2014
@rwst
Copy link
Author

rwst commented Jan 23, 2014

comment:7

Agree, after sleeping over it and rereading the documentation.

@rwst
Copy link
Author

rwst commented Jan 23, 2014

Branch: u/rws/ticket/15707

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 23, 2014

Commit: 22058aa

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 23, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

22058aaTrac #15707: convert power series to polynomial by truncation

@tscrim
Copy link
Collaborator

tscrim commented Jan 23, 2014

comment:11

I agree with this as well (and it's coherent with what we do with real fields to QQ), but could you add an doctest showing this is fixed?

Thanks,

Travis

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 24, 2014

Changed commit from 22058aa to 4ea4963

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 24, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

4ea4963trac #15707: doctest

@tscrim
Copy link
Collaborator

tscrim commented Jan 25, 2014

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Jan 25, 2014

comment:13

LGTM

@tscrim
Copy link
Collaborator

tscrim commented Jan 25, 2014

Author: Ralf Stephan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants