# Optimal and Variational Multi-Parameter Quantum Metrology
and Vector Field Sensing

Raphael Kaubruegger  Institute for Theoretical Physics, University of
Innsbruck, Innsbruck, 6020, Austria  Institute for Quantum Optics and Quantum
Information of the Austrian Academy of Sciences, Innsbruck, 6020, Austria
Athreya Shankar  Institute for Theoretical Physics, University of Innsbruck,
Innsbruck, 6020, Austria  Institute for Quantum Optics and Quantum Information
of the Austrian Academy of Sciences, Innsbruck, 6020, Austria  Department of
Instrumentation and Applied Physics, Indian Institute of Science, Bengaluru,
560012, India  Denis V. Vasilyev  Institute for Theoretical Physics,
University of Innsbruck, Innsbruck, 6020, Austria  Institute for Quantum
Optics and Quantum Information of the Austrian Academy of Sciences, Innsbruck,
6020, Austria  Peter Zoller  Institute for Theoretical Physics, University of
Innsbruck, Innsbruck, 6020, Austria  Institute for Quantum Optics and Quantum
Information of the Austrian Academy of Sciences, Innsbruck, 6020, Austria

###### Abstract

We study multi-parameter sensing of 2D and 3D vector fields within the
Bayesian framework for $SU(2)$ quantum interferometry. We establish a method
to determine the optimal quantum sensor, which establishes the fundamental
limit on the precision of simultaneously estimating multiple parameters with
an $N$-atom sensor. Keeping current experimental platforms in mind, we present
sensors that have limited entanglement capabilities, and yet, significantly
outperform sensors that operate without entanglement and approach the optimal
quantum sensor in terms of performance. Furthermore, we show how these sensors
can be implemented on current programmable quantum sensors with variational
quantum circuits by minimizing a metrological cost function. The resulting
circuits prepare tailored entangled states and perform measurements in an
appropriate entangled basis to realize the best possible quantum sensor given
the native entangling resources available on a given sensor platform. Notable
examples include a 2D and 3D quantum “compass” and a 2D sensor that provides a
scalable improvement over unentangled sensors. Our results on optimal and
variational multi-parameter quantum metrology are useful for advancing
precision measurements in fundamental science and ensuring the stability of
quantum computers, which can be achieved through the incorporation of optimal
quantum sensors in a quantum feedback loop.

##  I Introduction

The goal of quantum metrology [1, 2, 3, 4] is to enable and enhance
measurements of parameters of physical systems using quantum systems that
serve as probes. Quantum physics limits the performance of sensors employing
uncorrelated (classical) input states, establishing the so-called standard
quantum limit (SQL). At the same time, quantum physics provides us with
entanglement as a resource to overcome the SQL and approach the ultimate
limits for measurement precision in quantum sensing, which define the Optimal
Quantum Sensor (OQS). Identifying and eventually building such OQS is one of
the outstanding challenges in quantum metrology. This involves first of all
the identification of optimal entangled input states and measurements for a
given sensing task. Subsequently, the question arises how quantum sensors
operating close to the limits defined by the OQS can be implemented on
specific quantum sensor platforms given the experimental (entangling)
resources.

For single-parameter quantum metrology, there is a clear theoretical
understanding of the OQS [5, 2, 6], and recent experiments with programmable
quantum sensors have demonstrated close to optimal $N$-atom Ramsey
interferometry with low-depth entangling quantum circuits [7]. In contrast, we
will be interested below in multi-parameter quantum metrology [8, 9, 10, 11,
12], which deals with the precise estimation of several parameters
_simultaneously_ , and is hence relevant for numerous practical applications
[13, 14, 15, 16, 17, 18, 19], e.g. vector field sensing [20, 21, 22], which is
related to magnetometry [23, 24, 25, 26, 27, 28, 29, 30] or electrometry [31,
32, 33].

Figure 1: Quantum sensing of a vector field ${\bf B}$ using $\mathbf{SU(2)}$
interferometry. We consider Ramsey interferometry with entangled atoms, where
the vector of phases $\bm{\phi}$ are encoded in the quantum system via the
$SU(2)$ unitary $U(\bm{\phi})$ that carries information about the vector field
B (see Sec. II.1). Panels (a,b,c) define three interferometers, discussed in
more detail in Secs. III.2 and IV, which differ in the level of control
available for manipulating atomic entanglement in an experimental setup.
Panels (d,e,f) provide operational definitions of the interferometers in terms
of quantum circuits and projective measurements. The entangler
$\operatorname{\mathcal{U}_{\rm en}}$ and decoder
$\operatorname{\mathcal{U}_{\rm de}}$ transform the quantum state of the
system before and after the phase encoding. The projective measurement
outcomes $\bm{\sigma}$, $m$, $m^{A(B)}$ are converted into an estimate
$\bm{\xi}$ of the true phase vector $\bm{\phi}$. (a, d): The most general
$N$-atom sensor assumes universal control of atoms, which allows to realize
the optimal quantum sensor (see section II.3). (b, e): The atoms in the
1-partite quantum sensor (see Sec. IV.1.1) are controlled uniformly. The
sensor dynamics are thus constrained to the permutation symmetric subspace of
$N$ atoms, i.e., the atomic ensemble can be represented by a single macrospin
with angular momentum $J=N/2$. 1-partite control is realized by circuits
composed of collective rotation $\mathcal{R}_{x(y)}$ and the one-axis twisting
(OAT) gate $\mathcal{T}$. (c, d): The atoms in the 2-partite quantum sensor
(see Sec. IV.1.2) are grouped into two partitions $A$ and $B$ and controlled
uniformly within each partition, which includes uniform control of the entire
atomic ensemble. The system is thus equivalent to two entangled macrospins
with angular momenta $J^{A}=J^{B}=N/4$. 2-partite control is realized by
circuits composed of collective rotations $\mathcal{R}^{A(B)}_{x(y)}$ and OAT
$\mathcal{T}^{A(B)}_{z}$ acting on each partition, and OAT $\mathcal{T}_{z}$
on the full ensemble.

A fundamental difference between multi-parameter and single-parameter
metrology arises from the potential incompatibility of optimal measurements
for different parameters encoded by non-commuting Hamiltonians. This
distinctive feature of multi-parameter quantum metrology has been studied
primarily within the framework of quantum Fisher information, where the sensor
precision is tightly lower bounded by the Holevo Cramèr-Rao bound [1, 34, 9]
as the number of measurement repetitions of the same signal tends to infinity.
Instead, we are interested here in measurement scenarios that are limited to
one or a few measurement repetitions, as is relevant, e.g., for sensing time-
varying signals [35]. The problem of finding a sensor that maximizes the
precision of a single measurement in a given range of parameter values can be
formulated in the framework of Bayesian quantum metrology [1, 9]. However,
solving Bayesian multi-parameter quantum metrology for non-commuting
Hamiltonians remains a longstanding challenge. So far, only a handful of
special problems with an underlying group symmetry have been addressed in this
framework [36, 37, 38, 39].

In the present work, we study the paradigmatic multi-parameter quantum
metrology problem of vector field sensing [20, 21, 22] within the Bayesian
framework. While entangled field sensors for 1D sensing have already been
experimentally realized [40, 41, 42, 43], we consider the open problem of
sensing 2D and 3D fields in the context of entangled Ramsey interferometry
with $N$ atoms. We establish a method to determine the OQS, that sets the
ultimate achievable precision limit for simultaneous estimation of the
components of the vector field from a single measurement with a given number
of atoms. The latter is of particular importance when the number of atoms
cannot be arbitrarily increased, e.g., to maintain a high spatial resolution.
Keeping current experimental capabilities in mind, we consider sensors with
limited experimental quantum control that nevertheless approach the OQS in
terms of performance and significantly outperform the SQL, defined by sensors
operating without entanglement. Programmable sensors can be realized on a
variety of sensing platforms, including trapped ions [7, 18], laser-excited
Rydberg atoms [44, 45], atoms in optical cavities [46], polar molecules [47,
48], color centers [49, 50] and photons with orbital angular momentum [51, 52,
19]. Considering the example of one-axis twisting (OAT) interactions [53],
which is available e.g. for trapped ions, we optimize variational quantum
circuits [54] that point to a practical route to implement entangled quantum
sensors [7].

This work is organized as follows. In Sec. II we introduce
$SU(2)$-interferometry to measure the components of a vector field, and we set
the stage for OQS’s in the framework of Bayesian multi-parameter estimation.
Section III discusses theoretical aspects and provides (numerical) algorithms
for finding the OQS, and defines quantum circuit models. In Sec. IV we
introduce one- and two-partite quantum sensors as quantum sensors with limited
entangling capabilities. This leads to the discussion of variational low-depth
quantum circuits approximating the optimal quantum sensor in Sec. V. While
most of the results presented in this work are for 2D field sensing, Sec. VI
discusses aspects of 3D field sensing, followed by conclusions.

##  II Bayesian multi-dimensional field sensing

In this section, we review the theory of multi-parameter estimation using
multi-dimensional field sensing as an example. We focus on the Bayesian
framework of phase estimation, which accounts for prior uncertainty about the
parameters being measured. We define the OQS as the sensor that minimizes a
Bayesian cost function.

###  II.1 Vector field sensing with $SU(2)$-interferometers

We study the problem of estimating all components of a vector field
$\mathbf{B}=(\text{B}_{x},\text{B}_{y},\text{B}_{z})^{T}$ in $SU(2)$
interferometry 111We refer to an interferometer with a unitary phase encoding
that belongs to the group of SU(2) as an SU(2) interferometer., where we
assume that the field is uniformly coupled to an ensemble of $N$ identical
two-level atoms. The physical sensing scenarios we have in mind can be, e.g.,
DC magnetic fields or AC magnetic and electric fields. In Appendix A, we
elaborate on exemplary experimental settings that realize the model system
consider below.

In our model, the atoms couple to the vector field according to the
Hamiltonian

$\displaystyle H=\mathbf{B}\cdot\bm{J}\equiv\sum_{\nu}\text{B}_{\nu}J_{\nu}.$
(1)

Here, $J_{\nu}=\sum_{k=1}^{N}\sigma_{k}^{\nu}/2$ are the collective spin
operators and $\sigma_{k}^{\nu}$ are the Pauli operators of the $k$-th atoms
with $\nu=x,y,z$. After an evolution time $T$, the phases
$\bm{\phi}=\mathbf{B}\,T$ are imprinted on the input state $\ket{\psi_{{\rm
in}}}$ by the unitary $SU(2)$ operator

$\displaystyle U(\bm{\phi})=\exp\left[-i\,\bm{\phi}\cdot\bm{J}\right]$ (2)

such that $\ket{\psi_{\bm{\phi}}}=U(\bm{\phi})\ket{\psi_{{\rm in}}}$. Here we
assume that the coherence time of the field $\tau\gg T$ is long compared to
$T$, i.e. the field remains effectively constant during the evolution.
Finally, a measurement of the two-level atoms in the state
$\ket{\psi_{\bm{\phi}}}$ is performed to estimate the phases $\bm{\phi}$ and
thus infer the field B. While we focus here on measurements at discrete times,
an alternative approach based on continuous measurements is discussed in [56].

The most general measurement is described by a positive operator-valued
measure (POVM), i.e., a set $\\{M_{\mu}\\}$ of positive Hermitian operators,
$M_{\mu}\succeq 0$, such that $\sum_{\mu}\,M_{\mu}=\openone$. In the
following, we contrast POVMs with the less general but experimentally more
accessible projective measurements, denoted by $\Pi_{\mu}$. For a given vector
of phases $\bm{\phi}$, the measurement outcomes, labeled $\mu$, are realized
with probabilities

$\displaystyle
p(\mu|\bm{\phi})=\mathrm{Tr}\\{M_{\mu}\ket{\psi_{\bm{\phi}}}\bra{\psi_{\bm{\phi}}}\\}.$
(3)

Based on the result $\mu$, one estimates the phases using an estimator
$\bm{\xi}_{\mu}=(\xi_{\mu}^{x},\xi_{\mu}^{y},\xi_{\mu}^{z})^{T}$. The
deviation of the estimation from the actual value $\bm{\phi}$ is characterized
by an error (or loss) function $\epsilon(\bm{\phi},\bm{\xi}_{\mu})$, commonly
chosen to be the squared error

$\epsilon(\bm{\phi},\bm{\xi}_{\mu})=\left(\bm{\phi}-\bm{\xi}_{\mu}\right)\cdot\left(\bm{\phi}-\bm{\xi}_{\mu}\right).$
(4)

Finally, the figure of merit, which accounts for measurement statistics, is
given by the average estimation error (or risk) for a given $\bm{\phi}$. In
our case, it takes the form of the mean squared error (MSE)

$\text{MSE}(\bm{\phi})=\sum_{\mu}\epsilon(\bm{\phi},\bm{\xi}_{\mu})\,p(\mu|\bm{\phi}).$
(5)

Note that the $SU(2)$ phase encoding $U(\bm{\phi})$ is periodic which means
that $\lvert\bm{\phi}\rvert$ can only be estimated modulo $2\pi$. Since we
want to infer the vector field from the estimated phases according to
${\textbf{B}^{\rm est}\sim\bm{\xi}/T}$, it is crucial to take this ambiguity
into account. Therefore, we consider phases in the interval
${-\infty<\bm{\lvert\phi\rvert}<\infty}$, and we explicitly choose the squared
error (4), which is a non-periodic error function to strongly penalize phases
that slip outside the $d$-dimensional sphere $|\bm{\phi}|\leq\pi$ of
unambiguous phase estimation.

###  II.2 Bayesian multi-parameter estimation

In the Bayesian approach, the parameter vector $\bm{\phi}$ to be estimated is
assumed to be a random variable. Knowledge about the phases to be estimated is
represented by the prior probability density ${\cal P}(\bm{\phi})$. By
estimating the phases, we infer information, and the prior density is updated
to the posterior probability density.

The quantity central to our discussion is the Bayes Mean Squared Error (BMSE),
defined as the MSE (5) averaged over the prior probability density,

BMSE $\displaystyle\equiv{\cal C}=\int
d\bm{\phi}\,\text{MSE}(\bm{\phi})\,\mathcal{P}(\bm{\phi}).$ (6)

Below, the BMSE will play the role of a cost function ${\cal C}$, which
depends on the input state $\ket{\operatorname{\psi_{\rm in}}}$, POVMs
$\\{M_{\mu}\\}$, and estimators $\\{\bm{\xi}_{\mu}\\}$.

We use Bayes theorem
${p(\bm{\phi}|\mu)=p(\mu|\bm{\phi})\mathcal{P}(\bm{\phi})/p(\mu)}$ to
interpret $\mathcal{C}$ as the posterior expected error of the phase
estimation. In particular, $\mathcal{C}$ can be rewritten as

$\displaystyle\mathcal{C}=\sum_{\mu}p(\mu)\,\int
d\bm{\phi}\,\epsilon(\bm{\phi},\bm{\xi}_{\mu})\,p(\bm{\phi}|\mu),$ (7)

where $p(\mu)=\int d\bm{\phi}\,p(\mu|\bm{\phi})\mathcal{P}(\bm{\phi})$ is the
probability of measuring $\mu$. The integral over the phase vector $\bm{\phi}$
represents the expected squared error, i.e., the squared error averaged with
respect to the posterior probability density $p(\bm{\phi}|\mu)$, where the
latter represents our knowledge of $\bm{\phi}$ given that the outcome of the
measurement is $\mu$.

