## Abstract

Phase estimation algorithms are key protocols in quantum information processing. Besides applications in quantum computing, they can also be employed in metrology as they allow for fast extraction of information stored in the quantum state of a system. Here, we implement two suitably modified phase estimation procedures, the Kitaev and the semiclassical Fourier-transform algorithms, using an artificial atom realized with a superconducting transmon circuit. We demonstrate that both algorithms yield a flux sensitivity exceeding the classical shot-noise limit of the device, allowing one to approach the Heisenberg limit. Our experiment paves the way for the use of superconducting qubits as metrological devices which are potentially able to outperform the best existing flux sensors with a sensitivity enhanced by few orders of magnitude.

## Introduction

Phase estimation algorithms are building elements for many important quantum algorithms,^{1} such as Shor’s factorization algorithm^{2,3} or Lloyd’s algorithm^{4} for solving systems of linear equations. At the same time, phase estimation is a natural concept in quantum metrology,^{5} where one aims at evaluating an unknown parameter *λ* that typically enters into the Hamiltonian of a probe quantum system and defines its energy states *E*_{
n
}(*λ*). In a standard (classical) measurement, the precision *δλ* is restricted by the shot-noise limit \(\delta \lambda \propto 1{\mathrm{/}}\sqrt t\), where *t* is the measurement time. This, however, is not a fundamental limit: in principle, the ultimate attainable precision scales as *δλ* ∝ 1/*t*, constrained only by the Heisenberg relation Δ*E*(*λ*) ≥ 2*π*ℏ/*t*, where \({\mathrm{\Delta }}E\) = \({\mathrm{max}}_{n,m}\left( {E_n - E_m} \right)\). The Heisenberg limit can be achieved with the help of entanglement resources, e.g., using NOON photon states in optics.^{6,7,8} However, these states are difficult to create in general and they typically have a short coherence time. Alternatively, one can reach the Heisenberg limit without exploiting entanglement, by using the coherence of the wavefunction of a single quantum system as a dynamical resource. However, the uncontrollable interaction of the probe with the environment limits the time scale *t* where the Heisenberg scaling can be attained by the probe’s coherence time *t*~*T*_{2}. A further improvement then has to make use of an alternative measurement strategy with a precision following the standard quantum limit but with a better prefactor.

The unknown parameter *λ* can be estimated from the phase *ϕ* = Δ*E*(*λ*)*τ*/ℏ accumulated by the system in the course of its evolution during the time *τ*~*T*_{2}. The 2*π*-periodicity of the phase limits the probe’s measurement range Δ*λ* where *λ* can be unambiguously resolved within the narrow interval [*δλ*]_{H} = 2*π*ℏ/(*μT*_{2}), with *μ* ≡ ∂Δ*E*/∂*λ* denoting the sensitivity of the probe’s spectrum. Therefore, the improvement in the precision at larger *T*_{2} is concomitant with a proportional reduction of the measurement range Δ*λ*. The use of phase estimation algorithms then allows to resolve the 2*π* phase uncertainty and hence break this unfavorable trade-off between the measurement precision *δλ* and the measurement range Δ*λ*. Moreover, a metrological procedure based on a phase estimation algorithm is Heisenberg-limited: it attains the resolution *δλ* ~ [*δλ*]_{H} within a large measurement range \({\mathrm{\Delta }}\lambda \gg [\delta \lambda ]_{\mathrm{H}}\) with a Heisenberg scaling in the phase accumulation time *τ*, i.e., *δλ* ∝ ℏ/(*μτ*) for *τ* ≤ *T*_{2}. At larger times *τ* > *T*_{2}, the measurement proceeds with independent measurements involving the optimal time delay *τ* = *T*_{2}. Running *N* = *t*/*T*_{2} experiments and averaging over \(N \gg 1\) outcomes, one can further improve the precision within the standard quantum limit,^{9} \(\delta \lambda \propto 2\pi \hbar {\mathrm{/}}\left( {\mu T_2\sqrt N } \right)\) ≡ \(2\pi \hbar {\mathrm{/}}\left( {\mu \sqrt {tT_2} } \right)\).

There are two major classes of phase estimation algorithms, one suggested early on by Kitaev^{10} and a second originating from the quantum Fourier transform.^{11,12} In quantum computing, the Kitaev algorithm was run as part of Shor’s factorization algorithm^{13} and the Fourier transform algorithm was used in optics to measure frequencies.^{14} These algorithms are system-independent and can be employed in a variety of experimental settings, e.g., using NV centers in diamond for the sensitive detection of magnetic fields.^{15,16,17}

## Results

Here, we implement a modified version of these algorithms using an artificial atom or qubit in the form of a superconducting transmon circuit.^{18} We show that the transmon can be operated as a dc flux magnetometer with Heisenberg-limited sensitivity. The sensitivity is boosted by a magnetic moment that is about five orders of magnitude larger than that of natural atoms or ions. The idea of the experiment is to combine the extreme magnetic-field sensitivity of superconducting quantum interference devices (SQUIDs) with an enhanced performance brought about by exploiting quantum coherence. The ‘quantum’ in the name of this device refers to the macroscopic complex wave function of the superconducting electronic state. In the SQUID loop geometry, the relative phase of the superconducting wavefunctions across the Josephson junctions acquires a dependence on magnetic flux Φ via the Aharonov–Bohm effect. However, despite its quantum origin, in standard SQUID measurements this phase is a classical variable. In contrast, for the SQUID loop of a transmon qubit, the phase turns into a fully dynamical quantum observable and the flux Φ dependence is encoded in the energy-level separation ℏ*ω*_{01}(Φ) between the ground state and the first excited state. Therefore, it is possible to exploit the phase difference *ϕ* = [*ω*_{d} − *ω*_{01}(Φ)]*τ* acquired during a time *τ* by the qubit when it is prepared into a coherent superposition of the ground and excited energy states and driven by an external microwave field at a frequency *ω*_{d}. Differently from their “natural” counterparts, where the characteristics of the quantum sensor are sample independent and defined by the atomic structure, for artificial-atom systems, such as the transmon, we need to adapt the algorithms by including device-specific properties in a so-called *passport*—a sample specific Ramsey interference pattern obtained in advance from characterization measurements, see Fig. 1b. Making use of phase estimation algorithms, we demonstrate an enhanced dc-flux sensitivity of the transmon sensor in an enlarged flux range as compared to standard (classical) measurement schemes. Recently, a standard measurement procedure using a flux qubit has been used for the measurement of an ac-magnetic field signal.^{19}

The experiment employs a superconducting circuit in a transmon configuration, consisting of a capacitively-shunted split Cooper-pair box coupled to a *λ*/4–wavelength coplanar waveguide (CPW) resonator realized in a 90 nm thick aluminum film deposited on the surface of a silicon substrate, see Fig. 1 and SI 1 for an image of the sensor device. The SQUID loop of the transmon has an area of *S* ≃ 600 μm^{2}, which is chosen large in comparison with standard transmon qubit designs in order to provide a higher sensitivity to magnetic-field changes. The magnetic moment of this artificial atom is *μ* = *S*ℏ|*dω*_{01}/*d*Φ|, directly proportional to the area *S* and the rate of change with flux Φ of the transition frequency *ω*_{01}. For our device, we obtain *dω*_{01}/*d*Φ = −2*π* × 5.3 GHz/Φ_{0} at the bias point, resulting in *μ* = 1.10 × 10^{5} *μ*_{B}, where *μ*_{B} is the Bohr magneton. By comparison, the Zeeman splitting due to the magnetic moment of NV centers is 28 GHz T^{−1}, corresponding to a magnetic moment of 2*μ*_{B}. The sample is thermally anchored to the mixing chamber plate of a dilution refrigerator and cooled down to a temperature of roughly ~20 mK. The qubit has a separate flux-bias line and a microwave gate line, the former allowing to change the qubit transition frequency, while the latter is used for the qubit’s state manipulation. The qubit state is determined by a nondemolition read-out technique (see Methods and SI 1) measuring the probe signal reflected back from the dispersively-coupled CPW resonator. To increase the magnetic field sensitivity, we bias the qubit away from the “sweet spot”, see Fig. 1a. This follows an opposite strategy as compared to the situation where the phase estimation algorithms are employed for quantum computing and simulations; in the latter cases, the qubit sensitivity to flux noise is maximally suppressed by tuning the device to the “sweet spot” characterized by a vanishing first derivative of the energy with respect to flux. Operating away from the “sweet spot” leads to a reduction of the *T*_{2} time. The decoherence rate \(T_2^{ - 1} = \left( {2T_1} \right)^{ - 1} + T_\phi ^{ - 1}\) is the sum of the relaxation (2*T*_{1})^{−1} and dephasing \(T_\phi ^{ - 1}\) rates.^{20} The dephasing rate appreciably increases at our bias point, which reduces *T*_{2} and thus the number of available steps that can be implemented in the Kitaev and Fourier algorithms.

In the experiment, we apply a Ramsey sequence of two consecutive *π*/2 pulses separated by a time delay *τ*, which corresponds to an effective spin-1/2 precession around the z-axis of the Bloch sphere. The precession angle *ϕ* = Δ*ω*(Φ)*τ* is defined by the frequency mismatch Δ*ω*(Φ) = *ω*_{d}−*ω*_{01}(Φ) between the transition frequency *ω*_{01}(Φ) of the transmon qubit and the fixed drive frequency *ω*_{d} of the *π*/2 pulses. The Ramsey sequence drives the transmon from its ground state into a coherent superposition of ground and excited states with relative amplitudes determined by the phase *ϕ*. The theoretical probability to find the transmon in the first excited state is given by

