Simplify - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Physics : Simplify

Physics[Simplify] - simplify expressions involving objects and operations related to the Physics package

 Calling Sequence Simplify(A) Simplify(A, kind1, kind2, ...)

Parameters

 A - any mathematical expression kind1, kind2, ... - (optional) any of algebrarules, indices, noncommutativeproducts, sum, int; the kind of simplification to perform

Description

 • The Simplify command performs simplifications of expressions involving objects and operations related to the Physics package, including taking into account:
 - The summation convention for repeated indices, regarding them as dummies, and including the (anti)symmetry properties of the indices of the tensorial objects involved (according to how these objects were defined by the Define command).
 - Properties of noncommutative products.
 - (Anti)Commutator algebra rules.
 - Projectors and KroneckerDelta contracted indices inside sums.
 • As with the general Maple simplifier, simplify, when you call the Physics[Simplify] command with no extra arguments, all of the simplifications are attempted. When you call it with extra arguments specifying different simplifications, any of algebrarules, bracketrules, indices, noncommutativeproducts, sum, and int, only the specified simplifications are attempted.
 • You do not need to remember exactly all of the keywords; as with other Physics commands, Simplify will match wrong or partially spelled keywords to the first likely one, and perform the simplification. For example, Simplify(expr, alg) will invoke Simplify(expr, algebrarules).

Examples

 > $\mathrm{with}\left(\mathrm{Physics}\right):$
 > $\mathrm{Setup}\left(\mathrm{mathematicalnotation}=\mathrm{true}\right)$
 $\left[{\mathrm{mathematicalnotation}}{=}{\mathrm{true}}\right]$ (1)

