Beating the thermal limit of qubit initialization with a Bayesian Maxwell's demon

Fault-tolerant quantum computing requires initializing the quantum register in a well-defined fiducial state. In solid-state systems, this is typically achieved through thermalization to a cold reservoir, such that the initialization fidelity is fundamentally limited by temperature. Here, we present a method of preparing a fiducial quantum state with a confidence beyond the thermal limit. It is based on real time monitoring of the qubit through a negative-result measurement -- the equivalent of a `Maxwell's demon' that triggers the experiment only upon the appearance of a qubit in the lowest-energy state. We experimentally apply it to initialize an electron spin qubit in silicon, achieving a ground-state initialization fidelity of 98.9(4)%, corresponding to a 20$\times$ reduction in initialization error compared to the unmonitored system. A fidelity approaching 99.9% could be achieved with realistic improvements in the bandwidth of the amplifier chain or by slowing down the rate of electron tunneling from the reservoir. We use a nuclear spin ancilla, measured in quantum nondemolition mode, to prove the value of the electron initialization fidelity far beyond the intrinsic fidelity of the electron readout. However, the method itself does not require an ancilla for its execution, saving the need for additional resources. The quantitative analysis of the initialization fidelity reveals that a simple picture of spin-dependent electron tunneling does not correctly describe the data. Our digital `Maxwell's demon' can be applied to a wide range of quantum systems, with minimal demands on control and detection hardware.


I. INTRODUCTION
Fault-tolerant quantum computing places strict requirements on preparation, control and readout of qubits. Much emphasis is placed in the literature on the fidelity of quantum gate operations, but the most effective error correction codes demand an abundance of initialization and measurement steps. A well-known example is the surface code: in this scheme, fault-tolerant operation of a logical qubit is achieved when the probability of an error occurring on one-and two-qubit gates, and initialization and measurement, are all below 0.56% [1]. Similarly, a fault-tolerance error threshold of 4.8% is obtained for topological color codes, assuming both qubit errors and state preparation and measurement (SPAM) errors have the same rate [2].
Many physical qubit platforms have now reached quantum logic gate errors close to or below some faulttolerance thresholds [3][4][5], including nuclear [6] and electron [7][8][9] spin qubits in silicon. Not as common, however, is the achievement of equivalently low SPAM errors. The lowest errors are typically achieved in systems that allow for continuous or repetitive quantum nondemolition (QND) readout, such as nuclear spins [10,11] and superconducting transmon qubits [12,13]. Projective QND measurements combined with feedback can be used to ini- * a.morello@unsw.edu.au tialize the qubits with high fidelity [14,15]. Other qubit types, like superconducting phase qubits [16] and electron spins in semiconductors [17,18], adopt instead a measurement method based upon energy-dependent tunneling. There, the high-energy state of the qubit is detected through its much higher probability of tunneling out of the confining potential barrier; the tunneling event, in turn, causes a change in the state of a nearby sensor. This method naturally results in a SPAM fidelity limited by the thermal population of the energy eigenstates. Recent work on electron spin qubits in Si/SiGe quantum dots [19,20] has begun to address the issue of SPAM errors by implementing QND readout via a quantum logic operation with an ancilla dot.
In this paper we describe and demonstrate a method to beat the thermal limit for initializing the ground state of an electron spin qubit, which is read out via energydependent tunneling. Conceptually, energy-dependent tunneling is a form of negative-result measurement [21]. The theory of negative-result measurements has been extended to the case of a driven qubit [22] at zero temperature. Here, we focus instead on the finite-temperature case in the absence of drive, by extending the model originally presented by Ruskov et al. [22] to account for thermally induced tunneling out of the ground state, which represents a measurement error. The goal of our work is to reduce such error far below the thermal limit. We use the spin of the electron bound to an ion-implanted 31 P donor in silicon as our qubit [23], which naturally comes equipped with a spin-1/2 nucleus coupled to it.

arXiv:2110.02046v3 [quant-ph] 1 Nov 2022
We use the nucleus as an ancilla system that can be read out with near-unity fidelity [11,24], solely to prove the effectiveness of our electron initialization method. The method itself does not require an ancilla to operate and, thus, does not demand additional quantum resources.
The electron spin qubit is initialized by a real-time monitoring system, implemented in field-progammable gate array (FPGA) hardware, which acts as a Bayesian 'Maxwell's demon' by selectively preparing the lowestenergy spin state of an electron, which is initially drawn from a charge reservoir at nonzero temperature. In the original thought experiment, the demon separates highenergy from low-energy particles in a gas at no energy cost, and the separated gas is then operated as a heat engine to extract work from the system. This appears to violate the second law of thermodynamics; however, an information theoretic approach reveals the entropic cost of the demon resetting its knowledge at the beginning of each cycle [25,26]. Maxwell's demon has recently been applied in charge [27][28][29] and superconducting [30,31] qubit systems to study the thermodynamic cost of quantum information processing and to extract work. Here we adopt the Maxwell's demon idea to draw an electron from a warm charge reservoir. By monitoring in realtime the charge state of the donor, our demon is able to obtain a higher probability of the electron being in the ground state than would be achievable without the demon's careful observation.
Our device shares many similarities with the seminal experiment of Koski et al. [29], who realize a Szilard engine by using a single-electron box, whose charge state is monitored in real time by a single-electron transistor embodying the Maxwell's demon. In their work, the information acquired by the demon is used to then extract work equal to k B T ln 2 from a thermal bath. However, our work differs from previous Maxwell's demon experiments in that our interest is not in the thermodynamics itself, but in the impact of the information gain on the initialization fidelity of a qubit. Furthermore, because of the quantum information focus of our work, the initialization speed is of paramount importance. Our readout system is, thus, 3 orders of magnitude faster than the one used by Koski et al. [29] in their Szilard engine experiment.

