MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: TransformationFunctions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101922] Re: TransformationFunctions
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Thu, 23 Jul 2009 03:54:48 -0400 (EDT)
  • References: <h46p31$e4g$1@smc.vnet.net>

". at ntaxa.com" wrote:

> Can anyone advice why following code does not work:
>
> In[538]:=tf[z_NonCommutativeMultiply] := -z[[2]]**z[[1]]
> In[539]:=Simplify[x ** y + y ** x,TransformationFunctions -> {tf,
> Automatic}]
> Out[539]:=x ** y + y ** x
>
> I expect rather 0
>
> By the way:
> In[540]:=x ** y + tf[y ** x]
> Out[540]:=0
>

I think, the problem here is, that Simplify will apply tf to both
products. So I would suggest you do something like this:

tfrule = (x_ ** y_ + y_ ** x_) :> 0;
tf[expr_] := expr /. tfrule;
Simplify[x ** y + y ** x, TransformationFunctions -> {tf}]

Out=0


-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: Show doesn't work inside Do loop ?
  • Next by Date: Re: Thoughts on a Wolfram|Alpha package for
  • Previous by thread: TransformationFunctions
  • Next by thread: Re: Re: TransformationFunctions