Opened 5 years ago

Closed 4 years ago

#18094 closed defect (fixed)

conversion of bigoh to symbolic

Reported by: dkrenn Owned by:
Priority: major Milestone: sage-7.2
Component: symbolics Keywords: sd66
Cc: Merged in:
Authors: Ralf Stephan Reviewers: Daniel Krenn
Report Upstream: N/A Work issues:
Branch: 3efac92 (Commits) Commit: 3efac92413b61698bef39621b57d32c5a55761a6
Dependencies: #10846 Stopgaps:

Description

sage: P.<p> = ZZ[[]]
sage: a = 1/(1+p)
sage: o = a - a.truncate()
sage: o
O(p^20)
sage: 2*o
O(p^20)
sage: 2*SR(o)
0

The last line is wrong.

Change History (13)

comment:1 Changed 5 years ago by vdelecroix

Surely the big Oh is badly integrated into SR

sage: P.<p> = ZZ[[]]
sage: a = 1/(1+p)
sage: o = a - a.truncate()
sage: bool(SR(o) == 0)
True

comment:2 Changed 5 years ago by nbruin

At the very least related: #10846, #14693, #16203. Likely a fix there will also fix this ticket.

comment:3 Changed 5 years ago by rws

  • Dependencies set to #10846

The fix should be on top of #10846.

comment:4 Changed 5 years ago by rws

  • Branch set to u/rws/multiplication_of_powerseries_wrapped_in_sr_wrong

comment:5 Changed 5 years ago by rws

  • Authors set to Ralf Stephan
  • Commit set to 48011a4ac77473f5a45c59f6b89c374d0013a50a
  • Status changed from new to needs_review

New commits:

99916f910846: fix conversion of power series to symbolic series
26df71b10846: handle order term correctly
1f25c61Merge branch 'u/rws/conversion_of_powerseries____sr_bug' of trac.sagemath.org:sage into t/18094/multiplication_of_powerseries_wrapped_in_sr_wrong
48011a418094: constants were not handled by 10846: better take the variable from the power series element

comment:6 Changed 5 years ago by dkrenn

The example in the ticket now gives:

sage: P.<p> = ZZ[[]]
sage: a = 1/(1+p)
sage: o = a - a.truncate()
sage: 2*SR(o)
2*(Order(p^20))

But it should be Order(p^20).

comment:7 Changed 5 years ago by dkrenn

  • Reviewers set to Daniel Krenn
  • Status changed from needs_review to needs_info

comment:8 follow-up: Changed 5 years ago by rws

It's "only" a hack that will give us bare symbolic bigoh. Realistic behaviour must be added on Pynac level, it's simply not there at the moment, if I understand correctly.

You see you cannot do arithmetics at all with symbolic series:

sage: s = SR(1/(1-x)).series(x,5); s
1 + 1*x + 1*x^2 + 1*x^3 + 1*x^4 + Order(x^5)
sage: 2*s
2*(1 + 1*x + 1*x^2 + 1*x^3 + 1*x^4 + Order(x^5))

For that reason it would be helpful if someone could at least review those tickets that deal with symbolic<-->dedicated ring conversion (#10846, #16203, #17402 and maybe #17400 and #17659). I cannot do this: I am the author 8P

Last edited 5 years ago by rws (previous) (diff)

comment:9 in reply to: ↑ 8 Changed 4 years ago by rws

Replying to rws:

It's "only" a hack that will give us bare symbolic bigoh. Realistic behaviour must be added on Pynac level, it's simply not there at the moment, if I understand correctly.

No, it's there but the user is asked to apply series again:

sage: (2*s).series(x,5)
2 + 2*x + 2*x^2 + 2*x^3 + 2*x^4 + Order(x^5)

So, it's not as bad as thought, and the patch could go in without having to fix a bigger issue.

comment:10 Changed 4 years ago by rws

  • Branch changed from u/rws/multiplication_of_powerseries_wrapped_in_sr_wrong to u/rws/18094

comment:11 Changed 4 years ago by rws

  • Commit changed from 48011a4ac77473f5a45c59f6b89c374d0013a50a to 3efac92413b61698bef39621b57d32c5a55761a6
  • Milestone changed from sage-6.6 to sage-7.2
  • Status changed from needs_info to needs_review
  • Summary changed from multiplication of powerseries wrapped in SR wrong to conversion of bigoh to symbolic

New commits:

3efac9218094: conversion of bigoh to symbolic

comment:12 Changed 4 years ago by dkrenn

  • Status changed from needs_review to positive_review

comment:13 Changed 4 years ago by vbraun

  • Branch changed from u/rws/18094 to 3efac92413b61698bef39621b57d32c5a55761a6
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.