Re: Commutators and Operator Powers in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg16687] Re: Commutators and Operator Powers in Mathematica
- From: "Peltio" <pelt.ioNOS at PAMiol.it>
- Date: Sat, 20 Mar 1999 02:09:00 -0500
- Organization: Peltio Inc.
- References: <7ct2c2$83g@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Alan,
This is a minimum effort answer. Just a simple (alas, neither elegant
nor functional) way to do what you want.
>As an example, I have two operators L0 and L1 that act on arbitrary
>(well say infinitely differentiable) functions f[x]
L0[f_,t_Symbol:x]:=t f
L1[f_,t_Symbol:x]:= a t^(3/2) D[f,t] + b t^2 D[f,{t,2}]
L0[f[w],w]
w*f[w]
L1[f[x]]
b*f''[x]*x^2 + a*f'[x]*x^(3/2)
>Now what I want to do is be able to evaluate repeated commutators
>and powers of these operators.
Commutator[L0_,L1_]:=L0[L1[#]]-L1[L0[#]]&
Commutator[L0,L2]
L0(L2(#1))-L2(L0(#1))&
Commutator[L0,L2][f[x]]
x L2(f(x))-L2(x f(x))
>For example, the first commutator should evaluate to:
>[L0,L1]f[x] = x L1 f[x] - L1 (x f[x]) =
> -a x^(3/2) f[x] - 2 b x^2 D[f[x],x]
Commutator[L0,L1][f[x]]//Simplify
-2*b*f'[x]*x^2 - a*f[x]*x^(3/2)
>Repeated commutators are expressions like [L1,[L0,L1]] or [L0,[L0,L1]],
etc.
Commutator[L1,Commutator[L0,L1]][f[x]]//Simplify
-4*b*((Sqrt[x]*a + b)*f'[x] + b*x*f''[x])*x^2 -
3/4*a*(2*Sqrt[x]*a + b)*f[x]*x^(3/2)
Commutator[L0,Commutator[L0,L1]][f[x]]//Simplify
2*b*x^2*f[x]
>I would also like to evaluate powers such as L1^n,
> meaning the operator acts on f[x] n times.
This is thougher with the simple definitions I have made.Instead of
overloading Power, we could use Composition to define a new power
function for operators
?Composition
"Composition[f1, f2, f3, ... ] represents a composition of the
functions f1, f2, f3, ... ."
Composition[L0,L0,L0][f[x]]
x^3*f[x]
OpPower[A_,n_Integer]:=Composition[Sequence@@Table[A,{n}]]
OpPower[L0,3][f[x]]
x^3*f[x]
Hope this may be of some help.
Peltio
peltioNOS at PAMusa.net
remove NOS PAM to e-mail me