  Let $K$ denote an algebraically closed field and let $V$ denote a vector
space over $K$ with finite positive dimension. We consider a pair of linear
transformations $A:V \to V$ and $A^*:V \to V$ that satisfy the following
conditions: (i) each of $A,A^*$ is diagonalizable; (ii) there exists an
ordering $\lbrace V_i\rbrace_{i=0}^d$ of the eigenspaces of $A$ such that $A^*
V_i \subseteq V_{i-1} + V_{i} + V_{i+1}$ for $0 \leq i \leq d$, where
$V_{-1}=0$ and $V_{d+1}=0$; (iii) there exists an ordering $\lbrace
V^*_i\rbrace_{i=0}^\delta$ of the eigenspaces of $A^*$ such that $A V^*_i
\subseteq V^*_{i-1} + V^*_{i} + V^*_{i+1}$ for $0 \leq i \leq \delta$, where
$V^*_{-1}=0$ and $V^*_{\delta+1}=0$; (iv) there is no subspace $W$ of $V$ such
that $AW \subseteq W$, $A^* W \subseteq W$, $W \neq 0$, $W \neq V$. We call
such a pair a {\it tridiagonal pair} on $V$. It is known that $d=\delta$. For
$0 \leq i \leq d$ let $\theta_i$ (resp. $\theta^*_i$) denote the eigenvalue of
$A$ (resp. $A^*$) associated with $V_i$ (resp. $V^*_i$). The pair $A,A^*$ is
said to have {\it $q$-Racah type} whenever $\theta_i = a + b q^{2i-d}+ c
q^{d-2i}$ and $\theta^*_i = a^* + b^*q^{2i-d}+c^*q^{d-2i}$ for $0 \leq i \leq
d$, where $q, a,b,c,a^*,b^*,c^*$ are scalars in $K$ with $q,b,c,b^*,c^*$
nonzero and $q^2 \not\in \lbrace 1,-1\rbrace$. This type is the most general
one. We classify up to isomorphism the tridiagonal pairs over $K$ that have
$q$-Racah type. Our proof involves the representation theory of the quantum
affine algebra $U_q(\widehat{\mathfrak{sl}}_2)$.
