Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9604

Re: Replace each f in f^n to different variables

From Ray Koopman <koopman@sfu.ca>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Replace each f in f^n to different variables
Date 2012-04-13 08:57 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jm8pqe$j28$1@smc.vnet.net> (permalink)
References <jm64ff$6kn$1@smc.vnet.net>

Show all headers | View raw


On Apr 12, 1:41 am, Yi Wang <tririverwan...@gmail.com> wrote:
> Hi, all,
>
> I want to replace *each* f in f^n to a different variable, say
>
> f^n -> var1 * var2 * ... * varn
>
> Naively, if I try
>
> f^n /. f:>Unique[],
>
> Mathematica simply returns (a unique variable)^n, instead of the above behaviour.
>
> Is there a simple way to get the f's into different variables?
>
> Thanks!
> Yi
>
> PS:
>
> (1) I know there are ways to transform Power to a list by hand, and then do something in it. For example,
>
> Times[((f^3)[[1]]*Table[1, {(f^3)[[2]]}]) /. f :> Unique[]]
>
> However, eventually I will be dealing with a large expression, with all kinds of terms, instead of a single term. This method quickly becomes very complicated.
>
> (2) I want to do such "strange" things, because a product of functions in position space f(x)^n becomes F(k1)F(k2)...F(k_{n-1})F(-k1-k2...) in momentum space.

r := _^n_Integer?Positive :> Times@@Table[Unique[],{n}]

f^3 /. r

$1 $2 $3

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Replace each f in f^n to different variables Yi Wang <tririverwangyi@gmail.com> - 2012-04-12 08:41 +0000
  Re: Replace each f in f^n to different variables Ray Koopman <koopman@sfu.ca> - 2012-04-13 08:57 +0000

csiph-web