Adaptive characterization of spatially inhomogeneous fields and errors in qubit registers

New quantum computing architectures consider integrating qubits as sensors to provide actionable information useful for calibration or decoherence mitigation on neighboring data qubits, but little work has addressed how such schemes may be efficiently implemented in order to maximize information utilization. Techniques from classical estimation and dynamic control, suitably adapted to the strictures of quantum measurement, provide an opportunity to extract augmented hardware performance through automation of low-level characterization and control. In this work, we present an adaptive learning framework, Noise Mapping for Quantum Architectures (NMQA), for scheduling of sensor–qubit measurements and efficient spatial noise mapping (prior to actuation) across device architectures. Via a two-layer particle filter, NMQA receives binary measurements and determines regions within the architecture that share common noise processes; an adaptive controller then schedules future measurements to reduce map uncertainty. Numerical analysis and experiments on an array of trapped ytterbium ions demonstrate that NMQA outperforms brute-force mapping by up to 20× (3×) in simulations (experiments), calculated as a reduction in the number of measurements required to map a spatially inhomogeneous magnetic field with a target error metric. As an early adaptation of robotic control to quantum devices, this work opens up exciting new avenues in quantum computer science.


INTRODUCTION
Central to the scale-up of large-scale quantum computing systems will be the integration of automated procedures for hardware characterization, tune-up, and operation of realistic multi-qubit architectures [1][2][3][4][5][6] .This perspective is already validated in the literature; recent demonstrations of quantum supremacy subtly featured a graph-based learning routine in streamlining hardware calibration 7 .This successful demonstration motivates a broader exploration of how autonomous and adaptive learning can be deployed in addressing the ongoing challenges of calibration, as well as mitigation of decoherence and error in hardware.
Prior to the deployment of full quantum error correction, control solutions implemented as a form of "quantum firmware" 8 at the lowest level of the quantum computing software stack 4,9 provide an opportunity to improve hardware error rates using both open-loop dynamic error suppression [10][11][12][13][14][15] and closed-loop feedback stabilization.Closed-loop stabilization is a common lowlevel control technique for classical hardware 16,17 , but its translation to quantum devices faces challenges in the context of quantum-state collapse under projective measurement 18,19 .
One way feedback can be leveraged in quantum devices is through the adoption of an architectural approach embedding additional qubits as sensors at the physical level to provide actionable information on calibration errors and decoherence mechanisms 20 , e.g., real-time measurements of ambient field fluctuations 21 .In this so-called "spectator-qubit" paradigm, the objective is to spatially multiplex the complementary tasks of noise sensing and quantum data processing 22 .Fundamental to such an approach is the existence of spatial correlations in noise fields 23 , permitting information gained from a measurement on a spectator qubit used as an environmental or device-level hardware probe to be deployed in stabilizing proximal data qubits 24 used in the computation.Making the spectator-qubit paradigm practically useful in medium-scale architectures requires characterization of the spatial variations in the processes inducing error-a process to which we refer as mapping-in order to determine which qubits may be actuated upon using information from a specific sensor.This is because spatial inhomogeneities in background fields can cause decorrelation between spectator and data qubits, such that feedback stabilization becomes ineffective or even detrimental.Given the relative "expense" of projective measurements-they are often the slowest operations in quantum hardware, and can be destructive, for example, the case of light leakage to neighboring devices-improving the efficiency of this mapping routine is of paramount importance.
In this paper, we introduce a new and broadly applicable framework for adaptive learning, denoted Noise Mapping for Quantum Architectures (NMQA), to efficiently learn about spatial variations in quantum computer hardware performance across a device through sampling, and apply this to the challenge of mapping an unknown "noise" field across a multi-qubit quantum device as a concrete example.NMQA is a classical filtering algorithm operated at the quantum firmware level, and is specifically designed to accommodate the nonlinear, discretized measurement model associated with projective measurements on individual qubits.The algorithm adaptively schedules measurements across a multi-qubit device, and shares classical state information between qubits to enable efficient hardware characterization, with specific emphasis on employing sampling approaches that reduce measurement overheads encountered in large architectures.We implement the NMQA framework via a two-layer particle filter and an adaptive real-time controller.Our algorithm iteratively builds a map of the underlying spatial variations in a specific hardware parameter across a multi-qubit architecture in real time by maximizing the information utility obtained from each physical measurement.This, in turn, enables the controller to adaptively determine the highest-value measurement to be performed in the following step.We evaluate the performance of this framework to a noise-characterization task, where a decoherence-inducing field varies in space across a device.We study test cases by both numeric simulation on 1D and 2D qubit arrays, and application to real experimental data derived from Ramsey measurements on a 1D crystal of trapped ions.Our results demonstrate that NMQA outperforms brute-force measurement strategies by a reduction of up to 20× (3×) in the number of measurements required to estimate a noise map with a target error for simulations (experiments).These results hold for both 1D and 2D qubit regular arrays subject to different noise fields.
We consider a spatial arrangement of d qubits as determined by a particular choice of hardware.An unknown, classical field exhibiting spatial correlations extends over all qubits on our notional device, and corresponds to either intrinsic, spatially varying calibration errors, or extrinsic noise fields.Our objective is to build a map of the underlying spatial variation of the noise field with the fewest possible single-qubit measurements, performed sequentially.For concreteness, we conceive that each measurement is a single-shot Ramsey-like experiment in which the presence of the unknown field results in a measurable phase shift between a qubit's basis states at the end of a fixed interrogation period.This phase is not observed directly, but rather inferred from data, as it parameterizes the Born probability of observing a "0" or "1" outcome in a projective measurement on the qubit; our algorithms take these discretized binary measurement results as input data.The desired output at any given iteration t is a map of the noise field, denoted as a set of unknown qubit phases, F t , inferred from the binary measurement record up to t.
The simplest approach to the mapping problem is to undertake a brute-force, "naive" strategy in which one uniformly measures sensor qubits across the array, depicted schematically in Fig. 1a.By extensively sampling qubit locations in space repeatedly, one can build a map of the underlying noise fields through the collection of large amounts of measurement information.Evidently, the naive, brute-force measurement approach is highly inefficient as it fails to recognize and exploit spatial correlations in the underlying noise field that may exist over a lengthscale that exceeds the inter-qubit spacing.This is a particular concern in circumstances where qubit measurements are a costly resource, e.g., in time, classical communication bandwidth, or qubit utilization when sensors are dynamically allocated.
The NMQA framework shown in Fig. 1b stands in stark contrast, taking inspiration from the problem of simultaneous localization and mapping in robotic control [25][26][27][28][29][30][31][32][33] .Here, the underlying spatial correlations of the noise are mapped using a learning procedure, which adaptively determines the location of the next, mostrelevant measurement to be performed based on past observations.With this approach, NMQA reduces the overall resources required for spatial noise mapping by actively exploiting the spatial correlations to decide whether measurements on specific qubits provide an information gain.
In our algorithmic implementation, at every iteration t, information about the true map is contained in the state vector, X t .Here, the word "state" refers to all quantities being inferred statistically from data, as opposed to an actual physical quantum state.Aside from information about the true map that we denote F t ∈ X t , the state vector, X t , additionally contains information, R t , which approximates spatial gradients on the true map.The probability distribution of X t conditioned on data is called the posterior distribution, and it summarizes our best knowledge of the true map and its approximate spatial gradient information, given past measurement outcomes.
The key operating principle of NMQA is that we locally estimate the map value, F ðjÞ t (a qubit phase shift with a value between [0, π] radians), before globally sharing the map information at the measured qubit j with neighboring qubits q ∈ Q t in the vicinity of j.The algorithm is responsible for determining the appropriate size of the neighborhood, Q t , parameterized by the length-scale value, R ðjÞ t (left panel, Fig. 2); accordingly, we may conceive R ðjÞ t as the one-parameter mechanism to approximately learn local gradient information of the noise field.The combination of estimates of the state at each qubit and proxy local gradient information allows for a more efficient mapping procedure than brute-force sampling over all qubits.
In practice, Q t eventually represents the set of qubits in a posterior neighborhood at j at the end of iteration t, and this set shrinks or grows as inference proceeds over many iterations.We are ignorant, a priori, of any knowledge of R ðjÞ t¼0 .We set the prior distribution over lengthscales to be uniform over an interval [R min , R max ] where initial estimates take values between R min , the smallest inter-qubit spacing, and R max , as a multiple of the maximal separation distance on the qubit array, in units of distance.In principle, any prior distribution over the lengthscales can be designed by practitioners.The collection of map values and lengthscales, X

