Trace - Maple Help

Physics[Trace] - calculate the trace of noncommutative or anticommutative objects, including products of Dirac and Pauli matrices

 Calling Sequence Trace(f) Trace(f, onlymatrices = ..., ismatricialexpression = ...)

Parameters

 f - any algebraic expression, relation, or set, list or rtable of them onlymatrices - optional, the right hand side can be true (default value) or false, to consider as scalars everything but the algebraic representation for Dirac (Dgamma) and Pauli (Psigma) matrices as tensors of one index, or objects explicitly of type matrix or Matrix (Array) ismatricialexpression - optional, the right hand side can be true, false or "unknown",

Description

 • The Trace command represents and when possible computes the generalized trace of an object. The %Trace command is the inert form of Trace; that is, it represents the same mathematical operation, while displaying the operation unevaluated. To evaluate the operation, use the value command.
 • When tracing an algebraic expression, Trace considers as scalars everything but the Physics algebraic representation for Dirac (Dgamma) and Pauli (Psigma) matrices as tensors of one index, or objects that are of type matrix or Matrix (Array). This default is convenient in formulations in particle physics. This behavior, however, can be changed so that everything but constants are considered traceable objects - for instance any quantum operator set with Setup - for this purpose either pass the optional argument onlymatrices = false or set this behavior to be the default using Setup with its keyword onlymatrices = false.
 • When tracing an algebraic expression, if the expression is polynomial in Dirac matrices, Trace considers all the expression as matricial, so that every term not containing Dirac matrices is assumed to have as implicit factor the identity matrix. For example, in ${p}_{}^{\mathrm{\mu }}{{\mathrm{\gamma }}}_{\mathrm{\mu }}+m$, the term $m$ is assumed to have the identity matrix as a factor.
 • The result returned by Trace when onlymatrices = false is built as follows:
 – If $f$ is a constant, then return $f$.
 – If $f$ is a single matrix, then return the trace of $f$.
 – If $f$ is a (noncommutative) product, then
 – If the operands are Dirac matrices or Pauli matrices, then use standard related formulas (see below).
 – If all of the operands are anticommutative, then
 – If the number of operands is even, then return 0.
 – Otherwise, return the Trace after normalizing the product.
 – If there are constants in the operands, then return the constants times the Trace of the rest.
 – If $f$ is a (commutative) product, then return the constants times the Trace of the rest.
 – If $f$ is a sum, not just of noncommutative objects, distribute Trace according to:$\mathrm{Trace}\left(A+B\right)\to \mathrm{Trace}\left(A\right)+\mathrm{Trace}\left(B\right)$.
 – For all other cases, return the unevaluated expression, $'\mathrm{Trace}'\left(f\right)$.
 • The Trace of a product of Dirac matrices is based on their anticommutation relation ${\mathrm{gamma}}_{\mathrm{mu}}{\mathrm{gamma}}_{\mathrm{nu}}+{\mathrm{gamma}}_{\mathrm{nu}}{\mathrm{gamma}}_{\mathrm{mu}}=2\mathrm{g_}[\mathrm{mu},\mathrm{nu}]$, where g_ is the metric, and the formula is valid in 2, 3, and 4 dimensions. Thus, traces of products of an odd number of Dirac matrices are always equal to zero, while traces $\mathrm{Trace}\left({\mathrm{\gamma }}_{\mathrm{ν1}},{\mathrm{\gamma }}_{\mathrm{ν2}},\mathrm{...},{\mathrm{\gamma }}_{\mathrm{ν2}n}\right)$ of an even number ( $2n$ ) of them can be expressed as a sum of terms of the form $4\mathrm{g_}[\mathrm{mu1},\mathrm{mu2}]\mathrm{g_}[\mathrm{mu3},\mathrm{mu4}]\mathrm{...}\mathrm{g_}[{\mathrm{mu}}_{\mathrm{2n}-1}$, ${\mathrm{mu}}_{\mathrm{2n}}]$, with the sign of each term being determined by whether the permutation of indices, from $[{\mathrm{nu}}_{1},{\mathrm{nu}}_{2},\mathrm{...},{\mathrm{nu}}_{\mathrm{2n}}]$ to $[{\mathrm{mu}}_{1},{\mathrm{mu}}_{2},\mathrm{...},{\mathrm{mu}}_{\mathrm{2n}}]$, is odd or even.

