Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cheuberg opened this issue Jan 23, 2016 · 22 comments
Closed

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

cheuberg opened this issue Jan 23, 2016 · 22 comments

Comments

@cheuberg
Copy link
Contributor

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

Depends on #19961

CC: @dkrenn @behackl

Component: asymptotic expansions

Author: Daniel Krenn

Branch: 1259201

Reviewer: Clemens Heuberger

Issue created by migration from https://trac.sagemath.org/ticket/19946

@cheuberg

This comment has been minimized.

@dkrenn
Copy link
Contributor

dkrenn commented Jan 25, 2016

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

@dkrenn
Copy link
Contributor

dkrenn commented Jan 26, 2016

Branch: u/dkrenn/t/19946

@dkrenn
Copy link
Contributor

dkrenn commented Jan 26, 2016

Author: Daniel Krenn

@dkrenn
Copy link
Contributor

dkrenn commented Jan 26, 2016

Commit: 1b62954

@dkrenn
Copy link
Contributor

dkrenn commented Jan 26, 2016

comment:4

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

@cheuberg
Copy link
Contributor Author

Changed branch from u/dkrenn/t/19946 to u/cheuberg/t/19946

@cheuberg
Copy link
Contributor Author

comment:6

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

@cheuberg
Copy link
Contributor Author

Changed commit from 1b62954 to 7918417

@dkrenn
Copy link
Contributor

dkrenn commented Jan 26, 2016

Changed branch from u/cheuberg/t/19946 to u/dkrenn/t/19946

@dkrenn
Copy link
Contributor

dkrenn commented Jan 26, 2016

comment:8

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:

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

@dkrenn
Copy link
Contributor

dkrenn commented Jan 26, 2016

Changed commit from 7918417 to 7179c78

@dkrenn
Copy link
Contributor

dkrenn commented Jan 26, 2016

Dependencies: #19961

@dkrenn
Copy link
Contributor

dkrenn commented Jan 26, 2016

comment:9

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.

@cheuberg
Copy link
Contributor Author

comment:10

LGTM, thank you.

@cheuberg
Copy link
Contributor Author

Reviewer: Clemens Heuberger

@cheuberg
Copy link
Contributor Author

Changed branch from u/dkrenn/t/19946 to u/cheuberg/t/19946

@cheuberg
Copy link
Contributor Author

Changed commit from 7179c78 to 1259201

@cheuberg
Copy link
Contributor Author

comment:12

had forgotten to push the fix for one typo.


New commits:

1259201Trac #19946: fix typo

@vbraun
Copy link
Member

vbraun commented Jan 28, 2016

Changed branch from u/cheuberg/t/19946 to 1259201

@jdemeyer
Copy link

jdemeyer commented Jan 8, 2018

comment:14

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.

@jdemeyer
Copy link

jdemeyer commented Jan 8, 2018

Changed commit from 1259201 to none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants