  Quantum error correction and symmetries play central roles in quantum
information science and physics. It is known that quantum error-correcting
codes that obey (are covariant with respect to) continuous symmetries in a
certain sense cannot correct erasure errors perfectly (a well-known result in
this regard being the Eastin-Knill theorem in the context of fault-tolerant
quantum computing), in contrast to the case without symmetry constraints.
Furthermore, several quantitative fundamental limits on the accuracy of such
covariant codes for approximate quantum error correction are known. Here, we
consider the quantum error correction capability of uniformly random covariant
codes. In particular, we analytically study the most essential cases of $U(1)$
and $SU(d)$ symmetries, and show that for both symmetry groups the error of the
covariant codes generated by Haar-random symmetric unitaries, i.e., unitaries
that commute with the group actions, typically scale as $O(n^{-1})$ in terms of
both the average- and worst-case purified distances against erasure noise,
saturating the fundamental limits to leading order. We note that the results
hold for symmetric variants of unitary 2-designs, and comment on the
convergence problem of symmetric random circuits. Our results not only indicate
(potentially efficient) randomized constructions of optimal $U(1)$- and
$SU(d)$-covariant codes, but also reveal fundamental properties of random
symmetric unitaries, which yield important solvable models of complex quantum
systems (including black holes and many-body spin systems) that have attracted
great recent interest in quantum gravity and condensed matter physics. We
expect our construction and analysis to find broad relevance in both physics
and quantum computing.