Summation rule for repeated indices

 By default, the dimension of the spacetime when you load the Physics package is 4 = 3 + 1, and the signature is -.
 > $\mathrm{Setup}\left(\mathrm{dimension},\mathrm{signature}\right)$
 $\left[{\mathrm{dimension}}{=}{4}{,}{\mathrm{signature}}{=}{\mathrm{- - - +}}\right]$ (2)
 So the trace of the metric g_ is equal to 4.
 > ${\mathrm{g_}\left[\mathrm{\nu },\mathrm{\mu }\right]}^{2}$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{g}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (3)
 > $\mathrm{Simplify}\left(\right)$
 ${4}$ (4)
 The metric is used to 'raise and lower' indices in other tensors, as shown below.
 > $\mathrm{g_}\left[\mathrm{\nu },\mathrm{\mu }\right]\mathrm{g_}\left[\mathrm{\nu },\mathrm{\rho }\right]$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{\mathrm{\delta }}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}{\mathrm{\rho }}}^{\phantom{{}}{\mathrm{\nu }}\phantom{{\mathrm{\rho }}}}$ (5)
 > $\mathrm{Simplify}\left(\right)$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\rho }}}$ (6)
 Define $A$ as an object having tensorial properties; that is, the summation convention for repeated indices in products should be taken into account.
 > $\mathrm{Define}\left(A\right)$
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{A}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}$ (7)
 So the metric can now have indices contracted with $A$.
 > $\mathrm{g_}\left[\mathrm{\nu },\mathrm{\mu }\right]\mathrm{g_}\left[\mathrm{\rho },\mathrm{\sigma }\right]A\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\rho },\mathrm{\sigma }\right]$
 ${{A}}_{{\mathrm{\nu }}{,}{\mathrm{\mu }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{}{{g}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{g}}_{\phantom{{}}\phantom{{\mathrm{\rho }}{,}{\mathrm{\sigma }}}}^{\phantom{{}}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}$ (8)
 > $\mathrm{Simplify}\left(\right)$
 ${{A}}_{{\mathrm{\nu }}\phantom{{\mathrm{\nu }}}{\mathrm{\sigma }}\phantom{{\mathrm{\sigma }}}}^{\phantom{{\mathrm{\nu }}}{\mathrm{\nu }}\phantom{{\mathrm{\sigma }}}{\mathrm{\sigma }}}$ (9)
 The metric is totally symmetric with respect to interchange of positions of its indices, while the LeviCivita symbol, in the Maple worksheet displayed as epsilon, is totally antisymmetric. So the contraction of their respective indices is equal to zero.
 > $\mathrm{g_}\left[\mathrm{\nu },\mathrm{\mu }\right]\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\sigma },\mathrm{\rho }\right]$
 ${{\mathrm{\epsilon }}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{}{{g}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (10)
 > $\mathrm{Simplify}\left(\right)$
 ${0}$ (11)
 For the same reason, the contraction of any two of the indices of the LeviCivita symbol is also zero.
 > $\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\nu },\mathrm{\rho },\mathrm{\sigma }\right]$
 ${0}$ (12)
 As is the product of the LeviCivita symbol, where the same spacetime vector appears two times, contracting different indices of epsilon. To illustrate this case, first Define $q$ to represent this generic tensor.
 > $\mathrm{Define}\left(q\right)$
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{q}{,}{{A}}_{{\mathrm{\nu }}{,}{\mathrm{\mu }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}$ (13)
 > $\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\sigma },\mathrm{\rho }\right]q\left[\mathrm{\mu }\right]q\left[\mathrm{\nu }\right]$
 ${{\mathrm{\epsilon }}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{}{{q}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}{{q}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}$ (14)
 > $\mathrm{Simplify}\left(\right)$
 ${0}$ (15)
 When defining an object to have tensorial properties, you can define the symmetry properties of the indices of the object as well. The following Defines $B$ and $C$ as totally symmetric and totally antisymmetric, respectively.
 > $\mathrm{Define}\left(B,\mathrm{symmetric}\right)$
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{B}{,}{{A}}_{{\mathrm{\nu }}{,}{\mathrm{\mu }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{q}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}$ (16)
 > $\mathrm{Define}\left(C,\mathrm{antisymmetric}\right)$
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{B}{,}{C}{,}{{A}}_{{\mathrm{\nu }}{,}{\mathrm{\mu }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{q}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}$ (17)
 > $B\left[\mathrm{\mu },\mathrm{\nu }\right]\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\sigma },\mathrm{\rho }\right]$
 ${{\mathrm{\epsilon }}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{}{{B}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (18)
 > $\mathrm{Simplify}\left(\right)$
 ${0}$ (19)
 > $\mathrm{Define}\left(B,\mathrm{query}\right)$
 $\mathrm{Totally symmetric tensor, structured as}\left[\mathrm{name}{,}\mathrm{indices}{,}\mathrm{variables}\right]:$
 $\left[{B}{,}\left[{2}{,}{0}{,}{0}\right]{,}{0}\right]$ (20)
 > $C\left[\mathrm{\mu },\mathrm{\nu }\right]\mathrm{g_}\left[\mathrm{\nu },\mathrm{\mu }\right]$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{C}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (21)
 > $\mathrm{Simplify}\left(\right)$
 ${0}$ (22)
 > $\mathrm{Define}\left(C,\mathrm{query}\right)$
 $\mathrm{Totally antisymmetric tensor, structured as}\left[\mathrm{name}{,}\mathrm{indices}{,}\mathrm{variables}\right]:$
 $\left[{C}{,}\left[{2}{,}{0}{,}{0}\right]{,}{0}\right]$ (23)
 > $B\left[\mathrm{\mu },\mathrm{\nu }\right]C\left[\mathrm{\mu },\mathrm{\nu }\right]$
 ${{B}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{C}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (24)
 > $\mathrm{Simplify}\left(\right)$
 ${0}$ (25)
 The number of indices of the LeviCivita symbol depends on the dimension of spacetime. For any dimension and signature, the contracted product of two LeviCivita symbols can be expressed as a sum of products involving the metric g_. Note the use of Check to tell which indices are repeated (contracted) and which are free at any point.
 > $\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\alpha },\mathrm{\beta }\right]\mathrm{LeviCivita}\left[\mathrm{\mu },\mathrm{\sigma },\mathrm{\rho },\mathrm{\tau }\right]$
 ${{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{\mathrm{\epsilon }}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}{\mathrm{\rho }}{,}{\mathrm{\sigma }}{,}{\mathrm{\tau }}}^{\phantom{{}}{\mathrm{\mu }}\phantom{{\mathrm{\rho }}{,}{\mathrm{\sigma }}{,}{\mathrm{\tau }}}}$ (26)
 > $\mathrm{Check}\left(,\mathrm{indices},\mathrm{all}\right)$
 $\mathrm{The repeated indices per term are:}\left[\left\{\mathrm{...}\right\}{,}\left\{\mathrm{...}\right\}{,}\mathrm{...}\right]\mathrm{, the free indices are:}\left\{\mathrm{...}\right\}$
 $\left[\left\{{\mathrm{\mu }}\right\}\right]{,}\left\{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\nu }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}{,}{\mathrm{\tau }}\right\}$ (27)
 > $\mathrm{Simplify}\left(\right)$
 $\left({-}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\rho }}}{}{{g}}_{{\mathrm{\beta }}{,}{\mathrm{\sigma }}}{+}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\sigma }}}{}{{g}}_{{\mathrm{\beta }}{,}{\mathrm{\rho }}}\right){}{{g}}_{{\mathrm{\nu }}{,}{\mathrm{\tau }}}{-}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\sigma }}}{}{{g}}_{{\mathrm{\beta }}{,}{\mathrm{\tau }}}{}{{g}}_{{\mathrm{\nu }}{,}{\mathrm{\rho }}}{+}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\tau }}}{}{{g}}_{{\mathrm{\beta }}{,}{\mathrm{\sigma }}}{}{{g}}_{{\mathrm{\nu }}{,}{\mathrm{\rho }}}{-}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\tau }}}{}{{g}}_{{\mathrm{\beta }}{,}{\mathrm{\rho }}}{}{{g}}_{{\mathrm{\nu }}{,}{\mathrm{\sigma }}}{+}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\rho }}}{}{{g}}_{{\mathrm{\beta }}{,}{\mathrm{\tau }}}{}{{g}}_{{\mathrm{\nu }}{,}{\mathrm{\sigma }}}$ (28)
 > $\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\sigma },\mathrm{\rho }\right]\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\alpha },\mathrm{\beta }\right]$
 ${-}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{\mathrm{\epsilon }}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}\phantom{{\mathrm{\rho }}{,}{\mathrm{\sigma }}}}$ (29)
 > $\mathrm{Check}\left(,\mathrm{indices},\mathrm{all}\right)$
 $\mathrm{The repeated indices per term are:}\left[\left\{\mathrm{...}\right\}{,}\left\{\mathrm{...}\right\}{,}\mathrm{...}\right]\mathrm{, the free indices are:}\left\{\mathrm{...}\right\}$
 $\left[\left\{{\mathrm{\mu }}{,}{\mathrm{\nu }}\right\}\right]{,}\left\{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}\right\}$ (30)
 > $\mathrm{Simplify}\left(\right)$
 ${2}{}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\rho }}}{}{{g}}_{{\mathrm{\beta }}{,}{\mathrm{\sigma }}}{-}{2}{}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\sigma }}}{}{{g}}_{{\mathrm{\beta }}{,}{\mathrm{\rho }}}$ (31)
 > $\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\alpha },\mathrm{\sigma }\right]\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\alpha },\mathrm{\beta }\right]$
 ${{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\sigma }}}{}{{\mathrm{\epsilon }}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}{\mathrm{\beta }}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\alpha }}\phantom{{\mathrm{\beta }}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (32)
 > $\mathrm{Check}\left(,\mathrm{indices},\mathrm{all}\right)$
 $\mathrm{The repeated indices per term are:}\left[\left\{\mathrm{...}\right\}{,}\left\{\mathrm{...}\right\}{,}\mathrm{...}\right]\mathrm{, the free indices are:}\left\{\mathrm{...}\right\}$
 $\left[\left\{{\mathrm{\alpha }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}\right\}\right]{,}\left\{{\mathrm{\beta }}{,}{\mathrm{\sigma }}\right\}$ (33)
 > $\mathrm{Simplify}\left(\right)$
 ${-}{6}{}{{g}}_{{\mathrm{\beta }}{,}{\mathrm{\sigma }}}$ (34)
 > ${\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\alpha },\mathrm{\beta }\right]}^{2}$
 ${{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{\mathrm{\epsilon }}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (35)
 > $\mathrm{Check}\left(,\mathrm{indices},\mathrm{all}\right)$
 $\mathrm{The repeated indices per term are:}\left[\left\{\mathrm{...}\right\}{,}\left\{\mathrm{...}\right\}{,}\mathrm{...}\right]\mathrm{, the free indices are:}\left\{\mathrm{...}\right\}$
 $\left[\left\{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}\right\}\right]{,}{\varnothing }$ (36)
 > $\mathrm{Simplify}\left(\right)$
 ${-24}$ (37)
 Note that the results above are different if the dimension or signature of spacetime are different from 4 and -, respectively.
 During normal computations, a frequent occurrence is when two products have tensors with the same contracted indices, but in each product the contracted indices are represented by different letters, thus obscuring the fact that the two products are mathematically equal.
 > $\mathrm{Define}\left(F,'\mathrm{quiet}'\right)$
 $\left\{{F}{,}{{A}}_{{\mathrm{\nu }}{,}{\mathrm{\mu }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{,}{{B}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{C}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{q}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}$ (38)
 > $F\left[\mathrm{\mu },\mathrm{\nu }\right]C\left[\mathrm{\nu },\mathrm{\rho }\right]+F\left[\mathrm{\mu },\mathrm{\alpha }\right]C\left[\mathrm{\alpha },\mathrm{\rho }\right]$
 ${{C}}_{{\mathrm{\alpha }}{,}{\mathrm{\rho }}}{}{{F}}_{{\mathrm{\mu }}\phantom{{\mathrm{\alpha }}}}^{\phantom{{\mathrm{\mu }}}{\mathrm{\alpha }}}{+}{{C}}_{{\mathrm{\nu }}{,}{\mathrm{\rho }}}{}{{F}}_{{\mathrm{\mu }}\phantom{{\mathrm{\nu }}}}^{\phantom{{\mathrm{\mu }}}{\mathrm{\nu }}}$ (39)
 > $\mathrm{Check}\left(,\mathrm{indices},\mathrm{all}\right)$
 $\mathrm{The repeated indices per term are:}\left[\left\{\mathrm{...}\right\}{,}\left\{\mathrm{...}\right\}{,}\mathrm{...}\right]\mathrm{, the free indices are:}\left\{\mathrm{...}\right\}$
 $\left[\left\{{\mathrm{\alpha }}\right\}{,}\left\{{\mathrm{\nu }}\right\}\right]{,}\left\{{\mathrm{\mu }}{,}{\mathrm{\rho }}\right\}$ (40)
 > $\mathrm{Simplify}\left(\right)$
 ${2}{}{{C}}_{{\mathrm{\alpha }}{,}{\mathrm{\rho }}}{}{{F}}_{{\mathrm{\mu }}\phantom{{\mathrm{\alpha }}}}^{\phantom{{\mathrm{\mu }}}{\mathrm{\alpha }}}$ (41)
 The following example would be a little trickier to tell.
 > $\mathrm{Define}\left(A\left[\mathrm{\mu }\right],C\left[\mathrm{\mu }\right],'\mathrm{redo}','\mathrm{quiet}'\right)$
 $\left\{{{A}}_{{\mathrm{\mu }}}{,}{{B}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{C}}_{{\mathrm{\mu }}}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{F}}_{{\mathrm{\mu }}\phantom{{\mathrm{\alpha }}}}^{\phantom{{\mathrm{\mu }}}{\mathrm{\alpha }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{q}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}$ (42)
 > $\mathrm{Define}\left(\mathrm{query},A,C\right)$
 ${\mathrm{Tensors structured as}}\left[{\mathrm{name}}{,}{\mathrm{indices}}{,}{\mathrm{variables}}\right]{:}$
 $\left[{A}{,}\left[{1}{,}{0}{,}{0}\right]{,}{0}\right]{,}\left[{C}{,}\left[{1}{,}{0}{,}{0}\right]{,}{0}\right]$ (43)
 > $\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\alpha },\mathrm{\sigma }\right]\mathrm{LeviCivita}\left[\mathrm{\nu },\mathrm{\mu },\mathrm{\alpha },\mathrm{\beta }\right]\left(A\left[\mathrm{\beta }\right]C\left[\mathrm{\sigma }\right]-A\left[\mathrm{\sigma }\right]C\left[\mathrm{\beta }\right]\right)$
 $\left({{A}}_{{\mathrm{\beta }}}{}{{C}}_{{\mathrm{\sigma }}}{-}{{A}}_{{\mathrm{\sigma }}}{}{{C}}_{{\mathrm{\beta }}}\right){}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}\phantom{{\mathrm{\sigma }}}}^{\phantom{{\mathrm{\alpha }}}\phantom{{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{\mathrm{\sigma }}}{}{{\mathrm{\epsilon }}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (44)
 > $\mathrm{Simplify}\left(\right)$
 ${0}$ (45)

Sums, KroneckerDelta, and Projectors

 Expressions involving sums with KroneckerDelta indices contracted or with Projectors in the summand, and integrals involving Dirac functions, are simplifiable by using Simplify.
 Consider a basis, labeled $A$, whose dimension is $M+1$.
 > $\mathrm{Setup}\left(\mathrm{basisdim}=\left\{A=0..M\right\}\right)$
 $\mathrm{* Partial match of \text{'}}\mathrm{basisdim}\mathrm{\text{'} against keyword \text{'}}\mathrm{quantumbasisdimension}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{quantumbasisdimension}}{=}\left\{{A}{=}{0}{..}{M}\right\}\right]$ (46)
 The projector onto this basis is:
 > $\mathrm{Projector}\left(\mathrm{Ket}\left(A,j\right)\right)$
 ${\sum }_{{j}{=}{0}}^{{M}}{}\left|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{A}}_{{j}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\right⟩{}⟨\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{A}}_{{j}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|$ (47)
 So this expression,
 > $\mathrm{Sum}\left(\mathrm{Bracket}\left(\mathrm{Bra}\left(\mathrm{\Psi },n\right),\mathrm{Ket}\left(A,j\right)\right)\mathrm{Bracket}\left(\mathrm{Bra}\left(A,j\right),\mathrm{Ket}\left(\mathrm{\Psi },m\right)\right),j=0..M\right)$
 ${\sum }_{{j}{=}{0}}^{{M}}{}⟨\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\Psi }}}_{{n}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{A}}_{{j}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}⟩{}⟨\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{A}}_{{j}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\Psi }}}_{{m}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}⟩$ (48)
 where you see the projector inserted in the Bracket, can be simplified to:
 > $\mathrm{Simplify}\left(\right)$
 ${{\mathrm{\delta }}}_{{m}{,}{n}}$ (49)
 Expressions involving Sums with KroneckerDelta in the summand, provided that the indices in KroneckerDelta are inside the summation range (you can use assuming to enforce that), are also simplifiable.
 > $\mathrm{Sum}\left(\mathrm{Sum}\left(\mathrm{Sum}\left(\mathrm{Sum}\left(\mathrm{conjugate}\left(a\left[n,i\right]\right)a\left[i,m\right]\mathrm{KroneckerDelta}\left[i,j\right]\mathrm{KroneckerDelta}\left[m,n\right],j=0..M\right),i=0..M\right),n=0..M\right),m=0..M\right)$
 ${\sum }_{{m}{=}{0}}^{{M}}{}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{{n}{=}{0}}^{{M}}{}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{{i}{=}{0}}^{{M}}{}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{{j}{=}{0}}^{{M}}{}\stackrel{{&conjugate0;}}{{{a}}_{{n}{,}{i}}}{}{{a}}_{{i}{,}{m}}{}{{\mathrm{\delta }}}_{{i}{,}{j}}{}{{\mathrm{\delta }}}_{{m}{,}{n}}$ (50)
 > $\mathrm{Simplify}\left(\right)$
 ${\sum }_{{m}{=}{0}}^{{M}}{}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{{i}{=}{0}}^{{M}}{}\stackrel{{&conjugate0;}}{{{a}}_{{m}{,}{i}}}{}{{a}}_{{i}{,}{m}}$ (51)
 In the following example, both simplifications are used together.
 > $\mathrm{Sum}\left(\mathrm{Sum}\left(\mathrm{Sum}\left(\mathrm{Sum}\left(\mathrm{conjugate}\left(a\left[n,i\right]\right)a\left[i,m\right]\mathrm{Bracket}\left(\mathrm{Bra}\left(\mathrm{\Psi },n\right),\mathrm{Ket}\left(A,j\right)\right)\mathrm{Bracket}\left(\mathrm{Bra}\left(A,j\right),\mathrm{Ket}\left(\mathrm{\Psi },m\right)\right),j=0..M\right),i=0..M\right),n=0..M\right),m=0..M\right)$
 ${\sum }_{{m}{=}{0}}^{{M}}{}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{{n}{=}{0}}^{{M}}{}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{{i}{=}{0}}^{{M}}{}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{{j}{=}{0}}^{{M}}{}\stackrel{{&conjugate0;}}{{{a}}_{{n}{,}{i}}}{}{{a}}_{{i}{,}{m}}{}⟨\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\Psi }}}_{{n}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{A}}_{{j}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}⟩{}⟨\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{A}}_{{j}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\Psi }}}_{{m}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}⟩$ (52)
 > $\mathrm{Simplify}\left(\right)$
 ${\sum }_{{m}{=}{0}}^{{M}}{}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{{i}{=}{0}}^{{M}}{}\stackrel{{&conjugate0;}}{{{a}}_{{m}{,}{i}}}{}{{a}}_{{i}{,}{m}}$ (53)