The minimum MSE estimator, defined by minimizing the expected squared error
and thus the BMSE, is given by

$\displaystyle\bm{\xi}_{\mu}^{*}=\int
d\bm{\phi}\,\bm{\phi}\,p(\bm{\phi}|\mu)=\langle\bm{\phi}\rangle_{p(\bm{\phi}|\mu)},$
(8)

which corresponds to the mean value of the posterior probability density
$p(\bm{\phi}|\mu)$.

If the estimators $\\{\bm{\xi}_{\mu}\\}$ are chosen to be the minimum MSE
estimators $\\{\bm{\xi}_{\mu}^{*}\\}$, the BMSE is the posterior variance

$\displaystyle\Delta^{2}$ $\displaystyle\equiv\left.{\cal
C}\right|_{\bm{\xi}=\bm{\xi}^{*}}=\sum_{\mu}p(\mu)\,\Big{\langle}\epsilon\left(\bm{\phi},\langle\bm{\phi}\rangle_{p(\bm{\phi}|\mu)}\right)\Big{\rangle}_{p(\bm{\phi}|\mu)},$
(9)

i.e. the variances of the posterior densities averaged according to the
probability $p(\mu)$ to measure $\mu$.

In the following, the posterior uncertainty $\Delta^{2}$ will be the quantity
of interest that evaluates performance and allows comparison of various
quantum sensors for a given prior density $\mathcal{P}(\bm{\phi})$. By
minimizing the metrological cost function (6), we implicitly minimize the
posterior variance of the sensor. Therefore, our results will be presented as
plots, where we compare the ratio between posterior uncertainty $\Delta$ and
prior uncertainty for the different sensor models (see Figs. 2, 6, 7). The
more information we can gain about the phases $\bm{\phi}$ in a single
measurement, the smaller the value of this ratio.

Figure 2:  Bayesian quantum sensing of a 2D field. (a) Ratio of the posterior
width $\Delta$ to the prior width $\sqrt{2}\delta$ vs. $\delta$ for $N=8$
atoms. The OQS sets the ultimate performance limit; the gray-shaded region is
unattainable for any quantum sensor with $N$ atoms. The optimal 1-partite
quantum sensor, the 2-partite quantum sensor, and the 2-partite classical
sensor are shown for comparison. The asymptotic bounds for the classical (blue
dotted line) and quantum (black dotted line) sensors are predicted by the
Bayesian Cramér-Rao bounds (36) and (38). In Figs. 3 and 4 we illustrate the
working of the optimal sensors indicated here by the colored triangles.
Magnified panel: Performance of variational circuits (purple lines) defined in
Sec. V for an increasing number of decoding layers $\operatorname{n_{\rm
de}}$, and a fixed entangler depth of $\operatorname{n_{\rm en}}=2$.

Before proceeding, we comment on our choice of the prior probability density
$\mathcal{P}(\bm{\phi})$. In Bayesian quantum metrology, the B field to be
sensed has a prior density which translates into a density for the phases
$\mathbf{\phi}$. To give a specific example, we assume below a prior for the
field in the form of a Gaussian density centered around the origin with prior
width $({\delta{\lvert\mathbf{B}\rvert}})$. At the same time, there is no
knowledge of the orientation of the field. The corresponding prior probability
density for the phases is thus

$\displaystyle\mathcal{P}_{\delta}(\bm{\phi})=\frac{1}{\left(\sqrt{2\pi}\,\delta\right)^{d}}\exp\left[-\frac{\bm{\phi}\cdot\bm{\phi}}{2\delta^{2}}\right],$
(10)

where $d$ is the dimension of the vector $\bm{\phi}$. For 2D field sensing we
take $d=2$ and assume that $\text{B}_{z}={\phi}_{z}=0$. In the present
example, the prior is thus parameterized by a single parameter
$\delta\sim(\delta{\lvert\mathbf{B}\rvert})\,T$. However, the following
discussion can be adapted (see Appendix B) to more general priors motivated by
particular quantum sensor settings and tasks. As noted before, in mapping from
fields to phases via $\bm{\phi}=\mathbf{B}\,T$, we must ensure with a proper
choice of $T$, that there is a one-to-one map of estimated phases to the
vector field, i.e. there are no phase slips. Implicit in our discussion is the
assumption that the field $\mathbf{B}$ to be measured is essentially static
during time $T$.

###  II.3 Optimal quantum sensors

We define the OQS as the minimum of the metrological cost function BMSE (6)
over all input states $\ket{\psi_{{\rm in}}}$, measurements $\\{M_{\mu}\\}$,
and estimators $\\{\bm{\xi}_{\mu}\\}$ for a given prior density
$\mathcal{P}_{\delta}(\bm{\phi})$. Thus, the posterior variance of the OQS,

$\Delta^{2}_{\rm OQS}=\min_{\ket{\psi_{{\rm
in}}},M_{\mu},\bm{\xi}_{\mu}}\mathcal{C},$ (11)

represents the fundamental limit on the posterior variance achievable by any
$N$-atom sensor for a given prior $\mathcal{P}_{\delta}(\bm{\phi})$.

As a first result, in Sec. III we will develop a method that allows us to
efficiently find the OQS for vector field sensing, i.e. to perform a numerical
optimization that scales only polynomially with the number of particles $N$.

While the OQS is defined via unconstrained optimization over (entangled) input
states and measurements, the practical realization of the ‘best possible’
quantum sensors will be constrained by limited experimental quantum resources
and imperfections. This will lead us to discuss optimal quantum sensors with
limited (experimental) entangling capabilities, i.e. identifying the best
possible quantum sensors given experimental constraints. Similar to the OQS,
the performance of these sensors is characterized by the minimum posterior
variance $\Delta^{2}$ defined as in Eq. (11), but evaluated by imposing
relevant constraints on the input states and measurements.

Figure 1 gives an overview of quantum sensors with different levels of control
and entanglement capabilities, whose performance we compare in Fig. 2. An
operational definition of these quantum sensors is given in terms of a quantum
circuit model, see Sec. III.2. This includes in Fig. 1(a) a quantum sensor
with universal ($N$-partite) control of the $N$-particle quantum system, which
subsumes the OQS. We contrast this in Fig. 1(b) to a 1-partite quantum sensor
(1p-QS) defined by uniform control of the $N$ atoms and in Fig. 1(c) to a
2-partite quantum sensor (2p-QS) with uniform control on the level of two
partitions of the atomic ensemble (for details see Secs. IV.2.1 and IV.2.2,
respectively). We will see below that the optimal 2p-QS operates close to the
OQS for 2D field sensing independent of the width of the prior density, and
this will motivate our search for variational approximations to the relevant
quantum circuits.

Finally, we comment on the relationship between the Bayesian and Fisher
information approaches to multi-parameter quantum metrology [9] in relation to
the present work, see Appendix C for a more detailed discussion. The
metrological cost function in the latter approach is the MSE of a locally
unbiased estimator, which is lower bounded by the Cramér-Rao bound. In other
words, the sensitivity is considered locally around a given value
$\bm{\phi}_{0}$ of the phase vector, which is in contrast to the BMSE, which
averages the MSE over a range of phase values. However, in the limiting case
of small prior widths $\sqrt{d}\delta$, when the Bayesian approach becomes
local, the two approaches can be connected via the van Trees inequality (32).
In the Fisher information framework, the sensitivity of any $N$-atom multi-
dimensional field sensor is lower bounded by a Heisenberg-like limit, which in
turn limits the BMSE through the van Trees inequality; see Appendix C. For the
examples considered in the following, the OQS saturates these bounds [57, 20,
22] in the small $\delta$ limit, which highlights that the OQS is also optimal
from the Fisher information point of view.

##  III Theory of the optimal quantum sensor

In this section, we solve the mathematical problem of minimizing the BMSE (6)
as the metrological cost function, which defines the OQS and underlies the
numerical results for the OQS presented in Figs. 2 and 6. We conclude the
section by introducing a quantum circuit model that describes practical
realizations of (optimal) quantum sensors.

###  III.1 Identifying the optimal quantum sensor

To find the OQS, one minimizes the metrological cost function (6) over an
unconstrained set of input states, measurements, and estimators, as in Eq.
(11). In general, solving such a mathematical problem is difficult, given the
exponentially large number of degrees of freedom associated with a quantum
system of $N$ particles, the corresponding measurements, and estimators. Here,
we show that optimal Bayesian solutions can be found using computational
resources that scale only polynomially in the size of the system $N$. Our
approach is based on three key observations presented in the following and
further detailed in the Appendices D–F.

First, we note that the dynamics of a sensor comprising $N$ atoms, which is
uniformly coupled to the field $\mathbf{B}$ according to Eq. (1), is
restricted to an effective Hilbert space with dimension scaling as $\sim
N^{3}$. This is in contrast to the full $2^{N}$-dimensional Hilbert space
describing $N$ spin-1/2 atoms. The simplification originates in the $SU(2)$
and particle permutation symmetry of the unitaries $U(\bm{\phi})$ that encode
the phases. The idea is to consider the $N$-qubit space using irreducible
representations of the $SU(2)$ group. For example, by adding angular momenta
one can represent two spin-1/2’s as a direct sum of two orthogonal subspaces
corresponding to a spin-1 (triplet) and a spin-0 (scalar),
$\bm{\frac{1}{2}}\otimes\bm{\frac{1}{2}}=\bm{1}\oplus\bm{0}$. The addition of
more than 2 angular momenta leads to multiple orthogonal subspaces, or
equivalent representations, corresponding to the same spin-$j$, e.g., for
three qubits we have 2 equivalent spin-1/2 representations,
$\bm{\frac{1}{2}}^{\otimes
3}=\bm{\frac{3}{2}}\oplus\bm{\frac{1}{2}}\oplus\bm{\frac{1}{2}}$. The number
of equivalent representations $\ell_{j}$ of spin-$j$ grows exponentially with
the number of added qubits $N$ and thus exceeds the number of degrees of
freedom of a single spin-$j$ subspace, $d_{j}=2j+1$. Since the $SU(2)$
unitaries do not couple different angular momenta $j$ and their equivalent
representations, we can utilize not more than $d_{j}\leq\ell_{j}$ equivalent
representations by entangling them. The other $\ell_{j}-d_{j}$ equivalent
representations remain unpopulated and cannot be used for sensing, thus
reducing the effective Hilbert space dimension of a $SU(2)$ sensor to $\sim
N^{3}$ [38, 37, 58]. We present details in Appendix D.

The second observation is the multi-convex nature of the sensor optimization
problem. As we show in Appendix E, this means that minimization of the
metrological cost Eq. (6) is a convex optimization problem 222Convexity of
optimization problem guarantees that every local minimum is a global minimum.
with respect to each of the three sets ($\ket{\psi_{{\rm in}}}$,
$\\{M_{\mu}\\}$, and $\\{\bm{\xi}_{\mu}\\}$) of variables, if the other two
are fixed. The hardest of the corresponding subproblems is the optimization
over POVMs for fixed input state and estimators. It can be recast as a
semidefinite program, which is solvable in polynomial time for our problem of
polynomial size in $N$ 333The upper bound on the POVM complexity for
$d_{N}\sim N^{3}$ dimensional Hilbert space is given by a POVM comprising
$d_{N}^{2}\sim N^{6}$ measurement operators of full rank. We find the OQS
solution to be significantly simpler than the upper bound., as discussed
above.

The optimization algorithm is summarized as follows: Starting from a random
initial state, POVM, and estimators, one iteratively solves the convex
subproblems until the solution converges to the optimal sensor (with
$\ket{\psi_{\rm in}^{\star}}$, $\\{M^{\star}_{\mu}\\}$, and
$\\{\bm{\xi}_{\mu}^{\star}\\}$) that minimizes the metrological cost (6). We
present formal definitions of the corresponding convex subproblems in Appendix
E.

Finally, on the more technical side, we observe that a reliable convergence to
the optimum solution can be achieved when symmetric degrees of freedom are
eliminated from the search space. To this end, we have identified a covariant
ansatz for input states, generalized measurements, and estimators, which
describes the optimal sensor in the case of a priori unknown field direction
as reflected in the isotropic prior density, Eq. (10), that we consider. The
covariant ansatz is detailed in Appendix F for the optimal 2-partite 2D field
sensor. The general case of the OQS for 2D and 3D field sensing will be
considered in [61].

###  III.2 Quantum circuit model of a quantum sensor

Practical realizations of a quantum sensor will rely on unitary quantum
circuits that manipulate the quantum state of the sensor, and projective
measurements performed on the atoms, as illustrated in Fig. 1. In our quantum
circuit model of a sensor, the initial state

$\displaystyle\ket{\operatorname{\psi_{\rm
in}}}=\operatorname{\mathcal{U}_{\rm en}}\,\ket{\psi_{0}}$ (12)

is prepared by an entangling unitary $\operatorname{\mathcal{U}_{\rm en}}$
from a product state, e.g., $\ket{\psi_{0}}=\ket{\downarrow}^{\otimes N}$. On
the other hand, the decoding unitary $\operatorname{\mathcal{U}_{\rm de}}$ can
be viewed as transforming the projective measurement basis given by
$\ket{\bm{\sigma}}=\ket{\sigma_{1},\cdots,\sigma_{N}}$, where each atom $j$ is
projected into $\sigma_{j}=\ket{\uparrow}$ or $\sigma_{j}=\ket{\downarrow}$.
Therefore, the conditional probability
$p(\bm{\sigma}|\bm{\phi})=\operatorname{\mathrm{Tr}}\\{\Pi_{\bm{\sigma}}\ket{\operatorname{\psi_{\bm{\phi}}}}\bra{\operatorname{\psi_{\bm{\phi}}}}\\}$
to obtain the measurement outcome $\bm{\sigma}$ can be expressed in terms of
the effective measurement projectors

$\displaystyle\Pi_{\bm{\sigma}}=\operatorname{\mathcal{U}_{\rm
de}}^{\dagger}\ket{\bm{\sigma}}\bra{\bm{\sigma}}\operatorname{\mathcal{U}_{\rm
de}}.$ (13)

A general POVM underlying the discussion of OQS can be implemented in the
circuit model with additional ancillary atoms that are not involved in the
actual sensing process. Interestingly, we observe that, for sufficiently large
$N$, the optimal POVM acting on the OQS subspace of polynomial dimension,
$\sim N^{3}$, can be realized as projective measurements on the full $N$-atom
space. The $N$-atom Hilbert space has an exponential number of degrees of
freedom, $2^{N}$, which can be used instead of the ancillary atoms. This
suggests that the OQS can be faithfully represented as a quantum circuit if we
assume universal quantum control at the level of individual atoms, as shown in
Fig. 1(a). Our numerical results suggest that the OQS for 2D fields can be
realized without using ancillary atoms for sensors comprising $N\gtrsim 8$
atoms.

##  IV Optimal few-partite quantum sensors

In the previous section, we discussed general aspects of the OQS for multi-
dimensional field sensing in $SU(2)$-interferometry with $N$ atoms. In the
present section, we will introduce and discuss few-partite quantum sensors,
and compare their performance to the OQS. These sensors are defined by
partitioning $N$ atoms representing the sensor into subensembles. In
particular, we consider the 1p-QS and the 2p-QS indicated in Figs. 1(b,e) and
(c, f), respectively. For the 1p-QS, we assume that the atomic ensemble is
uniformly controlled, while the 2p-QS assumes uniform control at the level of
partitions $A$ and $B$.

