Einstein Summation in LaTeX (A^i B_i)
- LaTeX command
A^i B_i- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Einstein summation convention: a repeated upper and lower index is summed, so A^i B_i means the sum over i.
The convention lets A^i B_i stand for \sum_i A^i B_i, the scalar pairing of a vector with a covector, without writing the sum sign. Each summed index must appear exactly once up and once down; an index appearing three times signals an error. Free indices must match on both sides of an equation, as in v^i = T^i_j u^j. When the convention might be unfamiliar to readers, state it once and give the explicit \sum form in the first equation.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Einstein Summation: $A^i B_i$
\[ A^i B_i = \sum_{i=1}^{n} A^i B_i \]
\end{document}Related symbols
- Tensor Product
A \otimes B - Levi-Civita
\epsilon_{ijk} - Contraction
T^i_i - Kronecker Delta
\delta^i_j - Metric Lowering
v_i = g_{ij} v^j - Mixed Tensor
T^i_j
Frequently asked questions
- How do I write Einstein Summation in LaTeX?
- Type A^i B_i in math mode, for example $A^i B_i = \sum_{i=1}^{n} A^i B_i$. It works in plain LaTeX without loading any package.
- Which package do I need for A^i B_i?
- None. A^i B_i is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use A^i B_i in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $A^i B_i$ in running text.