  Near-term quantum computers have significant error rates and short coherence
times, so compilation of circuits to be as short as possible is essential. Two
types of compilation problems are typically considered: circuits to prepare a
given state from a fixed input state, called "state preparation"; and circuits
to implement a given unitary operation, for example by "unitary synthesis". In
this paper we solve a more general problem: the transformation of a set of $m$
states to another set of $m$ states, which we call "multi-state preparation".
State preparation and unitary synthesis are special cases; for state
preparation, $m=1$, while for unitary synthesis, $m$ is the dimension of the
full Hilbert space. We generate and optimize circuits for multi-state
preparation numerically. In cases where a top-down approach based on matrix
decompositions is also possible, our method finds circuits with substantially
(up to 40%) fewer two-qubit gates. We discuss possible applications, including
efficient preparation of macroscopic superposition ("cat") states and synthesis
of quantum channels.