The motivation for introducing few-partite quantum sensors is two-fold: First,
we observe that the wave function of the OQS does not always occupy the full
Hilbert space of an $N$-atom $SU(2)$ interferometer, see Appendix G. The
specific structure of the occupied subspace suggests that the OQS for 2D field
sensing can be approximated by few-partite quantum sensors. Second, few-
partite quantum sensors require limited quantum control to implement
entangling and decoding unitaries in our quantum circuit model [see Fig.
1(e,f)]. We will discuss such implementations in Sec. V, where we study
variational approximations to the corresponding quantum circuits which can be
realized with current experimental techniques.

###  IV.1 Few-partite quantum sensors

####  IV.1.1 One-partite quantum sensor (1p-QS)

The 1p-QS and the corresponding quantum circuit model are sketched in Figs.
1(b, e), respectively. We assume global control so that the dynamics of the
1p-QS, i.e. the action of the 1p-QS unitaries $\mathcal{U}_{\rm en(de)}^{\rm
1p}$ and the phase encoding $U(\bm{\phi})$ on $\ket{\psi_{0}}$, are confined
to the permutation invariant subspace
$\mathcal{H}_{\text{1p}}=\mathbb{C}^{N+1}$ of the $N$-atom Hilbert space
$(\mathbb{C}^{2})^{\otimes N}$. Therefore, the system is equivalent to a
single ‘macrospin’ with angular momentum $J=N/2$ [62]. The eigenstates
$\ket{m}$ of $J_{z}$, which satisfy $J_{z}\ket{m}=m\ket{m}$ with
$m=-J,-J+1,\dots,J$, form a basis of the 1p-QS Hilbert space.

In this basis, the initial state and the measurement projectors in Fig. 1(e)
are defined as

$\displaystyle\ket{\operatorname{\psi_{\rm in}}}$
$\displaystyle=\mathcal{U}_{\rm en}^{\text{1p}}\ket{m=-J},$ (14)
$\displaystyle\Pi_{m}$ $\displaystyle=\left.\mathcal{U}_{\rm
de}^{\text{1p}}\right.^{\dagger}\ket{m}\bra{m}\mathcal{U}_{\rm
de}^{\text{1p}}.$ (15)

The optimal 1p-QS is characterized by the posterior variance

$\Delta^{2}_{\text{1p-QS}}=\min_{\mathcal{U}_{\rm
en}^{\text{1p}},\,\mathcal{U}_{\rm
de}^{\text{1p}},\,\bm{\xi}_{m}}\mathcal{C}.$ (16)

Details of the optimization are presented in Appendix H.

####  IV.1.2 Two-partite quantum sensor (2p-QS)

The 2p-QS and the corresponding quantum circuit are displayed in Figs. 1(c,
f), respectively. Here the sensor dynamics are confined to a subspace
${\mathcal{H}_{\text{2p}}=\mathbb{C}^{N/2+1}\otimes\mathbb{C}^{N/2+1}}$. This
setup is equivalent to a pair of macrospins $J^{A}=N/4$ and $J^{B}=N/4$, which
can be entangled through bi-partite uniform control.

Here, the basis states $\ket{m^{A},m^{B}}$, are defined as the simultaneous
eigenstates of $J_{z}^{A},J_{z}^{B}$ satisfying
$J_{z}^{A(B)}\ket{m^{A},m^{B}}=m^{A(B)}\ket{m^{A},m^{B}}$ with
$m^{A(B)}=-J^{A(B)},\dots,J^{A(B)}$. The initial state and the measurement
projectors are now

$\displaystyle\ket{\operatorname{\psi_{\rm in}}}$
$\displaystyle=\mathcal{U}_{\rm
en}^{\text{2p}}\ket{m^{A}\\!=\\!-\\!J^{A},m^{B}\\!=\\!-\\!J^{B}},$ (17)
$\displaystyle\Pi_{m^{A},m^{B}}$ $\displaystyle=\left.\mathcal{U}_{\rm
de}^{\text{2p}}\right.^{\dagger}\ket{m^{A},m^{B}}\bra{m^{A},m^{B}}\mathcal{U}_{\rm
de}^{\text{2p}}.$ (18)

The optimal 2p-QS is characterized by the posterior variance (see Appendix H)

$\Delta^{2}_{\text{2p-QS}}=\min_{\mathcal{U}_{\rm
en}^{\text{2p}},\,\mathcal{U}_{\rm
de}^{\text{2p}},\,\bm{\xi}_{m^{A},m^{B}}}\mathcal{C}.$ (19)

####  IV.1.3 Two-partite classical sensor (2p-CS)

We contrast the 2p-QS to a 2-partite classical sensor (2p-CS), defined by
further restricting $\mathcal{U}_{\rm en(de)}^{\text{2p}}$ to allow only
collective rotations of all atoms within each ensemble. This implies that
there is no entanglement between the atoms. We use the corresponding
$\Delta^{2}_{\text{2p-CS}}$ to define the SQL for two-partite sensors.

###  IV.2 Results: 2D field sensing with few-partite quantum sensors

Our main results on 2D sensing, where
$\mathbf{B}=(\text{B}_{x},\text{B}_{y},0)^{T}$, are summarized in Fig. 2. We
plot the ratio of posterior and prior widths, $\Delta/(\sqrt{2}\,\delta)$, as
a function of the prior width $\sqrt{2}\delta$ for the OQS representing the
ultimate quantum limit, the optimal 2p-CS defining the SQL, and the optimal
1p-QS and 2p-QS. The results are presented for $N=8$ atoms, which is large
enough to demonstrate a reasonable sensitivity gain 444Results for small atom
numbers are relevant for field sensing in scenarios where only few atoms can
be used for the sensing task, e.g., in order to maintain a good spatial
resolution..

In this figure, there are two limits where the Bayesian update following the
measurement does not provide information about the signal, i.e., the ratio
$\Delta/(\sqrt{2}\,\delta)$ goes to $1$. The first is the limit $\delta\to 0$,
where quantum measurement fluctuations overwhelm the signal, and the second is
the regime $\delta\gg 1$, where the signal is dwarfed by a large estimation
error due to phases that slip outside the unambiguous estimation region
$|\bm{\phi}|\lesssim\pi$. As a result, each sensor has an optimal operating
point $\delta^{*}$ at which the information gain per measurement is maximized.

The results in Fig. 2(a) show that the OQS reaches its optimal operating point
in the large prior width regime $\delta\sim 1$, corresponding to an
interrogation time $T\sim(\delta{\lvert\mathbf{B}\rvert})^{-1}$. Another
relevant regime is that of small prior widths, $\smash{\delta\lesssim 1/N}$,
where the OQS performance is limited by the Bayesian Cramèr-Rao bound (black
dotted line), which follows from the van Trees inequality (see Appendix C).
The corresponding small evolution times
$T\sim(\delta{\lvert\mathbf{B}\rvert}N)^{-1}$ allow us to monitor more rapidly
time-varying signals since the requirement $\tau\gg T$ on the coherence time
$\tau$ of the fields is consequently relaxed.

Although the 1p-QS can realize the OQS for small prior widths, it fails to
improve over the classical sensor (blue curve) in the regime of large prior
widths. This is in contrast to the 2p-QS, which can perform close to the OQS
for the full range of prior widths. The near-optimal 2D field-sensing
performance of the 2p-QS and the limited experimental control it requires
motivate a practical implementation on a programmable quantum sensor, which we
discuss in Sec. V in terms of variational quantum circuits.

In the following, we will take a closer look at the interplay between the
optimal input states, measurement projectors, and estimators to understand how
these sensors achieve (near-)optimal sensitivity at various prior widths. In
particular, we will rely on the Wigner quasi-probability distributions [64] to
represent states $\ket{\operatorname{\psi_{\rm
in}}}\bra{\operatorname{\psi_{\rm in}}}$ and measurement projectors $\Pi_{m}$
on a generalized Bloch sphere corresponding to the macrospin representation of
the sensor. Wigner distributions rotate as rigid objects under the action of
$\operatorname{\mathcal{U}(\bm{\phi})}$, and the overlap between the Wigner
distribution of the rotated state
$\ket{\operatorname{\psi_{\bm{\phi}}}}\bra{\operatorname{\psi_{\bm{\phi}}}}$
and the projective measurement $\Pi_{m}$ integrated over the Bloch sphere
corresponds to the probability $p(m|\bm{\phi})$ of observing the corresponding
measurement outcome $m$.

####  IV.2.1 Optimal 1p-QS

The 1p-QS is optimal for sensing in the regime of small prior widths
$\delta\lesssim 1/N$. In this regime, the optimal entangled input state is
$\ket{m=0}$, i.e. a permutation symmetric state with an equal number of atoms
in $\ket{\uparrow}$ and $\ket{\downarrow}$ (we consider even $N$). The Wigner
distribution of this state is shown in Fig. 3 and represents a ring around the
equator of the generalized Bloch sphere, which implies that the state is
invariant under $z$-rotations and is equally sensitive to rotations around any
axis in the $xy$-plane. Remarkably, the optimal measurement in this regime of
2D field sensing is projective. Figure 3 shows a representative projector
$\Pi_{m}$, which has the greatest overlap with the input state rotated about
the $x$-axis. The corresponding measurement outcome $m$ is consequently mapped
to a phase estimate $\bm{\xi}_{m}$ that indicates a field oriented along the
$x$ axis.

The $N+1$ possible measurement outcomes are mapped to phase estimates that are
uniformly spaced in a circle. This means that, in the small prior width limit,
the 1p-QS operates like a “compass”, that is, a _single_ measurement provides
information only on the direction but not the magnitude of $\bm{\phi}$, and
hence also of $\mathbf{B}$. The high sensitivity of the 2D “compass” to small
rotations is particularly suitable for monitoring rapidly changing signals.
This is analogous to the GHZ state interferometer [65] in 1D field sensing,
which in a _single_ measurement can estimate only the sign but not the
strength of a 1D field. Note that the field magnitude is encoded in the
probabilities of the different measurement outcomes. Thus, repeated
measurements with the “compass” will enable us to access full information
about the vector field.

####  IV.2.2 Optimal 2p-QS

In Fig. 4, we visualize the state, projectors and estimators at the optimal
operating point of the 2p-QS, i.e., at the minimum of the green curve in Fig.
2, around $\delta\approx 0.75$. To show the Wigner distributions, we use the
addition of angular momentum to represent the Hilbert space of the two equal-
sized macrospins as the direct sum of spin-$j$ representations, i.e.
$\mathcal{H}_{\rm
2p}={\mathbb{C}^{N/2+1}\otimes\mathbb{C}^{N/2+1}=\bigoplus_{j=0}^{N/2}\mathbb{C}^{2j+1}}$.
We project the operators onto the different angular momentum manifolds and
show Wigner distributions corresponding to each of the $j$-manifolds. This
means that coherences between different $j$-manifolds are not represented in
the resulting Wigner distributions. Nevertheless, the distributions give an
intuitive picture of how the sensor works. The optimal input state of the
2p-QS consists of equatorial rings in all spin representations, which is an
approximation of the optimal covariant 2p-QS (see Appendix F) that is a
superposition of $\ket{j,m=0}$ states. The use of different spin manifolds
enables the the 2p-QS to extend the range of detectable field strengths.

The projective measurement outcomes $m^{A}$ and $m^{B}$ corresponding to the
entangled projectors $\Pi_{m^{A},m^{B}}$ are assigned to one of the evenly
distributed estimators, which approximate $N/2+1$ concentric rings. The rings
shown in the estimator plot in Fig. 4 are predicted from the optimal covariant
2p-QS. In contrast to the 2D “compass”, a single measurement by the optimal
2p-QS provides information on both field strength and direction. The three
representative projectors visualized in Fig. 4 detect rotations around the
$x$-axis with increasing strength, i.e., they have a large overlap with
$\ket{\operatorname{\psi_{\rm in}}}\bra{\operatorname{\psi_{\rm in}}}$ after
it is increasingly rotated around the $x$-axis.

Figure 3:  Illustration of the optimal 1p-QS for 2D fields. The sensor is
optimal for the prior width $\delta$ indicated by the red triangle in Fig. 2.
We show the Wigner distributions of the input state
$\ket{\operatorname{\psi_{\rm in}}}$ [prepared by the unitary
$\mathcal{U}_{\rm en}^{\text{1p}}$ (14)] and a representative projective
measurement operator $\Pi_{m}$ [realized by the unitary $\mathcal{U}_{\rm
de}^{\text{1p}}$ (15)]. For visual clarity, here we show the Wigner
distributions for $N=32$, which are qualitatively the same for any particle
number in the regime $\delta\lesssim 1/N$. The measurement outcomes $m$ are
mapped to estimators $\bm{\xi}_{m}$ in the $\phi_{x}\phi_{y}$-plane, and the
one corresponding to the displayed $\Pi_{m}$ is highlighted by a purple frame.

##  V Variational quantum circuits

Today’s programmable quantum sensors are NISQ devices implemented on various
platforms that support a reduced instruction set of native gates, which can
nevertheless be executed with high fidelity and are typically scalable to
tens, and potentially hundreds of particles. A practical implementation of a
quantum sensor, and in particular a quantum circuit model, must therefore rely
on a decomposition of the entangling and decoding unitaries into this native
set of gates. This can be achieved in an approximate manner via variational
quantum circuits. Here, an ansatz is made for ${\cal U}_{\rm en}$ and ${\cal
U}_{\rm de}$ in terms of low-depth quantum circuits, which are parametrized by
a set of variational parameters $\bm{\theta}$ ($\bm{\vartheta}$) for the
entangler (decoder). Given such a variational ansatz, the optimal entangler
and decoder within a class of variational quantum circuits correspond to the
minimum of the metrological cost function

$\displaystyle\Delta^{2}_{\rm
var}=\min_{\bm{\theta},\bm{\vartheta},\bm{\xi}}\mathcal{C}\quad(\geq\Delta^{2}_{\rm
OQS}),$ (20)

thus defining the best possible quantum sensor for given (entangling)
resources, i.e. resource gate set, circuit design, and circuit depth. The
practical aspects of the variational minimization are discussed in Appendix I.
This optimization can be performed within the theoretical model of the sensor
or by optimizing the variational parameters in a quantum feedback loop on the
actual physical device [7]. The latter case provides us with the opportunity
to optimize the quantum sensor even when the corresponding quantum circuits
are challenging to simulate classically, and in the presence of control errors
and noise.

Figure 4:  Illustration of the optimal 2p-QS for 2D fields. The sensor is
optimal for the prior width $\delta$ indicated by the green triangle in Fig.
2. We show the Wigner distributions of the input state
$\ket{\operatorname{\psi_{\rm in}}}$ [prepared by the unitary
$\mathcal{U}_{\rm en}^{\text{2p}}$ (17)] and representative projective
measurement operators $\Pi_{m^{A},m^{B}}$ [realized by the unitary
$\mathcal{U}_{\rm de}^{\text{2p}}$ (18)]. We visualize projections on to the
spin-$j$ representations of the 2p-QS space, with $j=0,1,\dots,N/2$ (for
further details see Sec. IV.2.2). The measurement outcomes $m^{A}$ and $m^{B}$
are mapped to estimators $\bm{\xi}_{m^{A},m^{B}}$ in the
$\phi_{x}\phi_{y}$-plane, and the ones corresponding to the displayed
$\Pi_{m^{A},m^{B}}$’s are highlighted by purple frames.