II. ELECTRON SPIN INITIALIZATION AND READOUT
We consider electron spin qubits in semiconductors [32]. An external magnetic field, B 0 , creates an energy splitting ∆E Z = E ↑ − E ↓ = hγ e B 0 , between the spin-down (|↓ ) and spin-up (|↑ ) states due to the Zeeman effect, where γ e is the electron gyromagnetic ratio and h is the Planck constant. For electrons in silicon, γ e ≈ 28 GHz/T, such that B 0 = 1 T results in ∆E Z /k B ≈ 1.34 K, where k B is the Boltzmann constant. From a microwave engineering point of view, it is costly and challenging to operate spin qubits at frequencies above 40 GHz, which means that ∆E Z /k B is limited to approximately 2 K for practical purposes, which corresponds to B 0 ≈ 1.4 T in silicon.
A natural way to initialize such a spin qubit is to cool down the host material to a temperature T ∆E Z /k B and wait a time approximately 5T 1e , where T 1e is the electron spin-lattice relaxation time. At low magnetic fields and low temperatures (typically about 100 mK), T 1e usually exceeds one second [18,[33][34][35][36][37]. Therefore, this method is practical only if the electron spin possesses an energy level structure which results in relaxation ''hot spots" [38], where the Zeeman splitting crosses an orbital or valley splitting, shortening T 1e to the microsecond range. Hot spots exist in quantum dots [33,36] but not in donors [34,37].
More commonly, the electron spin is initialized by the same method used for readout. Here we focus on the case where the readout occurs via energy-dependent tunneling to a Fermi reservoir [17,18,39]. We use spin-to-charge conversion to measure the state of an electron spin bound to a 31 P donor in isotopically enriched 28 Si [40]. The device is placed in a magnetic field B 0 = 1.423 T and cooled to T 1 K with a dilution refrigerator. The donor electron is tunnel coupled to a nearby SET which is tuned to be in Coulomb blockade (no current flowing) when the donor is in the neutral charge state (D 0 ). The blockade is lifted when the donor becomes ionized and positively charged (D + ) [41] upon tunneling of its electron onto the SET. The SET island can be approximated as a Fermi reservoir, as shown in Figure 1 (this approximation is examined in Sec. V). The fraction of occupied electron states, f , follows the Fermi function where E F is the Fermi energy. When ∆E Z k B T e , and the electrochemical potential of the donor is tuned about the Fermi level, a |↑ electron can tunnel to the reservoir at a rate Γ ↑,out , which is high because of the large density of empty states in the reservoir, i.e. 1 − f (E ↑ ) ≈ 1. Tunneling of a |↓ electron, at a rate Γ ↓,out , is greatly suppressed by the lack of available states, 1 − f (E ↓ ) 1. Single-shot electron spin readout is performed by observing the SET current for a duration t read . Traces where the current shows a step increase indicate an ionization event (transitioning from D 0 to D + ). The ability to distinguish |↑ and |↓ tunneling events is given by the ratio of the tunnel-out rates for the two orientations. Because Γ ↑,out Γ ↓,out , we identify this event with tunneling out of a |↑ electron. Conversely, the absence of current steps is identified with a |↓ electron remaining on the donor. In a broader quantum measurement context, this type of qubit readout belongs to the class of negative-result measurements [21]: Even the absence of an event (in this case, electron tunneling) provides information on the state of the monitored quantum system.  1. (a) False-colored micrograph of a device from the same batch as the one used in this paper. The SET for electron spin readout and initialization is shown on the right in green. The microwave antenna, used for ESR and NMR, is shown on the left in pink. Pulsing gates DG3, DG4, and SPL (identified by white dots) form a virtual gate VG. (b) Schematic energy landscape of the device. The donor binding potential confines an electron in the spin-down (blue line) or spin-up (green line) state. The conduction band edge is indicated for both spin-up (E c↑ ) and spin-down (E c↓ ) electrons, split by the Zeeman energy E Z . The green and blue shaded regions illustrate that |↑ and |↓ electrons are expected to face the same energy barrier to the reservoir upon elastic tunneling (see Sec. V). The electron is initially drawn from the SET island, shown in tan, which acts as a finite-temperature charge reservoir. (c) Level diagram of the electron-nuclear spin system (not to scale), alongside the occupied states in the SET island, which follow the Fermi-Dirac distribution f (E).
This should not be confused with whether the sensor output that signals a tunneling event is a positive or a negative current (or voltage) [42]. Here the "negative result" is the absence of a sensor signal, regardless of its sign.
An alternative method to read out an electron spin state is Pauli spin blockade (PSB). PSB distinguishes the triplet states of two spins from the singlet state |S = |↑↓ − |↓↑ , as only a spin singlet can occupy the same spatial quantum state [e.g. a (2, 0) charge configuration of two dots [43]]. PSB spin mapping errors arise from triplet-to-singlet relaxation during the readout window, resulting in a tunneling event for an initially blockaded spin configuration. As a result of PSB readout, the final two-spin state is either a singlet in the (2, 0) charge configuration or one of the triplet states in the (1, 1) charge configuration. Under certain conditions, PSB can be used instead to discern the two-electron parity, i.e. discriminate |↓↑ , |↑↓ from |↓↓ , |↑↑ [44].
This alone does not initialize a single electron spin state. However, if one of the electrons can be independently initialized to the fiducial state |↓ through e.g. energy-selective tunneling or T 1 relaxation, then PSB readout resulting in a triplet or even-parity state prepares the state |T − ≡ |↓↓ .

III. BAYESIAN MAXWELL'S DEMON
To understand how the electron spin state populations change under the Maxwell's demon observation, we adopt a Bayesian update framework, where the knowledge of the state populations is updated with each measurement sample. This framework naturally describes a digital, discrete-time measurement. In Appendix D we describe the equivalent continuous-time process.
In a setup as described above, the current through the SET charge sensor is used to determine whether an electron has tunneled to a reservoir. The current is then converted to a voltage through a transimpedance amplifier at room temperature, integrated over a short duration T s ≈ 10 µs, and digitized to yield a digital sample D n . Each sample yields information on whether the electron has tunneled or not, which correlates to the electron spin state. This information is processed by a FPGA, which enables real time decision making based on the information extracted from the sensor.
We define a Boolean parameter B, to represent the sensor signal exceeding a threshold S th above which a tunneling event is recognized, i.e. B = (D > S th ). The logical complement to B is denoted ¬B and is recorded when D ≤ S th .
The sensor measurement has a backaction on the electron spin, even when no tunneling event takes place [45]. This constitutes a variable-strength measurement, which is elaborated in Appendix D. The initial estimate of the |↓ probability P (↓) prior to the measurement can be taken as P (↓) = f (E ↓ ), since the electron is loaded from the SET island Fermi reservoir. As the measurement proceeds, we describe the probability of having a |↓ electron on the donor by an iterative Bayesian update process. If no blip is detected in a set of N measured samples ¬B N = (¬B N , ¬B N −1 , . . . , ¬B 1 ), i.e. the signal threshold is not exceeded, the prior |↓ probability P (↓) is updated based on the likelihoods L(↓| ¬B N ) and a) An example marginal likelihood function, L(↓| ¬B N )P (↓) + L(↑| ¬B N )P (↑), (denominator of Eq. 2), calculated assuming Γ ↑,out = 100Γ ↓,out , as a function of the observation time t obs expressed in units of the spin-up tunnelout time 1/Γ ↑,out . For short t obs the electron is unlikely to have tunneled from the donor. For long t obs , the electron escapes the donor regardless of its spin state. The ideal t obs (heavy black line) for single-shot spin readout is found where the likelihood function exhibits a large contrast between its values for P (↓) = 0 and P (↓) = 1 (black line). For these tunnel rates, the ideal spin readout contrast is approximately 95%. b) Bayesian update of the |↓ probability. For increasing observation times where a tunneling event is not observed, the postmeasurement |↓ probability increases toward unity. Different priors are shown to indicate that the prior spin population has only a small role in determining the final |↓ probability after a sufficiently long observation time. With a prior probability of P (↓) = 0, we know with certainty that the electron spin state is initially |↑ . Therefore, no amount of new information (data gathered through observation) can update the |↓ probability.