Exploration Path
Fig. 1 Difference between a naive brute force and the NMQA measurement strategy in reconstructing an inhomogeneous background field.A spatial arrangement of qubits (red circles) is shown with a true unknown field with finite correlations (colored regions).a The naive strategy measures the field across the array using a regular grid (red filled circles).b The NMQA strategy iteratively chooses which qubit to measure next (black arrows), and additionally stores state-estimation information in a form shared across local neighborhoods (white shaded circles), which reflects the spatial characteristics of the underlying map.
We rely on an iterative maximum-likelihood procedure within each iteration of the algorithm to solve the NMQA inference problem, as the size of the state-space generally impedes analytic solutions even in classical settings 32,34 .In each iteration, we update F t assuming that X t−1 is known, and subsequently R t based on F t .This structure is unique, and NMQA manipulates the joint probability distribution defined over F t and R t , such that we numerically implement an iterative maximum-likelihood procedure using techniques known as particle filters (see below).The final result of this first step in Fig. 2 is a posterior estimate of X t , which represents our best knowledge given measurement data.
This estimate is now passed to an adaptive measurement scheduler, the NMQA controller, which attempts to maximize the information utility from each measurement.The NMQA controller adaptively selects the location k for the next physical measurement by choosing the region where posterior-state variance is maximally uncertain (Fig. 2, top-middle panel).The new measurement outcome, once collected, is denoted Y ðkÞ tþ1 (a posterior-state variance is typically estimated using the properties of particles inside the filter 35 ).Meanwhile, the posterior-state information at step t is used to generate data messages so that estimated map information can be shared with proximal neighboring qubits (Fig. 2, bottom-middle panel).The shared information is denoted by the set f ŶðqÞ tþ1 ; q 2 Q t g, where the posterior information in Q t at the end of t is equivalent to information in Q t+1 provided at the beginning of the next iteration, t + 1.The data messages f ŶðqÞ tþ1 g are taken as an input to the algorithm in a manner similar to a physical measurement.Jointly, the new actual physical measurement, Y ðkÞ tþ1 , and the set of shared information f ŶðqÞ tþ1 g form the inputs for the next iteration, t + 1.Further technical information on the overall NMQA implementation is presented in "Methods".
We approximate the theoretical nonlinear filtering problem embodied by NMQA using a class of techniques known as particle filters.In each iteration of the NMQA algorithm, we must update information about the expected vectors F t and R t based on the latest measurement information acquired.This is a challenging data inference problem that shares commonality with a host of other inference problems in science and engineering (such as robotic mapping [36][37][38] ) involving nonlinear, non-Gaussian properties or high-dimensional state spaces that are sparsely sampled.Particle filters are numerical approximation methods belonging to a general class of Sequential Monte Carlo algorithms used to approximately solve the classical Bayesian inference problems under such conditions 39 .The prolific use of particle filters stems from their success in nonlinear filtering applications in large state spaces of continuous random variables, relevant to the application considered here.In our application, the choice of a particle filter to implement core NMQA functionality accommodates the nonlinear measurement model associated with the discretized outcomes given by projective qubit readout, and large state spaces defined over all possible maps and associated lengthscales.
Like many inference methods, particle filters use Bayes rule to solve an inference problem.Under Bayesian inference, the desired solution is a posterior distribution representing the probability distribution of the inferred state conditioned on data.The defining feature of particle-filtering algorithms is that one sacrifices access to analytical expressions for the moments of a posterior distribution (e.g., the mean).Instead, the posterior distribution is approximately represented as a discrete collection of weighted "particles".Each particle has two properties: a position and a weight.The position of the particle is effectively a hypothesis about the state X t , i.e., a sample from the probability distribution for X t given observed data.The weight specifies the likelihood or the importance of the particle in the estimation procedure.All weights are initially equal at step t = 0, and after receiving measurement data at each step, the particles are "re-sampled".This means that the original set of particles at step t is replaced by a set of "offspring" particles, where the probability that a parent is chosen to represent itself in the next iteration (with replacement) is directly proportional to its weight.Over many iterations, only the particles with the highest weights survive, and these surviving Meanwhile, posterior-state estimates are also used to share information at j within the posterior neighborhood, Q t via data messages, ŶðqÞ tþ1 , between all neighboring qubits q ∈ Q t (middle bottom) before commencing the next iteration.The input/output information loop is the outermost loop formed by a single physical measurement (in notation, Y) and a set of data messages (in notation, Ŷ).The arrow to site k from j does not relate to the transfer of any information, but rather, adaptive measurement scheduling by the controller to maximize information utility from the next physical measurement choice k.
particles form the estimate of the distribution of X t , given data in our algorithm.At any t, the estimate of X t can be obtained as the first moment of the posterior particle distribution, and similarly, true state uncertainty is estimated from the empirical variance of the particle distribution.The efficacy of any particle filter depends on how particle weights are computed, and many proposals to compute these weights exist.Further details on fundamental particle-filtering concepts and strategies to compute particle weights are introduced in refs. 39,40and restated in section 2C of Supplementary Information.
We now provide a summary of the particle-filtering implementation used here, and highlight modifications that are unique to NMQA.In each iteration, we update F t assuming that X t−1 is known, and subsequently R t assuming F t .This structure requires two particle types inside NMQA's particle filter: α particles carry information about the full state vector, X t , while β particles discover the optimal information-sharing neighborhood size, R ðjÞ t , around qubit j.The two different types of particle sets are then used to manipulate the joint probability distribution defined over F t and R t to obtain an estimate of X t , which represents our best knowledge, given measurement data.
Under the conditions articulated above, the NMQA filtering problem requires only two specifications: a prior or initial distribution for the state vector, X 0 , at t = 0, and a mechanism that assigns each particle with an appropriate weight based on measurement data.We take the approach where particle weights are computed using a specific type of likelihood function for measurement, and a novel branching process, whose convergence properties can be analyzed 41 .Assuming a uniform prior, we only need to define the global likelihood function incorporating both particle types.We label α particles by the set of numbers {1, 2, …, n α }; for each α particle, we also associate a set of β particles denoted β (α) , with β taking values {1, 2, …, n β }.Each α particle is weighted or scored by a so-called likelihood function.This likelihood function is written in notation as g 1 ðλ 1 ; Y ðjÞ t Þ, where λ 1 is a parameter of the NMQA model and Y ðjÞ t makes explicit that only one physical measurement at one location is received per iteration.A single β (α) particle inherits the state from its α parent, but additionally acquires a single, uniformly distributed sample for R ðjÞ t from the length-scale prior distribution.The β particles are scored by a separate likelihood function, g 2 (λ 2 , Q t ), where λ 2 is another parameter of the NMQA model.Then the total likelihood for an (α, β (α) ) pair is given by the product of the αand β-particle weights.
The functions g 1 ðλ 1 ; Y ðjÞ t Þ and g 2 (λ 2 , Q t ) are likelihood functions used to score particles inside the NMQA particle filter, and their mathematical definitions can be found in the Supplementary Methods.These functions are derived by representing the noise affecting the physical system via probability-density functions.The function g 1 ðλ 1 ; Y ðjÞ t Þ describes measurement noise on a local projective qubit measurement as a truncated or a quantized zeromean Gaussian error model to specify the form of the noisedensity function, with variance given by Σ v .The function g 2 (λ 2 , Q t ) represents the probability density of "true errors" arising from choosing an incorrect set of neighborhoods while building the map.For each candidate map, the value of the field at the center is extrapolated over the neighborhood using a Gaussian kernel.Thus, what we call "true errors" are the differences between the values of the true, spatially continuous map and the NMQA estimate, consisting of a finite set of points on a map and their associated (potentially overlapping) Gaussian neighborhoods.We assume that these errors are truncated Gaussian distributions with potentially nonzero means μ F and variances Σ F over many iterations, as detailed in the Supplementary Methods.
In general, the a priori theoretical design of the likelihood function and its parameters depends on the choice of the measurement procedure and physical application.For static field characterization, we impose a tightly regularized filtering procedure by setting low variance values relative to the initial state vector X t=0 and machine precision.Low variance values correspond to physical assumptions that bit-flip errors are unlikely, and high-frequency temporal noise is averaged away for large T, by setting Σ v = 10 −4 .Further, we assume that the unknown field is continuous and enables an approximation via overlapping Gaussian neighborhoods, by setting μ F = 0, Σ F = 10 −6 .As with any filtering problem, one may alternatively consider an optimization routine over design parameters and measurement protocols embodied by the likelihood functions, thereby removing all a priori knowledge of a physical application.
The two free parameters, λ 1 , λ 2 ∈ [0, 1], are used to numerically tune the performance of the NMQA particle filter.Practically, λ 1 controls how shared information is aggregated when estimating the value of the map locally, and λ 2 controls how neighborhoods expand or contract in size with each iteration.In addition, the numerically tuned values of λ 1 , λ 2 ∈ [0, 1] provide an important test of whether or not the NMQA sharing mechanism is trivial in a given application.Nonzero values suggest that sharing information spatially actually improves performance more than just locally filtering observations for measurement noise.As λ 1 , λ 2 → 1, the set f ŶðqÞ tþ1 g, is treated as if they were the outcomes of real physical measurements by the algorithm.However, in the limit λ 1 , λ 2 → 0, no useful information sharing in space occurs, and NMQA effectively reduces to the naive measurement strategy.
The information-sharing mechanism described above also influences how the controller schedules a measurement at the next qubit location.At each t, the particle filter can access the empirical mean and variance of the posterior distribution represented by the particles.In particular, the particle filter stores estimated posterior variance of the β particles at qubit location j, if this location was physically measured during the filtration until t.The ratio of the empirical variance of the β particles to the posterior estimate of R ðjÞ t , is then compared for all qubit locations.The controller selects a location k uniformly randomly between locations with the largest values of this ratio, corresponding to a location with the highest uncertainty in neighborhood lengthscales.In the absence of information sharing (setting λ 1 , λ 2 = 0), the controller effectively uniformly randomly samples qubit locations, and the difference between NMQA and a deterministic brute-force measurement strategy is reduced to the random vs. ordered sampling of qubit locations.
Detailed derivations for mathematical objects and computations associated with NMQA, and an analysis of their properties using standard nonlinear filtering theory are provided in ref. 41 .