Below we present a study of variational quantum circuits of increasing depth,
which allow us to approach the performance of the OQS in multi-parameter
quantum metrology. As a native gate set, we assume one-axis twisting (OAT)
operations as entangling gates and uniform spin rotations as single qubit
gates. This is motivated by the feasibility of realizing programmable quantum
sensors using strings of trapped ions, where OAT is natively implemented as a
Mølmer-Sørensen gate [66, 67], and spin rotations are performed via laser or
microwave driving. The 1p-QS and 2p-QS can be implemented directly as circuits
of the natively available gates in such a setup. We note that a similar set of
quantum resources is also available in Cavity QED setups [68] and spin
mixtures of Bose-Einstein condensates [69, 70].

To be specific, our discussion will focus on the 2p-QS illustrated in Fig. 1c.
In the previous section, we have shown that the 2p-QS has close to optimal
performance for 2D field sensing. Here, we show that low-depth variational
circuits built from OAT and spin rotations provide good approximations to the
optimal 2p-QS, and enable a significant enhancement over unentangled sensors
(see Fig. 2).

###  V.1 Resource gate set for 2p-QS

The 2p-QS assumes that we have a native set of gate operations available that
act independently on partitions $A$ and $B$ [see Fig. 1(c)]. This includes,
first of all, uniform rotation of spins in the partitions,

$\displaystyle\mathcal{R}^{A(B)}_{\nu}(\theta)=e^{-i\theta
J^{A(B)}_{\nu}}\qquad\text{with}\ \nu=x,y,z.$ (21)

Furthermore, we assume entanglement operations in the form of OAT. These
include

$\displaystyle\mathcal{T}^{A(B)}_{z}(\theta)=e^{-i\theta\left(J_{z}^{A(B)}\right)^{2}}$
(22)

which respectively entangle the atoms within the partitions $A$ and $B$, while
the entanglement between $A$ and $B$ is generated with

$\displaystyle\mathcal{T}_{z}(\theta)=e^{-i\theta\left(J_{z}^{A}+J_{z}^{B}\right)^{2}},$
(23)

which completes the gate set 555Note that extensions of this gate set, i.e.
allowing for twisting around arbitrary axes [94, 95] can lead to more
efficient parameterization in terms of the number of gates required to achieve
a certain performance.. Such gates can be realized on trapped ion platforms,
such as the one used to demonstrate optimal 1D field sensing [7].

###  V.2 Circuit design for 2p-QS

Figure 5: Convergence of estimators of optimized variational circuits.
Estimators $\bm{\xi}_{m^{A},m^{B}}$ of the optimized $N=8$ atoms variational
circuits for $\delta\approx 0.75$, with $\operatorname{n_{\rm en}}=2$ and
$\operatorname{n_{\rm de}}=1,10,32$. The estimators are colored according to
the corresponding measurement outcomes $m^{A}$ and $m^{B}$. The corresponding
sensitivity is shown in Fig. 2.

Variational circuits approximating the optimal entangler and decoder of the
2p-QS (see Fig. 1c) are compiled from the above elementary gates. In
particular, we consider circuits that are constructed by stacking multiple
layers. Each layer is described by a unitary

$\displaystyle\mathcal{L}(\bm{\theta_{k}})=$
$\displaystyle\,\mathcal{R}^{A}_{y}\left(\theta_{k}^{(4)}\right)\mathcal{R}^{B}_{y}\left(-\theta_{k}^{(4)}\right)\mathcal{R}^{A}_{x}\left(\theta_{k}^{(3)}\right)\mathcal{R}^{B}_{x}\left(\theta_{k}^{(3)}\right)$
$\displaystyle\,\times\mathcal{T}^{A}_{z}\left(\theta_{k}^{(2)}\right)\mathcal{T}^{B}_{z}\left(\theta_{k}^{(2)}\right)\mathcal{T}_{z}\left(\theta_{k}^{(1)}\right),$
(24)

that depends on the four parameters contained in the vector
$\bm{\theta}_{k}=\left(\theta_{k}^{(1)},\cdots,\theta_{k}^{(4)}\right)^{T}$.
The parameters within each layer are correlated (i.e.
$\theta_{k}^{(4)},\theta_{k}^{(3)},\text{and }\theta_{k}^{(2)}$ respectively
appear in two consecutive gates), so that the resulting circuits preserve a
symmetry that we identified in the optimal 2p-QS solution. Therefore, the
unitaries will not explore the entire Hilbert space $\mathcal{H}_{\text{2p}}$
of the 2p-QS, which reduces the number of variational parameters required for
a given circuit depth of the 2p-QS.

We parameterize entangling unitaries consisting of $\operatorname{n_{\rm en}}$
layers through a $4\operatorname{n_{\rm en}}$ dimensional parameter vector
$\bm{\theta}=\left(\bm{\theta}_{1},\cdots,\bm{\theta}_{\operatorname{n_{\rm
en}}}\right)^{T}$ as

$\displaystyle\mathcal{U}_{\rm
en}^{\text{2p}}(\bm{\theta})=\mathcal{L}\left(\bm{\theta}_{\operatorname{n_{\rm
en}}}\right)\cdots\mathcal{L}\left(\bm{\theta}_{n_{\text{1}}}\right)\mathcal{R}^{A}_{y}\left(\tfrac{\pi}{2}\right)\mathcal{R}^{B}_{y}\left(\tfrac{\pi}{2}\right),$
(25)

and decoding unitaries consisting of $\operatorname{n_{\rm de}}$ layers
through a $4\operatorname{n_{\rm de}}+2$ dimensional parameter vector
$\bm{\vartheta}=\left(\vartheta_{0}^{(1)},\vartheta_{0}^{(2)},\bm{\vartheta}_{1},\cdots,\bm{\vartheta}_{\operatorname{n_{\rm
en}}}\right)^{T}$ as

$\displaystyle\mathcal{U}_{\rm de}^{\rm 2p}(\bm{\vartheta})=$
$\displaystyle\,\mathcal{R}^{A}_{x}\big{(}\vartheta_{0}^{(1)}\big{)}\,\mathcal{R}^{B}_{x}\big{(}\vartheta_{0}^{(1)}\big{)}\,\mathcal{R}^{A}_{y}\big{(}\vartheta_{0}^{(2)}\big{)}\,\mathcal{R}^{B}_{y}\big{(}-\vartheta_{0}^{(2)}\big{)}$
$\displaystyle\,\times\mathcal{L^{\dagger}}(\bm{\vartheta}_{1})\cdots\mathcal{L}^{\dagger}(\bm{\vartheta}_{n_{\text{de}}}).$
(26)

Therefore, a sensor with an entangler and decoder depth of
$(\operatorname{n_{\rm en}},\operatorname{n_{\rm de}})$ depends on a total
number of $4(\operatorname{n_{\rm en}}+\operatorname{n_{\rm de}})+2$
variational parameters. The parameters of the circuit are variationally
optimized using the cost function Eq. (20) to find the best-performing sensor
for a given circuit with depth $(\operatorname{n_{\rm
en}},\operatorname{n_{\rm de}})$.

###  V.3 Results: variational optimization of 2p-QS

In the magnified panel of Fig. 2, we examine how closely the optimized
variational circuits approximate the performance of the optimal 2p-QS
comprising $N=8$ atoms. With increasing decoder depth, the variational
circuits consistently approach the optimal 2p-QS and eventually converge to it
for large $\operatorname{n_{\rm de}}$. Interestingly, optimal sensitivity is
achieved for the shallow depth of the entangler $\operatorname{n_{\rm en}}=2$,
indicating that it is significantly more challenging to implement optimal
decoding unitaries than to implement optimal entangling unitaries. This is due
to the fact that the entangler unitary only needs to transform
$\ket{\psi_{0}}$ to $\ket{\operatorname{\psi_{\rm in}}}$, while the decoder
needs to transform all measurement bases to the desired bases simultaneously,
imposing significantly more constraints on the optimal unitary.

To understand how the variational circuits approach the 2p-QS, it is
insightful to study the optimal estimators and see how they change as the
depth of the decoder increases. In Fig. 5, we show the estimators of the
optimized variational circuits. The minimal depth circuit
$\operatorname{n_{\rm de}}=1$ results in an asymmetric distribution of
estimators in the $\phi_{x}\phi_{y}$-plane, indicating that the sensor is not
equally sensitive to $\phi_{x}$ and $\phi_{y}$. Increasing the depth to
$\operatorname{n_{\rm de}}=10$, the estimators become more evenly distributed,
whereas the estimator pattern for $\operatorname{n_{\rm de}}=32$ is very close
to the optimal 2p-QS shown in Fig. 4.

An important question for currently available quantum sensors is how much
sensitivity gain we can expect for a fixed circuit depth. We address this by
determining the minimum value of the ratio $\Delta/\sqrt{2}\delta$ at the
optimal operating value of $\delta$ for a given circuit depth. In Fig. 6, this
value is shown as a function of the system size $N$. Interestingly, we find
that even for $\operatorname{n_{\rm de}}=1$, there is an increase in
performance that appears to scale with $N$. As the depth of the circuit
increases, the sensitivity and scaling improve steadily.

Figure 6: Performance scaling of variational 2D field sensors. Scaling of the
minimum value of the posterior to prior uncertainty ratio as a function of
system size $N$. The purple lines correspond to variational quantum sensors
with different numbers of decoding layers $\operatorname{n_{\rm de}}$ at a
fixed entangler depth of $\operatorname{n_{\rm en}}=2$. For comparison, we
also show the performance of the 2p-CS (blue line) and the optimal 2p-QS
(green line).

##  VI 3D field sensing

While so far our focus has been on 2D field sensing, the techniques developed
in the previous sections are readily extended to 3D. Here, we present first
results and observations for optimal and variational 3D field quantum sensors.

We observe that the OQS solution in 3D makes use of the full effective Hilbert
space of an $SU(2)$ sensor ($\text{dimension}\sim N^{3}$), see Appendix G.
This suggests that sensors made of a few partitions do not closely approximate
the OQS for 3D sensing of fields with arbitrary prior widths. Nevertheless,
few-partite sensors can provide a significant improvement over classical
sensors and even perform optimally at small prior widths, as we demonstrate
below.

Figure 7 shows the performance of various sensors with $N=6$ atoms, quantified
by the ratio $\Delta/\sqrt{3}\delta$, as $\delta$ is scanned. The 1p-QS and
2p-QS sensors, are both significantly less sensitive than the OQS in the large
prior regime and only the full $N$-partite quantum sensor ($N$p-QS), relying
on universal control, approaches the OQS. Here, we extend the discussion to a
3-partition quantum sensor (3p-QS), with uniform control at the level of three
partitions. However, the 3p-QS performance is still appreciably different from
that of the OQS, highlighting the added complexity of the 3D OQS near its
optimal operating point. To compare the few-partite sensors with a classical
reference, we study a 3-partite classical sensor, where the atoms are
unentangled. Here, we find that each partition is primarily sensitive to one
component. In comparison to the 3p-CS, the 2p-QS and 3p-QS show a considerable
improvement by using entanglement between the sensor atoms.

Figure 7: Bayesian quantum sensing of a 3D field. Left panel: Ratio of the
posterior width $\Delta$ to the prior width $\sqrt{3}\delta$ vs. $\delta$ for
$N=6$ atoms. The black marker shows one preliminary data point obtained for
the OQS at $\delta=0.75$. This point matches well with the sensitivity of a
$N$p-QS (dark gray line). The asymptotic bound on quantum (black dotted line)
and classical (blue dotted line) sensors are predicted by the Bayesian Cramér-
Rao bounds (36) and (38). In Fig. 8, we illustrate the working of the optimal
sensor indicated here by the red triangle. Magnified panel (right):
Performance of variational circuits (purple lines) with an increasing total
number of layers $n_{\rm l}=n_{\rm en}+n_{\rm de}$.

####  VI.0.1 Optimal 1p-QS

In the regime of small prior widths $\delta\lesssim 1/N$, the performance of
the 1p-QS is indistinguishable from the optimal performance. To gain insight
into the 1p-QS solution, we visualize the optimal state, measurement
projectors, and estimators in Fig. 8. The optimal state shows a regular
distribution of maxima and minima on the generalized Bloch sphere,
highlighting the high degree of symmetry in this state. Notably, the
estimators are found to lie on a sphere. As a result, they provide only
directional information and therefore the sensor acts as a 3D “compass”. The
visualized measurement projectors resemble the input state rotated around the
axis specified by the respective estimator. In other words, each projector is
sensitive to rotations around a different axis.

We conclude that the optimal sensor at small prior widths displays a universal
compass-like behavior for 1D, 2D, and 3D fields. However, a key difference is
that while GHZ ($\ket{m=0}$) states are optimal independent of $N$ in 1D (2D),
the optimal state for 3D field sensing changes with $N$ similar to the states
discussed in [72, 57, 73, 74, 51].

####  VI.0.2 Variational optimization of 1p-QS

The performance of the 1p-QS motivates us to study variational circuits to
approximate the optimal 1p-QS. As sketched in Fig. 1(e), we consider circuits
that parameterize $\mathcal{U}_{\rm en(de)}^{\rm 1p}$ according to

$\displaystyle\mathcal{U}_{\rm en}^{\text{1p}}(\bm{\theta})$
$\displaystyle=\mathcal{L}\left(\bm{\theta}_{\operatorname{n_{\rm
en}}}\right)\cdots\mathcal{L}\left(\bm{\theta}_{n_{\text{1}}}\right)$ (27)
$\displaystyle\mathcal{U}_{\rm de}^{\rm 1p}(\bm{\vartheta})$
$\displaystyle=\mathcal{L^{\dagger}}(\bm{\vartheta}_{1})\cdots\mathcal{L}^{\dagger}(\bm{\vartheta}_{n_{\text{de}}}).$
(28)

Here, the unitaries are constructed by repeated application of layers
containing three elementary gates

$\displaystyle\mathcal{L}(\bm{\theta})=\mathcal{T}_{z}\left(\bm{\theta}^{(3)}\right)\,\mathcal{R}_{y}\left(\bm{\theta}^{(2)}\right)\,\mathcal{R}_{x}\left(\theta^{(1)}\right).$
(29)

The number of variational parameters at a given circuit depth is therefore
$3(\operatorname{n_{\rm en}}+\operatorname{n_{\rm de}})$. In the magnified
panel of Fig. 7, we plot the performance of variational circuits with varying
depths and indeed find that circuits with modest depths can approach the
optimal 1p-QS performance. These results highlight the potential for
implementing a 3D quantum “compass” with currently available resources.

Figure 8: Illustration of the optimal 1p-QS for 3D fields. The sensor is
optimal for the prior width $\delta$ indicated by the red triangle in Fig. 7.
We show the Wigner distributions of the input state
$\ket{\operatorname{\psi_{\rm in}}}$ [prepared by the unitary
$\mathcal{U}_{\rm en}^{\text{1p}}$ (14)] and representative projective
measurement operators $\Pi_{m}$ [realized by the unitary $\mathcal{U}_{\rm
de}^{\text{1p}}$ (15)]. The measurement outcomes $m$ are mapped to estimators
$\bm{\xi}_{m}$ in the $\phi_{x}\phi_{y}$-plane, and the ones corresponding to
the displayed $\Pi_{m}$ are highlighted by colored frames. The purple arrows
illustrate that the Wigner distribution of the projectors resemble approximate
rotated versions of the Wigner distribution of the input state, when it is
rotated about the axis along the vector specified by the corresponding
estimator $\bm{\xi}_{m}$.