L(↑| ¬B
which tends to 1 as N → ∞. If a tunneling event is observed, i.e. a positive readout result, the knowledge of the Maxwell's demon is reset. In this manner, the positive result is simply discarded and initialization recommences when an electron rejoins the donor.
The denominator in Eq.
(2) is the marginal likelihood [example shown in Figure 2a]. It represents the likelihood of an electron not tunneling out of the donor after N observations, given the initial probabilities of occupying each spin state. The likelihood tends to zero for long observation times, which indicates that long records of no tunneling become increasingly rare. This is the sense in which our setup operates as a Bayesian Maxwell's demon: as N increases and the memory fills up with more samples of ¬B, the demon becomes increasingly confident that the electron, initially drawn from the warm reservoir, is in the ground state. In that sense, the electron can be thought of as being in equilibrium with a much colder reservoir than the one it is originally drawn from. Once the desired confidence is reached, the demon can give a trigger signal to start further quantum operations on the qubit. Below we discuss how to quantify such confidence.

IV. QUBIT INITIALIZATION FIDELITY
The qubit initialization fidelity is the probability of correctly preparing a |↓ electron. The basic method of initialization by spin-dependent tunneling, i.e. the same process used for electron spin readout, yields simply F I (0) = P (↓) = f (E ↓ ), limited by the thermal broadening of the Fermi distribution. The Maxwell's demon observation improves this fidelity as F I (N ) = P (↓ | ¬B N ) [Eq. 4]. However, we have no direct way to verify such improvement if we resort to an electron spin measurement with fidelity limited by the same thermally broadened reservoir. This limit can be circumvented by introducing an ancilla qubit which can be read out repetitively in a quantum nondemolition (QND) fashion. For a P donor system, such an ancilla is naturally provided by the 31 P nuclear spin. After the Maxwell's demon cooling operation, we map the state of the electron spin onto the nucleus [46,47] by a simple nuclear magnetic resonance (NMR) π pulse conditional on the electron |↓ state, followed by repetitive nuclear spin readout [11].

Cool Empty and Reload
Map to nucleus The total experiment fidelity F is thus composed of the fidelities of the three stages: electron initialization (F I ), NMR control (F C ) to map the electron state onto the nucleus, and nuclear readout (F R ): Therefore, to extract F I from the experiment we need to independently quantify F C and F R . This is detailed in Appendices E and F where we find F C = 99.5(3)% and F R = 99.99%. We stress that the Maxwell's demon cooling method does not require an ancilla to be implemented. The only role of the ancilla qubit here is to verify the effectiveness of the cooling method, to a precision better than the intrinsic electron readout fidelity. Figure 4 shows the total experiment (F) and initialization (F I ) fidelities of the donor electron spin, as a func-tion of observation times t obs . The error bars indicate the 25th and 75th percentiles of the data. As the data are binomially distributed, they are highly skewed (nonnormal) near zero. Percentiles are shown instead of the standard deviation as one standard deviation above the mean may be greater than one, which is unphysical.
We observe that, in contrast with the ideal prediction of Eq. 4, the initialization fidelity F I asymptotically approaches an upper bound 1 − P M for P M = 0. We attribute this discrepancy to fast tunneling events, resulting in current blips that go undetected because they are shorter than the rise time t rise of the transimpedance amplifier used to detect changes in the SET current. Our amplifier has a low-pass cutoff frequency f c = 50 kHz, which yields a rise time (using a first-order approxima- tion): where S th = 0.3 is the SET signal threshold [ Fig. 3a] with the SET signal rescaled between 0 and 1. The tunnel-in rate Γ ↑,in +Γ ↓,in , which determines the average blip duration, is measured to be approximately 2700 s −1 (Sec. V). The probability P M of missing a blip, i.e. the proportion of tunneling events from the reservoir to the donor that occur before the SET signal rises to the signal threshold, is (see Appendix C for details) Therefore, we fit the data to a modified version of Eq. 4 to account for missed blips, While we estimate P M above, it is treated as a free fitting parameter. The fit yields a total experiment fidelity approaching F = 98.39(8) % for t obs > 10 ms, which gives an initialization fidelity (by Eq. 5) approaching F I = 98.9(4) %. This is in close agreement with the limit predicted on the basis of the rise time limitation of the transimpedance amplifier, Eq. 7. From this we deduce that a qubit initialization fidelity F I = 99.9% would be achieved if the amplifier chain had a cutoff frequency of 300 kHz, or if the electron tunnel-in rate is slowed down to 880 s −1 . In the absence of Maxwell's demon initialization, the bare fidelity is F NM I ≈ 80% (Figure 5b), showing that our method reduces the initialization error by a factor 20. The bare fidelity closely matches the prior |↓ probability F I (0) ≈ 78% extracted from the fit. Next we consider (and rule out) other potential error channels that could impose an upper bound to the initialization fidelity. A possible mechanism could be the spurious spin excitation caused by absorption of thermal phonons. However, for an electron spin in silicon in a magnetic field B 0 > 1 T, the spin excitation rate W ↓↑ is many orders of magnitude lower than the spin decay rate W ↑↓ , which itself is about 3 orders of magnitude lower [37] than the tunnel rates. Since the observation time is much shorter than the relaxation and excitation rates (i.e. t obs W −1 ↑↓ W −1 ↓↑ ), the number of thermally excited electrons recorded throughout this experiment is expected to be negligible.
In the high-field limit γ e B 0 A, the eigenstates of the electron-nuclear system are the simple tensor products states of the electron (|↓ , |↑ ) and nuclear (|⇓ , |⇑ ) basis states. We now consider the effect of the finite B 0 in mixing the electron-nuclear eigenstates as a possible explanation for the observed -bound in |↓ preparation fidelity. In this experiment, the device is operated in a magnetic field of 1.423 T (see Appendix A), giving an electron Zeeman splitting of γ e B 0 ≈ 39.8 GHz. For an isotropic hyperfine interaction strength of A ≈ 116 MHz, this gives a deviation from the high-field limit electron spin eigenstates of only 10 −5 . In the context of Bayesian initialization, this is not the limiting factor in the present experiment.
The average time spent initializing the qubitt init is determined by the number of times the electron qubit is reset (i.e. tunnels out and another tunnels back in) during observation. For a given t obs , the total initialization time increases with the average electron reset time (τ in = 1 Γ ↑,in +Γ ↓,in ) scaled by the likelihood of observing no blips during readout (the denominator in Eq. 2), For this experiment the average initialization time is t init ≈ 40 ms with t obs = 10 ms. Our initialization method compares favorably to alternatives that use additional quantum resources. Exploiting QND readout, Yoneda et al. achieve a single electron ground-state initialization fidelity of 95.9% with a conventional majority vote of 20 consecutive reads [19]. Extending beyond majority voting to supermajority voting (i.e. moving the majority threshold above 50%), a |↓ initialization fidelity of F I = 99.6% was reached with at least a 76.6% majority vote spin-down in 10 consecutive reads, on an approximately 600 µs timescale. Similarly, Philips et al. [48] achieve up to 98% single-electron ground-state initialization in a six qubit register with a 100% majority vote of three consecutive QND reads, on a timescale of about 300 µs. Our method achieves 98.9(4)% which is comparable to the state of the art while using fewer quantum resources. That the measurement time (approximately 40 ms) here is longer than in other methods should not be taken as a fundamental feature of our system. A device with faster tunnel rates could achieve similar fidelities in much shorter times. The generic scaling of initialization fidelity with observation time, expressed in multiples of the inverse tunnel rate, is shown in Fig. 2b.
The above analysis is conducted by tuning the donor electrochemical potential µ D in alignment with the Fermi level. Next we investigate how the initialization fidelity varies with the initialization level, i.e. the position of donor electrochemical potential µ D relative to E F during the measurement phase. The donor initialization level is controlled by the virtual gate VG (see Figure 1a) which maintains a constant SET potential.
In standard energy-dependent tunneling readout, the dependence of Γ ↑,out , Γ ↓,out on µ D is reflected in a tuning dependence of the initialization fidelity (Fig. 5b, grey). Conversely, the Bayesian Maxwell's demon proves to be very effective in reducing the tuning dependence, as shown by the plateau in F I (blue) extending for about half the range corresponding to the electron spin Zeeman energy. The range over which the mean data remain within 3% of the maximum value of each curve is approximately 40% larger when Maxwell's demon is employed (90 µeV cf. 64 µeV). Therefore, Maxwell's demon not only improves the initialization fidelity in absolute terms, but also makes it more robust against drift in the device tuning.
While common error-correcting codes place strict bounds on state preparation and measurement errors, they also typically require that the time taken for these steps is similar to the gate operation time. This defines the "clock cycle" of a quantum processor. In our case, the initialization and readout steps (about 10 ms) take significantly longer than the gate times (about 100 ns). We can slow down the gate operations by reducing the microwave power, however the coherence time of the system T 2 ∼ 100 µs then becomes a limiting factor. Improving initialization and readout times is thus a priority.
For spin readout based on energy-dependent tunneling [17,18], decreasing initialization and readout times to 100 ns requires increasing the qubit-reservoir tunnel coupling to Γ ↑,out ≈ 10 7 s −1 . The ultimate speed limit for this method is set by the value of tunnel couplings where the electron starts to behave as a Kondo impurity [49][50][51]. At that point one loses the isolated nature of the spin qubit, whose levels hybridize with the reservoir states. The theoretical analysis of the impact of Kondo physics on readout speed is an ongoing project and will be discussed in future work.
Alternatively, fast spin readout can be achieved using PSB in two-electron systems [43,52]. This method works also when one of the two electrons is hosted by a donor coupled to a surface quantum dot. A hybrid donor-dot device has been operated with interdot tunnel couplings approximately 10 9 s −1 in combination with latched electron readout [53]. In combination with PSB, our method could be used to first prepare a fiducial one-electron |↓ state, and then select the triplet or even-parity outcome of PSB readout to obtain a two-qubit register initialized in the |↓↓ state.

V. ELECTRON TEMPERATURE AND SPIN-DEPENDENT TUNNELING
So far we have described the action of the Bayesian Maxwell's demon in terms of its impact on the fidelity F I of initializing the qubit in the |↓ state. The increased fidelity upon real time observation by the demon should intuitively be linked to a reduction in the effective tem-perature of the system. In this section we attempt to quantify such a cooling effect.
The starting point is the electron temperature T e in the SET island. We measure T e ≈ 260 mK using the standard method of observing the broadening on the SET Coulomb peaks [54,55] as a function of the refrigerator mixing chamber temperature (Fig. 6a). This value is higher than the refrigerator base temperature approximately 20 mK due to the modest (10 dB) attenuation along the microwave line, necessary to allow for highpower delivery for nuclear spin control. Moreover, the charge reservoir we use for spin discrimination (the SET island) is also used as part of that charge sensing device, and thus subjected to a sporadic current flow which can affect its temperature. As we detail below, the attempt to relate F I to T e highlights some long-standing (but seldom discussed) inconsistencies in the standard models of spin-dependent tunneling.
We can define an effective temperature T eff that determines F I from the tunnel rates between the donor and the Fermi reservoir. Let us call H the Hamiltonian describing the electron tunnel coupling between donor and SET island. Applying Fermi's golden rule, the (elastic) tunnel rate of a |↑ electron from the reservoir to the empty donor can be written as: where 0| H |↑ is the tunneling transition matrix element between initial (|0 , i.e. donor ionized) and final (|↑ electron on the donor) state, H is the tunnel coupling Hamiltonian, n(E) is the reservoir density of states, and E ↑ ≈ 82.5 µeV is the Zeeman energy of the |↑ electron, having set E F = 0 by convention. The dependence on T eff is given by the Fermi function. Similarly, the tunnel rate of a |↓ electron to the reservoir is At the ideal readout position, E ↓ = −E ↑ . Here, and in the near totality of the literature on spindependent tunneling in quantum dots, two implicit assumptions are made: (i) that ↓| H |0 = ↑| H |0 , i.e. the tunnel barrier seen by either spin state is the same, and (ii) that the density of states is constant over the range of interest, i.e. n(E ↑ ) = n(E ↓ ). Assumption (i) is physically justified on the basis that the barrier profile is, in fact, the edge of the conduction band ( Figure  1b), which itself is subjected (to a very good approximation) to the same Zeeman splitting as the donor-bound electron [56]. Assumption (ii) is carried over from the physics of spins in quantum dots tunnel coupled to a two-dimensional electron gas, where n(E) = const. [57]. We know that our situation is rather different, because the charge reservoir into which the electron tunnels is an SET island with about 100 electrons, i.e. a near-zero dimensional confining potential. A simple estimate yields a single-particle level spacing ≈ 24 µeV [41], smaller than the Zeeman splitting and comparable to the temperature of the experiment.
In the absence of the Maxwell's demon, the expected initialization fidelity is simply: This model fails to reproduce the no-monitoring (grey) data in Fig. 5b. At very negative initialization level, where f (E ↑ ) ≈ f (E ↓ ) ≈ 1 and Γ ↑,in ≈ Γ ↓,in , the model predicts F NM I ≈ 50%, versus the observed ≈ 70%. Such behavior is ubiquitous in electron and hole spin qubits in GaAs [17], Si [18,58] and Ge [59]. The initial spin-up fraction upon loading a random electron is seen in spinlattice relaxation (T 1 ) experiments, and is usually around 30%-40% instead of the expected 50%. We are not aware of papers reporting a 50% spin-up fraction from random loading.
More detailed analyses of spin-dependent tunnel rates in quantum dots [56,60] further confirm such discrepancies. Following Ref. [56], we introduce a phenomenological parameter χ as: We allow χ = 1, but assume that it does not depend on T eff . Defining the ratio of tunnel-in rates: the bare initialization fidelity becomes: The no-monitoring data at very negative initialization level in Fig. 5b can be used as a proxy for F NM I when T eff → ∞, because it describes the case where f (E ↑ ) = f (E ↓ ). From F NM I (µ D 0) = 72% at deep plunge we extract χ = 0.388. The solid line in Fig. 6b describes F NM I as a function of T eff , calculated from Eq. 15. From  Fig. 5b, the no-monitoring data at the optimal readout point yield F NM I ≈ 81%, which corresponds to T eff ≈ 2 K (grey dot). From fitting the data in Fig. 4 we obtain F I (N ) ≈ 78% for N = 0, which corresponds to T eff ≈ 3 K (red dot). The action of the Bayesian Maxwell's demon resulted in F I (N ) ≈ 99% for N = 2000. To this result, following the black line in Fig. 6b, we can attribute an effective temperature T eff (N ) ≈ 270 mK, indicating that the demon has reduced the effective temperature by about an order of magnitude.
The above discussion does allow us to frame the action of the Bayesian Maxwell's demon as a form of cooling. However, it also highlights the fundamental inadequacy of simple spin-dependent tunneling models to quantitatively describe the data. tobs FIG. 6. a) The electron temperature Te = 260 mK is determined by the onset of an excess thermal broadening σ V of the SET Coulomb peaks when increasing the temperature T MXC of the dilution refrigerator's mixing chamber. b) The initialization fidelity prior to the Maxwell demon's intervention (shown in red) is F I (0) = 78% which corresponds to the Fermi population at T eff = 2.95 K. With Maxwell's demon monitoring, F I reaches approximately 99% (shown in blue), which corresponds to an effective temperature T eff = 270 mK.