and depends both on the delay time *τ* and on the magnetic flux Φ through the frequency mismatch Δ*ω*(Φ). The decay function *γ*(*τ*) accounts for qubit dephasing, typically due to charge or flux noise. By design, the transmon artificial atom is rather insensitive to background charge fluctuations. On the other hand, intrinsic 1/*f* magnetic-flux noise couples to the SQUID loop and is known to be a relevant source for dephasing in flux qubits;^{21,22,23} in addition, other decoherence mechanisms can be present, see below for details. The dephasing process can be described through an external classical noise source, see Methods. The particular shape of *γ*(*τ*) depends on the noise spectral density at low frequencies. “White” noise with a constant power density results in an exponential decay function *γ*(*τ*) = exp(−Γ_{wn}*τ*), while 1/*f*-noise produces a Gaussian decay *γ*(*τ*) = exp[−(Γ_{1/f}*τ*)^{2}]. We fit our experimental curves *P*(*τ*, Δ*ω*(Φ)) by Eq. (1) using both an exponential and a Gaussian decay, see SI 2. For our sample with a relaxation time *T*_{1} of about 260 ns, we cannot distinguish between these two fits, neither in the ‘sweet spot’ nor in the bias point. Fitting the Ramsey oscillation at different fluxes one finds \({\mathrm{\Gamma }}_{{\mathrm{wn}}}^{ - 1} \approx 1250\) ns and \({\mathrm{\Gamma }}_{1/f}^{ - 1} \approx 780\) ns at the ‘sweet spot’. At the bias point, these pure dephasing times reduce to 520 and 420 ns, respectively. The decay rates Γ_{wn} and Γ_{1/f} in the bias point then can be translated into equivalent white and 1/*f* flux noises and we find the spectral densities *S*_{wn} = (5.9 × 10^{−8} Φ_{0})^{2}/Hz and *S*_{1/f}(*f*) = (1.9 × 10^{−5} Φ_{0})^{2}/*f*[Hz], respectively (see Methods).

The function *γ*(*τ*) determines the optimal delay time *τ* where the sensitivity of the probability *P*(*τ*, Δ*ω*) to the changes in Δ*ω* and hence to a flux is the highest. In the standard (classical) measurement approach, a minimal delay \(\tau = \tau _0 \ll T_2\) sets the frequency range Δ*ω*(Φ) ∈ [0, *π*/*τ*_{0}] where the phase *ϕ* and hence *P*(*τ*, Δ*ω*) can be unambiguously resolved. This defines the range ΔΦ = *π*(*τ*_{0}*dω*_{01}/*d*Φ)^{−1} where the magnetic flux can be resolved with a precision scaling given by the standard quantum limit (see Methods),

where *t* is the total measurement or sensing time of the experiment and *T*_{rep} is the time duration of a single Ramsey measurement. A better flux sensitivity can be attained at larger delays *τ*, where the probability *P*[*τ*, Δ*ω*(Φ)] is more sensitive to changes in Δ*ω*. We obtain the best sensitivity at *τ* = *τ*^{*} defined by the condition (2*T*_{1})^{−1} − [ln *γ*(*τ*)]′ = *τ*^{−1} (see Methods),

The amplitudes *A*_{class} and *A*_{quant} in Eqs. (2) and (3) quantify the magnetic flux sensitivities. Measuring at the optimal delay *τ* = *τ*^{*} improves the flux resolution by a factor *A*_{class}/*A*_{quant} = *τ*^{*}/(*eτ*_{0}), which depends on the qubit’s coherence time, the latter serving as the quantum resource in our algorithms. Another important factor which enhances the flux sensitivity is the slope *dω*_{01}/*d*Φ of the transmon’s spectrum. At our working point *ω*_{01} = 2*π* × 7.246 GHz, we have *dω*_{01}/*d*Φ = −2*π* × 5.3 GHz/Φ_{0}. The minimal delay is given by *τ*_{0}≈31.6 ns, see SI 1. The repetition time *T*_{rep} = 6.546 *μ*s involves the maximal time duration of the Ramsey sequence, the duration of the probe pulse (2 μs) and the transmon’s relaxation time back into its ground state (4 μs, which is 15 times longer than the *T*_{1} time). Combining these numbers and setting *τ*^{*}~2*T*_{1}, we estimate the theoretical value of flux sensitivity for our transmon sensor as *A*_{quant} ≃ 4 × 10^{−7} Φ_{0} Hz^{−1/2}, see Eq. (3), providing an improvement by a factor *A*_{class}/*A*_{quant} ~ 6 over the classical sensitivity. Note, that the best sensitivity is attained at *T*_{rep} = *τ*^{*} (i.e., for a very fast control and readout) that gives for our sample \(\left[ {\delta \Phi } \right]_{{\mathrm{quant}}}\) ≃ \(1.1 \times 10^{ - 7}\) \(\Phi _0{\kern 1pt} {\mathrm{Hz}}^{ - 1/2}{\mathrm{/}}\sqrt t\).

Measuring at large time delays *τ*~*T*_{2} leaves an uncertainty in Δ*ω*(Φ) due to the multiple 2*π*-winding of the accumulated phase, thereby squeezing the flux range ΔΦ ~ 2.5 × 10^{−3} Φ_{0} by the small factor *τ*_{0}/*T*_{2}. The Kitaev and Fourier phase estimation algorithms, avoid this phase uncertainty by measuring the probability *P*(*τ*, Δ*ω*) at different delays *τ*_{
k
} = 2^{k}*τ*_{0} for \(K\sim {\mathrm{log}}_2\left( {T_2{\mathrm{/}}\tau _0} \right)\) consecutive steps *k* = 0, …, *K* − 1. As a result, such a metrological procedure is able to resolve the magnetic flux with the quantum limited resolution [*δ*Φ]_{quant}, see Eq. (3), within the original flux range ΔΦ set by the duration ~ *τ*_{0} of the control rf-pulses. The operation of the Kitaev and Fourier metrological procedures can be viewed as a successive determination of the binary digits of the index \(n = \left[ {b_{K - 1} \ldots b_0} \right]\) ≡ \(\mathop {\sum}\nolimits_{k = 0}^{K - 1} b_k{\kern 1pt} 2^k\) in the so-called quantum abacus.^{24} The Kitaev algorithm starts from a minimal delay *τ* = *τ*_{0} and determines the most significant bit *b*_{K−1} in its first step, further proceeding with the less significant bits *b*_{K−2}, …, *b*_{0}. The Fourier algorithm works backwards:^{25} it starts from the maximal delay *τ* ~ *T*_{2} and first determines the least significant bit *b*_{0}, then gradually learns more and more significant bits *b*_{1}, *b*_{2}, …, *b*_{K−1}.

### Modified Kitaev and Fourier metrological algorithms

In the present work, we use modified versions of the phase estimation protocols, which take into account the nonidealities present in actual experiments. For brevity, we will still refer to these protocols as the Kitaev and Fourier phase estimation algorithms. We demonstrate the superiority of these algorithms over the standard technique and show that we can beat the standard quantum limit. Instead of relying on the ideal theoretical probability function *P*[*τ*, Δ*ω*(Φ)] of Eq. (1) these modified Kitaev and Fourier protocols exploit the empirical probability *P*_{
p
}(*τ*, Φ), the so-called passport, which we measure by a set of Ramsey sequences at various magnetic fluxes Φ, representing the result on a discrete equidistant grid in the form *P*_{
p
}(*τ*_{
j
},Φ_{
i
}), see Fig. 1b. Here, Φ_{
i
} = (*i* − 1)[*δ*Φ]_{step} + Φ_{1} with the index *i* chosen from the flux-index set *I*_{0} = [1, 161] [*δ*Φ]_{step} ≃ 1.59 × 10^{−5} Φ_{0}, Φ_{1} ≃ 0.137 Φ_{0}, and discrete time delays *τ*_{
j
} = (*j* − 1) × 2 ns, *j* = 1, … 241 quantifying the time separation between the two *π*/2 rf-pulses of the Ramsey sequence. In order to increase the signal-to-noise ratio, we average over 65000 Ramsey experiments at each discrete point (*τ*_{
j
}, Φ_{
i
}). The resulting pattern is only approximately described by Eq. (1) due to the fact that the resonator frequency changes slightly with the applied flux, thus modifying our calibration (see Methods and SI 2). In principle, one can change the working point to an even more sensitive part of the spectrum at the price of a further distortion of this pattern.

Using the qubit passport *P*_{
p
}(*τ*_{
j
}, Φ_{
i
}), one can pose the following metrological question: given an unknown flux Φ within some pre-chosen range, how can one estimate its value using a minimal number of Ramsey measurements? We design two metrological algorithms where the time delay *τ* of the Ramsey sequence serves as an adaptive parameter whose value is dynamically adjusted. In the course of operation, both our algorithms return a discrete probability distribution \({\cal P}\)(Φ_{
i
}), *i* ∈ *I*_{0}, which reflects our current knowledge about the flux Φ to be measured. This probability distribution is improved in subsequent steps and shrinks to a narrow interval around the actual flux-value when running the algorithm.

### Bayesian learning

The elementary building block for both our metrological algorithms is a Bayesian learning subroutine which updates the discrete flux distribution \({\cal P}\)(Φ_{
i
}) after each Ramsey measurement of the qubit state. This subroutine takes the time delay *τ*_{
j
} between *π*/2 pulses as an input parameter and performs a sequence of *N* = 32 Ramsey measurements. Our readout scheme returns a measured variable *h*_{
N
} which, at \(N \gg 1\), is equal to the empirical passport probability *P*_{
p
}(*τ*_{
j
}, Φ_{
i
}). At small values *N*, the readout variable *h*_{
N
} is a normally distributed random variable with a mean value given by *P*_{
p
}(*τ*_{
j
}, Φ_{
i
}),

where the variance \(\sigma _N^2 = \sigma _1^2{\mathrm{/}}N\) can be directly measured, \(\sigma _1^2 \approx 3.5\) (see SI 1 for further explanations on the readout variable *h*_{
N
}). Next, the algorithm makes use of the measurement outcomes *h*_{
N
} and updates the flux probability distribution with the help of Bayes’ rule, \({\cal P}\left( {{\mathrm{\Phi }}_i} \right)\) → \(p\left( {h_N|\tau _j,{\mathrm{\Phi }}_i} \right){\cal P}\left( {{\mathrm{\Phi }}_i} \right)\)/\(\mathop {\sum}\nolimits_i {\kern 1pt} p\left( {h_N|\tau _j,{\mathrm{\Phi }}_i} \right){\cal P}\left( {\Phi _i} \right)\).

### Kitaev algorithm

The Kitaev-type metrological algorithm has been introduced earlier in ref.^{26}. The algorithm involves *K* steps *k* = 0, …, *K* − 1 with optimized Ramsey times *τ*_{
k
}, tolerances \(\epsilon _k\), and flux index sets *I*_{
k
}; below, \({\cal N}\)(*I*) denotes the size of a discrete set *I*. It is initialized with a uniform discrete distribution \({\cal P}_{\mathrm{0}}\)(Φ_{
i
}) which reflects our prior ignorance of the flux to be measured. In the first step *k* = 0, the algorithm repeats the Bayesian learning subroutine at a zero time delay *τ*^{(0)} = 0 between *π*/2 pulses until the probability distribution shrinks to a twice narrower interval *I*_{1} ⊂ *I*_{0}, i.e., \({\cal N}\)(*I*_{1}) = \({\cal N}\)(*I*_{0})/2, satisfying \(\mathop {\sum}\nolimits_{i \in I_1} {\kern 1pt} {\cal P}_0\left( {{\mathrm{\Phi }}_i} \right) \ge 1 - \epsilon _0\). The flux values Φ_{
i
}, *i* ∉ *I*_{1} are discarded. After completing the first step, the algorithm searches for the optimal delay *τ*_{
j
} for the next step. The next optimal Ramsey measurement requires a larger delay *τ*^{(1)} > 0 such that the passport *P*_{
p
}(*τ*^{(1)}, Φ_{
i
}), *i* ∈ *I*_{1}, has the largest range: \(\tau ^{(1)} = {\mathrm{argmax}}_{\tau _j}{\kern 1pt} {\mathrm{\Delta }}P\left( {\tau _j} \right)\) where Δ*P*(*τ*_{
j
}) = \({\mathrm{max}}_{i \in I_1}P_p\left( {\tau _j,{\mathrm{\Phi }}_i} \right)\) − \({\mathrm{min}}_{i \in I_1}P_p\left( {\tau _j,{\mathrm{\Phi }}_i} \right)\). The algorithm thus sweeps over the passport data *P*_{
p
}(*τ*_{
j
}, Φ_{
i
}) to find the optimal delay *τ*^{(1)} with maximal range Δ*P*(*τ*^{(1)}). Subsequently, a new distribution \({\cal P}_1\left( {{\mathrm{\Phi }}_{i \in I_1}} \right)\) = \({\cal N}^{ - 1}\left( {I_1} \right)\) and \({\cal P}_1\left( {{\mathrm{\Phi }}_{i \notin I_1}} \right) = 0\) is initialized and the algorithm proceeds to the next step by running the Bayesian learning with the new optimal delay *τ*_{1}. After *K* steps, the algorithm localizes Φ within a 2^{K} times narrower interval *I*_{
K
}, \({\cal N}\)(*I*_{
K
}) = \({\cal N}\)(*I*_{0})/2^{K}, with an error probability \(\epsilon = 1 - \mathop {\prod}\nolimits_{k = 0}^{K - 1} \left( {1 - \epsilon _k} \right)\).

### Quantum Fourier algorithm

This algorithm starts from the Ramsey measurement with an optimal time delay *τ*^{(s)}~*T*_{2}. The starting delay *τ*^{(s)} is a free input parameter of the algorithm. Similarly to the Kitaev algorithm, the quantum Fourier algorithm runs the Bayesian learning subroutine until the flux probability distribution \({\cal P}_{\mathrm{0}}\)(Φ_{
i
}), *i* ∈ *I*_{0}, squeezes to a twice narrower subset *S*_{1} ⊂ *I*_{0} such that \(\mathop {\sum}\nolimits_{i \in S_1} {\kern 1pt} {\cal P}_0\left( {{\mathrm{\Phi }}_i} \right) \ge 1 - \epsilon _0\). However, in contrast to the Kitaev algorithm, the passport function *P*_{
p
}(*τ*^{(s)}, Φ_{
i
}) is an ambiguous function of Φ_{
i
} at the large delay *τ*^{(s)}. As a result, *S*_{1} is not a single interval but rather a set of *n* ~ *τ*^{(s)}/*τ*_{0} disjoint narrow intervals *S*_{1} = *I*_{1} ∪ … ∪ *I*_{
n
} of almost equal lengths, see Fig. 2. Hence, after completing the first step, the flux value is distributed among *n* equiprobable alternatives *I*_{
i
}. The Fourier algorithm discriminates between these *n* alternatives in the next steps. First, it searches for the next optimal delay *τ*_{
j
}, where it is possible to rule out half of the remaining alternatives in the most efficient way. At each delay *τ*_{
j
} the algorithm splits the remaining intervals *I*_{
i
}, *i* = 1, …, *n* into two approximately equal-in-size groups \(A = I_{i_1} \cup \ldots \cup I_{i_{[n/2]}}\) and \(B = I_{i_{[n/2] + 1}} \cup \ldots \cup I_{i_n}\) which are ordered by the passport function, *P*_{
p
}(*τ*_{
j
}, Φ ∈ *A*) > *P*_{
p
}(*τ*_{
j
}, Φ ∈ *B*). Then it finds the probability distance Δ*P*(*τ*_{
j
}) = \({\mathrm{min}}_{i \in A}P_p\left( {\tau _j,{\mathrm{\Phi }}_i} \right)\) − \({\mathrm{max}}_{i \in B}P_p\left( {\tau _j,\Phi _i} \right) > 0\) separating the two sets *A* and *B*. Repeating this procedure at all available delays *τ*_{
j
}, the algorithm finds the optimal delay *τ*^{(1)} with maximal Δ*P*(*τ*_{
j
}) over the discrete set of delays *τ*_{
j
}. In the next step, the algorithm discriminates between *A* and *B* by repeating the Bayesian learning subroutine approximately [Δ*P*(*τ*^{(1)})]^{−2} times and sets *S*_{2} = *A* or *B*. Continuing in this way, the algorithm returns a single interval *I*_{out} where the actual value of the flux Φ(Φ_{
i
}), *i* ∈ *I*_{out}, is located. Figure 2 shows how the flux distribution function \({\cal P}\)(Φ_{
i
}) develops in time during the execution of the Kitaev and Fourier algorithms.

### Results

The superiority of our quantum metrological algorithms is clearly demonstrated by the scaling behavior of the magnetic flux resolution with the total *sensing time* of the flux measurement, see Fig. 3. We run each algorithm *n* = 25 times at every flux value Φ = Φ_{
i
}, *i* ∈ *I*_{0}, within the entire flux range, and find the corresponding arrays of estimated values \({\hat{\mathrm \Phi }}_{ji}\), *j* = 1, …, *n*. The estimate \({\hat{\mathrm \Phi }} = {\hat{\mathrm \Phi }}({\cal P}({\mathrm{\Phi }}))\) is defined as the most likely value derived from the observed probability distribution \({\cal P}\)(Φ). For a probability distribution \({\cal P}_i\)(Φ) measured at a known flux value Φ = Φ_{
i
} the corresponding estimate \({\hat{\mathrm \Phi }}_{ji}\) is a random quantity due to statistical nature of the measurement procedure. We define an aggregated resolution *δ*Φ as an ensemble standard deviation of the random variables \({\hat{\mathrm \Phi }}_{ji} - {\mathrm{\Phi }}_i\),

In case of the Fourier algorithm, such a definition is meaningful only at the final step of the algorithm where \({\cal P}\)(Φ) becomes a single-peaked function. The sensing time *t* is defined through the total number of calls of the Bayesian learning subroutine *m*, *t* = *NT*_{rep} *m*. The scaling behavior of the measured flux resolution *δ*Φ(*t*) with sensing time *t* is shown in Fig. 3 for both our algorithms and is compared with the scaling *δ*Φ_{std}(*t*) of the standard (classical) procedure, where all Ramsey measurements are done at a zero delay *τ* = 0.

Both quantum algorithms clearly outperform the standard procedure, with the Kitaev algorithm appearing slightly more efficient than the Fourier one. We explain this by the fact that the Fourier algorithm strongly relies on the periodicity of the Ramsey interference pattern given by Eq. (1), whereas our readout scheme produces a slightly distorted pattern. On the other hand, the Kitaev algorithm turns out to be more stable to the irregularities in the measured passport function *P*_{
p
}(*τ*, Φ). The magnetic flux sensitivities *A*_{quant} range within 5.6–7.1 × 10^{−6} Φ_{0} Hz^{−1/2} for the Kitaev algorithm and within 6.5–8.5 × 10^{−6} Φ_{0} Hz^{−1/2} for the Fourier procedure. These sensitivites are an order of magnitude worse than the theoretical bound 4.0 × 10^{−7} Φ_{0} Hz^{−1/2} set by Eq. (3). The discrepancy has two main reasons. First, our readout scheme is not a single-shot measurement, which leads to a factor 32 increase of the *T*_{rep} time. Second, we spend part of the time resource for the intermediate steps with *τ*_{
k
} ≤ *T*_{2} during the run of the phase estimation procedure. Finally, for our transmon, the SQUID area *S* ≃ 20 × 30 μm^{2} results in a magnetic filed sensitivity in the range 19.3–29.3 pT Hz^{−1/2}.

Decoherence processes define the most important factor limiting the sensitivity of our device. E.g., the intrinsic 1/*f* flux noise^{22,23} caused by magnetic impurities constitutes a relevant source of decoherence. At short times 0 < *τ* < 2*T*_{1}, *τ* the duration of a single Ramsey sequence, the presence of 1/*f* noise can be accounted for by a finite coherence time *T*_{
ϕ
} of the qubit. Assuming that dephasing originates exclusively from intrinsic flux noise results in an upper limit *S*_{1/f}(*f*) = (1.9 × 10^{−5} Φ_{0})^{2}/*f*[Hz] for the noise spectral function. At much larger time scales, as defined by the entire duration *t* of the Kitaev or Fourier procedure, 1/*f* noise causes low-frequency flux fluctuations \(\left\langle {\delta {\mathrm{\Phi }}^2} \right\rangle \sim {\int}_{1/t}^{1/\tau ^ \ast } {\kern 1pt} S_{1/f}(f)df\). As follows from Fig. 3, the 5-step Kitaev procedure takes ≈0.05 s, which provides a value \(\left\langle {\delta {\mathrm{\Phi }}^2} \right\rangle\)~(6.4 × 10^{−5} Φ_{0})^{2} for the flux fluctuations, about twice larger than the actually achieved flux resolution *δ*Φ~3 × 10^{−5} Φ_{0}. This suggests that 1/*f* flux noise has a smaller weight and another, non-magnetic decoherence mechanism is present in our device. One of the potential candidates derives from electron tunneling at defects inside the dielectric layer of the qubit’s Josephson junctions. These fluctuating charges produce 1/*f* noise in the critical current and hence affect the transition frequency of the transmon atom.^{27} The 1/*f* flux noise may become more pronounced at a larger size *L* of the transmon’s SQUID loop as the flux-noise spectral density grows linearly with the loop size.^{23} Consequently, the flux resolution [*δ*Φ] degrades \(\propto \sqrt L\) when increasing the loop size, while the corresponding magnetic field resolution [*δB*] ∝ [*δ*Φ]/*L*^{2} still improves as *L* growths, see Methods.

Interestingly, the non-ideality of the qubit’s passport strongly affects the performance of the standard procedure as well. Its scaling behavior *δ*Φ_{std} ∝ *t*^{−α} exhibits a crossover in the scaling exponent *α*, assuming a value *α* ≈ 0.39 at short sensing times, while at large times *α* decreases to a much smaller value ≈0.046. The scaling exponent 0.39 deviates from the shot noise exponent 1/2 due to the cases when the actual flux value is located near the boundaries of the flux interval Φ ∈ [Φ_{1}, Φ_{161}], where the passport function *P*_{
p
}(0, Φ) has an extremum and the scaling exponent for the standard procedure is reduced to 1/4, *δ*Φ(*t*) ∝ *t*^{−1/4}. As a result, the aggregated scaling exponent of Eq. (5) is reduced below 1/2. On the other hand, the crossover to *α* ≈ 0.046 is a consequence of the irregularity of the passport function set by low-frequency noise fluctuations during the passport measurement. Indeed, at large sensing times, the standard procedure needs to distinguish fluxes within a narrow interval where the passport function *P*_{
p
}(*τ* = 0, Φ) has a non-regular and non-monotonic dependence on Φ. As a result, the Bayesian learning procedure fails to converge to a correct flux value. In contrast, at a larger scale of Φ, the passport function is smooth and monotonic and the standard procedure behaves properly. These arguments are indeed confirmed by a numerical simulation with a regular passport function given by Eq. (1). Importantly, both our quantum metrological algorithms are more stable than the standard procedure with respect to passport imperfections and their scaling behavior at large sensing times coincides with the scaling behavior resulting from a regular passport function. The quantum algorithms suffer, however, from the same irregularity problem at larger sensing times, not shown in Fig. 3.

Finally, we discuss how our metrological algorithms use the quantum resource of qubit coherence in order to acquire information about the measured flux. We quantify the quantum coherence resource spent in a given measurement by the total phase accumulation time \(\tau _\phi = N\mathop {\sum}\nolimits_k {\kern 1pt} \tau _km_k\), where *m*_{
k
} is the number of calls for the Bayesian learning subroutine with delay *τ*_{
k
}. The amount of information Δ*I* acquired during the measurement is given by a decrease of the Shannon entropy Δ*I* = *H*(\({\cal P}_{\mathrm{0}}\)) − *H*(\({\cal P}\)), where \({\cal P}_{\mathrm{0}}\)(Φ_{
i
}) and \({\cal P}\)(Φ_{
i
}) are the initial and final probability distributions and *H*(\({\cal P}\)) = \(- \mathop {\sum}\nolimits_i {\kern 1pt} {\cal P}\left( {{\mathrm{\Phi }}_i} \right){\mathrm{log}}_2\left( {{\cal P}\left( {{\mathrm{\Phi }}_i} \right)} \right)\). The scaling behavior \({\mathrm{\Delta }}I\left( {\tau _\phi } \right) \propto \tau _\phi ^\alpha\) separates the classical domain with 0 < *α* ≤ 0.5 from the quantum domain with 0.5 < *α* ≤ 1, where *α* = 1 corresponds to the ultimate Heisenberg limit. Indeed, in the ideal case where no relaxation and decoherence phenomena are present, the quantum algorithms double the flux resolution (squeeze the flux distribution function into a twice narrower range) for each next step of the procedure. This means that the associated Shannon entropy decreases by ln(2) and one learns one bit of information for each doubling of the Ramsey delay time. In contrast, the classical procedure with \(N \gg 1\) repetitions results in a Gaussian probability distribution of the measured quantity where the precision scales as \(\delta {\mathrm{\Phi }} \propto 1{\mathrm{/}}\sqrt N\). Hence the associated Shannon entropy scales as *τ*^{0.5} with an invested total phase accumulation time *τ* = *Nτ*_{0}. We run each quantum algorithm 25 times for every flux value and average over the obtained information gains and phase times. The resulting scaling dependence is shown in Fig. 4 and demonstrates that both Kitaev and Fourier algorithms indeed belong to the quantum domain with a scaling exponent within [0.624, 0.654] (95% confidence interval). The scaling exponent is still below the Heisenberg limit, which is a consequence of the finite dephasing time *T*_{2}: at large time delays *τ* ~ *T*_{2} the visibility of the Ramsey interference pattern decreases, requiring more Ramsey measurements in order to learn the next bit of information.

## Discussion

We have used a single transmon qubit as a magnetic-flux sensor and have implemented two quantum metrological algorithms in order to push the measurement sensitivity beyond the standard shot-noise limit. In our experiments, we utilize the coherent dynamics of the qubit as a quantum resource. We demonstrate experimentally, on the same sensor sample, that suitably modified Kitaev and Fourier algorithms both outperform the classical shot-noise-limited measurement procedure and approach the Heisenberg limit. Both algorithms exhibit a similar asymptotic flux-sensitivity *A*_{Φ} ~ 6 × 10^{−6} Φ_{0} Hz^{−1/2} or magnetic-field sensitivity *A*_{
B
} ~ 20.7 pT Hz^{−1/2} within *a dynamical range* \({\mathrm{\Delta \Phi /}}A_{\mathrm{\Phi }}\sim 417\sqrt {{\mathrm{Hz}}}\) at a coherence time *T*_{2}~260 ns of the qubit.

Finally, we can compare the characteristics of our qubit sensor with other magnetometers. dc-SQUID sensors typically feature a 1 *μ*Φ_{0} Hz^{−1/2} sensitivity and a much larger dynamical range \(\sim 10^6\sqrt {{\mathrm{Hz}}}\), see ref.^{27}. However, conventional dc-SQUIDs are operated with a current bias close to critical, which limits their sensitivity to 10^{−8}–10^{−6} Φ_{0} Hz^{−1/2}, see refs.^{27,28,29}, due to intrinsic thermal noise fluctuations of excited quasi-particles. Atomic magnetometers^{30} can approach a magnetic field sensitivity ~0.1–1.0 fT Hz^{−1/2}. However, these magnetometers measure the field in a finite macroscopic volume ~1 cm^{3} and their sensitivity translated to the (100 *μ*m)^{3} volume range of a transmon sensor reduces to 0.1–1.0 pT Hz^{−1/2}, with a dynamical range ~10^{4}–10^{5} \(\sqrt {{\mathrm{Hz}}}\) compatible with dc-SQUID sensors. NV centers in diamond are able to resolve magnetic fields with atomic spatial resolution and approach sensitivities ~ 6.1 nT Hz^{−1/2}. Phase estimation algorithms allow one to enlarge the dynamical range of NV-sensors^{15,16,17} up to 3 × 10^{5} Hz^{1/2}. With magnetic-field sensors based on superconducting qubits there is a lot of potential for improvements in dynamic range and sensitivity. In contrast to dc-SQUIDs, such sensors are not prone to thermal noise fluctuations. Their sensitivity is limited only by their coherence time and the duration of the readout procedure. With a coherence time of *T*_{2}~5 μs and very fast control and readout \(\left( {T_{{\mathrm{rep}}} \simeq \tau ^ \ast \simeq T_2} \right)\), one can potentially access a sensitivity of *A*_{quant} ≃ 4 × 10^{−8} Φ_{0} Hz^{−1/2} and a dynamical range of ΔΦ/*A*_{quant} ≃ 6.3 × 10^{4} \(\sqrt {{\mathrm{Hz}}}\). Moreover, making use of the higher excitation levels in a transmon atom, one can increase the sensitivity even further.^{31}

## Methods

### The superconducting artificial atom

The transmon^{18} is a capacitively-shunted split Cooper-pair box, with a Hamiltonian

where *E*_{C} is the charging energy *E*_{C} = *e*^{2}/2*C*_{Σ} with *C*_{Σ} the total capacitance (dominated by the shunting capacitor). The SQUID loop in the transmon design provides a flux-dependent effective Josephson energy *E*_{
J
}(Φ) = *E*_{JΣ}|cos(*π*Φ/Φ_{0})| (assuming identical junctions). The state of the device is described by a wavefunction which treats the superconducting relative phase across junctions *φ* as a quantum variable similar to a standard coordinate. In contrast to standard SQUID measurements, the flux dependence is reflected in the quantized energy levels; for the first transition this reads

The readout of the qubit state is realized by a dispersive coupling of the transmon to a CPW resonator whose resonance frequency depends on the transmon state. This allows us to perform a non-demolition measurement of the qubit state by sending a probe pulse to the CPW right after the second *π*/2-pulse and collecting the resulting resonator response signal whose shape in time depends on the qubit state, see SI 1.

### Dephasing mechanisms

The dephasing of the qubit can be modeled via an interaction of the qubit with an external classical noise source *ν*(*t*). The qubit state acquires a stochastic relative phase \(\delta \phi = {\int} {\kern 1pt} dt{\kern 1pt} \nu (t)\partial \omega _{01}{\mathrm{/}}\partial \nu\). Then the decay function \(\gamma (\tau ) \equiv \left\langle {e^{i\delta \phi }} \right\rangle\) can be expressed via a noise spectral density function *S*_{
ν
}(*ω*) = \({\int} {\kern 1pt} dtdt\prime \left\langle {\left\langle {\nu (t)\nu (t\prime )} \right\rangle } \right\rangle e^{i\omega \left( {t - t\prime } \right)}\) as *γ*(*τ*) = \({\mathrm{exp}}\left[ { - \frac{1}{2}(\partial \omega _{01}/\partial \nu )^2} \right.\) \(\left. {{\int} {\frac{{d\omega }}{{2\pi }}S_\nu (\omega ){\mathrm{sin}}^2(\omega \tau {\mathrm{/}}2){\mathrm{/}}(\omega {\mathrm{/}}2)^2} } \right]\), see ref.^{32}. A white noise source with a constant spectral density *S*_{
ν
} = *S*_{wn} at low frequencies gives an exponential decay function *γ*(*τ*) = exp(−Γ_{wn}*τ*) with \(\Gamma _{{\mathrm{wn}}}\) = \(\frac{1}{2}S_{{\mathrm{wn}}}\left( {\partial \omega _{01}{\mathrm{/}}\partial \nu } \right)^2\). A 1/*f*-noise *S*_{
ν
}(*ω*) = *S*_{1/f}/|*ω*| gives a Gaussian decay *γ*(*τ*) = exp[−(Γ_{1/f}*τ*)^{2}] with \({\mathrm{\Gamma }}_{{\mathrm{1/f}}}\) ~ \(\sqrt {S_{1/f}\left| {{\mathrm{ln}}\left( {\omega _c\tau } \right)} \right|{\mathrm{/}}(2\pi )}\) \(\left| {\partial \omega _{01}{\mathrm{/}}\partial \nu } \right|\), where *τ*~2*T*_{1} and *ω*_{
c
}~1*s*^{−1} is a low frequency cut-off. One can estimate the corresponding decay rates Γ_{wn} = (520 ns)^{−1} and Γ_{1/f} = (420 ns)^{−1}, from the free-induction decay of the qubit state at the working point of the qubit spectrum, see SI 2. If we assume that the main dephasing mechanism is due to the intrinsic magnetic flux noise of the SQUID loop *ν*(*t*) = *δ*Φ(*t*), one can translate these rates into the corresponding noise spectral densities, *S*_{wn} ≈ (5.9 × 10^{−8} Φ_{0})^{2}/Hz and *S*_{1/f}(*f*) ≈ (1.9 × 10^{−5} Φ_{0})^{2}/*f*[Hz], where we have used a value *dω*_{01}/*d*Φ ≈ −2*π* × 5.3 GHz/Φ_{0} obtained from the characterization measurement of the qubit spectrum.

### Quantum and classical magnetic flux sensitivities

After *N* Ramsey experiments at a fixed delay *τ*, the probability of the excited state *P*(*τ*, Δ*ω*) can be estimated as *N*_{1}/*N*, where *N*_{1} is the number of outcomes where an excited state was detected. The accuracy *δP*^{2} = \(\left\langle {\left( {P(\tau ,{\mathrm{\Delta }}\omega ) - N_1{\mathrm{/}}N} \right)^2} \right\rangle\) of this estimate is given by a binomial statistics, *δP*^{2} = *N*_{1}(*N* − *N*_{1})/*N*^{3} ≤ 1/(4*N*). From the equation *P*(*τ*, Δ*ω*) = *N*_{1}/*N*, one can find the frequency mismatch Δ*ω*. The corresponding accuracy *δ*[Δ*ω*] can be found from the relation *δP* = \(\left| {\frac{{\partial P\left( {\tau ,{\mathrm{\Delta }}\omega } \right)}}{{\partial {\mathrm{\Delta }}\omega }}} \right|\delta \left[ {{\mathrm{\Delta }}\omega } \right]\), hence *δ*[Δ*ω*] = \(\left| {\frac{{\partial P(\tau ,{\mathrm{\Delta }}\omega )}}{{\partial {\mathrm{\Delta }}\omega }}} \right|^{ - 1}\frac{1}{{2\sqrt N }}\). From Eq. (1), it follows that \({\mathrm{min}}_{{\mathrm{\Delta }}\omega }\left( {\left| {\frac{{\partial P(\tau ,{\mathrm{\Delta }}\omega )}}{{\partial {\mathrm{\Delta }}\omega }}} \right|^{ - 1}} \right)\) = \(2\left[ {\tau \gamma (\tau )} \right]^{ - 1}e^{\tau /2T_1}\). Combining all factors, one arrives at the flux resolution

The standard (classical) measurement is done at a minimal effective delay \(\tau = \tau _0 \ll T_2\). Assuming that each Ramsey experiment takes a time *T*_{rep}, the flux resolution of the standard scheme is given by Eq. (2) where *t* = *NT*_{rep}. In a quantum limited measurement, one optimizes the time delay *τ*. Minimizing the time factor \([\tau \gamma (\tau )]^{ - 1}e^{\tau /2T_1}\) in Eq. (8), one finds the optimal time delay *τ*^{*} from an equation (2*T*_{1})^{−1}−(ln[*γ*(*τ*)])′ = *τ*^{−1}. Considering the 1/*f* flux noise dephasing model (see Methods: Dephasing mechanisms) with *γ*(*τ*) = exp[−(Γ_{1/f}*τ*)^{2}], we obtain

As suggested in ref.^{23} the 1/*f* flux-noise originates from spin flips of magnetic impurities located nearby the SQUID loop. The noise strength then increases linearly with the loop size *L* giving \({\mathrm{\Gamma }}_{{\mathrm{1/f}}} \propto \sqrt L\). Hence at large *L* one has \(\tau ^ \ast\) → \({\mathrm{\Gamma }}_{{\mathrm{1/f}}}^{ - 1}{\mathrm{/}}\sqrt 2 \propto 1{\mathrm{/}}\sqrt L\), which degrades the attainable flux resolution [*δ*Φ] ∝ 1/*τ*^{*}. The corresponding magnetic field resolution [*δB*] = [*δ*Φ]/*L*^{2} ∝ *L*^{−3/2} still improves with increasing loop size.

### Voltage-to-flux conversion

The magnetic flux threading the transmon SQUID loop is generated by a dc-current flowing through the flux-bias line located nearby the SQUID loop with the current controlled by a dc-voltage *V* ∈ [0.977, 1.009] V generated with an Agilent 33500B waveform generator (see SI 2). As a result, our device can also be operated as a sensitive voltmeter. The conversion from voltage values to the non-integer part of the normalized flux (Φ/Φ_{0} − *n*), where *n* is an integer number, is obtained from spectroscopic measurements (Fig. 1a), and has the form

Here, *V*_{0} is the periodicity (in volts) of the CPW resonator and qubit spectra, which corresponds to the magnetic flux change by one flux quantum, and Φ_{tr} is the residual flux trapped in the SQUID loop. Measuring the CPW resonator spectrum periodicity (see Fig. 1a inset), one finds *V*_{0} = (12.55 ± 0.05) volts, and the trapped flux value can be found from the position of the qubit spectrum maximum *ω*_{01}[Φ(*V*)] (Fig. 1a), which gives Φ_{tr}/Φ_{0} = 0.059 ± 0.004. Hence, our qubit based magnetic flux sensor measures a flux change relative to some reference value.

### Data availability

The data that support the findings of this study are available from the corresponding author upon reasonable request.

## Additional information

**Publisher's note:** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## References

- 1.
Cleve, R., Ekert, A., Macchiavello, C. & Mosca, M. Quantum algorithms revisited.

*Proc. Roy. Soc. A***454**, 339–354 (1998). - 2.
Shor, P. W. Algorithms for quantum computation: discrete logarithms and factoring. In

*Proc. 35th Annual Symposium on Foundations of Computer Science*(ed. Santa Fe, N.M.) 124–134 (IEEE Computer Society Press, 1994). - 3.
Smolin, J. A., Smith, G. & Vargo, A. Oversimplifying quantum factoring.

*Nature***499**, 163–165 (2013). - 4.
Harrow, A. W., Hassidim, A. & Lloyd, S. Quantum algorithm for linear systems of equations.

*Phys. Rev. Lett.***103**, 150502 (2009). - 5.
Giovannetti, V., Lloyd, S. & Maccone, L. Quantum-enhanced measurements: beating the standard quantum limit.

*Science***306**, 1330–1336 (2004). - 6.
Nagata, T., Okamoto, R., O’Brien, J. L., Sasaki, K. & Takeuchi, S. Beating the standard quantum limit with four-entangled photons.

*Science***316**, 726–729 (2007). - 7.
Dowling, J. P. Quantum optical metrology—the lowdown on high-N00N states.

*Contemp. Phys.***49**, 125–143 (2008). - 8.
Matthews, J. C. F. et al. Towards practical quantum metrology with photon counting.

*npj Quantum Inf.***2**, 16023 (2016). - 9.
Sekatski, P., Skotiniotis, M., Kolodynski, J. & Dür, W. Quantum metrology with full and fast quantum control.

*Quantum***1**, 27 (2017). - 10.
Kitaev, A. Y. Quantum measurements and the Abelian stabilizer problem. Preprint at https://arXiv:quant-ph/9511026 (1995).

- 11.
Nielsen, M. A. & Chuang, I. L.

*Quantum Computation and Quantum Information*. 10th edn, (Cambridge University Press, Cambridge, 2011). - 12.
van Dam, W., D’Ariano, G. M., Ekert, A., Macchiavello, C. & Mosca, M. Optimal quantum circuits for general phase estimation.

*Phys. Rev. Lett.***98**, 090501 (2007). - 13.
Monz, T. et al. Realization of a scalable Shor algorithm.

*Science***351**, 1068–1070 (2016). - 14.
Higgins, B. L., Berry, D. W., Bartlett, S. D., Wiseman, H. M. & Pryde, G. J. Entanglement-free Heisenberg-limited phase estimation.

*Nature***450**, 393–396 (2007). - 15.
Waldherr, G. et al. High-dynamic-range magnetometry with a single nuclear spin in diamond.

*Nat. Nanotechnol.***7**, 105–108 (2012). - 16.
Puentes, G., Waldherr, G., Neumann, P., Balasubramanian, G. & Wrachtrup, J. Efficient route to high-bandwidth nanoscale magnetometry using single spins in diamond.

*Sci. Rep.***4**, 4677 (2014). - 17.
Bonato, C. Optimized quantum sensing with a single electron spin using real-time adaptive measurements.

*Nat. Nanotechnol.***11**, 247–252 (2016). - 18.
Koch, J. Charge insensitive qubit design derived from the Cooper pair box.

*Phys. Rev. A.***76**, 042319 (2007). - 19.
Bal, M., Deng, C., Orgiazzi, J.-L., Ong, F. R. & Lupascu, A. Ultrasensitive magnetic field detection using a single artificial atom.

*Nat. Commun.***3**, 1324 (2012). - 20.
Clarke, J. & Wilhelm, F. K. Superconducting quantum bits.

*Nature***453**, 1031–1042 (2008). - 21.
Yoshihara, F., Harrabi, K., Niskanen, A. O., Nakamura, Y. & Tsai, J. S. Decoherence of flux qubits due to 1/

*f*flux noise.*Phys. Rev. Lett.***97**, 167001 (2006). - 22.
Anton, S. M. et al. Magnetic flux noise in dc SQUIDs: temperature and geometry dependence.

*Phys. Rev. Lett.***110**, 147002 (2013). - 23.
Bialczak, R. C. et al. 1/

*f*flux noise in Josephson phase qubits.*Phys. Rev. Lett.***99**, 187006 (2007). - 24.
Suslov, M. V., Lesovik, G. B. & Blatter, G. Quantum abacus for counting and factorizing numbers.

*Phys. Rev. A.***83**, 052317 (2011). - 25.
Griffiths, R. B. & Niu, C.-S. Semiclassical fourier transform for quantum computation.

*Phys. Rev. Lett.***76**, 3228 (1996). - 26.
Lebedev, A. V., Treutlein, P. & Blatter, G. Sequential quantum-enhanced measurement with an atomic ensemble.

*Phys. Rev. A.***89**, 012118 (2014). - 27.
Clarke, J. & Braginski, A. I.

*The SQUID Handbook. Vol. 1 Fundamentals and Technology of SQUIDs and SQUID Systems*. (Wiley-VCH, Weinheim, 2004). - 28.
Awschalom, D. D. et al. Low-noise modular microsusceptometer using nearly quantum limited dc SQUIDs.

*Appl. Phys. Lett.***53**, 2108–2110 (1988). - 29.
Wellstood, F. C., Urbina, C. & Clarke, J. Hot electron effect in the dc-SQUID.

*IEEE Trans. Magn.***25**, 1001–1004 (1989). - 30.
Budker, D. & Romalis, M. Optical magnetometry.

*Nat. Phys.***3**, 227–234 (2007). - 31.
Shlyakhov, A. R. et al. Quantum metrology with a transmon qutrit.

*Phys. Rev. A.***97**, 022115 (2018). - 32.
Cottet, A.

*Implementation of A Quantum Bit in A Superconducting Circuit*. Ph.D. thesis. Université Paris VI (2002).

## Acknowledgements

The work was supported by the Government of the Russian Federation (Agreement 05.Y09.21.0018) (G. L.), by the RFBR Grant No. 17-02-00396A (G. L.), by the Foundation for the Advancement of Theoretical Physics “BASIS” (G. L.), by the Pauli Center for Theoretical Studies at ETH Zurich (G. L.) and by the Swiss National Foundation through the NCCR QSIT (A.L.) and the Ministry of Education and Science of the Russian Federation 16.7162.2017/8.9 (A.L.). We acknowledge financial support from Väisalä Foundation, the Academy of Finland (project 263457, Centers of Excellence “Low Temperature Quantum Phenomena and Devices”—project 250280 and “Quantum Technologies Finland”—project 312296), and the Centre for Quantum Engineering at Aalto University. The experiments used the cryogenic facilities of the Low Temperature Laboratory at Aalto University.

## Author information

### Affiliations

#### Low Temperature Laboratory, Department of Applied Physics, Aalto University School of Science, PO Box 15100, Aalto, FI-00076, Finland

- S. Danilin
- , A. Vepsäläinen
- & G. S. Paraoanu

#### Theoretische Physik, Wolfgang-Pauli-Strasse 27, ETH Zürich, CH-8093, Zürich, Switzerland

- A. V. Lebedev
- & G. Blatter

#### Moscow Institute of Physics and Technology, Institutskii per. 9, Dolgoprudny, 141700, Moscow District, Russia

- A. V. Lebedev
- & G. B. Lesovik

#### L.D. Landau Institute for Theoretical Physics RAS, Akad. Semenova av., 1-A, Chernogolovka, 142432, Moscow Region, Russia

- G. B. Lesovik

### Authors

### Search for S. Danilin in:

### Search for A. V. Lebedev in:

### Search for A. Vepsäläinen in:

### Search for G. B. Lesovik in:

### Search for G. Blatter in:

### Search for G. S. Paraoanu in:

### Contributions

The sample used in the experiment was designed and fabricated by S.D. The measurements were performed by S.D., A.V., and A.V.L.; the data was proceesed by A.V. and S.D. and further analyzed by A.V.L. G.B.L., G.B., and A.V.L. worked on the theoretical foundation of the experiments. A.V.L. and S.D. wrote the first draft, with further contributions from G.B.L., G.B., and G.S.P. A.V.L. and G.S.P. supervised the project.

### Competing interests

The authors declare no competing interests.

### Corresponding authors

Correspondence to A. V. Lebedev or G. S. Paraoanu.

## Electronic supplementary material

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.