Opened 10 years ago

# Incorrect/inconsistent treatment of inexact zeroes in coefficients of power series

Reported by: Owned by: Robert Harron David Roe major sage-6.4 padics padics, power series, precision N/A wrongAnswerMarker

### Description

p-adic coefficients: first of all, the way an inexact zero is treated is different based on whether one is working with capped-absolute or capped-relative coefficients:

```sage: R = ZpCA(3,5)
sage: PS.<z> = PowerSeriesRing(R)
sage: F = PS([1,2,3,O(3^3)])
sage: F
1 + O(3^5) + (2 + O(3^5))*z + (3 + O(3^5))*z^2
sage: F.list()
[1 + O(3^5), 2 + O(3^5), 3 + O(3^5)]
sage: F.coefficients()
[1 + O(3^5), 2 + O(3^5), 3 + O(3^5)]
sage: F[3]
O(3^5)
```

whereas the capped-relative p-adics (almost) behave as I would hope:

```sage: RCR = ZpCR(3,5)
sage: PSCR.<w> = PowerSeriesRing(RCR)
sage: G = PSCR([1,2,3,O(3^3)])
sage: G
1 + O(3^5) + (2 + O(3^5))*w + (3 + O(3^6))*w^2 + O(3^3)*w^3
sage: G.list()
[1 + O(3^5), 2 + O(3^5), 3 + O(3^6), O(3^3)]
sage: G.coefficients()
[1 + O(3^5), 2 + O(3^5), 3 + O(3^6)]
sage: G[3]
0
```

This last command should return `O(3^3)`, but returns an exact zero because if n > degree of the underlying polynomial of G, then G[n] returns an exact zero. Really, it should just return `self.__f[n]` in all cases.

The case of power series rings is similar to the capped-absolute case (unfortunately):

```sage: S.<t> = PowerSeriesRing(ZZ)
sage: c = S(0,3)
sage: PSS.<u> = PowerSeriesRing(S)
sage: H = PSS([t,2,3,c], 5)
sage: H
t + 2*u + 3*u^2 + O(u^5)
sage: H.list()
[t, 2, 3]
sage: H.coefficients()
[t, 2, 3]
sage: H[3]
0
```

These problems I think trace back to the way the underlying polynomial treats things, and I think some people are working to revamp polynomials over inexact rings, but I wanted to point out these problems. For instance, some of these I think can be solved without change the polynomial code.

### comment:1 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11 → sage-5.12

### comment:2 Changed 9 years ago by For batch modifications

Milestone: sage-6.1 → sage-6.2

### comment:3 Changed 9 years ago by For batch modifications

Milestone: sage-6.2 → sage-6.3

### comment:4 Changed 8 years ago by For batch modifications

Milestone: sage-6.3 → sage-6.4