Examples

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

First, set prefixes identifying anticommutative and noncommutative variables.

 > $\mathrm{Setup}\left(\mathrm{anticommutativeprefix}=Q,\mathrm{noncommutativeprefix}=Z\right)$
 $\left[{\mathrm{anticommutativeprefix}}{=}\left\{{Q}\right\}{,}{\mathrm{noncommutativeprefix}}{=}\left\{{Z}\right\}\right]$ (2)

Compute some traces of expressions involving constants and commutative, anticommutative, and noncommutative variables.

The Trace of the product of an even number of anticommutative elements is zero.

 > $\mathrm{Trace}\left(\mathrm{Q1}\mathrm{Q2},\mathrm{onlymatrices}=\mathrm{false}\right)$
 ${0}$ (3)
 > $\mathrm{Trace}\left(\mathrm{Q3}\mathrm{Q1}\mathrm{Q2}\right)$
 ${\mathrm{Q1}}{}{\mathrm{Q2}}{}{\mathrm{Q3}}$ (4)
 > $\mathrm{Trace}\left(a\mathrm{Q3}b\mathrm{Q1}c\mathrm{Q2}\right)$
 ${4}{}{a}{}{b}{}{c}{}{\mathrm{Q1}}{}{\mathrm{Q2}}{}{\mathrm{Q3}}$ (5)
 > $\mathrm{Trace}\left(\mathrm{\pi }\mathrm{Q3}\mathrm{\gamma }\mathrm{Q1}I\mathrm{Q2}\right)$
 ${I}{}{\mathrm{\pi }}{}{\mathrm{\gamma }}{}{\mathrm{Q1}}{}{\mathrm{Q2}}{}{\mathrm{Q3}}$ (6)
 > $\mathrm{Trace}\left(A+B+\mathrm{\pi }\mathrm{Q3}\mathrm{\gamma }\mathrm{Q1}I\mathrm{Q2}\right)$
 ${A}{+}{B}{+}{I}{}{\mathrm{\pi }}{}{\mathrm{\gamma }}{}{\mathrm{Q1}}{}{\mathrm{Q2}}{}{\mathrm{Q3}}$ (7)

Products of Dirac matrices and Pauli matrices:

 > $\mathrm{Dgamma}\left[3\right]\mathrm{Dgamma}\left[5\right]\mathrm{Dgamma}\left[5\right]$
 ${{\mathrm{\gamma }}}_{{3}}{}{{\mathrm{\gamma }}}_{{5}}^{{2}}$ (8)
 > $\mathrm{Trace}\left(\right)$
 ${0}$ (9)
 > $\mathrm{Dgamma}\left[3\right]\mathrm{Dgamma}\left[\mathrm{\xi }\right]$
 ${{\mathrm{\gamma }}}_{{3}}{}{{\mathrm{\gamma }}}_{{\mathrm{\xi }}}$ (10)
 > $\mathrm{Trace}\left(\right)$
 ${4}{}{{g}}_{{3}{,}{\mathrm{\xi }}}$ (11)
 > $\mathrm{Dgamma}\left[\mathrm{\alpha }\right]\mathrm{Dgamma}\left[\mathrm{\nu }\right]\mathrm{Dgamma}\left[\mathrm{\xi }\right]$
 ${{\mathrm{\gamma }}}_{{\mathrm{\alpha }}}{}{{\mathrm{\gamma }}}_{{\mathrm{\nu }}}{}{{\mathrm{\gamma }}}_{{\mathrm{\xi }}}$ (12)
 > $\mathrm{Trace}\left(\right)$
 ${0}$ (13)
 > $\mathrm{Dgamma}\left[\mathrm{\alpha }\right]\mathrm{Dgamma}\left[\mathrm{\nu }\right]\mathrm{Dgamma}\left[\mathrm{\xi }\right]\mathrm{Dgamma}\left[\mathrm{\rho }\right]$
 ${{\mathrm{\gamma }}}_{{\mathrm{\alpha }}}{}{{\mathrm{\gamma }}}_{{\mathrm{\nu }}}{}{{\mathrm{\gamma }}}_{{\mathrm{\xi }}}{}{{\mathrm{\gamma }}}_{{\mathrm{\rho }}}$ (14)
 > $\mathrm{Trace}\left(\right)$
 ${4}{}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\nu }}}{}{{g}}_{{\mathrm{\rho }}{,}{\mathrm{\xi }}}{+}{4}{}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\rho }}}{}{{g}}_{{\mathrm{\nu }}{,}{\mathrm{\xi }}}{-}{4}{}{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\xi }}}{}{{g}}_{{\mathrm{\nu }}{,}{\mathrm{\rho }}}$ (15)

