Opened 4 years ago
Closed 4 years ago
#19510 closed enhancement (fixed)
asymptotic expansion generator for binomial(kn, n)
Reported by:  dkrenn  Owned by:  

Priority:  major  Milestone:  sage7.1 
Component:  asymptotic expansions  Keywords:  
Cc:  behackl, cheuberg  Merged in:  
Authors:  Daniel Krenn  Reviewers:  Clemens Heuberger 
Report Upstream:  N/A  Work issues:  
Branch:  c998922 (Commits)  Commit:  c9989221b159e595cfc2ae08077cc3b6757f477a 
Dependencies:  #19306, #19521, #19528, #19957  Stopgaps: 
Description
Implement a generator for binomial(k*n, n)
.
Change History (22)
comment:1 Changed 4 years ago by
 Branch set to u/dkrenn/asy/generatorsbinomial
comment:2 Changed 4 years ago by
 Commit set to 221ad4f3ea14d1856ed432bacda948a718615639
 Dependencies changed from #19306 to #19306, #19521
comment:3 Changed 4 years ago by
 Dependencies changed from #19306, #19521 to #19306, #19521, #19528
comment:4 Changed 4 years ago by
 Commit changed from 221ad4f3ea14d1856ed432bacda948a718615639 to 4a27e66ce1f942ebe4f3ac91ee0c0cb431739052
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
a2b744d  Merge branch 'coerce/inverseaction' into asy/generatorsbinomial

1bd2223  make Binomial_kn_n really working

421e377  mutable poset map: remove elements ``None``

1d28240  term monoid: write change_parameter

2c37889  correct a bug in change_parameter

bdcb72b  write map_coefficients

2a0815d  Merge branch 'asy/map_coefficients' into asy/generatorsbinomial

e93ce46  simplify coefficients automatically and use the faster algorithm per default

f468de6  docu

4a27e66  result over QQ if skipparameter given

comment:5 Changed 4 years ago by
 Commit changed from 4a27e66ce1f942ebe4f3ac91ee0c0cb431739052 to e59c71f0c97a00310b0c30864f38f457462c13e1
Branch pushed to git repo; I updated commit sha1. New commits:
e59c71f  toc entry (at top of file)

comment:6 Changed 4 years ago by
 Status changed from new to needs_review
comment:7 Changed 4 years ago by
 Commit changed from e59c71f0c97a00310b0c30864f38f457462c13e1 to ea3dd35b42a60e491423b25f706ff50a4739e643
Branch pushed to git repo; I updated commit sha1. New commits:
ea3dd35  small bugfix

comment:8 Changed 4 years ago by
 Branch changed from u/dkrenn/asy/generatorsbinomial to u/cheuberg/asy/generatorsbinomial
comment:9 Changed 4 years ago by
 Commit changed from ea3dd35b42a60e491423b25f706ff50a4739e643 to 1529a4daf6eacfaac708816fdd5c4ee87fe127de
 Milestone changed from sage6.10 to sage7.1
Merged latest version of #19306 to avoid doctest failure.
New commits:
cc256c8  Trac #19306: remove old code

31e4dc4  Trac #19306: other variables than n

a3fad56  Trac #19306: fix error terms for low precision

a4c3f9d  Trac #19306: Fix low precision for Stirling

eac4977  Trac #19306: minor changes (crossreview and incorporate reviewer comments)

946a828  Trac #19306: change % to .format

809d653  Trac #19306: Merge tag '7.0' due to #19879

4d80eb3  Trac #19306: sage.rings.arith > sage.arith.all (after #19879)

1529a4d  Trac #19510: Merge #19306 (due to #19879)

comment:10 Changed 4 years ago by
 Commit changed from 1529a4daf6eacfaac708816fdd5c4ee87fe127de to 5d9152ce307eafd280374cce90ff05c7fa2937c2
comment:11 followup: ↓ 13 Changed 4 years ago by
 Reviewers set to Clemens Heuberger
 Status changed from needs_review to needs_work
