Opened 4 years ago

Closed 4 years ago

#19316 closed defect (fixed)

compute asymptotic expansion to some rational directly

Reported by: dkrenn Owned by:
Priority: major Milestone: sage-7.1
Component: asymptotic expansions Keywords:
Cc: behackl, cheuberg Merged in:
Authors: Daniel Krenn, Clemens Heuberger Reviewers: Daniel Krenn, Clemens Heuberger
Report Upstream: N/A Work issues:
Branch: 37917b2 (Commits) Commit: 37917b287453015084690b3b5dcbd6240f799ca4
Dependencies: #19083, #19423, #19576, #20000 Stopgaps:

Description

Currently we have

sage: A.<y> = AsymptoticRing(growth_group='y^ZZ', coefficient_ring=QQ)
sage: (y^2 + O(y))^(1/2)  # not tested
y + O(1)

It is not tested, since the current implementation rewrites it to exp(log(...)) which is not possible in A. There is a workaround:

sage: B.<z> = AsymptoticRing(growth_group='z^QQ * log(z)^QQ', coefficient_ring=QQ)
sage: (z^2 + O(z))^(1/2)
z + O(1)

The aim of this ticket is to make such things possible directly.

Change History (17)

comment:1 Changed 4 years ago by cheuberg

  • Dependencies changed from #19083 to #19083, #19423
  • Milestone changed from sage-6.9 to sage-6.10

comment:2 Changed 4 years ago by dkrenn

  • Branch set to u/dkrenn/asy/pow_rational

comment:3 Changed 4 years ago by dkrenn

  • Authors set to Daniel Krenn
  • Commit set to 58d1f2853cae7adbe66316005855cf436e872de7
  • Status changed from new to needs_review

Last 10 new commits:

84568cfTrac #19423: two code simplifications
342af12Trac #19316: write __pow_number__
a3b66afTrac #19316: extend existing __pow__ to use new method
1028b95Trac #19316: rewrite error message
37c6115Merge Trac #19850 into asy/pow_rational
d122786Trac #19316: restructure doctests of pow (add section EXAMPLES)
ef717b0Trac #19316: allow symbolic constants
6844299Trac #19316: fix ReST doc
6837874Trac #19423: fix ReST doc
58d1f28Merge branch 'asy/exploginv_taylor' into asy/pow_rational

comment:4 Changed 4 years ago by git

  • Commit changed from 58d1f2853cae7adbe66316005855cf436e872de7 to 10b2a64ffa756f9d54b8f04cac049661c6ea9e86

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

f87be85Merge commit '8f7195f7f8875ea81bd8b9026a138e269f719a4d' of git://trac.sagemath.org/sage into asy/pow_rational
10b2a64Trac #19316: fix doctest

comment:5 Changed 4 years ago by dkrenn

  • Dependencies changed from #19083, #19423 to #19083, #19423, #19576

comment:6 Changed 4 years ago by cheuberg

  • Branch changed from u/dkrenn/asy/pow_rational to u/cheuberg/asy/pow_rational

comment:7 Changed 4 years ago by cheuberg

  • Commit changed from 10b2a64ffa756f9d54b8f04cac049661c6ea9e86 to b38d602cec012b4f790d6d7158c27e0d660534b1
  • Dependencies changed from #19083, #19423, #19576 to #19083, #19423, #19576, #20000
  • Status changed from needs_review to needs_work

Merged #20000 due to a merge conflict (both tickets introduce a new method at the same position of the file).

My comments on #19423 also apply here.


New commits:

ffc1bf5write .sqrt() for asymptotic expansions
1441b31additional doctest (comparing with power series result)
310780aTrac #20000: remove redundant pair of parentheses
b38d602Trac #19316: Merge #20000 due to merge conflict

comment:8 Changed 4 years ago by git

  • Commit changed from b38d602cec012b4f790d6d7158c27e0d660534b1 to a7d28ba6c27cbb585982253506d7bf98f7fb5c12

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

3ac3044Trac #19423: rename _taylor_ to _power_series_
4c5edd6Trac #19423: new method _main_term_relative_error_
c3aeae8Trac #19423: refactor log to use _main_term_relative_error_
2a76cd7Trac #19423: refactor __invert__ to use _main_term_relative_error_
1a526b7Trac #19423: Merge #19946 to fix merge conflict
9a58142Trac #19423: document parameter precision
c56a095Trac #19423: doctests for precision
eb10a2aTrac #19316: merge latest version of #19423
a7d28baTrac #19316: use _main_term_relative_error_

comment:9 Changed 4 years ago by git

  • Commit changed from a7d28ba6c27cbb585982253506d7bf98f7fb5c12 to 6d44199f95365f50b1bbc9170b0f71c0d6022316

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

6d44199Trac #19316: fix 0^0

comment:10 follow-up: Changed 4 years ago by cheuberg

  • Authors changed from Daniel Krenn to Daniel Krenn, Clemens Heuberger
  • Milestone changed from sage-6.10 to sage-7.1
  • Reviewers set to Clemens Heuberger
  • Status changed from needs_work to needs_review

I reviewed your code, merged latest version of #19423 and adapted to use main_term_relative_error. This now needs review.

comment:11 Changed 4 years ago by dkrenn

  • Branch changed from u/cheuberg/asy/pow_rational to u/dkrenn/asy/pow_rational

comment:12 in reply to: ↑ 10 Changed 4 years ago by dkrenn

  • Commit changed from 6d44199f95365f50b1bbc9170b0f71c0d6022316 to 44e314c12548ce8413d084e77da1df7a0c3198f2

Replying to cheuberg:

I reviewed your code, merged latest version of #19423 and adapted to use main_term_relative_error. This now needs review.

LGTM, merged in #19423 again and removed two code lines (were already commented out), which were used for testing purposes.


New commits:

1b44d48Trac #19423: change ZeroDivisionError message
ecbeb26Trac #19423: rephrase OUTPUT-block of _main_term_relative_error_
f21ea78Trac #19423: new parameter to return inverse of main term in _main_term_relative_error_
7974666Trac #19423: use new parameter of previous commit
b091009Trac #19423: minor code rewrite to improve readability
96f1ea6Trac #19423: correct parent in __invert__
a61913cMerge branch 'u/dkrenn/asy/exploginv_taylor' of trac.sagemath.org:sage into t/19316/asy/pow_rational
44e314cTrac #19316: remove two commented code lines

comment:13 Changed 4 years ago by dkrenn

  • Reviewers changed from Clemens Heuberger to Daniel Krenn, Clemens Heuberger
  • Status changed from needs_review to positive_review

comment:14 follow-up: Changed 4 years ago by cheuberg

  • Status changed from positive_review to needs_info

I think that while merging the latest version of #19423, you inadvertently reverted commit 1b44d48 Trac #19423: change ZeroDivisionError message.

comment:15 Changed 4 years ago by git

  • Commit changed from 44e314c12548ce8413d084e77da1df7a0c3198f2 to 37917b287453015084690b3b5dcbd6240f799ca4

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

37917b2Trac #19316: change ZeroDivisonError message again (after merge; something went wrong earlier)

comment:16 in reply to: ↑ 14 Changed 4 years ago by dkrenn

  • Status changed from needs_info to positive_review

Replying to cheuberg:

I think that while merging the latest version of #19423, you inadvertently reverted commit 1b44d48 Trac #19423: change ZeroDivisionError message.

Changed.

comment:17 Changed 4 years ago by vbraun

  • Branch changed from u/dkrenn/asy/pow_rational to 37917b287453015084690b3b5dcbd6240f799ca4
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.