RESULTS
Application of the NMQA algorithm using both numerical simulations and real experimental data demonstrates the capabilities of this routine for a range of spatial arrangements of d qubits in 1D or 2D.For the results reported in this section, NMQA receives a single "0" or "1" projective measurement, Y ðjÞ t , in each iteration t and location j.We have also validated numerically that benefits persist with continuous (classically averaged) measurement outcomes, where many single-qubit projective measurements, fY ðjÞ t g, are averaged in each t and j in Fig. 5 of Supplementary Figures.
Our evaluation procedure begins with the identification of a suitable metric for characterizing mapping performance and efficiency.We choose a Structural SIMilarity Index (SSIM) 42 , frequently used to compare images in machine-learning analysis.This metric compares the structural similarity between two images, and is defined mathematically in "Methods".It is found to be sensitive to improvements in the quality of images while giving robustness against, e.g., large single-pixel errors that frequently plague norm-based metrics for vectorized images 43,44 .
In our approach, we compare the true map and its algorithmic reconstruction by calculating the SSIM; a score of zero corresponds to ideal performance, and implies that the true map and its reconstruction are identical.
We start with a challenging simulated example, in which d = 25 qubits are arranged in a 2D grid.The true field is partitioned into square regions with relatively low and high values (Fig. 3a, left inset) to provide a clear structure for the mapping procedure to identify.In this case, the discontinuous change of the field values in space means that NMQA will not be able to define a low-error candidate neighborhood for any qubits on the boundary.Both NMQA and naive are executed over a maximum of T iterations, such that t ∈ [1, T].For simplicity, in most cases, we pick values of T ≥ d as multiples of the number of qubits, d, such that every qubit is measured the same integer number of times in the naive approach, which we use as the baseline in our comparison.If T < d, the naive approach uniformly randomly samples qubit locations.Both NMQA and the naive approach terminate when t = T, and a single-run SSIM score is calculated using the estimated map for each algorithm in comparison with the known underlying "true" noise map.The average value of the score over 50 trials is reported as Avg.SSIM, and error bars represent 1 standard deviation (s.d.) for all data figures.
The Avg. SSIM score as a function of T is shown in the main panel of Fig. 3a.For any choice of T, NMQA reconstructs the true field with a lower SSIM than the naive approach, indicating better performance.The SSIM score also drops rapidly with T when using NMQA, compared with a more gradual decline in the naive case.Increasing T ≫ d leads to not only an improvement in the performance of both algorithms, but also a convergence of the scores as every qubit is likely to be measured multiple times for the largest values considered here.Representative maps for T = 10 and T = 75 measurements under both the naive and NMQA mapping approaches are shown in Fig. 3b-e, along with a representative adaptive measurement sequence employed in NMQA in panel b.In both cases, NMQA provides estimates of the map that are closer to the true field values, whereas naive maps are dominated by estimates at the extreme ends of the range, which is characteristic for simple reconstructions using sparse measurements.
It is instructive to represent these data in a form that shows the effective performance enhancement of the NMQA mapping procedure relative to the naive approach; the upper-right inset in Fig. 3a reports the improvement in the reduction of the number of measurements required to reach a desired Avg.SSIM value.We perform linear interpolation for each raw dataset in Fig. 3a, depicted using dashed lines in the main panel.The ratio of the interpolated data as a function of Avg.SSIM value is shown in the upper-right inset of Fig. 3a (red solid).The interpolation process is repeated to obtain the difference between the maximum upper and minimum lower error trajectories (shaded gray) using error bars on underlying raw data for these results.
The shape of the performance improvement curve is linked to the total amount of information provided to both algorithms.At high Avg.SSIM scores on the far right of the figure, both naive and NMQA algorithms receive very few measurements, and map reconstructions are dominated by errors.In the intermediate regime, a broad peak indicates that NMQA outperforms bruteforce measurement in reducing the total number of qubit measurements over a range of moderate-to-low Avg.SSIM scores for map reconstruction error, up to 7× for Avg.SSIM = 0.1.Similar performance is achieved for a range of other qubit-array geometries and characteristics of the underlying field (Supplementary Figures).Near the origin at Avg. SSIM < 0.05, an extremely large number of measurements are required to achieve low Avg.SSIM scores.For T → ∞ and when all locations are measured, we theoretically expect the relative performance ratio to approach unity for any true field.In empirical analysis, the relative improvement of NMQA to naive is based on projections of the interpolation procedure rather than raw data.Our simulations at T = 250 are being used to extrapolate at very low SSIM scores where the implied T ~10 3 for both naive and NMQA; consequently, the resulting ratio is very sensitive to a change in parameters of the interpolation procedure.An analytical, rather than empirical, investigation of NMQA's convergence at low-error scores is presented in ref. 41 .
All of our results rely on appropriate tuning of the NMQA particle filter via its parameters λ 1 and λ 2 .Numerical tuning of these parameters is conducted for each T, and these data are represented as a solid red curve in Fig. 3a.We also demonstrate that using fixed values for these parameters only marginally degrades performance, as indicated by the dashed line in the upper-right inset of Fig. 3a.
We now apply the NMQA mapping algorithm to real experimental measurements on qubit arrays.In Fig. 4, we analyze Ramsey experiments conducted on an array of 171 Yb + ions confined in a linear Paul trap, with trap frequencies ω x,y,z /2π ≈ (1.6, 1.5, 0.5) MHz.Qubits are encoded in the 2 S 1/2 ground-state manifold, where we associate the atomic hyperfine states F ¼ 0; m F ¼ 0 j i and F ¼ 1; m F ¼ 0 j i with the qubit states 0 j i and 1 j i, respectively.State initialization to 0 j i via optical pumping and state detection are performed using a laser resonant with the 2 S 1/2 − 2 P 1/2 transition near 369.5 nm.Laser-induced fluorescence (corresponding to projections into state 1 j i) is recorded using a spatially resolving EMCCD camera yielding simultaneous readout of all ions.In this experiment, qubit manipulation is carried out using microwave radiation at 12.6 GHz delivered via an in-vacuum antenna to all qubits globally.
The trapped ions experience an uncontrolled ("intrinsic"), linear magnetic field gradient that produces spatially inhomogeneous qubit frequencies over the trap volume.When manipulated using a global microwave control field, this results in a differential phase accumulation between qubits.The magnitude of the gradient is illustrated in Fig. 4a, superimposed on an image of six ions in the bright state 1 j i, and is not observed to drift or vary on any timescale relevant to these experiments.We aim to probe this field gradient through the resulting qubit detuning and associated differential phase accumulation throughout each measurement repetition.In this case, NMQA may be thought of as either an adaptive noise-mapping or calibration routine.
A preliminary Ramsey experiment, in which the interrogation time is varied, and fringes are observed, confirms that at an interrogation time of 40 ms, the accumulated relative phase in a Ramsey measurement is <π radians.A total of 25, 500 Ramsey measurements with a wait time of 40 ms are performed on all six ions in parallel.For each repetition, a standard machine-learning image classification algorithm assigns a "0" (dark) or "1" (bright) to each ion based on a previously recorded set of training data.From averaging over repetitions, we construct a map of the accumulated phase (and hence the local magnetic field inducing this phase) on each qubit, shown schematically in the left inset of Fig. 4b.We consider the field extracted from this standard averaging procedure over all repetitions of the Ramsey experiment, at each ion location, as the "true" field against which mapping estimates are compared using the SSIM score as introduced above.
We employ the full set of 6 × 25,500 measurements as a data bank on which to evaluate and benchmark both algorithms.At each iteration, the algorithm determines a measurement location in the array, and then randomly draws a single, discretized measurement outcome (0 or 1) for that ion from the data bank.The rest of the algorithmic implementation proceeds as before.Accordingly, we expect that the naive approach must smoothly approach a SSIM score of zero as T increases (Fig. 4b).In these experiments, we experience a large measurement error arising from the necessary detection time of 750 μs associated with the relatively low quantum efficiency and the effective operating speed of the EMCCD camera.Compensating this via extension of the measurement period leads to an asymmetric bias due to state decays that occur during the measurement process in ≈1.5 ms ( 1 j i !0 j i) and ≈30 ms ( 0 j i ! 1 j i) under the laser power and quantization magnetic field strength used in our experiment.In our implementation, neither NMQA nor the brute-force algorithm was modified to account for this asymmetric bias in the detection procedure, although in principle, the image classification algorithm employed to determine qubit states from fluorescence detection can be expanded to account for this.Therefore, both NMQA and the naive approach are affected by the same detection errors.Despite this complication, we again find that NMQA outperforms the naive mapping algorithm by a factor of 2-3 in the number of required measurements (Fig. 4b), with expected behavior at the extremal values of Avg.SSIM.