Mixed products involving constants, variables, Dirac matrices, or Pauli matrices:

 > $\mathrm{Psigma}\left[3\right]$
 ${{\mathrm{\sigma }}}_{{3}}$ (16)
 > $\mathrm{Library}:-\mathrm{RewriteInMatrixForm}\left(\right)$
 $\left[\begin{array}{rr}1& 0\\ 0& -1\end{array}\right]$ (17)
 > $\mathrm{Trace}\left(\right)$
 ${0}$ (18)
 > $5\mathrm{Psigma}\left[2\right]\mathrm{Psigma}\left[2\right]$
 ${5}{}{{\mathrm{\sigma }}}_{{2}}^{{2}}$ (19)
 > $\mathrm{Library}:-\mathrm{RewriteInMatrixForm}\left(\right)$
 ${5}{}{\mathrm{^}}{}\left(\left[\begin{array}{cc}0& -I\\ I& 0\end{array}\right]{,}{2}\right)$ (20)
 > $\mathrm{Library}:-\mathrm{PerformMatrixOperations}\left(\right)$
 $\left[\begin{array}{rr}5& 0\\ 0& 5\end{array}\right]$ (21)
 > $\mathrm{Trace}\left(\right)$
 ${10}$ (22)
 > $\mathrm{\lambda }\mathrm{Psigma}\left[2\right]\mathrm{Psigma}\left[3\right]$
 ${\mathrm{\lambda }}{}{{\mathrm{\sigma }}}_{{2}}{}{{\mathrm{\sigma }}}_{{3}}$ (23)
 > $\mathrm{Trace}\left(\right)$
 ${0}$ (24)
 > $\mathrm{Setup}\left(\mathrm{dimension}=3\right):$
 ${\mathbit{Warning, unable to define the Pauli sigma matrices \left(Psigma\right) as a tensor in a spacetime with dimension =}}{}{\mathbf{3}}{}{\mathbit{where the metric is not Euclidean. You can still refer to the Pauli matrices using}}{}{{\mathbit{Psigma}}}_{{\mathbit{x}}}{}{\mathbit{,}}{}{{\mathbit{Psigma}}}_{{\mathbit{y}}}{}{\mathbit{and}}{}{{\mathbit{Psigma}}}_{{\mathbit{z}}}$
 $\mathrm{The dimension and signature of the tensor space are set to}{}\left[3{,}{}{}\left(\mathrm{- - +}\right)\right]$ (25)
 > $3\mathrm{Dgamma}\left[1\right]\mathrm{Dgamma}\left[2\right]\mathrm{Psigma}\left[3\right]$
 ${3}{}{{\mathrm{\gamma }}}_{{1}}{}{{\mathrm{\gamma }}}_{{2}}{}{{\mathrm{\sigma }}}_{{3}}$ (26)
 > $\mathrm{Trace}\left(\right)$
 ${0}$ (27)