VI. CONCLUSIONS
We have presented a simple and effective method to drastically improve the initialization fidelity of an electron spin qubit. Starting from a poorly thermalized charge reservoir, we have achieved F I = 98.9(4)%. The method can be described as a form of Bayesian Maxwell's demon, that updates its confidence about the true state of the qubit while performing a negative-result measurement, i.e. watching the absence of a tunnel-out event. The effect can be conceptually described as drawing the electron from a colder reservoir, but a quantitative analysis reveals that a simple spin-dependent tunneling model is not adequate to capture the details.
Our method is purely based on classical software and does not require additional quantum resources such as ancilla qubits. We used a nuclear spin ancilla solely to verify the initialization fidelity beyond the intrinsic electron spin readout fidelity, but once the method is "trusted", it can be applied to single qubits without ancillas. Further increasing F I to 99.9% will be possible by adopting faster readout techniques, e.g. with cold baseband [61] or radio-frequency [52,62] amplifiers, or in cavity-based setups [63][64][65][66].
Future work will focus on integrating this method within multi-qubit systems [6,67]. We expect it will improve the fidelity in preparing highly entangled quantum states, and enable sufficient state preparation fidelity to implement quantum error correction codes [1, 2] at a fault-tolerant level. Office (Contract no. W911NF-17-1-0200), and the Australian Department of Industry, Innovation and Science (Grant No. AUSMURI000002). M. A. I. J. acknowledges the support of an Australian Government Research Training Program Scholarship. We acknowledge support from the Australian National Fabrication Facility (ANFF). All statements of fact, opinion or conclusions contained herein are those of the authors and should not be construed as representing the official views or policies of the U.S. Government.

