Skip to content

Lazy power series: fix bad handling of base ring and categorification #13433

@hivert

Description

@hivert

Currently

sage: R = LazyPowerSeriesRing(QQ)
sage: type(R.gen().coefficient(0))
<type 'sage.rings.rational.Rational'>
sage: type(R.gen().coefficient(1))
<type 'int'>
sage: type(R.gen().coefficient(2))
<type 'int'>

it should be always Rational

I also fixed the following bug:

sage: from sage.combinat.species.series import LazyPowerSeriesRing
sage: L = LazyPowerSeriesRing(QQ)
sage: g = L.gen(); z = L.zero()
sage: s = z+g; s
Uninitialized lazy power series
sage: s.coefficients(10)
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
sage: s
Uninitialized lazy power series

It should be:

sage: s.coefficients(10)
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]
sage: s
x + O(x^10)

Depends on #14685

CC: @sagetrac-sage-combinat @simon-king-jena @fchapoton @darijgr

Component: combinatorics

Keywords: LazyPowerSeries, Species, days49

Reviewer: Travis Scrimshaw

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions