High energy physics¶
Abstract
Contains docstrings for methods in high energy physics.
Gamma matrices¶
Module to handle gamma matrices expressed as tensor objects.
Examples¶
>>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, LorentzIndex
>>> from sympy.tensor.tensor import tensor_indices
>>> i = tensor_indices('i', LorentzIndex)
>>> G(i)
GammaMatrix(i)
Note that there is already an instance of GammaMatrixHead in four dimensions: GammaMatrix, which is simply declare as
>>> from sympy.physics.hep.gamma_matrices import GammaMatrix
>>> from sympy.tensor.tensor import tensor_indices
>>> i = tensor_indices('i', LorentzIndex)
>>> GammaMatrix(i)
GammaMatrix(i)
To access the metric tensor
>>> LorentzIndex.metric
metric(LorentzIndex,LorentzIndex)

sympy.physics.hep.gamma_matrices.
extract_type_tens
(expression, component)[source]¶ Extract from a
TensExpr
all tensors with \(component\).Returns two tensor expressions:
 the first contains all
Tensor
of having \(component\).  the second contains all remaining.
 the first contains all

sympy.physics.hep.gamma_matrices.
gamma_trace
(t)[source]¶ trace of a single line of gamma matrices
Examples
>>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, gamma_trace, LorentzIndex >>> from sympy.tensor.tensor import tensor_indices, tensorhead >>> p, q = tensorhead('p, q', [LorentzIndex], [[1]]) >>> i0,i1,i2,i3,i4,i5 = tensor_indices('i0:6', LorentzIndex) >>> ps = p(i0)*G(i0) >>> qs = q(i0)*G(i0) >>> gamma_trace(G(i0)*G(i1)) 4*metric(i0, i1) >>> gamma_trace(ps*ps)  4*p(i0)*p(i0) 0 >>> gamma_trace(ps*qs + ps*ps)  4*p(i0)*p(i0)  4*p(i0)*q(i0) 0

sympy.physics.hep.gamma_matrices.
kahane_simplify
(expression)[source]¶ This function cancels contracted elements in a product of four dimensional gamma matrices, resulting in an expression equal to the given one, without the contracted gamma matrices.
Parameters: `expression` the tensor expression containing the gamma matrices to simplify. Notes
If spinor indices are given, the matrices must be given in the order given in the product.
References
[1] Algorithm for Reducing Contracted Products of gamma Matrices, Joseph Kahane, Journal of Mathematical Physics, Vol. 9, No. 10, October 1968.
Examples
When using, always remember that the original expression coefficient has to be handled separately
>>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, LorentzIndex >>> from sympy.physics.hep.gamma_matrices import kahane_simplify >>> from sympy.tensor.tensor import tensor_indices >>> i0, i1, i2 = tensor_indices('i0:3', LorentzIndex) >>> ta = G(i0)*G(i0) >>> kahane_simplify(ta) Matrix([ [4, 0, 0, 0], [0, 4, 0, 0], [0, 0, 4, 0], [0, 0, 0, 4]]) >>> tb = G(i0)*G(i1)*G(i0) >>> kahane_simplify(tb) 2*GammaMatrix(i1) >>> t = G(i0)*G(i0) >>> kahane_simplify(t) Matrix([ [4, 0, 0, 0], [0, 4, 0, 0], [0, 0, 4, 0], [0, 0, 0, 4]]) >>> t = G(i0)*G(i0) >>> kahane_simplify(t) Matrix([ [4, 0, 0, 0], [0, 4, 0, 0], [0, 0, 4, 0], [0, 0, 0, 4]])
If there are no contractions, the same expression is returned
>>> tc = G(i0)*G(i1) >>> kahane_simplify(tc) GammaMatrix(i0)*GammaMatrix(i1)
Algorithm
The idea behind the algorithm is to use some wellknown identities, i.e., for contractions enclosing an even number of \(\gamma\) matrices
\(\gamma^\mu \gamma_{a_1} \cdots \gamma_{a_{2N}} \gamma_\mu = 2 (\gamma_{a_{2N}} \gamma_{a_1} \cdots \gamma_{a_{2N1}} + \gamma_{a_{2N1}} \cdots \gamma_{a_1} \gamma_{a_{2N}} )\)
for an odd number of \(\gamma\) matrices
\(\gamma^\mu \gamma_{a_1} \cdots \gamma_{a_{2N+1}} \gamma_\mu = 2 \gamma_{a_{2N+1}} \gamma_{a_{2N}} \cdots \gamma_{a_{1}}\)
Instead of repeatedly applying these identities to cancel out all contracted indices, it is possible to recognize the links that would result from such an operation, the problem is thus reduced to a simple rearrangement of free gamma matrices.

sympy.physics.hep.gamma_matrices.
simplify_gpgp
(ex, sort=True)[source]¶ simplify products
G(i)*p(i)*G(j)*p(j) > p(i)*p(i)
Examples
>>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, LorentzIndex, simplify_gpgp >>> from sympy.tensor.tensor import tensor_indices, tensorhead >>> p, q = tensorhead('p, q', [LorentzIndex], [[1]]) >>> i0,i1,i2,i3,i4,i5 = tensor_indices('i0:6', LorentzIndex) >>> ps = p(i0)*G(i0) >>> qs = q(i0)*G(i0) >>> simplify_gpgp(ps*qs*qs) GammaMatrix(L_0)*p(L_0)*q(L_1)*q(L_1)