Appendix A: Device fabrication and experimental apparatus
The device is fabricated on a 0.9 µm thick enriched 28 Si epilayer with a residual 29 Si concentration of 730 ppm. The epilayer is implanted with 31 P ions at an energy of 10 keV and fluence of 1.4 × 10 12 cm −2 . Further details on the device design, fabrication and ion implantation are given in Ref. [6].
The device is mounted in a copper enclosure and wirebonded to a gold-plated printed circuit board with aluminum wires. The sample is then mounted in a Bluefors LD400 cryogen-free dilution refrigerator with a base temperature of 22 mK. The sample is mounted in the centre of a superconducting solenoid which is set to a magnetic field of approximately 1.423 T.
The electronic apparatus used to operate the sample is identical to that in Ref. [68].
The Maxwell's demon is implemented in the FPGA hardware of a Keysight M3300A digitizer. The Maxwell's demon takes the form of a simple state machine with three states: observation, trigger and post-trigger wait. In the observation state, a hardware counter increments while a blip is not detected (¬B n ) and resets otherwise (B n ). Once the counter value N reaches the prescribed observation time N T s = t obs , the demon's state changes to trigger. While in the trigger state, an output trigger is asserted for a fixed duration, and then the state automatically changes to the post-trigger wait which waits for the measurement pulse sequence to complete before automatically transitioning back to the observation state.
The logic is designed to operate in a single cycle of the onboard clock to minimize the response time of the hardware. The onboard clock runs at 100 MHz. There is a single cycle delay between t obs being met and the trigger being asserted, which accounts for an approximately 100 ns latency.
We note that the SET signal is downsampled to a rate of f s = 100 kS/s (T s = 10 µs), or two times the bandwidth f s = 2f c . The downsampling is a decimation from 100 MS/s without internal low-pass filtering and is performed by the proprietary Keysight digital acquisition system. As t rise < T s , a higher proportion of missed blips may occur, which could result in a worse initialization fidelity.

