  We extend the ab initio coupled-cluster effective interaction (CCEI) method
to deformed open-shell nuclei with protons and neutrons in the valence space,
and compute binding energies and excited states of isotopes of neon and
magnesium. We employ a nucleon-nucleon and three-nucleon interaction from
chiral effective field theory evolved to a lower cutoff via a similarity
renormalization group transformation. We find good agreement with experiment
for binding energies and spectra, while charge radii of neon isotopes are
underestimated. For the deformed nuclei $^{20}$Ne and $^{24}$Mg we reproduce
rotational bands and electric quadrupole transitions within uncertainties
estimated from an effective field theory for deformed nuclei, thereby
demonstrating that collective phenomena in $sd$-shell nuclei emerge from
complex ab initio calculations.
