テンソル記法

アインシュタイン和規約、インデックス、縮約、共変微分。

Tensor notation in LaTeX: indices, Einstein summation and the tensor package

Tensor notation in LaTeX is built from superscripts and subscripts: T^{ij}_{kl} for a tensor with two upper and two lower indices, g_{\mu\nu} for the metric and \delta^i_j for the Kronecker delta. When the order of mixed indices matters, stagger them with an empty group, T^{i}{}_{j}, or load the tensor package and write \tensor{T}{^i_j}. The Levi-Civita symbol is \epsilon_{ijk}, the tensor product is \otimes, and Einstein summation simply repeats an index, A^i B_i. The table lists the tensor symbols people use most, with the package each one needs; the full list follows below.

Quick reference: indices and tensor operations

SymbolCommandUsePackageCopy
TklijT^{ij}_{kl}
T^{ij}_{kl}Tensor with upper and lower indicesbuilt in
TijT^{i}{}_{j}
T^{i}{}_{j}Staggered indices (order matters)built in
TijkT^{i}{}_{j}{}^{k}
\tensor{T}{^i_j^k}Staggered indices made easytensor
gμνg_{\mu\nu}
g_{\mu\nu}Metric tensorbuilt in
δji\delta^i_j
\delta^i_jKronecker deltabuilt in
ϵijk\epsilon_{ijk}
\epsilon_{ijk}Levi-Civita symbolbuilt in
AiBiA^i B_i
A^i B_iEinstein summation (repeated index)built in
A⊗BA \otimes B
A \otimes BTensor productbuilt in
∂μ\partial_\mu
\partial_\muPartial derivative along a coordinatebuilt in
∇μTν\nabla_\mu T^{\nu}
\nabla_\mu T^{\nu}Covariant derivativebuilt in
T(ij)T_{(ij)}
T_{(ij)}Symmetrisationbuilt in
T[ij]T_{[ij]}
T_{[ij]}Antisymmetrisationbuilt in

Connections, curvature and differential forms are on the differential geometry symbols page.

Frequently asked questions about tensor notation in LaTeX

How do I write a tensor with upper and lower indices in LaTeX?
Combine superscripts and subscripts: $T^{ij}_{kl}$. If the horizontal order of indices matters, insert an empty group so they do not stack: T^{i}{}_{j} puts j after i. The tensor package automates this with \tensor{T}{^i_j} and T\indices{^i_j}.
How do I write the Kronecker delta and Levi-Civita symbol in LaTeX?
The Kronecker delta is \delta_{ij} or \delta^i_j, and the Levi-Civita symbol is \epsilon_{ijk} or \varepsilon_{ijk}, depending on which epsilon shape your field uses. Both are built-in Greek letters with indices.
How do I write Einstein summation in LaTeX?
There is no special command: repeating an index up and down implies the sum, so A^i B_i means \sum_i A^i B_i. Write the explicit \sum only when you want to show it, and use Greek indices like \mu and \nu for spacetime components.
TklijT^{ij}_{kl}

Tensor

T^{ij}_{kl}
TijT_{ij}
TijT^{ij}
TjiT^i_j
δji\delta^i_j

Kronecker Delta

\delta^i_j
ϵijk\epsilon_{ijk}

Levi-Civita

\epsilon_{ijk}
AiBiA^i B_i
A⊗BA \otimes B

Tensor Product

A \otimes B
TiiT^i_i
vi=gijvjv_i = g_{ij} v^j

Metric Lowering

v_i = g_{ij} v^j
vi=gijvjv^i = g^{ij} v_j

Metric Raising

v^i = g^{ij} v_j
∂i\partial_i
∇i\nabla_i
T(ij)T_{(ij)}
T[ij]T_{[ij]}
(p,q)(p, q)
eie_i
eie^i
T′ij=ΛkiΛljTklT'^{ij} = \Lambda^i_k \Lambda^j_l T^{kl}

Component Transform

T'^{ij} = \Lambda^i_k \Lambda^j_l T^{kl}