Appendix B: Iterative Bayesian update model
The probability of having a |↓ electron after monitoring the sensor current with a digital system can be described by an iterative Bayesian update process. A single sample, B n , is acquired at times n · T s for positive integers n. If no blip is detected in the first measured sample (¬B 1 ), i.e. the signal threshold is not exceeded, the |↓ probability is updated based on the likelihood of the electron not tunneling for either state (L(↓| ¬B 1 ) and L(↑| ¬B 1 )).
where P (↓) is the |↓ probability prior to obtaining a sample, with P (↓) + P (↑) = 1. The denominator is the marginal likelihood function over each spin state ψ ∈ {↓, ↑}. The likelihood of not observing a blip during a single sample is for a |↑ and |↓ electron, respectively. When the next sample, B 2 comes in, we can repeat the process as in Eq. (B1) but we replace the prior with the first posterior, P (↓ | ¬B 1 ).
where B 2 = (B 2 , B 1 ) represents the collection of N = 2 samples and the likelihood functions of two samples is simply the product of the likelihood function of each sample. Substituting Eqs. (B4) and (B3) into Eq. (B6) gives (B7) When the data are independent we can reformulate this sequential process as a one-step process [69], collecting the N samples and applying them 'all at once'. The data are independent in the case of tunneling because an object has the same likelihood of tunneling at all times over a fixed duration, i.e. L(↓| ¬B n ) = L(↓| ¬B n+1 ) for all n, and likewise for the |↑ case.

