Opened 3 years ago

ordering of (O-)terms: absolute values, real parts, etc.

Reported by: Owned by: dkrenn major sage-7.6 asymptotic expansions cheuberg, behackl N/A

Description

The following (although correct) is not ideal:

sage: A.<n> = AsymptoticRing('ZZ^n * n^ZZ', ZZ)
sage: (-1)^n/n + O((-1)^n/n^2) + n + O(1/n^3) + O(1/n^(2+I))
(-1)^n*n^(-1) + O((-1)^n*n^(-2)) + n + O(n^(-I - 2))

The O-Terms could/should be combined. The O-Term O((-1)^n*n^(-2)) should be O(n^-2) and O(n^(-I - 2)) should be O(n^-2).

The ordering is also not what one would expect, e.g.

sage: (-1)^n/n + O((-1)^n/n^2) + n^2 + O(1/n^3) + O(1/n^(2+I))
(-1)^n*n^(-1) + O((-1)^n*n^(-2)) + n^2 + O(n^(-I - 2))

and we would like to see the n^2 at the front.

comment:1 in reply to: ↑ description Changed 3 years ago by dkrenn

The ordering is also not what one would expect, e.g.

sage: (-1)^n/n + O((-1)^n/n^2) + n^2 + O(1/n^3) + O(1/n^(2+I))
(-1)^n*n^(-1) + O((-1)^n*n^(-2)) + n^2 + O(n^(-I - 2))

and we would like to see the n^2 at the front.

Here I am not sure, if this is the same problem as above; if not, then we can either forget about it or open a new ticket for it.

comment:2 Changed 3 years ago by dkrenn

• Type changed from PLEASE CHANGE to defect

comment:3 Changed 3 years ago by dkrenn

Moreover, I am not sure, how to deal with these issues.

Note: See TracTickets for help on using tickets.