Contract

Description

Contract[expr] contracts pairs of Lorentz indices of metric tensors, four-vectors and (depending on the optionEpsContract) of Levi-Civita tensors in expr. For the contraction of Dirac matrices with each other use DiracSimplify. Contract[exp1, exp2] contracts (exp1*exp2), where exp1 and exp2 may be larger products of sums of metric tensors and 4-vectors.

Options[Contract]

See also:  Pair, DiracSimplify, MomentumCombine.

Examples

MetricTensor[μ, ν] FourVector[p, μ]

Contract[%]

FourVector[p, μ] DiracMatrix[μ]

Contract[%]

MetricTensor[μ, μ]

The default dimension for MetricTensor is 4.

Contract[%]

A short way to enter D-dimensional metric tensors is given by MTD. The "." as multiplication operator is not necessary but just convenient for typesetting.

MTD[μ, ν]  .  MTD[μ, ν]

Contract[%]

MTD[μ, ν]  .  MTD[μ, ν]

FourVector[p, μ] FourVector[q, μ]

Contract[% ]

FourVector[p - q, μ] FourVector[a - b, μ]

Contract[%]

LeviCivita[μ, ν, α, σ] FourVector[
        p, σ]

Contract[%]

LeviCivita[μ, ν, α, β] LeviCivita[μ, ν, α, σ]

Contract[%]

SetOptions[Eps, Dimension -> D]; 
    LCD[μ, ν, α, β] LCD[μ, ν, α, σ]

Contract[%] // Factor2

SetOptions[Eps, Dimension -> 4];