  We propose a strategy to generate a many-body entangled state in a collection
of randomly placed, dipolarly coupled electronic spins in the solid state. By
using coherent control to restrict the evolution into a suitable collective
subspace, this method enables the preparation of GHZ-like and spin-squeezed
states even for randomly positioned spins, while in addition protecting the
entangled states against decoherence. We consider the application of this
squeezing method to improve the sensitivity of nanoscale magnetometer based on
Nitrogen-Vacancy spin qubits in diamond.