Reviewed the code (without its dependency #19521) and the documentation, but did not yet verify the final output of the doctests. I had to modify the "constant factor" in order to get rational coefficients when k1
is not a square.
I am not happy with the growth group of the output:
(e^(n*log(n)))^(Symbolic Constants Subring)
will never occur.log(n)^(Symbolic Constants Subring)
will never occur.(e^n)^(Symbolic Constants Subring)
is hard to read; actually, the only exponential factor that will ever occur is(k^k/(k1)^(k1))^n
, soFractionField(k.parent())^n
would be enough (soQQ^n
in all examples). However, it is not clear to me how to implement this without pain.
comment:12 Changed 4 years ago by
 Branch changed from u/cheuberg/asy/generatorsbinomial to u/dkrenn/asy/generatorsbinomial
comment:13 in reply to: ↑ 11 Changed 4 years ago by
 Commit changed from 5d9152ce307eafd280374cce90ff05c7fa2937c2 to 10cd04bde3be402ea4c3550793475135096f27fb
 Status changed from needs_work to needs_review
Replying to cheuberg:
Reviewed the code (without its dependency #19521) and the documentation, but did not yet verify the final output of the doctests. I had to modify the "constant factor" in order to get rational coefficients when
k1
is not a square.I am not happy with the growth group of the output:
(e^(n*log(n)))^(Symbolic Constants Subring)
will never occur.log(n)^(Symbolic Constants Subring)
will never occur.(e^n)^(Symbolic Constants Subring)
is hard to read; actually, the only exponential factor that will ever occur is(k^k/(k1)^(k1))^n
, soFractionField(k.parent())^n
would be enough (soQQ^n
in all examples). However, it is not clear to me how to implement this without pain.
More or less complete rewrite of function.
Last 10 new commits:
1b62954  Trac #19946: add doctests to document behavior

24c153c  Trac #19946: reviewer commit: ReSt error

7918417  Trac #19946: additional doctest

1471336  Trac #19946: rewrite and improve explaination of 1b62954

9f9a23f  Trac #19961: document rpow

101e4de  Merge branch 'u/dkrenn/t/19961' of trac.sagemath.org:sage into t/19946

7179c78  Trac #19946: link from general doc to detailed explaination

1259201  Trac #19946: fix typo

37caf25  Merge branch 'u/cheuberg/t/19946' of trac.sagemath.org:sage into t/19510/asy/generatorsbinomial

10cd04b  Trac #19510: major rewrite of binomial kn over n

comment:14 Changed 4 years ago by
 Branch changed from u/dkrenn/asy/generatorsbinomial to u/cheuberg/asy/generatorsbinomial
comment:15 Changed 4 years ago by
 Commit changed from 10cd04bde3be402ea4c3550793475135096f27fb to 78bdd0f93c1c45c6b93fc631d99c95f7d79c76a7
 Dependencies changed from #19306, #19521, #19528 to #19306, #19521, #19528, #19957
I reviewed this version.
I merged #19957 and added doctests using compare_with_values
. Please crossreview and set to positive if you are satisfied.
Last 10 new commits:
7337e61  Trac 19957 review: restructure part of the code and remove inner list to make it better readable

0632fd3  Trac 19957 review: minor changes in doc

4a8ea9a  Trac #19957: move see also blocks to position given in developer guide

9ea47b9  Trac #19957: fix dead link

3d51289  Trac #19957: Merge #19946 to avoid workaround

b606fdf  Trac #19957: remove workaround for #19946

4346994  Trac #19957: rename e to expansion in doctests

5d6e9b2  Trac #19957: Introduce parameter relative tolerance

00eae5d  Merge branch 't/19957/asy/comparewithvalues' into t/19510/asy/generatorsbinomial

78bdd0f  Trac #19510: additional doctests using compare_with_values

comment:16 Changed 4 years ago by
 Status changed from needs_review to positive_review
comment:17 Changed 4 years ago by
 Status changed from positive_review to needs_work
sage t long src/sage/rings/asymptotic/asymptotic_expansion_generators.py ********************************************************************** File "src/sage/rings/asymptotic/asymptotic_expansion_generators.py", line 141, in sage.rings.asymptotic.asymptotic_expansion_generators.AsymptoticExpansionGenerators.Stirling Failed example: expansion.compare_with_values(n, lambda x: x.factorial(), [5, 10, 20]) Expected: [(5, 0.00675841118?), (10, 0.0067589306?), (20, 0.006744925?)] Got: [(5, 0.006758411181?), (10, 0.0067589306?), (20, 0.006744925?)] ********************************************************************** 1 item had failures: 1 of 11 in sage.rings.asymptotic.asymptotic_expansion_generators.AsymptoticExpansionGenerators.Stirling [45 tests, 1 failure, 8.78 s]
comment:18 Changed 4 years ago by
 Commit changed from 78bdd0f93c1c45c6b93fc631d99c95f7d79c76a7 to 2b713794ab0c19bc98fb4088a32fdb5b93ebc6e6
Branch pushed to git repo; I updated commit sha1. New commits:
2b71379  Trac #19510: specify relative tolerance for doctests

comment:19 Changed 4 years ago by
 Status changed from needs_work to needs_review
Added relative tolerance.
comment:20 Changed 4 years ago by
 Branch changed from u/cheuberg/asy/generatorsbinomial to u/dkrenn/asy/generatorsbinomial
comment:21 Changed 4 years ago by
 Commit changed from 2b713794ab0c19bc98fb4088a32fdb5b93ebc6e6 to c9989221b159e595cfc2ae08077cc3b6757f477a
 Status changed from needs_review to positive_review
New commits:
c998922  Trac #19510: constitent spacings

comment:22 Changed 4 years ago by
 Branch changed from u/dkrenn/asy/generatorsbinomial to c9989221b159e595cfc2ae08077cc3b6757f477a
 Resolution set to fixed
 Status changed from positive_review to closed
Last 10 new commits:
use symbolic constants subring (instead of SR)
remove automatic parenthesing in parent_to_repr_short
fix bug in split_str_by_op
binomial_kn_n: change to symbolic constants subring (WIP)
rename binomial* > Binomial*
delete code of binomial* since it was
Merge branch 't/19306/asy/generators' into asy/generatorsbinomial
change base class to SageObject
write docstrings of Stirling generators
Merge branch 't/19306/asy/generators' into asy/generatorsbinomial