Ask Your Question
0

Exponential change of variables in symbolic ring

asked 2017-03-03 06:36:54 +0200

user101214 gravatar image

updated 2017-03-03 06:37:33 +0200

I am using a program that outputs elements of the symbolic ring that are rational expressions in an exponential variables $p^s$ for some prime $p$. (Specifically, it is the igusa_zeta() function from here.) For example, one possible output is

(p^(s + 3) - 1)*(p - 1)*p^(2*s)/((p^(s + 1) - 1)*(p^(2*s + 3) - 1))}.

I would like to know if there is an automated way to change to the variable $t = p^s$ such that this expression becomes $$\frac{(p^3 t - 1) (p-1) t^2}{(pt-1) (p^3 t^2 - 1)}.$$

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2017-03-03 22:51:28 +0200

nbruin gravatar image

updated 2017-03-03 22:54:54 +0200

You could just formally express s in terms of t by setting s=log(t)/log(p) and trust formal manipulations to do what you want:

sage: expr = (p^(s + 3) - 1)*(p - 1)*p^(2*s)/((p^(s + 1) - 1)*(p^(2*s + 3) - 1))
sage: expr.subs({s:log(t)/log(p)}).canonicalize_radical().factor()
(p^3*t - 1)*(p - 1)*t^2/((p^3*t^2 - 1)*(p*t - 1))

it might save you having to come up with a fancy pattern of wildcards to catch all possible cases.

edit flag offensive delete link more
1

answered 2017-03-03 07:16:21 +0200

mforets gravatar image

updated 2017-03-04 07:33:05 +0200

Does this help?

var('p s t')

def transf(expr):
    w0 = SR.wild(0); w1 = SR.wild(1);
    expr_t = expr.subs({p^s:t})
    expr_t = expr_t.subs({p^(w0*s):t^w0})
    expr_t = expr_t.subs({p^(s+w1):t*p^w1})
    expr_t = expr_t.subs({p^(w0*s+w1):t^w0*p^w1})   
    return expr_t

# expression 1
expr1 = (p^(s + 3) - 1)*(p - 1)*p^(2*s)/((p^(s + 1) - 1)*(p^(2*s + 3) - 1))

# expression 2
expr2 = p^s / (p^(s+1) - 1)

for expr in [expr1, expr2]:
    pretty_print(expr, LatexExpr(r"\mapsto"), transf(expr))

produces:

$$ \newcommand{\Bold}[1]{\mathbf{#1}}\frac{{\left(p - 1\right)} p^{2 \, s} {\left(p^{s + 3} - 1\right)}}{{\left(p^{2 \, s + 3} - 1\right)} {\left(p^{s + 1} - 1\right)}} \mapsto \frac{{\left(p^{3} t - 1\right)} {\left(p - 1\right)} t^{2}}{{\left(p^{3} t^{2} - 1\right)} {\left(p t - 1\right)}} $$

$$ \newcommand{\Bold}[1]{\mathbf{#1}}\frac{p^{s}}{p^{s + 1} - 1} \mapsto \frac{t}{p t - 1} $$

My limited knowledge of using wild cards is that you have to be very careful because it does not identify "units", and "zero"; see the last substitution would be fine mathematically to catch all instances (if wildcard meant anything) but since the expression is syntactically different from the others, we need the previous ones.

edit flag offensive delete link more

Comments

It doesn't work with expr = p^s itself, or any expression containing it (I found this when looking at expr = p^s / (p^(s+1) - 1). ) I can't figure out why. (I've tried adding an addition expr_t = expr_t.subs({p^s : t}) but that doesn't catch it either.)

user101214 gravatar imageuser101214 ( 2017-03-04 00:46:51 +0200 )edit

i've edited the script so that it works with the new expression also, maybe answers your comment. but i upvoted @nbruin's solution because it is simpler.

mforets gravatar imagemforets ( 2017-03-04 07:36:36 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-03-03 06:36:54 +0200

Seen: 465 times

Last updated: Mar 04 '17