Re: Expanding expressions with Dot, Times and Plus

• To: mathgroup at smc.vnet.net
• Subject: [mg35540] Re: [mg35501] Expanding expressions with Dot, Times and Plus
• From: Rolf Mertig <rolf at mertig.com>
• Date: Thu, 18 Jul 2002 03:06:38 -0400 (EDT)
• Organization: Mertig Consulting
• Sender: owner-wri-mathgroup at wolfram.com

```Hi,
it is not hard to program such a function. Several packages exist.
One possibility is to use my old DotSimplify function from the OpenSource
FeynCalc Mathematica Application package.
See http://www.feyncalc.org/DotSimplify

I always wondered why such and other rather trivial to implement functionality
has never been added to the Mathematica kernel. Maybe WRI is too busy
with other important projects.

In[1]:= <<HighEnergyPhysics`fc`

In[2]:= FI;   DeclareNonCommutative[ex];

In[3]:= DotSimplify[ -ex[0,1].(ex[0,1].ex[1,2]-ex[1,2].ex[0,1]) ]

Out[3]= -ex[0, 1]^2 . ex[1, 2] + ex[0, 1] . ex[1, 2] . ex[0, 1]

In[4]:= ?DotSimplify
DotSimplify[expr] expands and reorders noncommutative terms in expr.
Simplifying relations may be specified by the option DotSimplifyRelations
or by Commutator and AntiCommutator definitions. Whether expr is expanded
noncommutatively depends on the option Expanding.

In[5]:= Options@DotSimplify

Out[5]= {Expanding -> True, DotSimplifyRelations -> {}, DotPower -> True}

Greetings,

Rolf Mertig
Mertig Consulting, http://www.mertig.com
Efficient Software, Training, Programming, Consulting
----------------------------------------------------------------

>I am trying to expand a large expression that has terms that look as
>
>follows:
>
>-ex[0,1].(ex[0,1].ex[1,2]-ex[1,2].ex[0,1])
>
>where ex[i,j] are unevaluated expressions. I would like Mathematica to
>simplify this and analogous expressions so that they read:
>
>ex[0,1].ex[1,2].ex[0,1]-ex[0,1].ex[0,1].ex[1,2]
>
>However, I cannot seem to find anything that will work. The problem is that
>I need to keep track of the order of the expressions ex[i,j]. If Dot were
>replaced by Times, there would be no problem whatsoever.
>
>If anyone knows how to help me with this problem, I would greatly appreciate
>it.
>
>Thanks,
>
>Jeremy Levy
>
>jlevy at pitt.edu

```

• Prev by Date: Re: Re: Factoring problem
• Next by Date: RE: Output of left-hand side of expression
• Previous by thread: RE: Expanding expressions with Dot, Times and Plus
• Next by thread: simplifying operator experessions with Dot, Times and Plus