  We present an efficient algorithm for twirling a multi-qudit quantum state.
The algorithm can be used for approximating the twirling operation in an
ensemble of physical systems in which the systems cannot be individually
accessed. It can also be used for computing the twirled density matrix on a
classical computer. The method is based on a simple non-unitary operation
involving a random unitary. When applying this basic building block
iteratively, the mean squared error of the approximation decays exponentially.
In contrast, when averaging over random unitary matrices the error decreases
only algebraically. We present evidence that the unitaries in our algorithm can
come from a very imperfect random source or can even be chosen
deterministically from a set of cyclically alternating matrices. Based on these
ideas we present a quantum circuit realizing twirling efficiently.
