  We study efficient generations of random diagonal-unitary matrices, an
ensemble of unitary matrices diagonal in a given basis with randomly
distributed phases for their eigenvalues. Despite the simple algebraic
structure, they cannot be achieved by quantum circuits composed of a few-qubit
diagonal gates. We introduce diagonal-unitary $t$-designs and present two
quantum circuits that implement diagonal-unitary $2$-designs with the
computational basis in $N$-qubit systems. One is composed of single-qubit
diagonal gates and controlled-phase gates with randomized phases, which
achieves an exact diagonal-unitary $2$-design after applying the gates on all
pairs of qubits. The number of required gates is $N(N-1)/2$. If the
controlled-Z gates are used instead of the controlled-phase gates, the circuit
cannot achieve an exact $2$-design, but achieves an $\epsilon$-approximate
$2$-design by applying gates on randomly selected pairs of qubits. Due to the
random choice of pairs, the circuit obtains extra randomness and the required
number of gates is at most $O(N^2(N+\log1/\epsilon))$. We also provide an
application of the circuits, a protocol of generating an exact $2$-design of
random states by combining the circuits with a simple classical procedure
requiring $O(N)$ random classical bits.