##  VII Conclusion and Outlook

In this work, we have identified fundamental bounds and studied the
performance of practically feasible sensors for the sensing of 2D and 3D
vector fields within the Bayesian framework for $SU(2)$-quantum
interferometry. We established a procedure to determine the OQS that sets the
fundamental bound on the performance of an $N$-atom sensor. Furthermore, we
introduced sensors with limited experimental control, namely the 1p-QS and
2p-QS, and studied their ability to approach the OQS. As a further step
towards practical realization, we also simulated the variational optimization
of sensors with limited entangling capabilities, considering the resources
available on state-of-the-art trapped ion systems.

Our study of 2D field sensing reveals important similarities and differences
between single- and multi-parameter metrology. In the case of 1D sensing, the
OQS operates in the particle permutation symmetric subspace of the $N$ atoms,
and hence the 1p-QS is optimal at all prior widths. Here, we find that the
1p-QS is optimal for 2D sensing only in the regime of small prior widths. In
this regime, it operates like a 2D “compass”, providing information only on
the field direction. This is similar to the GHZ-state interferometer, optimal
for 1D sensing with small prior widths, which only provides information on the
sign of the 1D field. In contrast to the 1D case, we find that the 2p-QS
approaches the OQS performance for 2D field sensing at large prior widths.

Although such a sensor requires more experimental control than a 1p-QS, it can
nevertheless be realized on state-of-the-art sensing platforms, as we
demonstrate by simulating a variational circuit optimization of the 2p-QS. Our
simulation reveals that sensors made of low-depth circuits provide appreciable
improvements over classical (unentangled) sensors, while deeper circuits may
be required to achieve optimal performance. This is in contrast to 1D sensing,
where low-depth variational circuits have previously been shown theoretically
and experimentally to achieve optimal performance. Nevertheless, these results
have promising implications for small-scale sensors as well as for those that
involve a macroscopic number of atoms; current technology provides excellent
coherent control of a small number of atoms, enabling the realization of deep
circuits that can reach the 2p-QS limit for small quantum sensors. Such
sensors may be relevant for practical applications where spatial resolution is
important. On the other hand, for sensors operating with a large number of
atoms, our results demonstrate that shallow-depth circuits can significantly
improve performance compared to unentangled sensors.

Although our study has focused on using infinite-range OAT as an entangling
resource, many promising quantum sensing platforms host finite-range
interactions, e.g. solid-state systems or neutral atoms in tweezer arrays [75,
76, 77, 78]. Variational optimization of the metrological cost function can be
directly generalized to finite-range interactions, as done in [79, 80, 6, 81]
for other metrological cost functions. However, in that case, the
classification into few-partite quantum sensors does not apply, and simulating
the full many-body problem is challenging for classical algorithms, which
makes feedback loop optimization on the physical quantum device even more
desirable. Furthermore, the $N$-atom 1p-QS and 2p-QS can also be realized,
respectively, as a single large macrospin [62] of length $J=N/2$ or two
entangled macrospins [82] of length $J=N/4$ each, allowing for a route to
optimal sensing with qudit-based quantum sensors.

We also briefly extended our study to the problem of 3D field sensing. Here,
we found an appreciable difference in the performance of sensors with a few
partitions and the optimal sensor. Therefore, it is an open challenge to find
circuits that efficiently approximate the OQS for 3D field sensing. However,
in the regime of small prior widths, we once again find that the 1p-QS is
essentially optimal. Similar to the 1D and 2D cases, it operates as a 3D
“compass” in this regime, with the estimators arranged on the surface of a
sphere. Furthermore, we showed that such a 3D “compass” can be well
approximated with low-depth variational circuits, paving the way for their
experimental realization.

In conclusion, we have highlighted the importance of finding Optimal Quantum
Sensors, which operate at the ultimate precision allowed by quantum physics,
and implementing them as Variational Quantum Sensors. This is crucial not just
for uncovering new physics through precision measurements [83] but also for
practical applications such as quantum computing. Programmable atomic sensors,
discussed in this article, can be integrated with atomic quantum computing
systems by utilizing common quantum resources, like entangling quantum gates.
In this way, an optimal quantum sensor for electromagnetic fields embedded in
the system can precisely detect and monitor noise fields, contributing to the
stability of quantum devices through an optimal feedback mechanism.

###### Acknowledgements.

We thank C. Marciniak, and Q. Liu for comments on the manuscript. The
computational results were obtained using the University of Innsbruck’s LEO
HPC infrastructure. Research in Innsbruck is supported by the US Air Force
Office of Scientific Research (AFOSR) via IOE Grant No. FA9550-19-1-7044
LASCEM, the European Union’s Horizon 2020 research and innovation program
under PASQuanS 2, and by the Simons Collaboration on Ultra-Quantum Matter,
which is a grant from the Simons Foundation (651440, P.Z.), and by the
Institut für Quanteninformation. Innsbruck theory is a member of the NSF
Quantum Leap Challenge. AS acknowledges the support of a CV Raman Post-
Doctoral Fellowship, IISc.

##  Appendix A Physical implementation of vector field sensors

Sec. II.1 provides a formal description of an $SU(2)$-interferometer to sense
vector fields. There, the discussion is phrased as an ensemble of $N$ two-
level atoms, described by collective angular momentum operators
$\bm{\mathcal{J}}$, coupled uniformly to a static (DC) vector field
$\bm{\mathcal{B}}$ given by the Hamiltonian (1). In Appendix A.1, we summarize
various physical scenarios where such a Hamiltonian arises in the context of
magnetometry. Furthermore, in Sec. IV, we have defined limited control sensors
where the $N$ two-level atoms are equivalent to one or two ‘macrospins’ with
large angular momenta (see Fig. 1). Accordingly, in Appendix A.2, we provide
examples of vector field sensors implemented directly using macrospins.

###  A.1 Vector field sensing with ensembles of $N$ two-level atoms

_DC magnetometry_ – For a single atom, the magnetic field couples to Zeeman
levels provided by a fine (or hyperfine) structure manifold $J$ (or $F$)
according to $H_{\rm M}=-\bm{\mu}_{\mathcal{B}}\cdot\bm{\mathcal{B}}$. Here,
the magnetic dipole moment $\bm{\mu}_{\mathcal{B}}=\mu_{\rm
B}g\bm{\mathcal{J}}/{\hbar}$ is given by the Bohr magneton $\mu_{\rm B}$, the
Landé g-factor $g$ and the total angular momentum operator $\bm{\mathcal{J}}$
(or $\bm{\mathcal{F}}$). This Zeeman Hamiltonian is valid within degenerate
perturbation theory in the given angular momentum manifold, resulting in a
Zeeman splitting linear in the magnetic field.

An example of a Zeeman manifold representing a two-level atom is the
${}^{2}S_{1/2}$ ground state of 40Ca ions, as used in trapped ion programmable
quantum sensor experiments [7]. For $N$ atoms, summing over these single-atom
contributions leads to the Hamiltonian (1), and thus sensing the three
components of a (static) magnetic field.

_AC magnetometry_ – Experiments commonly apply a bias field $\mathcal{B}_{0}$
that defines a quantization axis and lifts the degeneracy of Zeeman states, as
in NMR. Continuing with the example of the ${}^{2}S_{1/2}$ manifold, a static
bias field will introduce a Zeeman splitting $\omega$ defining a $z$-axis.
This Zeeman transition can be driven by a transverse AC magnetic field. Within
the validity of the rotating wave approximation, and going to a rotating frame
leads to a static Hamiltonian, which for $N$ atoms is of the form of Eq. (1).
In this case the three components of the magnetic field to be sensed are the
static magnetic field deviation from the bias field, and the in-phase and out-
phase components of the driving magnetic field (Rabi frequencies).

In the AC field measurement example, the origins of the effective longitudinal
and transverse components (with respect to the bias field) are different, and
thus our prior knowledge of these terms will generally not be the same.
Therefore, the assumption of an isotropic prior density (10) used in the main
text may not be accurate. In appendix B, we discuss how the results described
in the main text can be generalized to anisotropic prior probability
densities.

The above discussion can be generalized to pairs of atomic levels belonging to
different Zeeman manifolds with different Landé g-factors, which however leads
to anisotropic coupling Hamiltonians.

###  A.2 Vector field sensing with macroscopic spins

In Sec. IV, we have defined limited control sensors, i.e. the 1p-QS and 2p-QS
(see Fig. 1). In the 1p-QS, the $N$ atoms are uniformly controlled and hence
it is equivalent to a sensor consisting of a single macrospin with angular
momentum $J=N/2$. In the case of the 2p-QS, the $N$ atoms are partitioned into
two equal-sized partitions $A$ and $B$ with uniform control at the level of
each partition and over the entire ensemble. Thus, the 2p-QS is equivalent to
a sensor consisting of two physical, entangled ‘macro-spins’ each with angular
momenta $J^{A}=J^{B}=N/4$. Here, we briefly elaborate on the direct physical
implementation of macrospins in large angular momentum manifolds. These are
available as large angular momentum Zeeman manifolds, $SO(4)$-symmetric
manifolds in Rydberg atoms for electric field sensing, and in photon
interferometry with large orbital angular momentum states.

_Large Zeeman manifolds for magnetometry_ – As already noted in Appendix A.1,
large Zeeman fine and hyperfine manifolds available in trapped ion and atomic
tweezer experiments lead to a Hamiltonian of the form (1). An example is
provided by the $3^{2}\text{D}_{5/2}$ manifold of $\,{}^{40}\text{Ca}^{+}$
[84], which can be manipulated and entangled in qudit operations. Other
platforms that qualify for proof-of-principle experiments for AC magnetometry
with qudits are Dysprosium atoms [62] with an electronic spin of $J=8$, or
Holmium [85, 86] and Erbium[87] with large hyperfine splitting of the ground
state.

_Electrometry with Rydberg atoms–_ Highly excited, large orbital angular
momentum Rydberg states display a linear Stark effect. This is related to the
SO(4) symmetry of the hydrogen atom and the conservation of the Runge-Lenz
vector. The states belonging to a given $n$-manifold, where $n$ is the
principal atom number, are degenerate and highly sensitive to electric fields
[44]. The resulting Hamiltonian for coupling of the electric field to Rydberg
states can again be written in the form (1), where the effective angular
momentum of the manifold scales as $J\sim n$ with the principal quantum number
$n$. Ref. [82] outlines a method to entangle the Runge-Lentz vectors of
multiple atoms.

_Photons with orbital angular momentum–_ Another platform that can be used as
a test bed for proof-of-principle multidimensional SU(2) sensors are photons,
where a qudit of tunable dimension can be encoded into the orbital angular
momentum degree of freedom of each photon [19]. State preparation, unitary
phase encoding and measurement can be realized [52]. However, it is a
challenge to create entanglement between different photons.

##  Appendix B Generalization to other prior probability densities

In the main text, we consider a prior probability density (10) of the phase
vector, that is isotropic in $\bm{\phi}$. In many practical applications,
knowledge of the field components $\text{B}_{\nu}$, and hence the phases,
might not be isotropic. Note that 1D and 2D sensing are anisotropic cases of a
3D field, where we have complete knowledge of two and one components of the
field, respectively. Therefore, depending on the degree of anisotropy, the 1D
or 2D solution can be used as a starting point to find optimal solutions for a
given anisotropic prior density. Variational circuits for 1D sensing are
discussed in Ref. [6].

Another assumption we make is that the prior density is centered around zero.
In the presence of a known offset field, this assumption is still valid if we
can apply an additional external field that exactly compensates for the offset
_during_ the interrogation time. However, when this is not possible, the more
general case with a prior density centered around a phase vector
$\bm{\phi}_{0}$ must be treated separately since $\bm{\phi}_{0}\cdot\bm{J}$
and $\bm{\phi}\cdot\bm{J}$ do not commute, which distinguishes 2D and 3D from
1D field sensing. In the 1D case, we can apply a unitary _after_ the
interrogation time to compensate for $\bm{\phi}_{0}$, which is not possible
for 2D and 3D fields because of the non-commutativity. Instead, one can try to
identify alternative entangler and decoder circuits that take the effect of
$\bm{\phi}_{0}$ into account.

Finally, for probability densities that are isotropic and have a single
maximum at the origin, we expect the Gaussian prior solution to be a good
approximation.

##  Appendix C Bayesian Cramér-Rao like bound for multi-dimensional field
sensing

In this appendix, we elaborate on a connection (see Sec. II.3) between the
Fisher information (FI) framework and the Bayesian framework adopted in this
work. We first recall the Cramér-Rao (CR) inequality, which lower bounds the
performance of multi-parameter estimation in the FI approach [9]. Then we
elaborate on the assumptions that underlie the FI approach and introduce the
van Trees inequality, which connects the FI matrix with the BMSE. Finally, we
provide the corresponding bounds on the BMSE for multi-dimensional field
sensing.

Parameter estimation in the FI approach considers estimators
${\bm{\xi}}_{\mu}$ that are locally unbiased around some phase value
${\bm{\phi}}_{0}$ [9]. The corresponding MSE (5), is then lower-bounded by the
CR inequality (bound)

$\displaystyle\mathrm{MSE}(\bm{\phi}_{0})$
$\displaystyle\geq\operatorname{\mathrm{Tr}}[F(\bm{\phi}_{0})^{-1}],$ (30)
$\displaystyle F(\bm{\phi})$
$\displaystyle=\sum_{\mu}\frac{\bm{\nabla}p(\mu|\bm{\phi})\bm{\nabla}^{T}p(\mu|\bm{\phi})}{p(\mu|\bm{\phi})},$
(31)

where $F(\bm{\phi})$ is the (classical) Fisher information matrix of the
conditional probability $p(\mu|\bm{\phi})$ (3), at $\bm{\phi}$. Here,
$\bm{\nabla}=(\partial/\partial_{\phi_{x}},\partial/\partial_{\phi_{y}},\partial/\partial_{\phi_{z}})^{T}$
is the gradient operator that contains partial derivatives with respect to the
components of $\bm{\phi}$.

The FI matrix depends on the input state and the measurement and, therefore,
is upper bounded by the quantum FI (QFI) matrix, $F_{Q}(\bm{\phi})$, which is
obtained by optimizing the MSE for all measurements $\\{M_{\mu}\\}$ allowed by
quantum physics [9]. Note that in the multi-parameter case, the corresponding
quantum CR bound,
$\mathrm{MSE}(\bm{\phi}_{0})\geq\operatorname{\mathrm{Tr}}[F_{Q}(\bm{\phi}_{0})^{-1}]$,
cannot be saturated in general due to the potential incompatibility of optimal
measurements for different parameters encoded by non-commuting Hamiltonians.
The issue of measurement incompatibility is addressed by the Holevo CR bound
[1, 9]. However, in the case of multi-dimensional field sensing, the quantum
CR and the Holevo CR bounds coincide for optimal sensors comprising an even
number of atoms $N$ [20, 21]. This is the case we consider below, and thus the
quantum CR inequality provides a tight bound.

