My computer has problems when I try to perform a calculation with TensorContract.

In particular, with the second answer to my previous question Contracting indices in lists, I want to compute (Einsten summation convention on repeated indices is used)

expression to calculate,

where we have the 4-dimensional Levi-Civita tensor, $\gamma^\mu$ are four 4x4 matrices defined by

SetAttributes[γ, Listable]
γ[μ_] := If[μ == 0, KroneckerProduct @@ PauliMatrix[{1, μ}], I KroneckerProduct @@ PauliMatrix[{2, μ}]]

and $\psi^{\rho\sigma}$ are a set of 16 4x1 matrices (i.e. vectors) defined by

SetAttributes[ψ, Listable]
ψ[μ_, ν_] := If[μ == ν, {{0}, {0}, {0}, {0}}, {{psi0[μ, ν]}, {psi1[μ, ν]}, {psi2[μ, ν]}, {psi3[μ, ν]}}] ψμν = Outer[ψ, Range[0, 3], Range[0, 3]] // SparseArray

All the Greek indices run from 0 to 3. In particular, the expression I want to obtain has a free indices $\mu$, and so it is a 1-index tensor. To obtain the zeroth component ($\mu=0$, for example, I define

SetAttributes[a, Listable]
a[μ_] := If[μ == 0, a[μ] = 1, a[μ] = 0]
aμ = a[Range[0, 3]]

so that

an equation,

and use (see my previous question!) TensorContract[TensorProduct[LeviCivitaTensor[4], γμ, ψμν, η, η, η, aμ, η], {{1, 18}, {2, 11}, {3, 13}, {4, 15}, {5, 12}, {7, 10}, {8, 14}, {9, 16}, {17, 9}}].

My computer is just not able to do this: Mathematica crashes. Am I doing something wrong? Is there something I don't know about TensorContract, like a maximum number of arguments or stuff like that? If not, how can I solve this problem (changing computer is not an option)?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.