Solution (source code)

= Solution

Label an <orthonormal basis> of the $n$-dimensional <Hilbert space> by $j=0,\ldots,n-1$, with indices modulo $n$. Let
$$
\omega=e^{2\pi i/n},\qquad X|j\rangle=|j+1\rangle,\qquad Z|j\rangle=\omega^j|j\rangle.
$$
These are the shift and phase <Heisenberg-Weyl operators>. Alice holds the input $S$ and one half $A$ of the shared <maximally entangled state>
$$
|\Phi_n\rangle_{AB}=\frac1{\sqrt n}\sum_{j=0}^{n-1}|j\rangle_A|j\rangle_B.
$$
She measures $SA$ in the <generalized Bell basis>
$$
|B_{pq}\rangle_{SA}=\frac1{\sqrt n}\sum_{j=0}^{n-1}\omega^{pj}|j\rangle_S|j+q\rangle_A,
\qquad p,q=0,\ldots,n-1.
$$
Its inner products are
$$
\langle B_{pq}|B_{p'q'}\rangle
=\delta_{qq'}\frac1n\sum_{j=0}^{n-1}\omega^{(p'-p)j}
=\delta_{pp'}\delta_{qq'}.
$$
There are $n^2$ orthonormal vectors in an $n^2$-dimensional space, so this is a complete <projective measurement>.

For an unknown normalized state $|u\rangle=\sum_j u_j|j\rangle$, its contraction with measurement outcome $(p,q)$ gives Bob's unnormalized state
$$
\begin{aligned}
{}_{SA}\langle B_{pq}|\bigl(|u\rangle_S|\Phi_n\rangle_{AB}\bigr)
&=\frac1n\sum_j u_j\omega^{-pj}|j+q\rangle_B\\
&=\frac1nX^qZ^{-p}|u\rangle_B.
\end{aligned}
$$
Each outcome has <probability> $1/n^2$, independently of the input. Alice communicates the two $n$-valued labels, and Bob applies the ordered inverse
$$
\boxed{U_{pq}=Z^pX^{-q},\qquad
U_{pq}\left(\frac1nX^qZ^{-p}|u\rangle\right)=\frac1n|u\rangle.}
$$
The order matters because shift and phase operators do not generally commute. Normalizing the branch recovers the unknown state exactly, and all outcomes are corrected, so success is deterministic. The quantum resource is one maximally entangled pair of local dimension $n$. The classical resource is an $n^2$-valued message, with information content $2\log_2 n$ bits; $\lceil\log_2(n^2)\rceil$ ordinary bits suffice in fixed-length binary encoding.

This is faithful <qudit teleportation> even for an input entangled with a reference $R$. Expand a joint pure state as $\sum_j|j\rangle_S|r_j\rangle_R$, without requiring the reference vectors to be orthogonal. The same contraction and correction act on each system basis vector, producing $n^{-1}\sum_j|j\rangle_B|r_j\rangle_R$. Thus the whole joint state, not just a reduced state, is preserved. Linearity extends the conclusion to mixed inputs. This is <teleportation as an identity channel on a reference>.