Noncommutative products and (Anti)Commutator algebras

 Two different kinds of simplifications are available: a normalization of products involving noncommutative operands some of which commute between themselves (that have Commutator equal to zero), and a simplification taking into account (Anti)Commutator rules (that have (Anti)Commutator not equal to zero). These simplifications are frequently required, for example, when deriving the Commutator algebra of problems involving angular momentum or Annihilation/Creation operators.
 1. Consider the angular momentum operators $|L|$, $\mathrm{Lx},\mathrm{Ly}$, and $\mathrm{Lz}$ in quantum mechanics. Verify that the Commutator of $|L|^2$ with any of the components of $L$ is equal to zero (see for instance Chapter VI of the reference, below). For that purpose, a 3-D vector-quantum-operator representation of $L$ is constructed with the Vectors package (vectorpostfix identifier is '_'), setting $L$, $\mathrm{Lx},\mathrm{Ly},\mathrm{Lz}$, $r$, and $p$, as well as their components, as quantum operators.
 > $\mathrm{with}\left(\mathrm{Physics}:-\mathrm{Vectors}\right)$
 $\left[{\mathrm{&x}}{,}{\mathrm{+}}{,}{\mathrm{.}}{,}{\mathrm{Assume}}{,}{\mathrm{ChangeBasis}}{,}{\mathrm{ChangeCoordinates}}{,}{\mathrm{CompactDisplay}}{,}{\mathrm{Component}}{,}{\mathrm{Curl}}{,}{\mathrm{DirectionalDiff}}{,}{\mathrm{Divergence}}{,}{\mathrm{Gradient}}{,}{\mathrm{Identify}}{,}{\mathrm{Laplacian}}{,}{\nabla }{,}{\mathrm{Norm}}{,}{\mathrm{ParametrizeCurve}}{,}{\mathrm{ParametrizeSurface}}{,}{\mathrm{ParametrizeVolume}}{,}{\mathrm{Setup}}{,}{\mathrm{Simplify}}{,}{\mathrm{^}}{,}{\mathrm{diff}}{,}{\mathrm{int}}\right]$ (54)
 > $\mathrm{Setup}\left(\mathrm{quantumoperators}=\left\{\mathrm{L_},\mathrm{Lx},\mathrm{Ly},\mathrm{Lz},\mathrm{p_},\mathrm{px},\mathrm{py},\mathrm{pz},\mathrm{r_},x,y,z\right\}\right)$
 $\left[{\mathrm{quantumoperators}}{=}\left\{\stackrel{{\to }}{{L}}{,}{\mathrm{Lx}}{,}{\mathrm{Ly}}{,}{\mathrm{Lz}}{,}\stackrel{{\to }}{{p}}{,}{\mathrm{px}}{,}{\mathrm{py}}{,}{\mathrm{pz}}{,}\stackrel{{\to }}{{r}}{,}{x}{,}{y}{,}{z}\right\}\right]$ (55)
 So for $|L|^2$ and $L$ itself in terms of the vector operators $r$ and $p$, you have:
 > $\mathrm{LL}≔\mathrm{L_}·\mathrm{L_}$
 ${\mathrm{LL}}{≔}\stackrel{{\to }}{{L}}{·}\stackrel{{\to }}{{L}}$ (56)
 > $\mathrm{L_}≔\mathrm{r_}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{p_}$
 $\stackrel{{\to }}{{L}}{≔}\stackrel{{\to }}{{r}}{×}\stackrel{{\to }}{{p}}$ (57)
 where
 > $\mathrm{r_}≔x\mathrm{_i}+y\mathrm{_j}+z\mathrm{_k}$
 $\stackrel{{\to }}{{r}}{≔}\stackrel{{\wedge }}{{i}}{}{x}{+}\stackrel{{\wedge }}{{j}}{}{y}{+}\stackrel{{\wedge }}{{k}}{}{z}$ (58)
 > $\mathrm{p_}≔\mathrm{px}\mathrm{_i}+\mathrm{py}\mathrm{_j}+\mathrm{pz}\mathrm{_k}$
 $\stackrel{{\to }}{{p}}{≔}\stackrel{{\wedge }}{{i}}{}{\mathrm{px}}{+}\stackrel{{\wedge }}{{j}}{}{\mathrm{py}}{+}\stackrel{{\wedge }}{{k}}{}{\mathrm{pz}}$ (59)
 The Commutator rules for the components ${L}_{i}$ are a consequence of the Commutator rules for the components of r and p. These rules can be set by using the Setup command, entering all of the commutators between any two of {$x,y,z,\mathrm{px},\mathrm{py},\mathrm{pz}$}, as in $\mathrm{Setup}\left(\mathrm{algebrarules}=\left\{%\mathrm{Commutator}\left(x,\mathrm{px}\right)=I,%\mathrm{Commutator}\left(x,\mathrm{py}\right)=0,%\mathrm{Commutator}\left(x,y\right)=0,...\right\}\right)$. A convenient alternative for situations such as this is to create an indexing procedure for a Matrix. For example,
 > $C≔\left(a,i,b,j\right)↦\mathrm{%Commutator}\left(\mathrm{Component}\left(a,i\right),\mathrm{Component}\left(b,j\right)\right)$
 ${C}{≔}\left({a}{,}{i}{,}{b}{,}{j}\right){↦}{\left[{\left({a}\right)}_{{i}}{,}{\left({b}\right)}_{{j}}\right]}_{{-}}$ (60)
 > $\mathrm{algebra}≔\left(i,j\right)↦\left(C\left(\mathrm{r_},i,\mathrm{p_},j\right)=I\cdot \mathrm{KroneckerDelta}\left[i,j\right],C\left(\mathrm{r_},i,\mathrm{r_},j\right)=0,C\left(\mathrm{p_},i,\mathrm{p_},j\right)=0\right)$
 ${\mathrm{algebra}}{≔}\left({i}{,}{j}\right){↦}\left({C}{}\left(\stackrel{{\to }}{{r}}{,}{i}{,}\stackrel{{\to }}{{p}}{,}{j}\right){=}{I}{}{{\mathrm{\delta }}}_{{i}{,}{j}}{,}{C}{}\left(\stackrel{{\to }}{{r}}{,}{i}{,}\stackrel{{\to }}{{r}}{,}{j}\right){=}{0}{,}{C}{}\left(\stackrel{{\to }}{{p}}{,}{i}{,}\stackrel{{\to }}{{p}}{,}{j}\right){=}{0}\right)$ (61)
 The commutators are then generated by the Matrix constructor, and the whole Matrix can be passed to Setup.
 > $\mathrm{Matrix}\left(3,3,\mathrm{algebra}\right)$
 $\left[\right]$ (62)
 > $\mathrm{Setup}\left(\right)$
 $\left[{\mathrm{algebrarules}}{=}\left\{{\left[{\mathrm{px}}{,}{\mathrm{py}}\right]}_{{-}}{=}{0}{,}{\left[{\mathrm{px}}{,}{\mathrm{pz}}\right]}_{{-}}{=}{0}{,}{\left[{\mathrm{py}}{,}{\mathrm{pz}}\right]}_{{-}}{=}{0}{,}{\left[{x}{,}{\mathrm{px}}\right]}_{{-}}{=}{I}{,}{\left[{x}{,}{\mathrm{py}}\right]}_{{-}}{=}{0}{,}{\left[{x}{,}{\mathrm{pz}}\right]}_{{-}}{=}{0}{,}{\left[{x}{,}{y}\right]}_{{-}}{=}{0}{,}{\left[{x}{,}{z}\right]}_{{-}}{=}{0}{,}{\left[{y}{,}{\mathrm{px}}\right]}_{{-}}{=}{0}{,}{\left[{y}{,}{\mathrm{py}}\right]}_{{-}}{=}{I}{,}{\left[{y}{,}{\mathrm{pz}}\right]}_{{-}}{=}{0}{,}{\left[{y}{,}{z}\right]}_{{-}}{=}{0}{,}{\left[{z}{,}{\mathrm{px}}\right]}_{{-}}{=}{0}{,}{\left[{z}{,}{\mathrm{py}}\right]}_{{-}}{=}{0}{,}{\left[{z}{,}{\mathrm{pz}}\right]}_{{-}}{=}{I}\right\}\right]$ (63)
 The components of $L$ are:
 > $\mathrm{Lx}≔\mathrm{Component}\left(\mathrm{L_},1\right)$
 ${\mathrm{Lx}}{≔}{y}{}{\mathrm{pz}}{-}{z}{}{\mathrm{py}}$ (64)
 > $\mathrm{Ly}≔\mathrm{Component}\left(\mathrm{L_},2\right)$
 ${\mathrm{Ly}}{≔}{z}{}{\mathrm{px}}{-}{x}{}{\mathrm{pz}}$ (65)
 > $\mathrm{Lz}≔\mathrm{Component}\left(\mathrm{L_},3\right)$
 ${\mathrm{Lz}}{≔}{x}{}{\mathrm{py}}{-}{y}{}{\mathrm{px}}$ (66)
 To verify that $|L|^2=\mathrm{LL}$ commutes with each ${L}_{i}$,
 > $\mathrm{%Commutator}\left(\mathrm{LL},\mathrm{Lx}\right)$
 ${\left[{\left({y}{}{\mathrm{pz}}{-}{z}{}{\mathrm{py}}\right)}^{{2}}{+}{\left({z}{}{\mathrm{px}}{-}{x}{}{\mathrm{pz}}\right)}^{{2}}{+}{\left({x}{}{\mathrm{py}}{-}{y}{}{\mathrm{px}}\right)}^{{2}}{,}{y}{}{\mathrm{pz}}{-}{z}{}{\mathrm{py}}\right]}_{{-}}$ (67)
 > $\mathrm{value}\left(\right)$
 ${0}$ (68)
 > $\mathrm{Commutator}\left(\mathrm{LL},\mathrm{Ly}\right)$
 ${0}$ (69)
 > $\mathrm{Commutator}\left(\mathrm{LL},\mathrm{Lz}\right)$
 ${0}$ (70)
 • Depending on the case, an expansion of the Commutator is sometimes necessary to verify its value is 0, or to take the commutator rules into account in all subexpressions use Simplify.
 2. Using a quantum-operator-tensor notation for the components of $L$, show that $[{L}_{i},{L}_{j}]=I\mathrm{epsilon}[i,j,k]{L}_{k}$ (see the exercises of Chap VI in Cohen-Tannoudji). For this purpose, set the dimension of spacetime to 3, and its signature to Euclidean. To follow textbook notation, also use lowercaselatin letters for space tensor indices (see Setup).
 > $\mathrm{Setup}\left(\mathrm{dimension}=3,\mathrm{signature}=\mathrm{+},\mathrm{spacetimeindices}=\mathrm{lowercaselatin_is},\mathrm{spaceindices}=\mathrm{none},\mathrm{quiet}\right)$
 $\left[{\mathrm{dimension}}{=}{3}{,}{\mathrm{signature}}{=}{\mathrm{+ + +}}{,}{\mathrm{spaceindices}}{=}{\mathrm{none}}{,}{\mathrm{spacetimeindices}}{=}{\mathrm{lowercaselatin_is}}\right]$ (71)
 Define $r$ and $p$ as tensors in this 3-D Euclidean space to be able to Simplify the result by using Einstein's summation convention for repeated (tensor) indices.
 > $\mathrm{Define}\left(r,p\right)$
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{p}{,}{r}{,}{{\mathrm{\gamma }}}_{{i}}{,}{{\mathrm{\sigma }}}_{{i}}{,}{{\partial }}_{{i}}{,}{{g}}_{{i}{,}{j}}{,}{{\mathrm{\epsilon }}}_{{i}{,}{j}{,}{k}}\right\}$ (72)
 Now set the related Commutator rules defining the algebra in tensor notation; in doing so, erase also previous settings (by using the redo option of Setup) for quantum operators and algebra rules (not necessary here, but sometimes desired).
 > $\mathrm{Setup}\left(\mathrm{redo},\mathrm{quantumoperators}=\left\{L,p,r\right\},\mathrm{algebrarules}=\left\{\mathrm{%Commutator}\left(p\left[i\right],p\left[j\right]\right)=0,\mathrm{%Commutator}\left(r\left[i\right],p\left[j\right]\right)=I\mathrm{kd_}\left[i,j\right],\mathrm{%Commutator}\left(r\left[i\right],r\left[j\right]\right)=0\right\}\right)$
 $\left[{\mathrm{algebrarules}}{=}\left\{{\left[{{p}}_{{i}}{,}{{p}}_{{j}}\right]}_{{-}}{=}{0}{,}{\left[{{r}}_{{i}}{,}{{p}}_{{j}}\right]}_{{-}}{=}{I}{}{{\mathrm{\delta }}}_{{i}{,}{j}}{,}{\left[{{r}}_{{i}}{,}{{r}}_{{j}}\right]}_{{-}}{=}{0}\right\}{,}{\mathrm{quantumoperators}}{=}\left\{{L}{,}{p}{,}{r}\right\}\right]$ (73)
 Verify how this algebra of Commutators works.
 > $\mathrm{%Commutator}\left(r\left[j\right],p\left[k\right]\right)$
 ${\left[{{r}}_{{j}}{,}{{p}}_{{k}}\right]}_{{-}}$ (74)
 > $\mathrm{value}\left(\right)$
 ${I}{}{{\mathrm{\delta }}}_{{j}{,}{k}}$ (75)
 > $\mathrm{Commutator}\left(r\left[j\right]p\left[k\right],r\left[m\right]p\left[m\right]\right)$
 ${-}{I}{}{{\mathrm{\delta }}}_{{k}{,}{m}}{}{{r}}_{{j}}{}{{p}}_{{m}}{+}{I}{}{{\mathrm{\delta }}}_{{j}{,}{m}}{}{{r}}_{{m}}{}{{p}}_{{k}}$ (76)
 Enter expressions for the tensor components of L that enter the commutator $\left[{L}_{i},{L}_{j}\right]$, to verify that it is equal to $I\mathrm{epsilon}[i,j,k]{L}_{k}$. In doing so, use the default abbreviation $\mathrm{\epsilon }$ for the LeviCivita pseudo-tensor.
 > $L\left[i\right]≔\mathrm{ep_}\left[i,m,n\right]r\left[m\right]p\left[n\right]$
 ${{L}}_{{i}}{≔}{{\mathrm{\epsilon }}}_{{i}{,}{m}{,}{n}}{}{{r}}_{{m}}{}{{p}}_{{n}}$ (77)
 > $L\left[j\right]≔\mathrm{subs}\left(i=j,L\left[i\right]\right)$
 ${{L}}_{{j}}{≔}{{\mathrm{\epsilon }}}_{{j}{,}{m}{,}{n}}{}{{r}}_{{m}}{}{{p}}_{{n}}$ (78)
 Compute the Commutator.
 > $\mathrm{ans}≔\mathrm{Commutator}\left(L\left[i\right],L\left[j\right]\right)$
 ${\mathrm{ans}}{≔}{{\mathrm{\epsilon }}}_{{i}{,}{m}{,}{n}}{}{{\mathrm{\epsilon }}}_{{j}{,}{k}{,}{l}}{}\left({-}{I}{}{{\mathrm{\delta }}}_{{k}{,}{n}}{}{{r}}_{{m}}{}{{p}}_{{l}}{+}{I}{}{{\mathrm{\delta }}}_{{l}{,}{m}}{}{{r}}_{{k}}{}{{p}}_{{n}}\right)$ (79)
 The above is indeed ${L}_{k}$, but is missing some simplification of the contracted indices of the LeviCivita and KroneckerDelta tensors, and the indices of the quantum operators $r,p$ involved in the noncommutative products.
 > $\mathrm{Simplify}\left(\mathrm{ans}\right)$
 ${-I}{}\left({{r}}_{{j}}{}{{p}}_{{i}}{-}{{r}}_{{i}}{}{{p}}_{{j}}\right)$ (80)
 See Also

References

 Cohen-Tannoudji, C.; Diu, B.; and Laloe, F. Quantum Mechanics. Paris, France: Hermann, 1977.