#19946 closed defect (fixed)
Asymptotic Ring: cannot construct 2^n when coefficient ring is SR
Reported by:  cheuberg  Owned by:  

Priority:  major  Milestone:  sage7.1 
Component:  asymptotic expansions  Keywords:  
Cc:  dkrenn, behackl  Merged in:  
Authors:  Daniel Krenn  Reviewers:  Clemens Heuberger 
Report Upstream:  N/A  Work issues:  
Branch:  1259201 (Commits, GitHub, GitLab)  Commit:  
Dependencies:  #19961  Stopgaps: 
Description (last modified by )
The following is unexpected:
sage: A.<n> = AsymptoticRing('QQ^n * n^QQ', SR) sage: 2^n Traceback (most recent call last): ... ArithmeticError: Cannot construct 2^n in Growth Group QQ^n * n^QQ > *previous* TypeError: unsupported operand parent(s) for '*': 'Growth Group QQ^n * n^QQ' and 'Growth Group SR^n'
The only workaround I found until now is
sage: A(AsymptoticRing(growth_group='QQ^n', coefficient_ring=ZZ)('2^n')) 2^n
Once this is fixed, the workaround should be removed from #19532 (asymptotic_expansions.SingularityAnalysis
).
Change History (14)
comment:1 Changed 5 years ago by
 Description modified (diff)
comment:2 in reply to: ↑ description Changed 5 years ago by
comment:3 Changed 5 years ago by
 Branch set to u/dkrenn/t/19946
comment:4 Changed 5 years ago by
 Commit set to 1b62954467b74292e349a1631f9837dbe8ff9c3b
 Status changed from new to needs_review
I've fixed the original problem. However, there is the following:
sage: T = TermMonoid('exact', GrowthGroup('QQ^n * n^QQ'), SR) sage: n = T('n') sage: n.rpow(2) 2^n sage: _.parent() Exact Term Monoid QQ^n * n^SR with coefficients in Symbolic Ring Above, we get ``QQ^n * n^SR`` since :: sage: (n^SR(1)).parent() Exact Term Monoid QQ^n * n^SR with coefficients in Symbolic Ring and that is because of sage: (QQ(2)^SR(1)).parent(), (QQ(1)*SR(1)).parent() (Rational Field, Symbolic Ring)
For me this is fine; although it is not nice. What do you think?
New commits:
1fc00c7  Trac #19946: fix _pushout_ for cartesian product of growth groups

1b62954  Trac #19946: add doctests to document behavior

comment:5 Changed 5 years ago by
 Branch changed from u/dkrenn/t/19946 to u/cheuberg/t/19946
comment:6 followups: ↓ 8 ↓ 9 Changed 5 years ago by
 Commit changed from 1b62954467b74292e349a1631f9837dbe8ff9c3b to 7918417adce86770e782d2f7607f8be6f80c258d
Reviewed your changes, main bug is fixed; two reviewer commits added; but I do not understand the explanation why we fall into QQ^n * n^SR
. For future investigations I would prefer to have a good explanation once we intend to fix this pushout explosion. But that would be another ticket.
New commits:
24c153c  Trac #19946: reviewer commit: ReSt error

7918417  Trac #19946: additional doctest

comment:7 Changed 5 years ago by
 Branch changed from u/cheuberg/t/19946 to u/dkrenn/t/19946
comment:8 in reply to: ↑ 6 Changed 5 years ago by
 Commit changed from 7918417adce86770e782d2f7607f8be6f80c258d to 7179c784bbd69881e7505053ff5bfb50ecdb1371
 Dependencies set to #19961
Replying to cheuberg:
two reviewer commits added;
Crossreviewed.
but I do not understand the explanation why we fall into
QQ^n * n^SR
. For future investigations I would prefer to have a good explanation once we intend to fix this pushout explosion.
Rewritten.
But that would be another ticket.
Ok.
I've merged #19961 and made a link from there to this new explaination.
New commits:
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

comment:9 in reply to: ↑ 6 Changed 5 years ago by
comment:10 Changed 5 years ago by
 Reviewers set to Clemens Heuberger
 Status changed from needs_review to positive_review
LGTM, thank you.
comment:11 Changed 5 years ago by
 Branch changed from u/dkrenn/t/19946 to u/cheuberg/t/19946
comment:12 Changed 5 years ago by
 Commit changed from 7179c784bbd69881e7505053ff5bfb50ecdb1371 to 1259201fe2a01fd64adf0b21489ecb8f321a987f
comment:13 Changed 5 years ago by
 Branch changed from u/cheuberg/t/19946 to 1259201fe2a01fd64adf0b21489ecb8f321a987f
 Resolution set to fixed
 Status changed from positive_review to closed
comment:14 Changed 3 years ago by
 Commit 1259201fe2a01fd64adf0b21489ecb8f321a987f deleted
This ticket has added a few doctests of the form
sage: A.<n> = AsymptoticRing('QQ^n * n^QQ', SR) sage: n.rpow(2) 2^n sage: _.parent() Asymptotic Ring <QQ^n * n^SR> over Symbolic Ring
With #19945, the last result will change to
Asymptotic Ring <SR^n * n^SR> over Symbolic Ring
I think that this change makes sense, since a coercion of QQ
and SR
should end up in SR
. If you object, please comment at #19945.
Replying to cheuberg:
The workaround
works. However, for some reason (I still have to track this down) the parent changes to