DISCUSSION
In this work, we presented NMQA-a framework for adaptive learning where we reconstruct spatially varying parameters associated with qubit hardware, derived from autonomously and adaptively scheduled measurements on a multi-qubit device.We developed an iterative, maximum-likelihood procedure implemented via a two-layer particle filter to share state-estimation information between qubits within small spatial neighborhoods, via a mapping of the underlying spatial correlations of the parameter being measured.An adaptive controller schedules future measurements in order to reduce the estimated uncertainty of the map reconstruction.We focused on the specific application of mapping an unknown decoherence-inducing noise field, but this methodology could equally be applied to the characterization of nearly any device parameter subject to spatial inhomogeneities, and where efficiency in measurement sampling is valued.This could include, for instance, calibration of qubit Rabi rates due to nonuniform coupling of devices to their control lines, or variations in qubit frequencies arising from device-fabrication tolerances.
Numerical simulations and calculations run on real experimental data demonstrated that NMQA outperforms a naive mapping procedure by reducing the required number of measurements up to 3× in achieving a target map similarity score on a 1D array of six trapped ytterbium ions (up to 20× in a 2D grid of 25 qubits using simulated data).Beyond these example demonstrations, the key numerical evidence for the correctness of NMQA's functionality came from the observation that the tuned values of λ 1 , λ 2 ≫ 0 for all results reported here.Since numerically tuned values for these parameters were found to be nonzero, we conclude that information sharing in NMQA is nontrivial, and the algorithm departs substantially from a brute-force measurement strategy.This contributes to the demonstrated improvements in Avg.SSIM scores when using NMQA in Figs. 3 and 4.
Overall, achieving suitable adaptive learning through NMQA requires that the (λ 1 , λ 2 ) parameters are appropriately tuned using measurement datasets as part of a training procedure.To select (λ 1 , λ 2 ), we chose a (λ 1 , λ 2 ) pair with the lowest expected error.In practice, one cannot calculate the true error as the true field is unknown.Additional numerical analysis shows that tuned λ 1 , λ 2 > 0 improves NMQA performance, and that this performance improvement gradually increases from the bottom-left to the top-right corner of the unit square away from the case λ 1 = λ 2 = 0 (Fig. 1; Supplementary Figures) for a range of different noise fields with regularly spaced 1D or 2D configurations.This numerically observed gradual improvement in performance as a function of λ 1,2 → 1 suggests that theoretical approaches to deducing "optimal" regions for (λ 1 , λ 2 ) may be possible.Meanwhile, in a specific application, a practitioner may only have access to the real-time rate of change of state estimates and residuals, i.e., a particle filter generates a predicted measurement at location j, which can be compared with the next actual measurement received at j. Monitoring the real-time rate of change of state estimates and/or residuals in a single run can be used to develop effective stopping criteria to set (λ 1 , λ 2 ) with minimal a priori knowledge of the physical system.If, for example, total preparation and measurement time is on the order of tens or hundreds of microseconds, then an experiment of T ~10 5 measurements takes a few minutes to complete.For ion traps, the relevant timescales for temporal drift in control fields are on the order of hours.Meanwhile, run times for a single NMQA iteration are on the order of 1 ms in Python under typical operating conditions.Thus, it is possible to numerically tune λ 1 , λ 2 for NMQA using small T measurements before proceeding with a desired experiment.Future work to speed up and integrate NMQA into low-level experimental control software appears promising as particle filters do not require complicated linear algebra operations (e.g., matrix inversions), and enable rapid, parallel computations across particles.The particle-filtering structure of NMQA presents as-yet unexplored opportunities in software execution to explore in-cycle tuning with run times on par with physical measurements.These extensions to the operability of NMQA are active research areas.
The framework we have introduced is flexible and can accommodate temporal variations in the system, such as drifts in the map and changes in the availability of sensor qubits.Without a priori information about dynamics, the state-transition kernel is set to identity, and in this form, our assumption is that NMQA accommodates low-frequency drift quasi-statically.Temporal dynamics rapid compared with the measurement cycle are generally averaged over, and ignored by the algorithm.In intermediate regimes, it may be possible to accommodate fluctuations as measurement noise or error in our knowledge of a qubit's given location.A formal spatiotemporal analysis with NMQA is the subject of future work, and combines a nonidentity state-transition kernel with NMQA's unique branching process.
We have thus far presented a comparison of NMQA with a naive, brute-force measurement strategy, but it is also possible to consider the error-scaling behavior under NMQA against a strengthened competing measurement procedure.For instance, it is possible to perform many measurements at each qubit location in order to accurately (within a user-defined bound) establish the relevant mapped value for that qubit.One may gradually increase the number of simultaneous measurements at a single location j as 2, 3, …50, … measurements per iteration t and so on, which means that NMQA takes in a classically postprocessed measurement result rather than a "0" or "1" projective measurement input.For a true field of Fig. 3, our investigations show that in the region of Avg.SSIM score ≈0.2, NMQA outperforms naive by a factor greater than ≫2 using 2-15 measurements per t, and is above unity in the regions 15-50 measurements per t (Fig. 5; Supplementary Figures).In this case, determining where to measure next in order to build the map still benefits from estimating lengt-scales to approximate local field gradient information; minimizing uncertainty in these estimated lengthscales informs an adaptive strategy.
In the limit that many qubit measurements are taken at every location (such as performing many averaged measurements in parallel), the naive brute-force measurement strategy essentially transitions from an inference to an interpolation problem-i.e., given near-perfect knowledge of a finite-point set, we seek to approximately reconstruct an unknown continuous function in bivariate parameter space.In this regime, the arrangement of qubits on a 2D plane affects the accuracy of the resulting reconstruction.One approach to this problem is to restrict physical measurements to a subset of qubits within the register, requiring that the value of an unknown, continuous, spatially varying field must be inferred at the remaining set of unmeasured qubits.The study of this approach, and comparison of the error-scaling behavior of an optimally constructed classical interpolant vs. NMQA is the subject of future work 45 .We are also excited to explore how exploitation of hardware platforms in which qubit locations are not rigidly fixed during fabrication, such as with trapped ions, may allow sublattice spatial resolution by dynamically translating individual qubits during the mapping procedure.Our work is part of an exciting new area of future study exploring the intersection between hardware architectures and control solutions 8,41 in NISQ-era quantum computers, and may also have bearing on distributed networks of quantum sensors.

