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μ⁢γμ+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:TraceA+B→TraceA+TraceB.
For all other cases, return the unevaluated expression, Trace⁡f.
The Trace of a product of Dirac matrices is based on their anticommutation relation gammamu⁢gammanu+gammanu⁢gammamu=2⁢g_[mu,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 Trace⁡γν1,γν2,...,γν2⁢n of an even number ( 2⁢n ) of them can be expressed as a sum of terms of the form 4⁢g_[mu1,mu2]⁢g_[mu3,mu4]...g_[mu2n−1, mu2n], with the sign of each term being determined by whether the permutation of indices, from [nu1,nu2,...,nu2n] to [mu1,mu2,...,mu2n], is odd or even.
Examples
with⁡Physics:
Setup⁡mathematicalnotation=true
mathematicalnotation=true
First, set prefixes identifying anticommutative and noncommutative variables.
Setup⁡anticommutativeprefix=Q,noncommutativeprefix=Z
anticommutativeprefix=Q,noncommutativeprefix=Z
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.
Trace⁡Q1⁢Q2,onlymatrices=false
0
Trace⁡Q3⁢Q1⁢Q2
Q1⁢Q2⁢Q3
Trace⁡a⁢Q3⁢b⁢Q1⁢c⁢Q2
a⁢b⁢c⁢Q1⁢Q2⁢Q3
Trace⁡π⁢Q3⁢γ⁢Q1⁢I⁢Q2
I⁢π⁢γ⁢Q1⁢Q2⁢Q3
Trace⁡A+B+π⁢Q3⁢γ⁢Q1⁢I⁢Q2
A+B+I⁢π⁢γ⁢Q1⁢Q2⁢Q3
Products of Dirac matrices and Pauli matrices:
Dgamma3⁢Dgamma5⁢Dgamma5
γ3⁢γ52
Trace⁡
Dgamma3⁢Dgammaξ
γ3⁢γξ
4⁢g3,ξ
Dgammaα⁢Dgammaν⁢Dgammaξ
γα⁢γν⁢γξ
Dgammaα⁢Dgammaν⁢Dgammaξ⁢Dgammaρ
γα⁢γν⁢γξ⁢γρ
4⁢gα,ν⁢gρ,ξ+4⁢gα,ρ⁢gν,ξ−4⁢gα,ξ⁢gν,ρ
Mixed products involving constants, variables, Dirac matrices, or Pauli matrices:
Psigma3
σ3
Library:-RewriteInMatrixForm⁡
5⁢Psigma2⁢Psigma2
5⁢σ22
5⁢2
Library:-PerformMatrixOperations⁡
10
λ⁢Psigma2⁢Psigma3
λ⁢σ2⁢σ3
Setup⁡dimension=3:
Warning, unable to define the Pauli sigma matrices (Psigma) as a tensor in a spacetime with dimension = 3 where the metric is not Euclidean. You can still refer to the Pauli matrices using Psigmax, Psigmay and Psigmaz
The dimension and signature of the tensor space are set to 3,⁢⁡- - +
3⁢Dgamma1⁢Dgamma2⁢Psigma3
3⁢γ1⁢γ2⁢σ3
Traces of algebraic expressions involving contracted products of tensors
Setup⁡dimension=4,signature=`-`,op=k,p
* Partial match of 'op' against keyword 'quantumoperators'
The dimension and signature of the tensor space are set to 4,⁢⁡- - - +
_______________________________________________________
dimension=4,quantumoperators=k,p,signature=- - - +
Define⁡p,k,quiet
k,p,γμ,σμ,∂μ,gμ,ν,εα,β,μ,ν
pμ⁢Dgammaμ+m⁢kν⁢Dgammaν+m
pμ⁢γ⁢μ⁢μ+m⁢kν⁢γ⁢ν⁢ν+m
4⁢m2+4⁢pν⁢k⁢ν⁢ν
pμ⁢Dgammaμ+m⁢kν⁢Dgammaν+m⁢kρ⁢Dgammaρ+m⁢kσ⁢Dgammaσ+m
pμ⁢γ⁢μ⁢μ+m⁢kν⁢γ⁢ν⁢ν+m⁢kρ⁢γ⁢ρ⁢ρ+m⁢kσ⁢γ⁢σ⁢σ+m
4⁢m4+12⁢m2⁢kλ⁢k⁢λ⁢λ+12⁢m2⁢pλ⁢k⁢λ⁢λ+4⁢pλ⁢kτ⁢k⁢τ⁢τ⁢k⁢λ⁢λ−4⁢pλ⁢kτ⁢k⁢λ⁢λ⁢k⁢τ⁢τ+4⁢pτ⁢k⁢τ⁢τ⁢kλ⁢k⁢λ⁢λ
See Also
Dgamma, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Physics[*], Physics[Library], Psigma, Setup
Download Help Document