Opened 5 years ago
Closed 5 years ago
#19316 closed defect (fixed)
compute asymptotic expansion to some rational directly
Reported by:  dkrenn  Owned by:  

Priority:  major  Milestone:  sage7.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 5 years ago by
 Dependencies changed from #19083 to #19083, #19423
 Milestone changed from sage6.9 to sage6.10
comment:2 Changed 5 years ago by
 Branch set to u/dkrenn/asy/pow_rational
comment:3 Changed 5 years ago by
 Commit set to 58d1f2853cae7adbe66316005855cf436e872de7
 Status changed from new to needs_review
comment:4 Changed 5 years ago by
 Commit changed from 58d1f2853cae7adbe66316005855cf436e872de7 to 10b2a64ffa756f9d54b8f04cac049661c6ea9e86
comment:5 Changed 5 years ago by
 Dependencies changed from #19083, #19423 to #19083, #19423, #19576
comment:6 Changed 5 years ago by
 Branch changed from u/dkrenn/asy/pow_rational to u/cheuberg/asy/pow_rational
comment:7 Changed 5 years ago by
 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:
ffc1bf5  write .sqrt() for asymptotic expansions

1441b31  additional doctest (comparing with power series result)

310780a  Trac #20000: remove redundant pair of parentheses

b38d602  Trac #19316: Merge #20000 due to merge conflict

comment:8 Changed 5 years ago by
 Commit changed from b38d602cec012b4f790d6d7158c27e0d660534b1 to a7d28ba6c27cbb585982253506d7bf98f7fb5c12
Branch pushed to git repo; I updated commit sha1. New commits:
3ac3044  Trac #19423: rename _taylor_ to _power_series_

4c5edd6  Trac #19423: new method _main_term_relative_error_

c3aeae8  Trac #19423: refactor log to use _main_term_relative_error_

2a76cd7  Trac #19423: refactor __invert__ to use _main_term_relative_error_

1a526b7  Trac #19423: Merge #19946 to fix merge conflict

9a58142  Trac #19423: document parameter precision

c56a095  Trac #19423: doctests for precision

eb10a2a  Trac #19316: merge latest version of #19423

a7d28ba  Trac #19316: use _main_term_relative_error_

comment:9 Changed 5 years ago by
 Commit changed from a7d28ba6c27cbb585982253506d7bf98f7fb5c12 to 6d44199f95365f50b1bbc9170b0f71c0d6022316
Branch pushed to git repo; I updated commit sha1. New commits:
6d44199  Trac #19316: fix 0^0

comment:10 followup: ↓ 12 Changed 5 years ago by
 Milestone changed from sage6.10 to sage7.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 5 years ago by
 Branch changed from u/cheuberg/asy/pow_rational to u/dkrenn/asy/pow_rational
comment:12 in reply to: ↑ 10 Changed 5 years ago by
 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:
1b44d48  Trac #19423: change ZeroDivisionError message

ecbeb26  Trac #19423: rephrase OUTPUTblock of _main_term_relative_error_

f21ea78  Trac #19423: new parameter to return inverse of main term in _main_term_relative_error_

7974666  Trac #19423: use new parameter of previous commit

b091009  Trac #19423: minor code rewrite to improve readability

96f1ea6  Trac #19423: correct parent in __invert__

a61913c  Merge branch 'u/dkrenn/asy/exploginv_taylor' of trac.sagemath.org:sage into t/19316/asy/pow_rational

44e314c  Trac #19316: remove two commented code lines

comment:13 Changed 5 years ago by
 Reviewers changed from Clemens Heuberger to Daniel Krenn, Clemens Heuberger
 Status changed from needs_review to positive_review
comment:14 followup: ↓ 16 Changed 5 years ago by
 Status changed from positive_review to needs_info
comment:15 Changed 5 years ago by
 Commit changed from 44e314c12548ce8413d084e77da1df7a0c3198f2 to 37917b287453015084690b3b5dcbd6240f799ca4
Branch pushed to git repo; I updated commit sha1. New commits:
37917b2  Trac #19316: change ZeroDivisonError message again (after merge; something went wrong earlier)

comment:16 in reply to: ↑ 14 Changed 5 years ago by
 Status changed from needs_info to positive_review
comment:17 Changed 5 years ago by
 Branch changed from u/dkrenn/asy/pow_rational to 37917b287453015084690b3b5dcbd6240f799ca4
 Resolution set to fixed
 Status changed from positive_review to closed
Last 10 new commits:
Trac #19423: two code simplifications
Trac #19316: write __pow_number__
Trac #19316: extend existing __pow__ to use new method
Trac #19316: rewrite error message
Merge Trac #19850 into asy/pow_rational
Trac #19316: restructure doctests of pow (add section EXAMPLES)
Trac #19316: allow symbolic constants
Trac #19316: fix ReST doc
Trac #19423: fix ReST doc
Merge branch 'asy/exploginv_taylor' into asy/pow_rational