In general, not only the unbiased estimators but also the optimal measurement
projectors depend explicitly on $\bm{\phi}_{0}$ so that an exact value of
$\bm{\phi}_{0}$ must be known in advance to optimally measure around this
value. This drawback can be overcome if the measurement can be repeated many
times for the same unknown parameter vector or if many ensembles are available
to measure the same parameter vector. Under these conditions, an adaptive
protocol can be performed in which a preliminary estimate is first obtained
using which the optimal measurement strategy can be executed [88].

In a Bayesian sense, the preliminary estimate can be understood as prior
knowledge about the phases being measured, which allows for a connection
between the two frameworks in the limiting case of narrow prior density. This
connection is given by the van Trees inequality [89], which defines CR-like
bounds for the Bayesian cost. The multi-parameter generalization [9] lower
bounding the BMSE (6), is given by

$\displaystyle\mathcal{C}\geq\operatorname{\mathrm{Tr}}\left[\left(\overline{F}+\mathcal{I}\right)^{-1}\right],$
(32)

where $\overline{F}=\int d\bm{\phi}\,F(\bm{\phi})\,\mathcal{P}(\bm{\phi})$ is
the FI matrix averaged over the prior density and $\mathcal{I}$ is the FI
matrix of the prior density

$\displaystyle\mathcal{I}=\int
d\bm{\phi}\,\frac{\bm{\nabla}\mathcal{P}(\bm{\phi})\bm{\nabla}^{T}\mathcal{P}(\bm{\phi})}{\mathcal{P}(\bm{\phi})}.$
(33)

The inequality (32) provides us with a Heisenberg-limit-like bound on the
sensitivity of a multi-dimensional field sensor in the Bayesian setting.

In particular, for an $N$-atom quantum sensor with Gaussian prior (10), the
inequality (32) is defined using the following parameters. The FI matrix of
the prior $\mathcal{P}_{\delta}(\bm{\phi})$ reads

$\mathcal{I}=\frac{1}{\delta^{2}}\mathbb{1}_{d},$ (34)

where $\mathbb{1}_{d}$ is the $d$-dimensional identity matrix with $d$ the
$\mathbf{B}$ field dimension. The average FI matrix is upper bounded by the
QFI matrix (for even $N$) [57, 20, 22]

$\overline{F}\leq F_{Q}=\frac{N(N+2)}{d}\mathbb{1}_{d}.$ (35)

Substituting (34) and (35) into the inequality (32), we obtain the Heisenberg-
limit-like bound

$\Delta^{2}_{\rm OQS}\geq\frac{d}{N(N+2)/d+1/\delta^{2}},$ (36)

which defines the black dotted line in Figs. 2 and 7 of the main text.

Finally, the standard quantum limit for the multi-dimensional field sensing is
set by the FI matrix corresponding to the best classical input state

$\overline{F}\leq F_{\rm SQL}=\frac{N}{d}\mathbb{1}_{d}.$ (37)

The corresponding Bayesian SQL bound reads

$\Delta^{2}_{\rm SQL}\geq\frac{d}{N/d+1/\delta^{2}}.$ (38)

The SQL bound is shown with the blue dotted line in Figs. 2 and 7 of the main
text.

##  Appendix D Irreducible Hilbert space of the $SU(2)$ sensor

In this appendix, we provide details on the Hilbert space describing an
$SU(2)$ sensor (see Sec. III.1). A general quantum system of $N$ qubits is
described by a quantum state living in an exponentially large Hilbert space
$\left(\mathbb{C}^{2}\right)^{\otimes N}$. Despite this, the symmetry and
invariance under qubit permutations of the generators $J_{x,y,z}$ reduce the
dimensionality of the effective Hilbert space explored by the sensor to
polynomial in $N$.

More precisely, according to Weyl’s Theorem [90], the full $N$-qubits space
can be decomposed into orthogonal subspaces:

$\left(\mathbb{C}^{2}\right)^{\otimes
N}=\bigoplus_{j=0(\frac{1}{2})}^{N/2}\mathbb{C}^{2j+1}\otimes\mathbb{C}^{\ell_{j}},$
(39)

where $j$ labels the irreducible representations of $SU(2)$ with the lower
limit in the direct sum given by $0$ or $1/2$ for even or odd $N$,
respectively. Each spin-$j$ representation occurs with multiplicity
$\ell_{j}=\binom{N}{N/2-j}\frac{2j+1}{N/2+j+1}$ [91]. Importantly, the number
$\ell_{j}$ of equivalent spin-$j$ representations exceeds the number of spin
degrees of freedom, $\ell_{j}\geq(2j+1)$, for all but the largest spin
representation $j=J\equiv N/2$. Thus, for any pure quantum state, one can
always find a decomposition in terms of equivalent spin-$j$ representations in
which the state populates only $2j+1$ instead of all the $\ell_{j}$
representations associated with each $j$ [38, 37, 58]. Since phases
$\bm{\phi}$ are imprinted through unitaries $U(\bm{\phi})\in SU(2)$ that do
not couple different angular momenta $j$ and their equivalent representations,
we can, without loss of generality, describe each $j$-subspace as a pair of
spin-$j$’s living in the space $\mathbb{C}^{2j+1}\otimes\mathbb{C}^{2j+1}$.
Here, only the first spin of each pair is affected by the $SU(2)$ unitary
$U(\bm{\phi})$.

Summing up all spin-$j$ pairs and the single symmetric subspace ($j=J$), we
obtain the irreducible Hilbert space of an $SU(2)$ sensor.

$\mathcal{H}_{\rm
OQS}\equiv\mathbb{C}^{2J+1}\oplus\bigoplus_{j=0(\frac{1}{2})}^{J-1}\mathbb{C}^{2j+1}\otimes\mathbb{C}^{2j+1}.$
(40)

The dimension of the space scales only as the _cube_ of the system size
$N$,i.e.,
$d_{N}=(N+1)+\sum_{j=0(\frac{1}{2})}^{N/2-1}(2j+1)^{2}=1+N(N^{2}+5)/6.$ The
polynomial growth of the size of the irreducible Hilbert space is crucial for
the efficient minimization of the metrological cost function (6) with the
numerical approach presented in the main text (see Sec. III.1) and detailed in
Appendix E.

##  Appendix E Cost minimization as a multi-convex problem

In this appendix, we discuss the multi-convexity of the sensor optimization
problem and present a corresponding efficient algorithm for solving Bayesian
sensing problems (see Sec. III.1). We start by recasting the cost (6) in a
form that highlights its multi-convexity and which is suitable for numerical
optimization. To this end, it is convenient to define linear maps:

$\displaystyle\Lambda_{0}\left[\bullet\right]=$ $\displaystyle\int
d\bm{\phi}\,U(\bm{\phi})\bullet
U(\bm{\phi})^{\dagger}\operatorname{\mathcal{P}(\bm{\phi})},$ (41)
$\displaystyle\bm{\varLambda}_{1}\left[\bullet\right]=$ $\displaystyle\int
d\bm{\phi}\,\bm{\phi}\,U(\bm{\phi})\bullet
U(\bm{\phi})^{\dagger}\operatorname{\mathcal{P}(\bm{\phi})},$ (42)

where the unitary $U(\bm{\phi})=\exp\left[-i\bm{\phi}\cdot\bm{J}\right]$
imprints phases $\bm{\phi}$. In terms of these maps, Eq. (6) can be expressed
as

$\displaystyle\mathcal{C}=\mathrm{var}(\bm{\phi})-\sum_{\mu}\Big{(}$
$\displaystyle
2\,\bm{\xi}_{\mu}^{T}\cdot\operatorname{\mathrm{Tr}}\big{\\{}M_{\mu}\bm{\varLambda}_{1}\left[\rho_{\rm
in}\right]\big{\\}}$
$\displaystyle-\bm{\xi}_{\mu}^{T}\cdot\bm{\xi}_{\mu}\operatorname{\mathrm{Tr}}\big{\\{}M_{\mu}\Lambda_{0}\left[\rho_{\rm
in}\right]\big{\\}}\Big{)},$ (43)

where $\mathrm{var}(\bm{\phi})=\int
d\bm{\phi}\,\bm{\phi}^{T}\bm{\phi}\,\mathcal{P}(\bm{\phi})$ is the prior phase
variance and $\rho_{\rm in}=\ket{\operatorname{\psi_{\rm
in}}}\bra{\operatorname{\psi_{\rm in}}}$.

Equation (43) shows that the minimization of the metrological cost function is
a convex optimization problem with respect to each of the three sets of
variables ($\ket{\psi_{{\rm in}}}$, $\\{M_{\mu}\\}$, and
$\\{\bm{\xi}_{\mu}\\}$) if the other two are kept fixed. More precisely:

(i) For fixed $\ket{\psi_{{\rm in}}}$ and $\\{M_{\mu}\\}$ we have a quadratic
minimization problem for estimators $\\{\bm{\xi}_{\mu}\\}$. The optimal
solution is explicitly expressed as the minimum MSE estimator (8),
corresponding to the average value of the phases with respect to the posterior
probability density $p(\bm{\phi}|\mu)$.

(ii) For fixed $\ket{\psi_{{\rm in}}}$ and $\\{\bm{\xi}_{\mu}\\}$, the cost
(43) is linear with respect to the measurement operators $\\{M_{\mu}\\}$,
which are positive semidefinite ($M_{\mu}\succeq 0$) and subjected to the POVM
condition $\sum_{\mu}\,M_{\mu}=\openone$. Thus, the cost minimization with
fixed state and estimators can be recast as a semidefinite program (SDP). This
is an optimization problem that can be efficiently implemented with
polynomial-time solvers provided the size of the problem is polynomial, as is
the case here.

(iii) For fixed $\\{M_{\mu}\\}$ and $\\{\bm{\xi}_{\mu}\\}$, the optimization
problem is quadratic with respect to the quantum state. This can be seen by
writing the cost (43) as

$\mathcal{C}=\braket{\psi_{{\rm in}}}{\Upsilon}{\psi_{{\rm in}}},$

where the Hermitian operator $\Upsilon$ reads

