Opened 4 years ago

Closed 4 years ago

Last modified 23 months ago

#19946 closed defect (fixed)

Asymptotic Ring: cannot construct 2^n when coefficient ring is SR

Reported by: cheuberg Owned by:
Priority: major Milestone: sage-7.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) Commit:
Dependencies: #19961 Stopgaps:

Description (last modified by cheuberg)

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 work-around I found until now is

sage: A(AsymptoticRing(growth_group='QQ^n', coefficient_ring=ZZ)('2^n'))
2^n

Once this is fixed, the work-around should be removed from #19532 (asymptotic_expansions.SingularityAnalysis).

Change History (14)

comment:1 Changed 4 years ago by cheuberg

  • Description modified (diff)

comment:2 in reply to: ↑ description Changed 4 years ago by dkrenn

Replying to cheuberg:

The only work-around I found until now is

sage: A(AsymptoticRing(growth_group='QQ^n', coefficient_ring=ZZ)('2^n'))
2^n

The workaround

sage: n.rpow(2)
2^n

works. However, for some reason (I still have to track this down) the parent changes to

sage: n.rpow(1/2).parent()
Asymptotic Ring <QQ^n * n^SR> over Symbolic Ring

comment:3 Changed 4 years ago by dkrenn

  • Branch set to u/dkrenn/t/19946

comment:4 Changed 4 years ago by dkrenn

  • Authors set to Daniel Krenn
  • 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:

1fc00c7Trac #19946: fix _pushout_ for cartesian product of growth groups
1b62954Trac #19946: add doctests to document behavior

comment:5 Changed 4 years ago by cheuberg

  • Branch changed from u/dkrenn/t/19946 to u/cheuberg/t/19946

comment:6 follow-ups: Changed 4 years ago by cheuberg

  • 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:

24c153cTrac #19946: reviewer commit: ReSt error
7918417Trac #19946: additional doctest

comment:7 Changed 4 years ago by dkrenn

  • Branch changed from u/cheuberg/t/19946 to u/dkrenn/t/19946

comment:8 in reply to: ↑ 6 Changed 4 years ago by dkrenn

  • Commit changed from 7918417adce86770e782d2f7607f8be6f80c258d to 7179c784bbd69881e7505053ff5bfb50ecdb1371
  • Dependencies set to #19961

Replying to cheuberg:

two reviewer commits added;

Cross-reviewed.

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:

24c153cTrac #19946: reviewer commit: ReSt error
7918417Trac #19946: additional doctest

New commits:

1471336Trac #19946: rewrite and improve explaination of 1b62954
9f9a23fTrac #19961: document rpow
101e4deMerge branch 'u/dkrenn/t/19961' of trac.sagemath.org:sage into t/19946
7179c78Trac #19946: link from general doc to detailed explaination
Version 0, edited 4 years ago by dkrenn (next)

comment:9 in reply to: ↑ 6 Changed 4 years ago by dkrenn

Replying to cheuberg:

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.

Follow-up is #19965.

comment:10 Changed 4 years ago by cheuberg

  • Reviewers set to Clemens Heuberger
  • Status changed from needs_review to positive_review

LGTM, thank you.

comment:11 Changed 4 years ago by cheuberg

  • Branch changed from u/dkrenn/t/19946 to u/cheuberg/t/19946

comment:12 Changed 4 years ago by cheuberg

  • Commit changed from 7179c784bbd69881e7505053ff5bfb50ecdb1371 to 1259201fe2a01fd64adf0b21489ecb8f321a987f

had forgotten to push the fix for one typo.


New commits:

1259201Trac #19946: fix typo

comment:13 Changed 4 years ago by vbraun

  • Branch changed from u/cheuberg/t/19946 to 1259201fe2a01fd64adf0b21489ecb8f321a987f
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:14 Changed 23 months ago by jdemeyer

  • 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.

Note: See TracTickets for help on using tickets.