Einstein Summation in LaTeX (A^i B_i)

AiBiA^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.

AiBi=∑i=1nAiBiA^i B_i = \sum_{i=1}^{n} A^i B_i
\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

All 텐서 표기법 →

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.
Math poweredAI로 LaTeX 작성

최고의 AI LaTeX 편집기, Overleaf 대안

Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움

  • AI로 아름다운 TikZ 다이어그램 생성
  • 이미지를 업로드하고 LaTeX로 원활하게 변환
  • 논문 작성 및 서식에 대한 즉각적인 지원 받기