Opened 6 years ago
Last modified 5 years ago
#21665 new defect
AsymptoticRing.substitute fails with exponents in QQbar
Reported by: | cheuberg | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-7.4 |
Component: | asymptotic expansions | Keywords: | |
Cc: | behackl, dkrenn | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | #22120 | Stopgaps: |
Description
Presence of a redundant exponential growth group lets substitution fail.
sage: A.<T> = AsymptoticRing('T^QQbar', SR) sage: B.<n> = AsymptoticRing('QQbar^n*n^QQbar', SR) sage: C.<p> = AsymptoticRing('n^QQbar', SR) sage: e1 = T^QQbar(sqrt(2)) sage: e1.subs(T=p) n^(1.414213562373095?) sage: e1.subs(T=n) Traceback (most recent call last): ... TypeError: Cannot apply the substitution rules {T: n} on T^(1.414213562373095?) in Asymptotic Ring <T^(Algebraic Field)> over Symbolic Ring. > *previous* ValueError: Cannot substitute in T^(1.414213562373095?) in Asymptotic Ring <T^(Algebraic Field)> over Symbolic Ring. >> *previous* ValueError: Cannot substitute in T^(1.414213562373095?) in Exact Term Monoid T^(Algebraic Field) with coefficients in Symbolic Ring. >>> *previous* ValueError: Cannot substitute in T^(1.414213562373095?) in Growth Group T^(Algebraic Field). >>>> *previous* ValueError: Cannot take n to the exponent 1.414213562373095?. >>>>> *previous* TypeError: no canonical coercion from Algebraic Field to Rational Field
Change History (3)
comment:1 follow-up: ↓ 3 Changed 6 years ago by
comment:2 Changed 6 years ago by
Another related problem:
sage: R.<n> = AsymptoticRing('QQbar^n*n^QQbar', SR) sage: alpha = QQbar(sqrt(2)) sage: n.rpow(alpha) Traceback (most recent call last): ... ValueError: Cannot construct the power of 1.414213562373095? to the exponent n in Asymptotic Ring <(Algebraic Field)^n * n^(Algebraic Field)> over Symbolic Ring. > *previous* ValueError: Cannot take 1.414213562373095?^n to the exponent 1. >> *previous* TypeError: no canonical coercion from Symbolic Ring to Rational Field
So basically, in order to have alpha^n*n^alpha
, it is currently necessary to use the following work-around:
sage: R1 = AsymptoticRing('QQbar^n', SR) sage: R2.<n> = AsymptoticRing('n^QQbar', SR) sage: R = AsymptoticRing('QQbar^n*n^QQbar', SR) sage: alpha = QQbar(sqrt(2)) sage: t1 = R1(R1.growth_group(raw_element=alpha)); t1 sage: t2 = n^alpha sage: R(t1)*t2
comment:3 in reply to: ↑ 1 Changed 5 years ago by
- Dependencies set to #22120
Note: See
TracTickets for help on using
tickets.
The problem boils down to the following:
So the problem is that we cannot compute
QQbar(1)^alpha
.I see the following options:
QQbar
so thatQQbar(1)^everything == QQbar(1)
.ExponentialGrowthElement.__pow__
such thatbase == 1
leads to result1
, irrespective ofexponent
.GenericProduct.Element.__pow__
such that trivial factors are ignored.