Optimal three-to-one qubit random access code (source code)

= Optimal three-to-one qubit random access code
{title2=$p_*=\tfrac12(1+1/\sqrt3)$}

Encode signs $s_j=(-1)^{b_j}$ by the unit <Bloch vector> $(s_1,s_2,s_3)/\sqrt3$. Perform the requested <Pauli measurement> and interpret a positive outcome as zero. Every input and index has success $p_*$. To prove optimality, write each binary-measurement difference as $D_j=t_jI+v_j\cdot\sigma$, where positivity gives $|v_j|\le1-|t_j|$. Averaging over all eight inputs cancels the $t_j$ terms. For any encoding vectors of norm at most one, the average success is at most $1/2+(1/48)\sum_s|\sum_js_jv_j|$. The <Cauchy-Schwarz inequality> bounds the sum by $8\sqrt{\sum_j|v_j|^2}\le8\sqrt3$, proving the optimum even for mixed encodings and general binary measurements. The constant-success construction also maximizes worst-case success.