METHODS
We summarize the structure of the NMQA algorithm in Algorithm 1 using a pseudocode representation.The first part of the algorithm consists of an initialization procedure, which ensures that all particles are sampled from the prior for extended-state vector at t = 0, giving X 0 .All particles are equally weighted before measurement data are received.For t > 0, the function PropagateStates represents the transition-probability distribution for Markov X t , i.e., it represents identity dynamics, and is a placeholder for future extensions to model dynamical F t .In each t, a single physical measurement is received.This triggers a set of update rules for F t and R t .We note that the state variables, F t and R t , are updated in a specific order within each timestep t.The order of these computations corresponds to the iterative maximum-likelihood approximation for the NMQA framework.

Fig. 2
Fig.2Schematic overview of the NMQA iteration.A particle filter estimates the map, F t , and discovers neighborhoods (circular shaded) parameterized by R ðjÞ t for sharing state information about site j.Posterior-state estimates from the particle filter are used by the controller to choose site k as the location of the next physical measurement, Y ðkÞ tþ1 , based on regions of the highest estimated uncertainty (middle top).Meanwhile, posterior-state estimates are also used to share information at j within the posterior neighborhood, Q t via data messages, ŶðqÞ tþ1 , between all neighboring qubits q ∈ Q t (middle bottom) before commencing the next iteration.The input/output information loop is the outermost loop formed by a single physical measurement (in notation, Y) and a set of data messages (in notation, Ŷ).The arrow to site k from j does not relate to the transfer of any information, but rather, adaptive measurement scheduling by the controller to maximize information utility from the next physical measurement choice k.