Appendix C: Accounting for imperfect detection
A missed blip is the result of an electron tunneling to the SET island followed by an electron rejoining the donor before the amplifier output signal rises above the detection threshold S th . Since these events are fundamentally undetectable with the measurement apparatus, we do not know when they occur. During an initialization trace where no samples exceed the detection threshold, it is possible that a blip is missed at any point in the trace. Moreover, it is also possible (though unlikely) that multiple blips are missed in a single trace. This makes the final |↓ probability difficult to exactly calculate since the different times at which the fast tunneling events occur yield different outcomes. Despite this inherent complexity, the initialization fidelity from a missed blip has a lower bound set by the prior |↓ probability P (↓) ≈ 78%. We now formally extend the model presented in the Sec. III and Appendix B to account for unobserved tunneling events.
The intuitive motivation for the following treatment is that the final initialization fidelity arises from two distinct cases: initialization where a blip is not missed P (↓ | ¬B N , ¬M ) and where a blip is missed P (↓ | ¬B N , M ). A missed blip consequently reduces the average initialization fidelity. Since the probability of missing a blip is inherently rare (Eq. 7), this yields only a small difference in the final outcome. The probability of having a |↓ electron after readout is therefore Since the unobserved tunneling events happen at an unknown time, the conditional probability P (↓ | ¬B N , M ) is difficult to define. However, we know the |↓ probability is lower in the cases where the electron does not tunnel due to the effect of the Maxwell's demon, i.e.
We can then reformulate Eq. C1 as is a number between zero and P (↓) depending on when the electron rejoins the donor in time. Z takes on its maximum value when a new electron rejoins the donor in the final sample of the initialization trace.
Since Z < 1, the upper bound to initialization fidelity F I is 1 − ZP M at t obs → ∞. This is higher than the conservative estimate 1 − P M presented in the main text (Eq. 8).