$\Upsilon=\mathrm{var}(\bm{\phi})-\sum_{\mu}\Big{(}2\,\bm{\xi}_{\mu}^{T}\cdot\bm{\varLambda}_{1}^{\\#}\left[M_{\mu}\right]-\bm{\xi}_{\mu}^{T}\cdot\bm{\xi}_{\mu}\,\Lambda_{0}^{\\#}\left[M_{\mu}\right]\Big{)},$

where $\Lambda_{0}^{\\#}$ and $\bm{\varLambda}_{1}^{\\#}$ are linear maps
adjoint to Eqs. (41) and (42), respectively. Thus, the optimum state
$\ket{\psi_{{\rm in}}^{*}}$ is given by an eigenstate of $\Upsilon$
corresponding to the lowest eigenvalue.

The multi-convexity of the cost (43) with respect to the three sets of
parameters, (i)–(iii), makes the problem of finding the optimal multi-
parameter quantum sensor approachable with numerical algorithms. Even though
multi-convex problems are in general hard to solve globally, local methods
based on block coordinate descent work well and are widely used in practice
[92]. For example, in the case of single parameter metrology, optimization of
the cost (43) becomes a biconvex problem (points (i) and (ii) are combined
into a single quadratic optimization of projective measurements), leading to a
fast and reliable convergence to a unique solution [5].

In the general case, the optimization procedure can be summarized as follows:
the minimization problem is initialized with a random input state,
measurement, and estimators. After that, we iteratively solve subproblems
(i)-(iii) until reaching convergence to the optimal sensor solution with
$\ket{\psi_{\rm in}^{\star}}$, $\\{M^{\star}_{\mu}\\}$, and
$\\{\bm{\xi}_{\mu}^{\star}\\}$ minimizing the cost (43) 666We note that due to
the resulting low rank of the optimal measurement operators
$\\{M^{\star}_{q}\\}$, it is beneficial to use the nonlinear programming with
augmented Lagrangian algorithm [96] for solving the SDP in subproblem (ii)..
This algorithm combined with a covariant ansatz for input states and
measurements (see Appendix F) is used to obtain the OQS results presented in
the main text.

##  Appendix F Covariant states and POVMs for 2p-QS

Here, we present covariant [1, 9] states and measurements for 2D field
sensing, $\mathbf{B}=\\{\text{B}_{x},\text{B}_{y}\\}$, with the 2p-QS (see
Sec. III.1). This not only illustrates the central ideas, which can be
generalized to the case of the OQS including 3D field sensing, but it also
enables us to efficiently determine the 2p-QS performance limit for large
system sizes, as shown in Fig. 6.

Using the method of Appendix E for the case of 2D fields with a priori unknown
field direction (i.e. $\mathcal{P}(\bm{\phi})=\mathcal{P}(|\bm{\phi}|)$), we
obtain the following optimal input state minimizing the cost (43) for the
2p-QS:

$\ket{\psi_{\rm in}^{({\text{2p}})}}=\bigoplus_{j=0}^{J}\alpha_{j}\ket{j,0}.$
(44)

The state (44) features a direct sum of the eigenstates of $J_{z}$ with
eigenvalue zero (we consider even $N$) of all $j$-representations, with
corresponding amplitudes $\alpha_{j}$. Consequently, the state is invariant
under rotations around the $z$-axis. The numerical solution for the isotropic
prior density suggests that the combination of the input state (44) and the
corresponding optimal measurements results in an MSE (5) that is also
invariant under $z$-rotations. We can impose the rotational symmetry by using
measurements parametrized as

$M_{q\bar{\varphi}}=e^{-i\bar{\varphi}J_{z}}M_{q}e^{i\bar{\varphi}J_{z}},$
(45)

such that all POVM operators are determined by seed operators $M_{q}$. The
corresponding rotationally invariant estimators read
$\bm{\xi}_{q\bar{\varphi}}=\\{r_{q}\cos\bar{\varphi},r_{q}\sin\bar{\varphi}\\}$.
Here, $r_{q}$ and $\bar{\varphi}$ are polar coordinates of the phase estimates
which correspond to the field strength and direction, respectively. The
estimators of the optimal 2p-QS are illustrated as concentric rings in Figs. 3
and 4 of the main text.

Using the ansatz (44) for the input state and for the measurements (45), and
the corresponding estimators and $\varphi$-invariant prior [$\mathcal{P}(r)$
in polar coordinates], the cost (43) can be expressed as

$\mathcal{C}=\mathrm{var}(r)-\sum_{q}\left(2r_{q}\mathrm{Tr}\left\\{M_{q}\varrho_{1}\right\\}-r_{q}^{2}\mathrm{Tr}\left\\{M_{q}\varrho_{0}\right\\}\right),$
(46)

where $\mathrm{var}(r)=2\pi\int r^{3}dr\,\mathcal{P}(r)$ is the prior variance
and

$\displaystyle\varrho_{0}$ $\displaystyle=\int
rdr\,\mathcal{P}(r)\frac{d\varphi}{2\pi}e^{-i\varphi
J_{z}}\ket{\psi_{r}}\bra{\psi_{r}}e^{i\varphi J_{z}},$
$\displaystyle\varrho_{1}$ $\displaystyle=\int
r^{2}dr\,\mathcal{P}(r)\frac{d\varphi}{2\pi}\cos\varphi\,e^{-i\varphi
J_{z}}\ket{\psi_{r}}\bra{\psi_{r}}e^{i\varphi J_{z}}.$

Here, we define the state $\ket{\psi_{r}}\equiv e^{-irJ_{x}}\ket{\psi_{{\rm
in}}}$.

The cost (46) is linear in $\\{M_{q}\\}$ which are semidefinite operators,
$M_{q}\succeq 0$, with a modified POVM condition
$\sum_{q}\int\frac{d\varphi}{2\pi}e^{-i\varphi J_{z}}M_{q}e^{i\varphi
J_{z}}=\openone$. Thus, as discussed in Appendix E, minimization of (46) for a
fixed state $\ket{\operatorname{\psi_{\rm in}}}$ and estimators $\\{r_{q}\\}$
is an SDP program.

As a result, the problem of estimation of two parameters
$\\{\phi_{x},\phi_{y}\\}$ with non-commuting generators $J_{x}$, $J_{y}$ has
been decoupled into two separate problems of estimation of the field strength
$r$ with generator $J_{x}$, and the field direction $\varphi$ with generator
$J_{z}$. The latter is explicitly solved by the corresponding covariant POVM
(45) and the former single-parameter problem is amenable to the numerical
method of Appendix E. Note that the resulting single-parameter problem of
estimating $r$ requires optimization over POVMs. This makes it qualitatively
different from single-parameter metrology problems which, in general, are
solved with projective measurements [9].

The remarkable simplification of the original two-parameter problem to a
single-parameter estimation task allows us to efficiently obtain the optimal
2-partite 2D field sensor. In particular, the optimal solution comprises at
most $N/2+1$ measurement seed operators $M_{q}$ of rank $1$. A generalization
of the covariant ansatz approach to obtain the OQS for 2D and 3D field sensing
will be presented in [61].

##  Appendix G Hilbert space of 1p-QS and 2p-QS

Here, we identify two important subspaces occupied by the OQS in different
regimes, which correspond to the Hilbert spaces of the 1p-QS and 2p-QS
introduced in the main text (see Sec. IV). First, we find that in the limit of
small prior widths, $\delta\lesssim 1/N$, the OQS for 2D and 3D fields
occupies only the maximum spin representation ($J=N/2$) in $\mathcal{H}_{\rm
OQS}$ (40). The permutation symmetric subspace describes the 1p-QS, such that

$\mathcal{H}_{\text{1p}}\equiv\mathbb{C}^{2J+1}.$ (47)

In the case of 2D field sensing at arbitrary prior widths, we observe that the
OQS does not utilize the full $\mathcal{H}_{\rm OQS}$, (40), as the optimal
input state consists of weakly entangled pairs of spins in each of the
$j$-subspaces. Thus, the effective Hilbert space of the 2D field OQS can be
very well approximated by the 2p-QS which contains $j$-representations with
multiplicity 1:

$\displaystyle\mathcal{H}_{\text{2p}}\equiv\mathbb{C}^{J+1}\otimes\mathbb{C}^{J+1}=\bigoplus_{j=0(\frac{1}{2})}^{J}\mathbb{C}^{2j+1}.$
(48)

It follows from the discussion in Ref. [22] that in the limit of a large
number of atoms, $N\to\infty$, the 2p-QS saturates the fundamental bound on 2D
field sensing and, thus, converges to the OQS. We will discuss this
convergence in more detail in Ref. [61].

In contrast, the OQS for 3D fields makes use of the full $\mathcal{H}_{\rm
OQS}$ (40), by employing strongly entangled pairs of spins in the
$j$-subspaces for the optimal input state. Hence, in general, it cannot be
efficiently represented by a sensor comprising a small and predefined number
of partitions. The optimal partitioning of the 3D field sensor should depend
on the sensor size $N$ and represents an interesting topic for further study.

##  Appendix H Optimization of sensors with limited entangling capabilities

In Sec. IV, we discuss the performance of sensors with limited entangling
capabilities, which live in
$\mathcal{H}_{\mathrm{1p}},\mathcal{H}_{\mathrm{2p}}$ and are restricted to
operate with projective measurements. Here, we describe how the optimization
of these sensors is carried out.

To constrain the optimization to projective measurements, we express the
measurement projectors $\Pi_{m}$ and $\Pi_{m^{A},m^{B}}$ according to Eqs.
(15) and (18) for the 1p-QS and 2p-QS. We further parametrize the decoding
unitary as
$\mathcal{U}_{\mathrm{de}}^{\mathrm{1p}}=e^{-iH^{\mathrm{1p}}_{\mathrm{de}}}$
($\mathcal{U}_{\mathrm{de}}^{\mathrm{2p}}=e^{-iH^{\mathrm{2p}}_{\mathrm{de}}}$),
where $H^{\mathrm{1p}}_{\mathrm{de}}$ ($H^{\mathrm{2p}}_{\mathrm{de}}$) is a
Hermitian matrix. Finally, the iterative procedure discussed in Appendix E is
performed, with the key difference that the optimization over the POVM set
$\\{M_{\mu}\\}$ is replaced with optimization over the set of Hermitian
matrices $\\{H^{\mathrm{1p}}_{\mathrm{de}}\\}$
[$\\{H^{\mathrm{2p}}_{\mathrm{de}}\\}$].

Unlike the case of general POVMs, the optimization problem is not convex with
respect to the Hermitian matrix that parameterizes the projective
measurements. Typically, the optimization is performed starting from several
random initial conditions, iteratively converging to a local minimum for each
starting point and then selecting the global minimum from the converged
solutions. The “brute-force” optimization over the elements of the Hermitian
matrix restricts the use of this approach to small systems. However, the
results from this approach provide a saturable lower limit to the performance
of variational quantum circuits, which are also restricted to projective
measurements.

##  Appendix I Variational optimization

In Secs. V and VI, we present results that are obtained by optimizing
variational quantum circuits where the unitaries $\mathcal{U}_{\rm en(de)}$
are parameterized by the parameter vectors $\bm{\theta}$ and $\bm{\vartheta}$.
The gates considered in this work are all periodic; nonetheless, the parameter
space grows exponentially in the number of parameters, that is, convergence to
the global minimum (20) of the cost function cannot be guaranteed if the depth
of the circuit grows.

The results in this work were obtained using gradient-descent optimization
based on exact gradient calculations. To approach the global minimum, we
optimized starting from a number of initial conditions and kept the best
result. In a first step, we sampled random initial parameters and later
refined the variational solution by choosing parameters that were optimal for
other settings of the sensor as starting points. This involved starting with
optimal parameters for different $N$ and/or $\delta$, adding layers to shorter
circuits, and removing closest-to-identity layers from longer circuits.

## References

  * Holevo [1982] A. Holevo,  _Probabilistic and Statistical Aspects of Quantum Theory_ , North-Holland series in statistics and probability (North-Holland Publishing Company, 1982).
  * Demkowicz-Dobrzański  _et al._ [2015] R. Demkowicz-Dobrzański, M. Jarzyna, and J. Kołodyński,  _Quantum Limits in Optical Interferometry_, Progress in Optics, Vol. 60 (Elsevier, 2015) pp. 345 – 435\.
  * Degen  _et al._ [2017] C. L. Degen, F. Reinhard, and P. Cappellaro, Quantum sensing, Rev. Mod. Phys. 89, 035002 (2017).
  * Pezzè  _et al._ [2018] L. Pezzè, A. Smerzi, M. K. Oberthaler, R. Schmied, and P. Treutlein, Quantum metrology with nonclassical states of atomic ensembles, Rev. Mod. Phys. 90, 035005 (2018).
  * Macieszczak  _et al._ [2014] K. Macieszczak, M. Fraas, and R. Demkowicz-Dobrzański, Bayesian quantum frequency estimation in presence of collective dephasing, New Journal of Physics 16, 113002 (2014).
  * Kaubruegger  _et al._ [2021] R. Kaubruegger, D. V. Vasilyev, M. Schulte, K. Hammerer, and P. Zoller, Quantum variational optimization of ramsey interferometry and atomic clocks, Phys. Rev. X 11, 041045 (2021).
  * Marciniak  _et al._ [2022] C. D. Marciniak, T. Feldker, I. Pogorelov, R. Kaubruegger, D. V. Vasilyev, R. van Bijnen, P. Schindler, P. Zoller, R. Blatt, and T. Monz, Optimal metrology with programmable quantum sensors, Nature 603, 604 (2022).
  * Gessner  _et al._ [2018] M. Gessner, L. Pezzè, and A. Smerzi, Sensitivity bounds for multiparameter quantum metrology, Phys. Rev. Lett. 121, 130503 (2018).
  * Demkowicz-Dobrzański  _et al._ [2020] R. Demkowicz-Dobrzański, W. Górecki, and M. Guţă, Multi-parameter estimation beyond quantum Fisher information, Journal of Physics A: Mathematical and Theoretical 53, 363001 (2020).
  * Liu  _et al._ [2019] J. Liu, H. Yuan, X.-M. Lu, and X. Wang, Quantum fisher information matrix and multiparameter estimation, Journal of Physics A: Mathematical and Theoretical 53, 023001 (2019).
  * Sidhu and Kok [2020] J. S. Sidhu and P. Kok, Geometric perspective on quantum parameter estimation, AVS Quantum Science 2, 014701 (2020), https://doi.org/10.1116/1.5119961 .
  * Sidhu  _et al._ [2021] J. S. Sidhu, Y. Ouyang, E. T. Campbell, and P. Kok, Tight bounds on the simultaneous estimation of incompatible parameters, Phys. Rev. X 11, 011028 (2021).
  * Humphreys  _et al._ [2013] P. C. Humphreys, M. Barbieri, A. Datta, and I. A. Walmsley, Quantum enhanced multiple phase estimation, Phys. Rev. Lett. 111, 070403 (2013).
  * Gessner  _et al._ [2020] M. Gessner, A. Smerzi, and L. Pezzè, Multiparameter squeezing for optimal quantum enhancements in sensor networks, Nature Communications 11, 3817 (2020).
  * Huang  _et al._ [2021] Z. Huang, C. Lupo, and P. Kok, Quantum-limited estimation of range and velocity, PRX Quantum 2, 030303 (2021).
  * Belliardo  _et al._ [2022] F. Belliardo, V. Cimini, E. Polino, F. Hoch, B. Piccirillo, N. Spagnolo, V. Giovannetti, and F. Sciarrino, Optimizing quantum-enhanced Bayesian multiparameter estimation in noisy apparata, arXiv 10.48550/ARXIV.2211.04747 (2022).
  * Baamara  _et al._ [2022] Y. Baamara, M. Gessner, and A. Sinatra, Quantum-enhanced multiparameter estimation and compressed sensing of a field, arXiv 10.48550/ARXIV.2208.00640 (2022).
  * Conlon  _et al._ [2023] L. O. Conlon, T. Vogl, C. D. Marciniak, I. Pogorelov, S. K. Yung, F. Eilenberger, D. W. Berry, F. S. Santana, R. Blatt, T. Monz, P. K. Lam, and S. M. Assad, Approaching optimal entangling collective measurements on quantum computing platforms, Nature Physics 10.1038/s41567-022-01875-7 (2023).
  * Eriksson  _et al._ [2023] M. Eriksson, A. Z. Goldberg, M. Hiekkamäki, F. Bouchard, G. Leuchs, R. Fickler, and L. L. Sanchez-Soto, Sensing rotations with multiplane light conversion, arXiv 10.48550/ARXIV.2301.10265 (2023).
  * Vaneph  _et al._ [2013] C. Vaneph, T. Tufarelli, and M. G. Genoni, Quantum estimation of a two-phase spin rotation, Quantum Measurements and Quantum Metrology 1, 12 (2013).
  * Baumgratz and Datta [2016] T. Baumgratz and A. Datta, Quantum Enhanced Estimation of a Multidimensional Field, Physical Review Letters 116, 030801 (2016).
  * Górecki and Demkowicz-Dobrzański [2022] W. Górecki and R. Demkowicz-Dobrzański, Multiparameter quantum metrology in the Heisenberg limit regime: Many-repetition scenario versus full optimization, Physical Review A 106, 012424 (2022).
  * Budker and Romalis [2007] D. Budker and M. Romalis, Optical magnetometry, Nature Physics 3, 227 (2007).
  * Budker and Kimball [2013] D. Budker and D. F. J. Kimball, eds.,  _Optical Magnetometry_ (Cambridge University Press, 2013).
  * Le Sage  _et al._ [2013] D. Le Sage, K. Arai, D. R. Glenn, S. J. DeVience, L. M. Pham, L. Rahn-Lee, M. D. Lukin, A. Yacoby, A. Komeili, and R. L. Walsworth, Optical magnetic imaging of living cells, Nature 496, 486 (2013).
  * Behbood  _et al._ [2013] N. Behbood, F. Martin Ciurana, G. Colangelo, M. Napolitano, M. W. Mitchell, and R. J. Sewell, Real-time vector field tracking with a cold-atom magnetometer, Applied Physics Letters 102, 173504 (2013), https://doi.org/10.1063/1.4803684 .
  * Lee  _et al._ [2015] S.-Y. Lee, M. Niethammer, and J. Wrachtrup, Vector magnetometry based on $s=\frac{3}{2}$ electronic spins, Phys. Rev. B 92, 115201 (2015).
  * Thiele  _et al._ [2018] T. Thiele, Y. Lin, M. O. Brown, and C. A. Regal, Self-calibrating vector atomic magnetometry through microwave polarization reconstruction, Phys. Rev. Lett. 121, 153202 (2018).
  * Zheng  _et al._ [2020] H. Zheng, Z. Sun, G. Chatzidrosos, C. Zhang, K. Nakamura, H. Sumiya, T. Ohshima, J. Isoya, J. Wrachtrup, A. Wickenbrock, and D. Budker, Microwave-free vector magnetometry with nitrogen-vacancy centers along a single axis in diamond, Phys. Rev. Appl. 13, 044023 (2020).
  * Wang  _et al._ [2021] G. Wang, Y.-X. Liu, Y. Zhu, and P. Cappellaro, Nanoscale vector ac magnetometry with a single nitrogen-vacancy center in diamond, Nano Letters 21, 5143 (2021), pMID: 34086471\.
  * Fan  _et al._ [2015] H. Fan, S. Kumar, J. Sedlacek, H. Kübler, S. Karimkashi, and J. P. Shaffer, Atom based rf electric field sensing, Journal of Physics B: Atomic, Molecular and Optical Physics 48, 202001 (2015).
  * Brownnutt  _et al._ [2015] M. Brownnutt, M. Kumph, P. Rabl, and R. Blatt, Ion-trap measurements of electric-field noise near surfaces, Rev. Mod. Phys. 87, 1419 (2015).
  * Sedlacek  _et al._ [2013] J. A. Sedlacek, A. Schwettmann, H. Kübler, and J. P. Shaffer, Atom-based vector microwave electrometry using rubidium Rydberg atoms in a vapor cell, Phys. Rev. Lett. 111, 063001 (2013).
  * Albarelli  _et al._ [2019] F. Albarelli, J. F. Friel, and A. Datta, Evaluating the Holevo Cramér-Rao Bound for Multiparameter Quantum Metrology, Physical Review Letters 123, 200503 (2019).
  * Tsang  _et al._ [2011] M. Tsang, H. M. Wiseman, and C. M. Caves, Fundamental quantum limit to waveform estimation, Phys. Rev. Lett. 106, 090401 (2011).
  * Bagan  _et al._ [2001] E. Bagan, M. Baig, A. Brey, R. Muñoz-Tapia, and R. Tarrach, Optimal encoding and decoding of a spin direction, Phys. Rev. A 63, 052309 (2001).
  * Chiribella  _et al._ [2004a] G. Chiribella, G. M. D’Ariano, P. Perinotti, and M. F. Sacchi, Efficient Use of Quantum Resources for the Transmission of a Reference Frame, Physical Review Letters 93, 180503 (2004a).
  * Bagan  _et al._ [2004] E. Bagan, M. Baig, and R. Muñoz-Tapia, Quantum reverse engineering and reference-frame alignment without nonlocal correlations, Phys. Rev. A 70, 030301(R) (2004).
  * Kahn [2007] J. Kahn, Fast rate estimation of a unitary operation in SU(d), Physical Review A 75, 022326 (2007).
  * Wasilewski  _et al._ [2010] W. Wasilewski, K. Jensen, H. Krauter, J. J. Renema, M. V. Balabas, and E. S. Polzik, Quantum noise limited and entanglement-assisted magnetometry, Phys. Rev. Lett. 104, 133601 (2010).
  * Sewell  _et al._ [2012] R. J. Sewell, M. Koschorreck, M. Napolitano, B. Dubost, N. Behbood, and M. W. Mitchell, Magnetic sensitivity beyond the projection noise limit by spin squeezing, Phys. Rev. Lett. 109, 253605 (2012).
  * Ockeloen  _et al._ [2013] C. F. Ockeloen, R. Schmied, M. F. Riedel, and P. Treutlein, Quantum metrology with a scanning probe atom interferometer, Phys. Rev. Lett. 111, 143001 (2013).
  * Arias  _et al._ [2019] A. Arias, G. Lochead, T. M. Wintermantel, S. Helmrich, and S. Whitlock, Realization of a Rydberg-dressed Ramsey interferometer and electrometer, Phys. Rev. Lett. 122, 053601 (2019).
  * Facon  _et al._ [2016] A. Facon, E.-K. Dietsche, D. Grosso, S. Haroche, J.-M. Raimond, M. Brune, and S. Gleyzes, A sensitive electrometer based on a Rydberg atom in a Schrödinger-cat state, Nature 535, 262 (2016).
  * Omran  _et al._ [2019] A. Omran, H. Levine, A. Keesling, G. Semeghini, T. T. Wang, S. Ebadi, H. Bernien, A. S. Zibrov, H. Pichler, S. Choi, J. Cui, M. Rossignolo, P. Rembold, S. Montangero, T. Calarco, M. Endres, M. Greiner, V. Vuletić, and M. D. Lukin, Generation and manipulation of Schrödinger cat states in Rydberg atom arrays, Science 365, 570 (2019), https://www.science.org/doi/pdf/10.1126/science.aax9743 .
  * Robinson  _et al._ [2022] J. M. Robinson, M. Miklos, Y. M. Tso, C. J. Kennedy, T. Bothwell, D. Kedar, J. K. Thompson, and J. Ye, Direct comparison of two spin squeezed optical clocks below the quantum projection noise limit, arXiv 10.48550/ARXIV.2211.08621 (2022).
  * Carr  _et al._ [2009] L. D. Carr, D. DeMille, R. V. Krems, and J. Ye, Cold and ultracold molecules: science, technology and applications, New Journal of Physics 11, 055049 (2009).
  * Anderegg  _et al._ [2019] L. Anderegg, L. W. Cheuk, Y. Bao, S. Burchesky, W. Ketterle, K.-K. Ni, and J. M. Doyle, An optical tweezer array of ultracold molecules, Science 365, 1156 (2019), https://www.science.org/doi/pdf/10.1126/science.aax1265 .
  * Bermudez  _et al._ [2011] A. Bermudez, F. Jelezko, M. B. Plenio, and A. Retzker, Electron-mediated nuclear-spin interactions between distant nitrogen-vacancy centers, Phys. Rev. Lett. 107, 150503 (2011).
  * Yao  _et al._ [2012] N. Y. Yao, L. Jiang, A. V. Gorshkov, P. C. Maurer, G. Giedke, J. I. Cirac, and M. D. Lukin, Scalable architecture for a room temperature solid-state quantum information processor, Nature Communications 3, 800 (2012).
  * Bouchard  _et al._ [2017] F. Bouchard, P. de la Hoz, G. Björk, R. W. Boyd, M. Grassl, Z. Hradil, E. Karimi, A. B. Klimov, G. Leuchs, J. Řeháček, and L. L. Sánchez-Soto, Quantum metrology at the limit with extremal majorana constellations, Optica 4, 1429 (2017).
  * Brandt  _et al._ [2020] F. Brandt, M. Hiekkamäki, F. Bouchard, M. Huber, and R. Fickler, High-dimensional quantum gates using full-field spatial modes of photons, Optica 7, 98 (2020).
  * Kitagawa and Ueda [1993] M. Kitagawa and M. Ueda, Squeezed spin states, Phys. Rev. A 47, 5138 (1993).
  * Cerezo  _et al._ [2021] M. Cerezo, A. Arrasmith, R. Babbush, S. C. Benjamin, S. Endo, K. Fujii, J. R. McClean, K. Mitarai, X. Yuan, L. Cincio, and P. J. Coles, Variational quantum algorithms, Nature Reviews Physics 3, 625 (2021).
  * Note [1] We refer to an interferometer with a unitary phase encoding that belongs to the group of SU(2) as an SU(2) interferometer.
  * Yang  _et al._ [2022] D. Yang, S. F. Huelga, and M. B. Plenio, Efficient information retrieval for sensing via continuous measurement, arXiv 10.48550/ARXIV.2209.08777 (2022).
  * Kolenderski and Demkowicz-Dobrzanski [2008] P. Kolenderski and R. Demkowicz-Dobrzanski, Optimal state for keeping reference frames aligned and the platonic solids, Phys. Rev. A 78, 052333 (2008).
  * Chiribella  _et al._ [2004b] G. Chiribella, G. M. D’Ariano, P. Perinotti, and M. F. Sacchi, Covariant quantum measurements that maximize the likelihood, Phys. Rev. A 70, 062105 (2004b).
  * Note [2] Convexity of optimization problem guarantees that every local minimum is a global minimum.
  * Note [3] The upper bound on the POVM complexity for $d_{N}\sim N^{3}$ dimensional Hilbert space is given by a POVM comprising $d_{N}^{2}\sim N^{6}$ measurement operators of full rank. We find the OQS solution to be significantly simpler than the upper bound.
  * Vasilyev et al. [shed] D. V. Vasilyev et al., Optimal multi-parameter quantum metrology: Vector field sensing (unpublished).
  * Chalopin  _et al._ [2018] T. Chalopin, C. Bouazza, A. Evrard, V. Makhalov, D. Dreon, J. Dalibard, L. A. Sidorenkov, and S. Nascimbene, Quantum-enhanced sensing using non-classical spin states of a highly magnetic atom, Nature Communications 9, 4955 (2018).
  * Note [4] Results for small atom numbers are relevant for field sensing in scenarios where only few atoms can be used for the sensing task, e.g., in order to maintain a good spatial resolution.
  * Dowling  _et al._ [1994] J. P. Dowling, G. S. Agarwal, and W. P. Schleich, Wigner distribution of a general angular-momentum state: Applications to a collection of two-level atoms, Phys. Rev. A 49, 4101 (1994).
  * Bollinger  _et al._ [1996] J. J. Bollinger, W. M. Itano, D. J. Wineland, and D. J. Heinzen, Optimal frequency measurements with maximally correlated states, Phys. Rev. A 54, R4649 (1996).
  * Leibfried  _et al._ [2005] D. Leibfried, E. Knill, S. Seidelin, J. Britton, R. B. Blakestad, J. Chiaverini, D. B. Hume, W. M. Itano, J. D. Jost, C. Langer, R. Ozeri, R. Reichle, and D. J. Wineland, Creation of a six-atom ‘Schrödinger cat’ state, Nature 438, 639 (2005).
  * Monz  _et al._ [2011] T. Monz, P. Schindler, J. T. Barreiro, M. Chwalla, D. Nigg, W. A. Coish, M. Harlander, W. Hänsel, M. Hennrich, and R. Blatt, 14-qubit entanglement: Creation and coherence, Phys. Rev. Lett. 106, 130506 (2011).
  * Leroux  _et al._ [2010] I. D. Leroux, M. H. Schleier-Smith, and V. Vuletić, Implementation of cavity squeezing of a collective atomic spin, Phys. Rev. Lett. 104, 073602 (2010).
  * Riedel  _et al._ [2010] M. F. Riedel, P. Böhi, Y. Li, T. W. Hänsch, A. Sinatra, and P. Treutlein, Atom-chip-based generation of entanglement for quantum metrology, Nature 464, 1170 (2010).
  * Gross  _et al._ [2010] C. Gross, T. Zibold, E. Nicklas, J. Estève, and M. K. Oberthaler, Nonlinear atom interferometer surpasses classical precision limit, Nature 464, 1165 (2010).
  * Note [5] Note that extensions of this gate set, i.e. allowing for twisting around arbitrary axes [94, 95] can lead to more efficient parameterization in terms of the number of gates required to achieve a certain performance.
  * Zimba [2006] J. Zimba, Anticoherent spin states via the majorana representation, EJTP 3, 143 (2006).
  * Giraud  _et al._ [2010] O. Giraud, P. Braun, and D. Braun, Quantifying quantumness and the quest for queens of quantum, New Journal of Physics 12, 063005 (2010).
  * Björk  _et al._ [2015] G. Björk, A. B. Klimov, P. de la Hoz, M. Grassl, G. Leuchs, and L. L. Sánchez-Soto, Extremal quantum states and their majorana constellations, Phys. Rev. A 92, 031801(R) (2015).
  * Young  _et al._ [2020] A. W. Young, W. J. Eckner, W. R. Milner, D. Kedar, M. A. Norcia, E. Oelker, N. Schine, J. Ye, and A. M. Kaufman, Half-minute-scale atomic coherence and high relative stability in a tweezer clock, Nature 588, 408 (2020).
  * Graham  _et al._ [2019] T. M. Graham, M. Kwon, B. Grinkemeyer, Z. Marra, X. Jiang, M. T. Lichtman, Y. Sun, M. Ebert, and M. Saffman, Rydberg-mediated entanglement in a two-dimensional neutral atom qubit array, Phys. Rev. Lett. 123, 230501 (2019).
  * Madjarov  _et al._ [2020] I. S. Madjarov, J. P. Covey, A. L. Shaw, J. Choi, A. Kale, A. Cooper, H. Pichler, V. Schkolnik, J. R. Williams, and M. Endres, High-fidelity entanglement and detection of alkaline-earth rydberg atoms, Nature Physics 16, 857 (2020).
  * Schine  _et al._ [2022] N. Schine, A. W. Young, W. J. Eckner, M. J. Martin, and A. M. Kaufman, Long-lived bell states in an array of optical clock qubits, Nature Physics 18, 1067 (2022).
  * Kaubruegger  _et al._ [2019] R. Kaubruegger, P. Silvi, C. Kokail, R. van Bijnen, A. M. Rey, J. Ye, A. M. Kaufman, and P. Zoller, Variational spin-squeezing algorithms on programmable quantum sensors, Phys. Rev. Lett. 123, 260505 (2019).
  * Koczor  _et al._ [2020] B. Koczor, S. Endo, T. Jones, Y. Matsuzaki, and S. C. Benjamin, Variational-state quantum metrology, New Journal of Physics 22, 083038 (2020).
  * Zheng  _et al._ [2022] T.-X. Zheng, A. Li, J. Rosen, S. Zhou, M. Koppenhöfer, Z. Ma, F. T. Chong, A. A. Clerk, L. Jiang, and P. C. Maurer, Preparation of metrological states in dipolar-interacting spin systems, npj Quantum Information 8, 150 (2022).
  * Kruckenhauser  _et al._ [2022] A. Kruckenhauser, R. van Bijnen, T. V. Zache, M. D. Liberto, and P. Zoller, High-dimensional so(4)-symmetric rydberg manifolds for quantum simulation, Quantum Science and Technology 8, 015020 (2022).
  * Gilmore  _et al._ [2021] K. A. Gilmore, M. Affolter, R. J. Lewis-Swan, D. Barberena, E. Jordan, A. M. Rey, and J. J. Bollinger, Quantum-enhanced sensing of displacements and electric fields with two-dimensional trapped-ion crystals, Science 373, 673 (2021), https://www.science.org/doi/pdf/10.1126/science.abi5226 .
  * Ringbauer  _et al._ [2022] M. Ringbauer, M. Meth, L. Postler, R. Stricker, R. Blatt, P. Schindler, and T. Monz, A universal qudit quantum processor with trapped ions, Nature Physics 18, 1053 (2022).
  * Saffman and Mølmer [2008] M. Saffman and K. Mølmer, Scaling the neutral-atom rydberg gate quantum computer by collective encoding in holmium atoms, Phys. Rev. A 78, 012336 (2008).
  * Robicheaux  _et al._ [2018] F. Robicheaux, D. W. Booth, and M. Saffman, Theory of long-range interactions for rydberg states attached to hyperfine-split cores, Phys. Rev. A 97, 022508 (2018).
  * Patscheider  _et al._ [2020] A. Patscheider, B. Zhu, L. Chomaz, D. Petter, S. Baier, A.-M. Rey, F. Ferlaino, and M. J. Mark, Controlling dipolar exchange interactions in a dense three-dimensional array of large-spin fermions, Phys. Rev. Res. 2, 023050 (2020).
  * Barndorff-Nielsen and Gill [2000] O. Barndorff-Nielsen and R. D. Gill, Fisher information in quantum statistics, Journal of Physics A: Mathematical and General 33, 4481 (2000).
  * Trees [1968] H. L. V. Trees,  _Detection, Estimation and Modulation_ (Wiley, New York, 1968).
  * Fulton and Harris [2004] W. Fulton and J. Harris,  _Representation Theory_, Graduate Texts in Mathematics, Vol. 129 (Springer New York, New York, NY, 2004).
  * Cirac  _et al._ [1999] J. I. Cirac, A. K. Ekert, and C. Macchiavello, Optimal Purification of Single Qubits, Physical Review Letters 82, 4344 (1999).
  * Shen  _et al._ [2017] X. Shen, S. Diamond, M. Udell, Y. Gu, and S. Boyd, Disciplined multi-convex programming, in  _2017 29th Chinese Control And Decision Conference (CCDC)_ (IEEE, 2017) pp. 895–900.
  * Note [6] We note that due to the resulting low rank of the optimal measurement operators $\\{M^{\star}_{q}\\}$, it is beneficial to use the nonlinear programming with augmented Lagrangian algorithm [96] for solving the SDP in subproblem (ii).
  * Schulte  _et al._ [2020] M. Schulte, V. J. Martínez-Lahuerta, M. S. Scharnagl, and K. Hammerer, Ramsey interferometry with generalized one-axis twisting echoes, Quantum 4, 268 (2020).
  * Thurtell and Miyake [2022] T. G. Thurtell and A. Miyake, Optimizing one-axis twists for realistic variational bayesian quantum metrology, arXiv 10.48550/ARXIV.2212.12461 (2022).
  * Burer and Monteiro [2003] S. Burer and R. D. Monteiro, A nonlinear programming algorithm for solving semidefinite programs via low-rank factorization, Mathematical Programming 95, 329 (2003).