Traces of algebraic expressions involving contracted products of tensors

 > $\mathrm{Setup}\left(\mathrm{dimension}=4,\mathrm{signature}=\mathrm{-},\mathrm{op}=\left\{k,p\right\}\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{op}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{quantumoperators}{}\text{'}$
 $\mathrm{The dimension and signature of the tensor space are set to}{}\left[4{,}{}{}\left(\mathrm{- - - +}\right)\right]$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{dimension}}{=}{4}{,}{\mathrm{quantumoperators}}{=}\left\{{k}{,}{p}\right\}{,}{\mathrm{signature}}{=}{\mathrm{- - - +}}\right]$ (28)
 > $\mathrm{Define}\left(p,k,\mathrm{quiet}\right)$
 $\left\{{k}{,}{p}{,}{{\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\}$ (29)
 > $\left(p\left[\mathrm{\mu }\right]\mathrm{Dgamma}\left[\mathrm{\mu }\right]+m\right)\left(k\left[\mathrm{\nu }\right]\mathrm{Dgamma}\left[\mathrm{\nu }\right]+m\right)$
 $\left({{p}}_{{\mathrm{\mu }}}{}{{\mathrm{\gamma }}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{+}{m}\right){}\left({{k}}_{{\mathrm{\nu }}}{}{{\mathrm{\gamma }}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{+}{m}\right)$ (30)
 > $\mathrm{Trace}\left(\right)$
 ${4}{}{{m}}^{{2}}{+}{4}{}{{p}}_{{\mathrm{\nu }}}{}{{k}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}$ (31)
 > $\left(p\left[\mathrm{\mu }\right]\mathrm{Dgamma}\left[\mathrm{\mu }\right]+m\right)\left(k\left[\mathrm{\nu }\right]\mathrm{Dgamma}\left[\mathrm{\nu }\right]+m\right)\left(k\left[\mathrm{\rho }\right]\mathrm{Dgamma}\left[\mathrm{\rho }\right]+m\right)\left(k\left[\mathrm{\sigma }\right]\mathrm{Dgamma}\left[\mathrm{\sigma }\right]+m\right)$
 $\left({{p}}_{{\mathrm{\mu }}}{}{{\mathrm{\gamma }}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{+}{m}\right){}\left({{k}}_{{\mathrm{\nu }}}{}{{\mathrm{\gamma }}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{+}{m}\right){}\left({{k}}_{{\mathrm{\rho }}}{}{{\mathrm{\gamma }}}_{\phantom{{}}\phantom{{\mathrm{\rho }}}}^{\phantom{{}}{\mathrm{\rho }}}{+}{m}\right){}\left({{k}}_{{\mathrm{\sigma }}}{}{{\mathrm{\gamma }}}_{\phantom{{}}\phantom{{\mathrm{\sigma }}}}^{\phantom{{}}{\mathrm{\sigma }}}{+}{m}\right)$ (32)
 > $\mathrm{Trace}\left(\right)$
 ${4}{}{{m}}^{{4}}{+}{12}{}{{m}}^{{2}}{}{{k}}_{{\mathrm{\kappa }}}{}{{k}}_{\phantom{{}}\phantom{{\mathrm{\kappa }}}}^{\phantom{{}}{\mathrm{\kappa }}}{+}{12}{}{{m}}^{{2}}{}{{p}}_{{\mathrm{\kappa }}}{}{{k}}_{\phantom{{}}\phantom{{\mathrm{\kappa }}}}^{\phantom{{}}{\mathrm{\kappa }}}{-}{4}{}{{p}}_{{\mathrm{\kappa }}}{}{{k}}_{{\mathrm{\lambda }}}{}{{k}}_{\phantom{{}}\phantom{{\mathrm{\kappa }}}}^{\phantom{{}}{\mathrm{\kappa }}}{}{{k}}_{\phantom{{}}\phantom{{\mathrm{\lambda }}}}^{\phantom{{}}{\mathrm{\lambda }}}{+}{4}{}{{p}}_{{\mathrm{\kappa }}}{}{{k}}_{\phantom{{}}\phantom{{\mathrm{\kappa }}}}^{\phantom{{}}{\mathrm{\kappa }}}{}{{k}}_{{\mathrm{\lambda }}}{}{{k}}_{\phantom{{}}\phantom{{\mathrm{\lambda }}}}^{\phantom{{}}{\mathrm{\lambda }}}{+}{4}{}{{p}}_{{\mathrm{\kappa }}}{}{{k}}_{{\mathrm{\lambda }}}{}{{k}}_{\phantom{{}}\phantom{{\mathrm{\lambda }}}}^{\phantom{{}}{\mathrm{\lambda }}}{}{{k}}_{\phantom{{}}\phantom{{\mathrm{\kappa }}}}^{\phantom{{}}{\mathrm{\kappa }}}$ (33)
 >