Opened 8 months ago

Closed 7 weeks ago

#26587 closed defect (fixed)

correctly handle exponential growth in asymptotic ring

Reported by: dkrenn Owned by:
Priority: major Milestone: sage-8.8
Component: asymptotic expansions Keywords:
Cc: behackl Merged in:
Authors: Daniel Krenn Reviewers: Benjamin Hackl
Report Upstream: N/A Work issues:
Branch: 22e2957 (Commits) Commit: 22e295758f2bcf02d9f8cb42abbd9363a33ee7c2
Dependencies: #26588 Stopgaps:

Description

The base of an exponential growth element can be any number, but indeed it should only be a positive number and its argument should be dealt with in a separate way (as this does not contribute to the growth, but still distinguishes different elements, e.g. (-2)^n and 2^n. As a consequence, the sorting of the terms in an asymptotic expansion is not correct and as one wanted.

E.g. one might get something

3/32*(-1)^n*n^(-4) + 3/8*(-1)^n*n^(-5) + O((-1)^n*n^(-6)) + (-1/27*I*sqrt(3) + 1/27)*(-zeta3 - 1)^n*n^(-3) + (-1/9*I*sqrt(3) + 1/3)*(-zeta3 - 1)^n*n^(-4) + O((-zeta3 - 1)^n*n^(-5)) + 133/72*n + 7/12*log(n) + 7/12*euler_gamma - 1/6*a0*(I*sqrt(3) + 1) - 1/6*a1*(-I*sqrt(3) + 1) - 1/4*a2 - 23/6 - 11/36*n^(-1) + O(n^(-2)) + (1/27*I*sqrt(3) + 1/27)*zeta3^n*n^(-3) + (1/9*I*sqrt(3) + 1/3)*zeta3^n*n^(-4) + O(zeta3^n*n^(-5))

(copied out of some larger computation)

Change History (24)

comment:1 Changed 8 months ago by dkrenn

  • Branch set to u/dkrenn/asy-roots-of-unity-etc

comment:2 Changed 8 months ago by dkrenn

  • Commit set to ebf3d85d160e9975b4cf39559f5648b783727c3b
  • Dependencies set to #26588

Last 10 new commits:

b71c441extend element constructor for partial conversion elements
79276e3update doctests due to nonnegativity
6950ea8minor code simplification due to nonnegativity
1cbad39extend splitting of raw elements to all complex fields
01b6403extend growth group factory
608c296allow splitting of symbolic elements
1a0f5a9fix remaining doctests
96de88aExponentialArgumentGrowthGroup
a14dec4...Functor
ebf3d85test category

comment:3 Changed 8 months ago by git

  • Commit changed from ebf3d85d160e9975b4cf39559f5648b783727c3b to fa684a21d23de82d1139cc7acf67fbd4899e458e

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

9200823extend docstrings and complete them
1a5fb6cfixup conversion string to parent and fixup related doctests
1ce1501factor out NonGrowthGroup
26eeca7docstring of group_factory in exponential groups
da51c19refactor group_factory
e13c97asimplify a method
35070e2fixup classes
4cd7643set non_growth_group class
711c61cextend growth group factory to deal correctly with argument growth groups
fa684a2rename to _non_growth_group_class_

comment:4 Changed 8 months ago by git

  • Commit changed from fa684a21d23de82d1139cc7acf67fbd4899e458e to d1a0417095f29c62f76869f4cdd3d37c94d166df

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

d01abd4move non_growth_group-methods to GenericGrowthGroup
a4d2ec1non_growth_group method for monimial groups
c2a1859fixup doctests
67e0046fix imports in doctest
b6ffb11add monomial non-growth groups
3e96f9esolve a minor bug in repr
2e7bb26extend growth group factory to monomial non-growth groups
8e67f6cadd some more doctests to factory
3247905small update in docstring
d1a0417factory for monomial growth groups

comment:5 Changed 8 months ago by git

  • Commit changed from d1a0417095f29c62f76869f4cdd3d37c94d166df to ae99d04a612f3d1feac9ad48da47c975b2edcaa5

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

0e68723I: add a doctest
541148bU: make the docs build
ae99d04Merge branch 'u/dkrenn/roots-of-unity-group' into u/dkrenn/asy-roots-of-unity-etc

comment:6 Changed 8 months ago by git

  • Commit changed from ae99d04a612f3d1feac9ad48da47c975b2edcaa5 to 3804f505739d2b1dc7e9fca621c8b98cfd33891f

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

da0d3dcU: index new groups
3804f50Merge branch 'u/dkrenn/roots-of-unity-group' into u/dkrenn/asy-roots-of-unity-etc

comment:7 Changed 8 months ago by git

  • Commit changed from 3804f505739d2b1dc7e9fca621c8b98cfd33891f to c3dcbe37a77fb7f811d0bb0b7e6b516bed3700fd

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

9e05089fix inversion bug in exponential growth group
72bd4eawhitespaces
a2d2fcffix and extend doctests in asymptotic_ring
d368958helper function for stripping the symbolic part of exponents in pow
ad7a216solve bug on pow, rpow by dealing with symbolic exponents
a563d8fcorrect typo in docstring
efd6443fix doctests after last change (pow/exponents)
3652b18fix QQ_+ doctests on growth_group_cartesian
8f69ccefix one more doctest in term_monoid
c3dcbe3adapt growth group used in binomial generator

comment:8 Changed 7 months ago by git

  • Commit changed from c3dcbe37a77fb7f811d0bb0b7e6b516bed3700fd to 7810433064d8e857c223ac1d8997c29c47d20525

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

2466bdcimplement _an_element_ for exponential growth groups
3f0d5f6check positivity wrt SR in __init__ of exponential growth groups
cef2e5efix doctests by assumptions on SR
d949a25add an additional doctest
f0e16c4fix doctests (U --> S)
3f78197fix doctest (U-->S) for cartesian growth groups
f1b4b0ffix doctests (U-->S) for term monoids
003cf78fix doctests asymptotic ring (U-->S, assumptions SR)
6b42bc8extend repr_op to take care of operator '_'
7810433fix powers/rpow/cyclotomicfield conversion/coercion bug

comment:9 Changed 7 months ago by dkrenn

  • Cc behackl added
  • Status changed from new to needs_review

comment:10 Changed 7 months ago by git

  • Commit changed from 7810433064d8e857c223ac1d8997c29c47d20525 to 0780a3f57544fd9af14fb783b5a4b1a718964702

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

b2857e9U: absolute value
57b4a92Merge branch 'u/dkrenn/roots-of-unity-group' into u/dkrenn/asy-roots-of-unity-etc
cfc8b42_an_element_base_ for ExponentialNonGrowthGroup
182afd0factor out additional check and skip it for ExponentialNonGrowthGroup
fdfdb1aextend error message for additional check
0a100ccpy3-correctly handle exceptions
3e7f385py3: islice
0780a3fMerge tag '8.5.beta2' into u/dkrenn/asy-roots-of-unity-etc

comment:11 Changed 7 months ago by git

  • Commit changed from 0780a3f57544fd9af14fb783b5a4b1a718964702 to 05f08448888d7a4d0d47972239c7f5ea6160ae34

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

8d05984Trac #26146 (py3): avoid comparison of NoneType and tuple
9e1bedbTrac #26146 (py3): fix escape in re.sub
1b73a77Trac #26146 (py3): handle raised exceptions properly
2b124c5Trac #26146 (py3): fix Heisenbug due to non-sorting of subsets
05f0844Merge branch 'u/dkrenn/asy-py3' of git://trac.sagemath.org/sage into u/dkrenn/asy-roots-of-unity-etc

comment:12 Changed 7 months ago by dkrenn

Some small update to take care of a trivial merge conflict in the current 8.5.beta2 and make everything Python3-compatible.

comment:13 Changed 7 months ago by git

  • Commit changed from 05f08448888d7a4d0d47972239c7f5ea6160ae34 to 4059d0d00a1e384619a6cac48e6d3ecad31ecbcf

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

f82c1a2Trac #26587: fix doctests other than sage.rings.asymptotic
4059d0dMerge branch 'u/dkrenn/asy-roots-of-unity-etc-8.4' into u/dkrenn/asy-roots-of-unity-etc

comment:14 Changed 7 months ago by dkrenn

Ok, patchbot was not happy; changed, so let's give it another try...


New commits:

f82c1a2Trac #26587: fix doctests other than sage.rings.asymptotic
4059d0dMerge branch 'u/dkrenn/asy-roots-of-unity-etc-8.4' into u/dkrenn/asy-roots-of-unity-etc

New commits:

f82c1a2Trac #26587: fix doctests other than sage.rings.asymptotic
4059d0dMerge branch 'u/dkrenn/asy-roots-of-unity-etc-8.4' into u/dkrenn/asy-roots-of-unity-etc

comment:15 Changed 3 months ago by git

  • Commit changed from 4059d0d00a1e384619a6cac48e6d3ecad31ecbcf to a5fefd2d22e76b263e5a960ee76d888e6bf57a4d

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

c994b45Merge tag '8.7' into u/dkrenn/asy-roots-of-unity-etc
6b50c47Trac #26587: rename variable in doctest
01aef0fMerge tag '8.7' into u/dkrenn/roots-of-unity-group
48523adextend conversion repr<-->parent (cherry-pick)
9aab729remove import
a5fefd2Merge branch 'u/dkrenn/roots-of-unity-group' into HEAD

comment:16 Changed 3 months ago by dkrenn

Merged in 8.7.

comment:17 Changed 2 months ago by behackl

  • Branch changed from u/dkrenn/asy-roots-of-unity-etc to u/behackl/asy/roots-of-unity-etc
  • Commit changed from a5fefd2d22e76b263e5a960ee76d888e6bf57a4d to 7c1a021e1e75160bb1ec063f829669c5838eb649
  • Reviewers set to Benjamin Hackl

Merged changes from #26588 and fixed one failing doctest. I'll have a look at this now.


New commits:

980825cabs(AbstractArgument) should not return Python int
c3d5c15additional doctests w.r.t. normalization
7c7eb1ftest that global methods real_part and imag_part also work
a193018Merge branch 'asy/roots-of-unity-group' into asy/roots-of-unity-etc
7c1a021fix failing doctest (QQ^y --> (QQ_+)^y)

comment:18 Changed 2 months ago by dkrenn

  • Branch changed from u/behackl/asy/roots-of-unity-etc to u/dkrenn/asy/roots-of-unity-etc

comment:19 follow-up: Changed 2 months ago by behackl

  • Commit changed from 7c1a021e1e75160bb1ec063f829669c5838eb649 to 22e295758f2bcf02d9f8cb42abbd9363a33ee7c2

These changes look good and produce a working version of the creation of the AsymptoticRing. I only have minor remarks, namely:

  • growth_group.py
    1. L2855: str(self.exponent).isalpha() can probably even be str(self.exponent).isidentifier().
    2. L5348: I'd suggest trimming multiple spaces such that not only 'ZZ * I' or 'ZZ *I', but maybe also 'ZZ * I' and friends are recognized.

New commits:

8a6b4caTrac #26587: use isidentifier
7620a4fTrac #26588: kwds passed on to element during construction
3d72ec3Trac #26588: return type of __abs__
31668d6Trac #26588: move exactly_one_is_true to sage.misc.misc
9d7173dTrac #26588: add doctest for normalize=False
1c3e52fMerge branch 't/26588/asy/roots-of-unity-groups' into t/26587/asy/roots-of-unity-etc
22e2957Trac #26587: handle multiple spaces in growth group string

comment:20 in reply to: ↑ 19 ; follow-up: Changed 2 months ago by dkrenn

Replying to behackl:

These changes look good and produce a working version of the creation of the AsymptoticRing. I only have minor remarks, namely:

  • growth_group.py
    1. L2855: str(self.exponent).isalpha() can probably even be str(self.exponent).isidentifier().

Done in

8a6b4caTrac #26587: use isidentifier
  1. L5348: I'd suggest trimming multiple spaces such that not only 'ZZ * I' or 'ZZ *I', but maybe also 'ZZ * I' and friends are recognized.

Done in

22e2957Trac #26587: handle multiple spaces in growth group string

comment:21 in reply to: ↑ 20 Changed 2 months ago by behackl

  • Milestone changed from sage-8.5 to sage-8.8
  • Status changed from needs_review to positive_review

Replying to dkrenn:

  • growth_group.py
    1. L2855: str(self.exponent).isalpha() can probably even be str(self.exponent).isidentifier().

Done in

8a6b4caTrac #26587: use isidentifier

LGTM

  1. L5348: I'd suggest trimming multiple spaces such that not only 'ZZ * I' or 'ZZ *I', but maybe also 'ZZ * I' and friends are recognized.

Done in

22e2957Trac #26587: handle multiple spaces in growth group string

LGTM.

Thank you.

comment:22 Changed 2 months ago by behackl

  • Status changed from positive_review to needs_review

... waiting for the patchbot before setting this to positive_review.

comment:23 Changed 2 months ago by behackl

  • Status changed from needs_review to positive_review

comment:24 Changed 7 weeks ago by vbraun

  • Branch changed from u/dkrenn/asy/roots-of-unity-etc to 22e295758f2bcf02d9f8cb42abbd9363a33ee7c2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.