A single spin is the smallest possible magnetic field sensor, capable of mapping magnetisation with quantum-limited sensitivity and nanoscale spatial resolution. Research by the quantum technology community in the past couple of decades has opened the capability to control and detect individual electronic spins, in particular the spin associated with the nitrogen-vacancy (NV) point defect in diamond. This system exhibits some quite unique capabilities: (i) atomic-scale wavefunctions and the short-range decay of magnetic dipolar interaction deliver nanoscale spatial resolution; (ii) long spin coherence results in excellent sensitivity; (iii) the possibility to optically detect and polarize the electron spin over a wide temperature range (from mK to room-temperature) makes it versatile for different applications.

Our work in this area is related to the optimisation of the sensor capabilities and to its application to study many-body physics and magnetic ordering in 2D materials.

Real-time adaptive optimisation. One of the main bottlenecks for NV magnetometry is the data acquisition time: especially for long dynamical decoupling sequences with high spectral selectivity, required in nanoscale magnetic resonance, the signal acquisition timescales become prohibitively long. This issue can be addressed by improving spin readout (e.g. by spin-to-charge conversion techniques) and by optimising the way measurements are performed.

Our work has show that Bayesian estimation provides an excellent framework for real-time optimisation of the sensing parameters. Bayesian techniques can take into account existing *a-priori* information and they are compatible with adaptive experiment design. In this approach, one starts from an *a-priori* probability distribution p(X) for the quantity X of interest (a uniform distribution if no preliminary knowledge is available) and updates it after each measurement outcome m using Bayes rule p(X|m) ~ p(m|x) p(X). At each point in time, *the current probability distribution p(X) can be used to optimally adjust, in real time, the experimental settings for the following measurements*. We implement these type of protocols using real-time microcontrollers, FPGAs and programmable arbitrary waveform generators.