  We propose a protocol for generating multi-particle entangled states using
coherent manipulation of atoms trapped in an optical cavity. We show how
entanglement can be adiabatically produced with two control beams and by
exploiting cavity-mediated interactions between the atoms. Our methods will
allow for optimal generation of entanglement for the measurement protocol we
propose. We discuss an experimental implementation and compare the performance
of the states produced with those of classical states and ideal
maximally-entangled Dicke states. We find that our states always feature
metrological gain and even outperform ideal Dicke states in the measurement of
magnetic field gradients. Due to the easy scalability, our entanglement
protocol is a promising tool for quantum state engineering.
