  Spin systems are an attractive candidate for quantum-enhanced metrology. Here
we develop a variational method to generate metrological states in small
dipolar-interacting ensembles with limited qubit controls and unknown spin
locations. The generated states enable sensing beyond the standard quantum
limit (SQL) and approaching the Heisenberg limit (HL). Depending on the circuit
depth and the level of readout noise, the resulting states resemble
Greenberger-Horne-Zeilinger (GHZ) states or Spin Squeezed States (SSS). Sensing
beyond the SQL holds in the presence of finite spin polarization and a
non-Markovian noise environment.
