  Clarifying the relation between the whole and its parts is crucial for many
problems in science. In quantum mechanics, this question manifests itself in
the quantum marginal problem, which asks whether there is a global pure quantum
state for some given marginals. This problem arises in many contexts, ranging
from quantum chemistry to entanglement theory and quantum error correcting
codes. In this paper, we prove a correspondence of the marginal problem to the
separability problem. Based on this, we describe a sequence of semidefinite
programs which can decide whether some given marginals are compatible with some
pure global quantum state. As an application, we prove that the existence of
multiparticle absolutely maximally entangled states for a given dimension is
equivalent to the separability of an explicitly given two-party quantum state.
Finally, we show that the existence of quantum codes with given parameters can
also be interpreted as a marginal problem, hence, our complete hierarchy can
also be used.
