Quantum magnetic sensing is a new paradigm for detecting ultra-weak magnetic fields. Its protocol design concerns the devise of optimal sensing parameters to estimate the underlying signals of interest (SoI). Existing studies mainly rely on adaptive algorithms based on black-box AI models or formula-driven principled searches. However, when the SoI spans a wide range and the quantum sensor has physical constraints, these methods may fail to converge efficiently or optimally, causing prolonged interrogation times and reduced accuracy. This work presents a new protocol using a two-stage optimization method, consisting of a Bayesian neural network to first narrow the SoI range and a federated reinforcement learning agent to subsequently calibrate the SoI. The protocol is developed and evaluated in the challenging context of an NV-center spin system with single-shot readout and limited sensing time; and yet it achieves significant improvements in both accuracy and resource efficiency compared to the state-of-the-art.
Quantum magnetic sensing is a new paradigm for detecting ultra-weak magnetic fields. Its protocol design concerns the devise of optimal sensing parameters to estimate the underlying signals of interest (SoI). Existing studies mainly rely on adaptive algorithms based on black-box AI models or formula-driven principled searches. However, when the SoI spans a wide range and the quantum sensor has physical constraints, these methods may fail to converge efficiently or optimally, causing prolonged interrogation times and reduced accuracy. This work presents a new protocol using a two-stage optimization method, consisting of a Bayesian neural network to first narrow the SoI range and a federated reinforcement learning agent to subsequently calibrate the SoI. The protocol is developed and evaluated in the challenging context of an NV-center spin system with single-shot readout and limited sensing time; and yet it achieves significant improvements in both accuracy and resource efficiency compared to the state-of-the-art.
Quantum information protocols, such as quantum error correction and quantum phase estimation, have been widely used to enhance the performance of quantum sensors. While these protocols have relied on single-shot detection, in most practical applications only an averaged readout is available, as in the case of room-temperature sensing with the electron spin associated with a nitrogen-vacancy center in diamond. Here, we theoretically investigate the application of the quantum phase estimation algorithm for high dynamic-range magnetometry, when single-shot readout is not available. We show that, even in this case, Bayesian estimation provides a natural way to efficiently use the available information. We apply Bayesian analysis to achieve an optimized sensing protocol for estimating a time-independent magnetic field with a single electron spin associated to a nitrogen-vacancy center at room temperature and show that this protocol improves the sensitivity over previous protocols by more than a factor of 3. Moreover, we show that an extra enhancement can be achieved by considering the timing information in the detector clicks.
Quantum sensors offer significant advantages over classical devices in spatial resolution and sensitivity, enabling transformative applications across materials science, healthcare, and beyond. Their practical performance, however, is often constrained by unmodelled effects, including noise, imperfect state preparation, and non-ideal control fields. In this work, we report the first experimental implementation of a graybox modelling strategy for a solid-state open quantum system. The graybox framework integrates a physics-based system model with a data-driven description of experimental imperfections, achieving higher fidelity than purely analytical (whitebox) approaches while requiring fewer training resources than fully deep-learning blackbox models. We experimentally validate the method on the task of estimating a static magnetic field using a single-spin quantum sensor, performing Bayesian inference with a graybox model trained on prior experimental data. Using roughly 10,000 training datapoints, the graybox model yields several orders of magnitude improvement in mean squared error over the corresponding physics-only model, as well as significant improvement over a blackbox model with comparable size. These results are broadly applicable to a wide range of quantum sensing platforms, not limited to single-spin systems, and are particularly valuable for real-time adaptive protocols, where model inaccuracies can otherwise lead to suboptimal control and degraded performance.
Single-spin quantum sensors, for example based on nitrogen-vacancy centres in diamond, provide nanoscale mapping of magnetic fields. In applications where the magnetic field may be changing rapidly, total sensing time is crucial and must be minimised. Bayesian estimation and adaptive experiment optimisation can speed up the sensing process by reducing the number of measurements required. These protocols consist of computing and updating the probability distribution of the magnetic field based on measurement outcomes and of determining optimized acquisition settings for the next measurement. However, the computational steps feeding into the measurement settings of the next iteration must be performed quickly enough to allow real-time updates. This article addresses the issue of computational speed by implementing an approximate Bayesian estimation technique, where probability distributions are approximated by a finite sum of Gaussian functions. Given that only three parameters are required to fully describe a Gaussian density, we find that in many cases, the magnetic field probability distribution can be described by fewer than ten parameters, achieving a reduction in computation time by factor 10 compared to existing approaches. ForT2*=1μs, only a small decrease in computation time is achieved. However, in these regimes, the proposed Gaussian protocol outperforms the existing one in tracking accuracy.
Quantum sensors offer control flexibility during estimation by allowing manipulation by the experimenter across various parameters. For each sensing platform, pinpointing the optimal controls to enhance the sensor's precision remains a challenging task. While an analytical solution might be out of reach, machine learning offers a promising avenue for many systems of interest, especially given the capabilities of contemporary hardware. We have introduced a versatile procedure capable of optimizing a wide range of problems in quantum metrology, estimation, and hypothesis testing by combining model-aware reinforcement learning (RL) with Bayesian estimation based on particle filtering. To achieve this, we had to address the challenge of incorporating the many non-differentiable steps of the estimation in the training process, such as measurements and the resampling of the particle filter. Model-aware RL is a gradient-based method, where the derivatives of the sensor's precision are obtained through automatic differentiation (AD) in the simulation of the experiment. Our approach is suitable for optimizing both non-adaptive and adaptive strategies, using neural networks or other agents. We provide an implementation of this technique in the form of a Python library called qsensoropt, alongside several pre-made applications for relevant physical platforms, namely NV centers, photonic circuits, and optical cavities. This library will be released soon on PyPI. Leveraging our method, we've achieved results for many examples that surpass the current state-of-the-art in experimental design. In addition to Bayesian estimation, leveraging model-aware RL, it is also possible to find optimal controls for the minimization of the Cramér-Rao bound, based on Fisher information.
The recent advances in Machine Learning hold great promises for the field of quantum sensing and metrology. With the help of reinforcement learning, we can tame the complexity of quantum systems and solve the problem of optimal experimental design. Reinforcement learning is a powerful model-free technique that allows an agent, which is typically a neural network, to learn the best strategy to reach a certain goal in a completely a priori unknown environment. However, in general, we know something about the quantum system the agent is interacting with, at least that it follows the rules of quantum mechanics. In quantum metrology, we typically have a model for the system and only some parameters of the evolution or of the initial state are unknown. We present here a general Machine Learning technique that can optimize the precision of quantum sensors, and in doing so it exploits the knowledge we have on the system. We have developed a Python package to automate a broad class of optimizations that can be found in the tasks of quantum parameter estimation, quantum metrology and quantum hypothesis testing. What the agent is learning here is an optimal adaptive strategy, that, on the basis of the previous outcomes, decides the next measurements to perform. It works both for Bayesian estimation and for frequentist estimation. The user is required to implement the physics of the system to be studied and state which parameters in the experiment are controllable and which are unknowns. The functions of the library allow then to easily train a neural network agent for optimizing the precision of the sensor, by simulating the experiment. We have explored some applications of this technique to magnetometry on NV centers (both DC and AC), to state discrimination in quantum optics and to phase estimation. So far, we were able to certify better results than the current state-of-the-art controls for many examples. The Machine Learning technique developed here can be applied in all those scenarios where the quantum system is well characterized and relatively simple and small. In these cases, we can squeeze every last bit of information from a quantum sensor by controlling it with a neural network appropriately trained.
Abstract Quantum optimal control in color center physics plays a crucial role in advancing sensor technology. This study focuses on optimizing microwave pulse shapes within a Ramsey sequence for nitrogen-vacancy centers to enhance sensor sensitivity and signal detection capabilities. We compare state-of-the-art optimization methods, including the dressed chopped randomized basis Nelder–Mead algorithm and covariance matrix adaptation evolutionary strategy, and extend our search to machine learning approaches, such as Gaussian processes and artificial neural networks. These machine learning techniques are specifically designed to provide robust and global solutions that can rapidly adapt to changing environmental conditions. Our results demonstrate more than a sixfold increase in convergence speed compared to conventional methods and considerable contrast improvements with a limited retraining set of 72 samples. Furthermore, we demonstrate that the optimized Ramsey contrast translates into a significant enhancement in the signal-to-noise ratio for detecting synthetic magnetic heart signals. This highlights the potential of machine learning-driven quantum optimal control for developing more flexible, adaptive, and efficient quantum sensing solutions in real-world scenarios.