Appendix D: Maxwell's demon as a variable-strength observer
In this paper we present a Maxwell's demon that initializes a |↓ electron using readout. For long observation periods without a tunneling event, the initialization fidelity drastically improves as the demon performs a strong projective measurement onto the state |↓ . Conversely, for short observation periods, the initialization fidelity improves moderately, according to the amount of information extracted from the system [70]. In this way, the Maxwell's demon is performing a weak measurement for t obs Γ −1 ↑,out . Note that the measurement is weak only if no tunneling event occurs during t obs , since otherwise an electron tunneling projects the spin state to |↑ .
The information extracted from the system is described by a discrete-time Bayesian update process (Sec. III and Appendix B), but it can also be described by a continuous-time process. We define the measurement strength under continuous readout as the projection onto the |↓ state We now introduce a quantum master equation to describe the evolution of the electron state ρ(t obs ) under continuous measurement.
At the readout position, the donor electron can either be loaded (|↑ or |↓ ) or unloaded (|0 ). These three states now form our basis {|↑ , |↓ , |0 }. The electron state evolves according to with Liouvillian[71] and where W ↑↓(↓↑) are the electron spin-phonon relaxation (excitation) rates. For the present consideration, the electron phonon relaxation and excitation rates W ↓↑ W ↑↓ < T −1 1 ≈ 1 s −1 [37] are much smaller than the tunnel rates, and so are treated as zero, giving We assume an initial, randomly prepared electron state |↓ with probability P (↓) and |↑ with probability P (↑) = 1 − P (↓), By constraining ρ 3 (t obs ) = 0, we describe the evolution ρ(t obs ) in the absence of any observed electron tunneling events. The electron spin state then evolves as where C = 1 (1 − P (↓))e −Γ ↑,out t obs + P (↓)e −Γ ↓,out t obs (D7) normalizes the vector at each time t obs . The measurement strength then becomes which agrees with the discrete-time Bayesian update approach detailed in the main text (Sec. III, Eq. 4).
The rate of change of the measurement strength, ∂ ∂t obs m(t obs ), can be understood as the rate at which we accumulate knowledge of the spin state. Note that the rate of information gain depends on the initial population P (↓). This can be intuitively explained by considering the extreme cases of P (↓) = 1 or 0. Here, we know with certainty that the electron is initially |↓ or |↑ . Since there is no knowledge to be gained, ∂ ∂t obs m(t obs ) = 0. In the limit of measuring for infinite time without observing a tunneling event, the measurement strength (and the final electron |↓ probability) approaches unity: lim t obs →∞ m(t obs ) = 1. (D10)

Appendix E: Nuclear control fidelity
The control fidelity in these experiments is the accuracy of the NMR π pulse used to map the electron spin state to the nucleus. The fidelity of an NMR π pulse can be hampered by both a frequency mismatch of the applied stimulus and the system resonance ( ) and an over-or under-rotation caused by miscalibrated pulses. We define the control fidelity based on the Rabi formula where ∆ is the drive strength, Ω = √ ∆ 2 + 2 is the Rabi frequency and t pulse is the duration of the pulse.
A nonzero frequency detuning reduces the amplitude of the oscillation while an imperfect pulse duration t pulse leads to over-or under-rotation of the spin. Prior to each experiment we perform calibration routines that measure the NMR frequency corresponding to the electron |↓ state using Ramsey fringes to tune to within 100 Hz. With the precision of ≤ 100 Hz the amplitude of the Rabi oscillations is expected to be 99.98% with a measured frequency of Ω R ≈ 7.6 kHz.
The spin rotation angle θ = Ωt pulse can be determined by comparing Carr-Purcell and Carr-Purcell-Meiboom-Gill experiments, which allows us to extract the amount of over-or under-rotation of the spin [72]. Note that this method is insensitive to the sign of the angle of error due to symmetry of sin 2 (θ/2) about θ = π. We find a rotation error σ = θ − π of σ = ±0.143(7) rad with t pulse = 67 µs.
Substituting these values into Eq. E1 gives a final control fidelity of F C = 99.5(3)%.

Appendix F: Nuclear readout fidelity
The readout fidelity F R is the accuracy of correctly determining the nuclear spin state. Since we perform re-peated QND readout of the nuclear spin [11], the readout fidelity is sensitive to both the accuracy with which the nuclear spin state can be determined, F det , and how often the readout method causes the nuclear spin state to change during measurement, F QND . The nuclear readout fidelity can then be expressed as (F1) To determine the nuclear spin state we load an electron, perform an adiabatic electron spin resonance (ESR) pulse conditioned on the nucleus being |⇑ , and then read out the electron. We repeat this process n = 65 times, and record the fraction of these electron reads that are |↑ . Figure 7 shows a histogram of the electron |↑ fraction recorded from 100000 single nuclear spin readout shots. The histogram shows two clearly resolved peaks which correspond to the nuclear |⇓ and |⇑ states. We designate any electron |↑ fraction greater than a chosen threshold (indicated by the dotted line) as resulting from a nuclear |↑ (red region); otherwise it is designated a nuclear |↓ result (purple region).
The visibility V is a measure of how distinct the two peaks are, and is determined by fitting two Gaussian profiles to the peaks and calculating their overlap. The nuclear spin visibility provides a lower bound for the nuclear spin determination fidelity: The two Gaussian fits have a numerically calculated overlap of less than 5 × 10 −6 which gives a visibility of V = 99.9995%, hence F det > 99.9995%. While QND readout allows for the nucleus to be repeatedly measured, QND readout itself is imperfect due to "ionization shock" which can flip the nuclear spin when loading or unloading an electron. This is due to the components of the electron-nuclear hyperfine interaction tensor A that do not commute with the measurement operator, and thus violate the QND condition [73]. We find experimentally that each tunneling event has an average probability p = 1.4 × 10 −6 of changing the nuclear spin state. The probability of encountering zero erroneous spin flips during readout depends on the number of electron tunneling events that occur during readout which is on average the number of electron shots n, For a single nuclear readout, in which we perform n = 65 electron shots the average QND fidelity is F QND = 99.99%. Therefore, the average readout fidelity is F R = 99.99%.