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

AsymptoticRing.coefficients_of_generating_function: hardcoded exponents in QQ #21659

Open
cheuberg opened this issue Oct 7, 2016 · 11 comments
Open

Comments

@cheuberg
Copy link
Contributor

cheuberg commented Oct 7, 2016

The method AsymptoticRing.coefficients_of_generating_function enforces exponents to be in QQ:

sage: R.<n> = AsymptoticRing('n^QQbar', QQbar)
sage: R.coefficients_of_generating_function(lambda z: (1-z)^(1/2), [1], 1)
-1/2/sqrt(pi)*n^(-3/2) + O(n^(-5/2))
sage: R.coefficients_of_generating_function(lambda z: (1-z)^QQbar(sqrt(2)), [1], 1)
Traceback (most recent call last):
...
ValueError: Cannot include T^(-1.414213562373095?) with parent Exact Term Monoid
T^(Algebraic Field) * log(T)^(Algebraic Field) with coefficients in Symbolic
Ring in Asymptotic Ring <T^QQ * log(T)^QQ> over Symbolic Ring
> *previous* ValueError: T^(-1.414213562373095?) is not in Growth Group T^QQ * log(T)^QQ

The problem is that the singular expansion is always constructed in

A = AsymptoticRing('T^QQ * log(T)^QQ', coefficient_ring=SR,
                   default_prec=precision)

Depends on #21963

CC: @behackl @dkrenn

Component: asymptotic expansions

Keywords: singularity analysis

Work Issues: remove fix for QQbar(1/2)

Author: Clemens Heuberger

Branch/Commit: u/dkrenn/21659/singularity-analysis-qqbar @ 71af378

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

@cheuberg
Copy link
Contributor Author

cheuberg commented Oct 7, 2016

@cheuberg
Copy link
Contributor Author

cheuberg commented Oct 7, 2016

Commit: 382abb8

@cheuberg
Copy link
Contributor Author

cheuberg commented Oct 7, 2016

comment:2

Here is a first version of a fix. Unfortunately, some workaround is needed due to the fact that gamma(QQbar(1/2)) does not work, see post on sage-devel.

What I do not understand is that

sage: B.<n> = AsymptoticRing('n^QQbar', SR)
sage: B.coefficients_of_generating_function(
....:     lambda z: (1-z)^QQbar(sqrt(2)), [1], precision=1, exponent_ring=QQbar)
0.384695296551923*n^(-2.414213562373095?) + O(n^(-3.414213562373095?))

works but

sage: B.<n> = AsymptoticRing('QQbar^n * n^QQbar', SR)
sage: B.coefficients_of_generating_function(
....:     lambda z: (1-z)^QQbar(sqrt(2)), [1], precision=1, exponent_ring=QQbar)
Traceback (most recent call last)
...
TypeError: Cannot apply the substitution rules {Z: n} on 0.384695296551923*Z^(-2.414213562373095?) + 0.656715949434358*Z^(-3.414213562373095?) + 0.979573650974364*Z^(-4.414213562373095?) + O(Z^(-5.414213562373095?)) in Asymptotic Ring <Z^(Algebraic Field)> over Symbolic Ring.
> *previous* ValueError: Cannot substitute in 0.384695296551923*Z^(-2.414213562373095?) + 0.656715949434358*Z^(-3.414213562373095?) + 0.979573650974364*Z^(-4.414213562373095?) + O(Z^(-5.414213562373095?)) in Asymptotic Ring <Z^(Algebraic Field)> over Symbolic Ring.
>> *previous* ValueError: Cannot substitute in O(Z^(-5.414213562373095?)) in O-Term Monoid Z^(Algebraic Field) with implicit coefficients in Symbolic Ring.
>>> *previous* ValueError: Cannot substitute in Z^(-5.414213562373095?) in Growth Group Z^(Algebraic Field).
>>>> *previous* ValueError: Cannot take n to the exponent -5.414213562373095?.
>>>>> *previous* TypeError: no canonical coercion from Algebraic Field to Rational Field

does not.


New commits:

382abb8Trac #21659: Singularity Analysis with exponents from QQbar

@cheuberg
Copy link
Contributor Author

cheuberg commented Oct 7, 2016

Author: Clemens Heuberger

@cheuberg
Copy link
Contributor Author

cheuberg commented Oct 8, 2016

comment:3

Replying to @cheuberg:

What I do not understand is that

sage: B.<n> = AsymptoticRing('n^QQbar', SR)
sage: B.coefficients_of_generating_function(
....:     lambda z: (1-z)^QQbar(sqrt(2)), [1], precision=1, exponent_ring=QQbar)
0.384695296551923*n^(-2.414213562373095?) + O(n^(-3.414213562373095?))

works but

sage: B.<n> = AsymptoticRing('QQbar^n * n^QQbar', SR)
sage: B.coefficients_of_generating_function(
....:     lambda z: (1-z)^QQbar(sqrt(2)), [1], precision=1, exponent_ring=QQbar)
Traceback (most recent call last)
...
TypeError: Cannot apply the substitution rules {Z: n} on 0.384695296551923*Z^(-2.414213562373095?) + 0.656715949434358*Z^(-3.414213562373095?) + 0.979573650974364*Z^(-4.414213562373095?) + O(Z^(-5.414213562373095?)) in Asymptotic Ring <Z^(Algebraic Field)> over Symbolic Ring.
> *previous* ValueError: Cannot substitute in 0.384695296551923*Z^(-2.414213562373095?) + 0.656715949434358*Z^(-3.414213562373095?) + 0.979573650974364*Z^(-4.414213562373095?) + O(Z^(-5.414213562373095?)) in Asymptotic Ring <Z^(Algebraic Field)> over Symbolic Ring.
>> *previous* ValueError: Cannot substitute in O(Z^(-5.414213562373095?)) in O-Term Monoid Z^(Algebraic Field) with implicit coefficients in Symbolic Ring.
>>> *previous* ValueError: Cannot substitute in Z^(-5.414213562373095?) in Growth Group Z^(Algebraic Field).
>>>> *previous* ValueError: Cannot take n to the exponent -5.414213562373095?.
>>>>> *previous* TypeError: no canonical coercion from Algebraic Field to Rational Field

does not.

This is independent of singularity analysis; see #21665.

@cheuberg
Copy link
Contributor Author

comment:4

The problem with QQbar(1/2) seems to be fixed in pynac/pynac#201 ,
so wait for #21963.

@cheuberg
Copy link
Contributor Author

Dependencies: #21963

@cheuberg
Copy link
Contributor Author

Work Issues: remove fix for QQbar(1/2)

@dkrenn
Copy link
Contributor

dkrenn commented Jun 7, 2019

@dkrenn
Copy link
Contributor

dkrenn commented Jun 7, 2019

comment:6

Merged in SageMath 8.6


New commits:

71af378Merge tag '8.6' into u/cheuberg/21659/singularity-analysis-qqbar

@dkrenn
Copy link
Contributor

dkrenn commented Jun 7, 2019

Changed commit from 382abb8 to 71af378

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

3 participants