Single-atom energy-conversion device with a quantum load

We report on a single-atom energy-conversion quantum device operating as an engine, or a refrigerator, coupled to a quantum load. The ‘working fluid’ consists of the two optical levels of an ion, while the load is one of its vibrational modes, cooled down to the quantum regime. We explore two important differences with classical engines: (1) the presence of a strong generic coupling interaction between engine and load, which can induce correlations between them and (2) the use of nonthermal baths. We examine the ergotropy of the load, which indicates the maximum amount of energy of the load extractable using solely unitary operations. We show that ergotropy rises with the number of engine cycles despite an increase in the information entropy of the load. The increase of ergotropy of the load points to the possibility of using the phonon distribution of a single atom as a form of quantum battery.


INTRODUCTION
Our green future may rely on energy-conversion devices at scales and temperatures where quantum effects become relevant or even dominant. Nanoscale heat engines and refrigerators are hence recognized as a promising research frontier [1][2][3][4] . To pave the way toward technological breakthroughs, researchers have investigated a number of fundamental questions, even examining the validity and pertinence of thermodynamic concepts at the nanoscale. Indeed, recent years witnessed fruitful studies exploring how the discreteness of energy levels, quantum statistics, quantum adiabaticity, quantum measurement, coherence and entanglement affect the operation of heat engine cycles in various experimental set-ups, including trapped ions, nitrogen vacancies, transmon qubits and more [5][6][7][8][9][10][11][12][13][14][15] . Models of quantum heat engines have also been exploited as a platform to investigate the thermodynamics underlying nanoscale energy conversion beyond the weak coupling limit [16][17][18][19][20][21][22] or in the presence of engine-load correlations 23,24 . Applications of quantum thermodynamics, and in particular of cooling, have been investigated in the realm of quantum computing 25,26 . Experimental investigations of quantum engine cycles are called for to clearly assess the correspondences, or lack thereof, between classical and quantum thermodynamic engine cycles. One important research direction is how to characterize the thermodynamic properties of a quantum engine operating in a generic scenario, for example, when the engine and the load are strongly coupled, and/or when the baths used are not thermal. This experimental work aims to set an important milestone toward the understanding of single-atom energyconversion cycles acting on a quantum load. This work is a realization and thermodynamic analysis of a nontrivial engine and refrigerator cycle simulator with generic and strong coupling to a quantum load. Our set-up is also such that the baths can prepare the engine in states that are not necessarily thermal. This is an additional feature of this simulator of generic quantum energyconversion systems, which may not be coupled to thermal baths. The protocol that we have devised for our energy-conversion system can be transferred to other experimental realizations of the Jaynes-Cummings Hamiltonian.
Recently, several experimental realizations of nanoscale engine cycles and thermodynamic processes have been reported [27][28][29][30][31][32][33] , including experiments in the quantum regime [30][31][32][33] . In this work, we build on previous efforts in this direction by realizing a hitherto unstudied class of heat engine cycles. In particular, the working fluid of our engine cycle consists of two optical states of a single trapped barium ion, and the load is one vibrational mode of the same ion. The load is prepared with a low average phonon number, which ensures it is in the quantum regime. We consider a generic coupling of the engine with the load, in which the interaction term does not commute either with the engine or the load Hamiltonians, thus enabling a significant back action between the two. This interaction allows us to investigate the impact of the strong engine-load coupling on the energy flow into the load and on the dynamics of the Shannon entropy of the load. We note that, for the energy of the load to change, it is a requirement that the engine-load interaction term should not commute with the Hamiltonian of the load. A second notable aspect of our system is that at the beginning of each cycle the engine is actively reset by the bath to a state which is not thermal, meaning not characterized by a thermal distribution. Taken together, these two properties yield more tunable engine cycles, which allow us to increase the information entropy of the load during heating cycles-a marked contrast with conventional sideband heating, where the information entropy of the load does not change. Furthermore, by rearranging the strokes of the engine cycle, the device can be readily executed in reverse, thus also functioning as a refrigerator that can decrease both the energy and, because of the coupling, the information entropy of the load. In this case, the device can be regarded as a thermodynamically analyzed experimental realization of a cyclic refrigerator coupled to a quantum load. Figure 1a depicts our experimental platform consisting of a linear ion trap, along with a single ion. Figure 1b presents a schematic of the two-level working fluid (in the following also referred to as the engine), which is coupled to one of the ion's vibrational modes, which is the load, shown in Fig. 1c. To represent the state of the atom, we use the basis states σ; n j i, where σ represents the internallevel state and n represents the motional-level state of the harmonic oscillator. We use the notation σ = ↑, ↓ to represent, respectively, the electron in the D 5/2,−5/2 or S 1/2,−1/2 (cf. Fig. 2), level of the engine, and σ = a for the auxiliary P 3/2 level used to reset the two-level system. A simplified schematic illustration of the cycle we have implemented is depicted in Fig. 2 (top), and a more detailed graphical representation may be found in Supplementary Fig. 1. In two of the four strokes, (I) and (III) (orange frames in Fig. 2), the engine is not coupled to the load and the engine state is optically pumped to the electronic ground state (spin down state) involving a dissipative process. In the other two strokes, (II) and (IV) (black frames in Fig. 2), the engine is coupled to the load and not to a bath. This is analogous to a classical Otto cycle, where the engine is decoupled from the load during two dissipative 'isochoric strokes' and is coupled to the load during two 'adiabatic strokes'. However, from a thermodynamics point of view, we must stress two important aspects. The first point concerns the adiabatic strokes: since the coupling of the engine and the load develops correlations between them and causes information entropy to increase in the load, the energy transfer between engine and load cannot be described solely as work. The second point is that we use a generic isochoric stroke in which the engine is not reset to a thermal state, in other words it is coupled to a nonthermal bath. Such a resetting protocol, however, is a path-dependent process in the sense that the engine could be reset to the same state using different dissipative and unitary processes, thus involving different energy exchanges. As a result of these two points, it is generally not possible to clearly differentiate between heat and work transfers, and these common notions must be complemented by other thermodynamic considerations. We will return to this subject in the section on Thermodynamic considerations.

Evolution of the engine cycle
Before implementing the cycle, the system is prepared in a welldefined initial condition by successively applying Doppler cooling and motional sideband cooling. This creates a thermal state that we refer to as O with σ = ↓ and average occupation of the harmonic oscillator 〈n〉 L ≈ 1.2 (note that we use the notation h i L ¼ trðρ L Þ, where ρ L ¼ tr E ðρ EþL Þ is the reduced density matrix of the load obtained by tracing out the engine from the 'engine + load' density matrix ρ E+L ). The cycle then proceeds with stroke (I b ), followed by stroke (II) and so on. The roman numeral notation (I)-(IV) denotes processes used to go between different states, as shown in Fig. 2 (top) and Supplementary Fig. 1, while the notation A, B, C and D is used to refer to the states themselves, as in Fig. 2 (bottom).
The four strokes are the following: Stroke (I) is composed of process (I a ) and (I b ). In process (I a ), any state with σ = ↑ is transferred to the auxiliary a state, which spontaneously decays to the σ = ↓ and σ = ↑ states. Since the σ = ↑ state is continuously depleted, optical pumping into the σ = ↓ state takes place. Process (I a ) brings the engine back to the (nonlabeled) state between D and A, see Fig. 2. In process (I b ), with the engine decoupled from the load, the engine is reset to a pure quantum superposition of the two optical levels. This is done Fig. 1 Experimental set-up. a Image of the ion trap set-up with a single ion acting as both an engine and a load. b Schematic representation of the working fluid of a quantum engine (two-level system) and c the load (the vibrational modes of a quantum harmonic oscillator). The two-level system undergoes a cyclic evolution. The sizes of the filled circles in the harmonic oscillator pictorially represent the occupation probabilities of different modes. Initially, when the ion is cooled near the ground state, the spread in occupation probabilities is small (smaller blue circle). After operating the energy-conversion device for a number of forward (engine type, as opposed to refrigerator type) cycles, the spread in occupation probabilities increases (larger, fuzzier, red circle). (III), the processes do not couple the internal levels to the vibrational mode, and a dissipative process occurs (spontaneous decay denoted by a dashed arrow). In strokes (II) and (IV), the optical and vibrational degrees of freedom are coupled, and a change in the occupation of the internal level is accompanied by a change in the occupation of the vibrational modes. (bottom) The black dotted line shows the results of numerical simulations for the evolution over time of the occupation probability of the higher energy level (D 5/2,−5/2 ), of the two-level system, referred to as p D (left vertical axis). The solid blue line shows the evolution of the mean phonon number 〈n〉 L (right vertical axis). The five steps of the cycle are highlighted by shadings of different colors. First, the system is initialized to the starting state O. Process (I b ) takes the system from state O to A, as shown in green. Stroke (II), from A to B is in red, stroke (III), from B to C is in gray, stroke (IV) from C to D is in blue. Finally, the cycle is completed by process (I a ), in gray, followed by process (I b ) that brings the system to state A again. The horizontal dashed line in the middle shows the value to which the engine population is reset, once in each cycle, at the end of stroke (I). Here this value is N. Van Horne et al.
using a partial Rabi oscillation applied between the σ = ↑ and σ = ↓ states, which creates a superposition with a predefined population ratio. Stroke (II): the engine-load coupling of Jaynes-Cummings type 34 is switched on, and each component of the density matrix of the load (the harmonic oscillator level) is either increased or decreased by one, depending, respectively, on whether the corresponding component of the engine state is in the upper σ ¼ " ð Þ or lower σ ¼ # ð Þ level. Stroke (III): The engine and the load are decoupled, and the component of the engine that is in the excited state is dissipatively brought back to the ground state by optical pumping via the auxiliary a state. This process involves a spontaneous decay and is exactly the same process as for (I a ). Stroke (IV): The engine-load coupling of anti-Jaynes-Cummings type is switched on, which swaps the "; n þ 1 j i and the #; n j i components of the density matrix. The cycle repeats, with each of the subsequent processes in (I)-(IV) bringing the engine to, in consecutive order, states A, B, C, and D in Fig. 2 (bottom). If not explicitly stated otherwise, the specific timedependent driving protocol used to implement strokes (II) and (IV) is a resonant sideband transfer 35 .
After this general overview, we now provide a more detailed description of the set-up and the coupling terms. The device consists of a single Ba + ion confined in a radiofrequency linear Paul trap 36 . The Hamiltonian of the whole system is given by where H E = ℏ(ν/2)σ z is the Hamiltonian describing the two optical levels of the engine, H L = ℏω(n + 1/2) is the Hamiltonian of the load, and V M (t) is the interaction Hamiltonian that characterizes the strength of the interaction between the engine and the load for the strokes M = (II) and (IV). V M (t) can be of Jaynes-Cummings type, V (II) (t) = ℏg(t)(σ + a + σ − a † ), or of anti-Jaynes-Cummings type, Here, ℏν denotes the energy difference between the two levels of the engine, σ z is the standard Pauli matrix, ω is the harmonic oscillator frequency of the load, and n is the phonon number operator for the load. The notation σ z should not be confused with the notation σ used to denote the internal states of the ion, σ = ↑, ↓, a. Additionally, g(t) (see the Methods for more details) denotes the time-dependent coupling strength, σ + (σ − ) raises (lowers) the engine state by one photon, and a (a † ) destroys (creates) one phonon in the load. Note that V M (t) does not commute with either the engine Hamiltonian H E or the load Hamiltonian H L , which indicates that the engine-load coupling can redistribute the population between the engine states; that is, the two optical levels S1 2 ;À 1 2 and D5 2 ;À 5 2 (see the Experimental set-up section in Methods for details).
The four-stroke cycle described above differs from typical classical thermodynamic cycles in two significant ways: First, throughout the duration of the Jaynes-Cummings and anti-Jaynes-Cummings interactions (180 μs for resonant sideband transfers), there is strong coupling between the engine and load, leading to correlations between them. Although the correlations are dispelled during resetting, within each cycle they contribute an integral part to the mathematical description of the system (see Supplementary Material 2).
Second, through a process involving energy exchange with both the vacuum of the photon field (in (I a )) and the lasers (in (I b )), stroke (I) brings the engine to a predetermined nonequilibrium superposition state, rather than a thermal equilibrium state. Together with the coupling between the engine and load during strokes (II) and (IV), which entails significant population redistribution within the engine, this opens the door to a generic set of operations that can be used to increase the information entropy of the load. As shown below, tuning the superposition state of the engine offers a useful control knob to manipulate the output of the device.
The two aforementioned features allow us to explore situations relevant to energy-conversion devices in the quantum regime. For example, the first point above shows that, in an accurate description of a quantum engine coupled to a quantum load, the strokes in which the engine is coupled to the load are not described by a unitary evolution of the engine alone, and the evolution is only unitary at the level of the full engine + load system. This is in sharp contrast to most existing theoretical models of quantum engine cycles, where an operation to extract work from the engine is assumed to be a unitary process of the engine alone (for example, refs. 6,8,10,12 ). It is therefore of crucial theoretical importance to include a quantum load and its correlations with the engine, if one is to accurately assess the performance of nanoscale engine cycles.

Device simulations and experimental measurements
We first analyze the system using numerical simulations of the forwards engine cycle, taking into account the most relevant aspects of our experimental set-up, including the main decoherence effects (see the Methods for more details). For a more intuitive understanding of the evolution of the populations in the engine and the load, we refer the reader to Supplementary Fig. 1. The black dotted line in Fig. 2 (bottom) depicts simulation results for the occupation of the D level, p D , over time, while the solid blue line shows the average phonon number in the load, 〈n〉 L . Different shadings identify different strokes, with the red, gray, and blue regions corresponding, respectively, to strokes (II), (III) and (IV). Stroke (I) is partitioned into two shadings: gray for making the engine decay to its ground state on optical pumping, (I a ), and green for bringing the engine to a predetermined value of its excited-state population, p A D , (I b ). The horizontal black dashed line in Fig. 2 (bottom) marks the value corresponding to the beginning of the red region, which for this set of simulations is p A D ¼ 0:32. In Fig. 2 (bottom), 〈n〉 L increases roughly proportionally to the number of engine cycles. Meanwhile, the occupation of the Dlevel of the engine tends toward a periodic pattern (sharper peaks, right) after a transient period.
Next we turn to experimental measurements. Figure 3a shows the average phonon number, 〈n〉 L , versus the engine cycle number N c (red dotted line with ), confirming that the engine cycle indeed transfers energy to the load in an approximately linear fashion, with the average phonon occupation number, proportional to the average load energy, increasing from 〈n〉 L = 1.2 to 〈n〉 L = 6.1 over the course of N c = 8 cycles. To demonstrate that our engine cycle can operate in reverse, we execute the strokes in the order (I), (IV), (III), (II), with the load initially prepared in a highly excited state. The results for this refrigeration operation (blue dot-dashed line with ) are also presented in Fig. 3a for comparison. In both cases, the change of 〈n〉 L is fairly uniform from cycle to cycle for the first eight cycles. Although it cannot be seen from the values of 〈n〉 L in Fig. 3, each data point corresponds to an increasingly non'thermal-type' distribution in the load, going from left to right, as we find from our analysis detailed below.
To measure the average phonon number, we use the experimentally derived probability distribution of the occupation of each level of the load, p n . This is obtained by least-squared fitting of p n with experimentally measured blue sideband Rabi oscillations and using the numerically derived distribution of p n as an initial condition for the fitting (details in the Methods). Each such data point in Fig. 3 is based on a delay scan containing up to 200 time steps for the highest precision (smallest error bar) measurements. Each data point in the delay scan contains 150 repetitions of the exact same experimental sequence, averaged together. An example of a delay scan is shown in the Methods.
We now focus on the performance of the forward cycle. In Fig.  3b, we show that the rate of change in 〈n〉 L versus N c can be tuned by resetting the engine to different states before stroke (II) (point A in Fig. 2 (bottom), or in other words by varying p A D . An increase in p A D increases the rate of change in 〈n〉 L and equates to greater energy flow into the load. This is because, for larger p A D , the Jaynes-Cummings-type engine-load coupling in stroke (II) induces a smaller decrease of 〈n〉 L .
Finally, we study how different engine-load coupling protocols might affect the energy flow from the engine to the load. The experimental results for this comparison are depicted in Fig. 3c, where, in terms of 〈n〉 L versus N c , a rapid adiabatic passage (RAP) protocol 37 (black ) is compared with the resonant sideband transfer (blue ) used in Fig. 3a-c. For both cases in Fig. 3c, Compared with the resonant sideband transfer protocol, the RAP protocol nearly doubles the energy transfer rate. This observation can be understood by the fact that the RAP protocol effectiveness in transferring the populations is greater compared to the resonant sideband transfer. We note here that the only experimental data pertaining to RAP is in Fig. 3c, while all other data are obtained using resonant sideband transfers.

Thermodynamic considerations
The engine cycle we have designed and implemented is shown to pump energy into the quantum load in a cyclic manner. The next step is to look at how the cycle influences the population distribution within the load. When energy is pumped into the load, one might wonder, for instance: (1) whether the load is merely being heated up (in which case the distribution remains thermal), (2) whether the load's energy increases but the information entropy remains constant or (3) whether the load's energy increases and the information entropy also increases. In addition to being of basic interest, understanding how the population evolves within the load is helpful in determining whether cyclic repetitions of the four strokes can be used as a means of 'charging' the harmonic oscillator/load, effectively turning it into a quantum battery 38,39 .
To this end, we introduce the concepts of ergotropy E L and of passive states 40,41 . By definition, the ergotropy of a system is the maximum energy that could be extracted from it via solely unitary operations. It should be noted that unitary operations preserve the information entropy and the rank of the density matrix. A state is passive when the associated density matrix is diagonal in the representation of energy eigenstates, with the diagonal terms (the occupation probabilities) decreasing for increasing energy eigenvalues. To give a familiar example, all thermal states are passive, since the probability of occupation of higher energy levels is smaller than that of lower energy levels. As a case in point, the initial thermal state in Fig. 4a is passive.
It follows that to determine the ergotropy of a given population distribution, the distribution can be compared with its corresponding so-called 'passified' state. The ergotropy is then defined as the difference in energy between the original state ρ L (t), and the passified state,ρ L ðtÞ ¼ Mρ L ðtÞM y where M is an ideal unitary transformation that renders the state ρ L (t) passive. Following ref. 40 , the ergotropy of the load at a given time t is E L ðtÞ ¼ tr½H L ρ L ðtÞ À tr½H LρL ðtÞ, where H L is the Hamiltonian of the load, ρ L (t) is the reduced density matrix of the load andρ L ðtÞ is the passified state. Note that ergotropy is always greater or equal to zero, and it vanishes for passive states 40 . Experimentally, to determine the ergotropy of the load we look at the distribution of p n within the load and make the assumption (justified below) that the off-diagonal elements of the density matrix of the load ρ L (t) may, in our case, be neglected when evaluating the ergotropy. This assumption turns out to be accurate despite the fact that coherence is present throughout the duration of the coupling between the engine and the load. We emphasize that, at the time at which the ergotropy is experimentally measured, the engine and the load are decoupled. Figure 4a,b shows two examples of measured p n distributions, extracted by fitting to experimental data. In Fig. 4c, we also show p n , the probability of occupation of the energy levels for the passified stateρ L ðtÞ, obtained by applying an ideal unitary transformation to ρ L (t), Fig. 4b. The initial state of the load in Fig. 4a is thermal and hence passive. After N c = 8 cycles, Fig. 4b, the occupation probability profile is no longer passive and the load has nonzero ergotropy. This can be seen from the shift in the location of the peak from n = 0 in Fig. 4a to n = 4 in Fig. 4b. The qualitative evolution from a thermal distribution toward a Gaussian form is driven by the preparation of a superposition during step (I b ) of the cycle. Theoretically, under ideal conditions of perfect state transfer and in the absence of dissipation, the ergotropy would grow with increasing number of cycles as . The detailed evolution of the ergotropy measured in the experiment is shown in Fig. 4d by . For N c = 8 cycles, the ergotropy is calculated using the states ρ L (t) andρ L ðtÞ shown in Fig. 4b,c.
The ergotropy clearly grows with the number of cycles, indicating that successive iterations of the same cycle continuously increase the ergotropy of the load. Numerical simulations of the state of the ion with increasing cycles support this (continuous and dashed lines), showing that the numerical and experimental values are in qualitative agreement. Since the experimental ergotropy is evaluated assuming a diagonal reduced density matrix of the load, the numerical simulations are also used to verify the validity of this approximation. The simulation results show that the difference between the approximated ergotropy, neglecting the off-diagonal elements of the reduced density In all panels, the lines connecting the data points are only to guide the eye. The error bars represent one sigma standard deviation and contain both statistical and systematic errors, obtained by parameter estimation using the least-squares method (see the Methods for details). The reduced χ 2 value that gives the error bars depends strongly on the number of data points in a given fit, which ranges from 25 to 200. In all cases, the phase error that enters in the χ 2 is 0.1, estimated from >150 replicates. matrix of the load (dashed black line) and the exact ergotropy (continuous red line), is indeed small.
In addition to the change in ergotropy, Fig. 4b shows that the variance in the phonon number increases over a few cycles. This behavior is consistent with a pattern of biased diffusion, as predicted in an earlier theoretical study 24 . Figure 4e,f shows both numerical and experimental results for the evolution of the von Neumann (Shannon information) entropy S L ¼ Àtr ρ L log ðρ L Þ ½ for an engine-load coupling implemented by the resonant sideband transfer protocol. The red continuous line represents the exact information entropy of the load while the black dashed line represents an estimate of the information entropy neglecting the off-diagonal elements of the reduced density matrix of the load. Since the two curves are very close to each other, the experimentally measured values of p n can be used to estimate the information entropy of the load, depicted by blue squares and triangles in Fig. 4e,f. Figure 4e shows the information entropy increasing over N c = 8 cycles, for p A D ¼ 0:32. Figure 4f shows the information entropy decreasing over the course of 15 cooling cycles, with p A D ¼ 0:5. Here we note the experimental constraint on the error bars in Fig. 4. For the specific endpoint cases of 0 cycles and 8 or 15 cycles, we used longer scans to reduce the error bars and to confirm the general trends. However, the time required to perform such scans for every number of cycles in turn would diminish the overall accuracy of the results; this is because of slow long-term instabilities in the lasers, which increase the systematics. We observe the fact that the information entropy increases in Fig. 4e can be traced back to the coupling between the engine and the load in strokes (II) and (IV), which leads to the result that the overall density matrix cannot be accurately modeled as a tensor product of the reduced density matrices of, respectively, the engine and the load. Therefore, the increase in information entropy provides one signature of the presence of correlations between the engine and the load.
With the benefit of the above thermodynamic analysis, we find it pertinent to compare the effect of the experimental sequence studied here, with the process of sideband heating or sideband cooling. First and perhaps most obviously, in sideband heating or cooling the two-level system is continuously coupled to the harmonic oscillator. This prohibits the simulation of a four-stroke equivalent thermodynamic cycle where two of the strokes are performed on the engine alone (strokes (I) and (III)). Second, and related to this, in sideband heating or cooling one of the 'qubit' states is continuously emptied. This is in contrast with stroke (I b ) of our energy-conversion cycle, which creates a superposition of the engine states. Using a superposition changes the thermodynamic behavior of the system on application of stroke (II), which consequently produces an increase in the information entropy of the load. This distinguishes our cycle from both plain heating of the load, for which the ergotropy would not increase, and sideband heating, which in ideal conditions would increase the energy of the load but not the information entropy.
To summarize, our four-stroke cycle investigates a generic scenario in which the coupling between the engine and load does not commute with their respective Hamiltonians and in which superposition states of the engine are used to tune the engine performance.

DISCUSSIONS
This work describes the experimental implementation and theoretical study of both an engine and a refrigerator quantum cycle, using two electronic states of a single trapped ion as the working fluid and one vibrational mode of the same ion as the quantum load. We demonstrate that, when engine cycles are run after preparing a superposition of electronic states, the ergotropy, information entropy, and average phonon number in the load increase. We also run the device under different forward-cycle conditions, demonstrating that its operation can be variably tuned. This is a thermodynamic study of a cyclic quantum energyconversion device operating with strong coupling to a load that operates in the deep quantum regime. Peculiar features of our energy-conversion device include (1) resetting of the working fluid to nonequilibrium states, through the use of both dissipative optical pumping and coherent laser excitation to implement stroke (I), and (2) the presence of nontrivial back action from the load.
A detailed analysis of the dynamical and thermodynamic properties of the engine cycles shows that in theory, simulations, and experiment, the engine-load coupling results in correlations between the engine and the load, and information entropy generation and flow between them which, at this scale, cannot be neglected. A remarkable conclusion of this analysis is that, because it is possible to change the phonon population distribution of the load, the load can operate as an effective quantum battery. This battery could be discharged for instance by coupling it to another harmonic oscillator (for example, another Here the experimental data are given by the blue triangles. The quantities in this figure are derived from the same data used in Fig. 3, and the error bars represent one sigma standard deviation. As in Fig. 3, the reduced χ 2 depends on the number of data points in the fit for a given number of cycles, which ranges from 25 to 200. The phase error used is 0.1, estimated from >150 replicates. vibrational mode of the ion). Future experimental works could focus on the use of two or more harmonic oscillators as batteries, with a special focus on the charging speed, the role of correlations built between the oscillators, and the possible occurrence of quantum advantage 38,39,[42][43][44] . In particular, experiments using a larger number of ions could test whether quantum correlations between N qubits could lead to an N-fold advantage in the charging power per qubit when global operations are permitted, as predicted in ref. 45 .
Next, we briefly comment on the efficiency of the engine cycle. The cycle couples optical states of the ion (the working fluid) with its vibrational states (the load). As discussed previously, in a generic scenario it is not straightforward to differentiate heat from work and hence the usual definition of efficiency does not apply. Since the energy of each photon quantum is much greater than a phonon quantum, it is also not particularly useful to define the efficiency purely in terms of energy conversion. However, this set-up still converts photon quanta (in the engine) to phonon quanta (in the load). Therefore, analogous to solar cells, we define an efficiency of conversion of quanta, η Q , as the net increase in the mean phonon number in the load divided by the total input of photon quanta in the working fluid throughout the various strokes. For the cycle with Given the importance of measurements in quantum mechanics, and specifically in quantum thermodynamics, we conclude with a comment on the role of measurements. A projective measurement made on the state of the engine collapses both the states of the engine and the load. This makes it important to specify how measurements are performed in our experiment. In this work, the device is run for various numbers of cycles and then a single measurement is performed at the end of the prescribed number of cycles. However, we stress that, in our set-up, a nonselective measurement of the energy of the load 12,46 at an intermediate or later time would bear little impact on the evolution of the system for two reasons. First, the engine and the load are in a product state at the end of strokes (I) and (III). Second, even if quantum coherence can build up in both the engine and the load during the cycle, as explained above, because of the inherent decoherence in the experiment, the quantities we study are well described by a diagonal density matrix. Further studies are called for to gain deeper insight into the role of measurements in quantum energy-conversion devices.

METHODS Experimental set-up
Our energy-conversion device consists of a singly ionized 138 Ba + atom in a linear Paul trap, with a radial trap frequency of~1.7 MHz. The 138 Ba + ion has five internal energy levels relevant to this experiment. Four lasers at wavelengths of 493, 650, 614 and 1,762 nm are needed to address these states. The 493 and 650-nm lasers are used for Doppler cooling and repumping out of the D3 2 level, as well as for quantum state detection by fluorescence observation. The 614-nm laser is used in conjunction with the 1,762-nm laser for further sideband cooling, nearly to the ground state of the radial external motional mode. A separate, circularly polarized 493-nm laser, along with the 650-nm laser, is used to initialize the ion to the ground state of the engine, S1 2 ;À 1 2 , by optical pumping 47 . The 1,762-nm laser is also used to address the two energy levels, which constitute the engine of our device, namely, the S1 2 ;À 1 2 and the D5 2 ;À 5 2 states. This transition can alternatively be described as our quantum bit ('qubit') transition, due to its long (~30 s) lifetime 48 . We have confirmed that the lifetime is ≥2 s, which is sufficient for our purposes, since 2 s is longer than the characteristic time of individual experiments. Technical details of the lasers themselves and laser locking set-ups are available in refs. 49,50 . The 650-and 614-nm lasers, along with the Doppler-cooling 493-nm laser, are combined into a single beam before being focused on the ion, while the 1,762-and 493-nm (optical pumping) beams are applied separately, through different optical viewports into the ultra-high vacuum chamber. The 1,762-nm laser's frequency is tuned by generating a signal either using a direct digital synthesizer (DDS) or an arbitrary waveform generator (AWG) for resonant sideband or adiabatic sideband transitions, respectively. The signal produced by the DDS or AWG is channeled by a switch and then amplified before going to an acousto-optic modulator.
To implement the simplified two-level system depicted in Fig. 1, three pairs of coils in the Helmholtz configuration are used to apply a 4 Gauss external magnetic field along the axis of the 493-nm (optical pumping) laser beam. This Zeeman splits the otherwise degenerate internal atomic energy levels and defines an axis of quantization of the atom. To initialize the ion to the well-defined ground state, S1 2 ;À 1 2 , at the beginning of each experiment we apply the 493-nm optical pumping beam, with left circular polarization, propagating along the quantization axis.
As mentioned previously, the engine of the device is formed by the approximate two-level system consisting of the S1 2 ;À 1 2 and the D5 2 ;À 5 2 states. The transition between these states is addressed by the narrow linewidth (nearly single frequency) 1,762-nm laser (linewidth ≲100 Hz). The two-level approximation holds since the 1,762-nm laser hardly shifts any other energy level of the atom while addressing the S1 2 ;À 1 2 and D5 2 ;À 5 2 levels on resonance.
The ion's internal quantum state, that is (for our purposes), whether it is in the S1 2 ;À 1 2 or D5 2 ;À 5 2 state, is determined by measuring its fluorescence while exciting it with only the 493-and 650-nm lasers. If the ion is in the D5 2 ;À 5 2 state, it is not affected by the 493-and 650-nm lasers, and no fluorescence is observed. If the ion is not in the in the D5 2 ;À 5 2 state, exposing it to the 493-and 650-nm lasers causes it to excite and de-excite continuously on the 493-nm transition, emitting 493-nm photons. In this way, by measuring 493-nm photons one can distinguish between the ground state and the D5 2 ;À 5 2 state with nearly 100% efficiency. Repeating such a measurement many times on an 'identically' prepared state, and averaging the results yields a value p S , or in other words the probability that the ion is in the S1 2 ;À 1 2 state.

Experimental procedure
The ion is first Doppler cooled for 300 μs using the 493-and the 650-nm lasers, and then sideband cooled for~25 ms by continuously applying the red detuned 1,762-and the 614-nm lasers. One full cycle of the device is implemented via the following steps: (I) The first step, D to A in Fig. 2 (bottom), consists of two parts: (I a ) (Setting the engine to its ground state): Any population in the D5 2 ;À 5 2 state is transferred from the D5 2 ;À 5 2 state to the S1 2 ;À 1 2 state via the P3 2 state. This is done by simultaneous application of the 614-, 650and 493-nm optical pumping lasers for~5-50 μs. The 493-nm optical pumping beam uses circularly polarized light to continuously empty the S1 2 ;þ 1 2 state. (I b ) (Resetting the engine to state A): The 1762-nm laser is applied to the ion at exactly the carrier optical transition frequency, for somewhere between 0 and 2.1 μs, depending on the desired value of p A D . (Note, 2.1 μs corresponds to half of a π time, or one quarter of a period, of the carrier Rabi oscillation). Although in our case the laser phase used for coherent excitation is fixed, producing a pure state, it could also be randomized to effectively prepare a mixed state. (II) (Red sideband transfer, A to B): A red sideband transfer is performed by applying the red detuned 1,762-nm laser for 180 μs (resonant transfer) or by sweeping (±30 kHz) across the red sideband frequency, over 4 ms, in the case of the rapid adiabatic protocol. Here red sideband and red detuned refer to the wavelength given by λ r.s. = (1,762-nm carrier transition) + 2πc/ω, where c is the speed of light and ω is the radial motional frequency of the ion in the trap, 2π × 1.7 MHz. The coupling strength, g(t), is 10-50 kHz for the resonant transfer, and~1.5 kHz for the rapid adiabatic protocol. (III) (Setting the engine to its ground state, B to C): Step (III) is the same as step (I a ). (IV) (Blue sideband transfer, C to D): A blue sideband transfer is performed by applying the blue detuned 1,762-nm laser (that is, λ b.s. = (1762-nm carrier transition) − 2πc/ω), for 180 μs, for the resonant transfer or by sweeping (±30 kHz) across the blue sideband frequency, over 4 ms, for the rapid adiabatic protocol. These strokes are repeated an integer number of iterations ranging from N c = 0 to 8 when using resonant sideband transfer for the coupling between the two-level system and the harmonic oscillator, or N c = 0-5 when using the rapid adiabatic transfer protocol. In stroke (I), the engine is prepared in state A (referring to the states in Fig. 2), in stroke (II) the engine and the load are coupled, then in stroke (III) the engine is prepared in state C and in stroke (IV) the engine and load are coupled again.
After the intended number of cycles is run, both the internal and external states of the ion are detected by performing a blue sideband Rabi excitation scan. This entails applying a laser at the wavelength λ b.s. for times ranging from t = 0 to t ≥ 100 μs, and at each time value the state of the ion is detected. For a given time value (each data point in Fig. 5), the full set of steps described above is repeated 150-200 times, and the fraction of the outcomes where the ion is found in the S1 2 state is calculated. Thus, to obtain the final state of the engine and the load after a given number of cycles, a measurement such as shown in Fig. 5

Modeling of the experiment
Each stroke M (I-IV) is modeled by a weak-coupling Markovian master equation of the form Here ρ E+L is the density matrix of the engine+load system, and [⋅, ⋅] denotes the commutator. As before, H E is the Hamiltonian describing the two optical levels of the engine, H L is the Hamiltonian of the load, and V M (t) is the interaction Hamiltonian. The three main dissipative processes are described by D L ϕ;M ðρ EþL Þ, for the dephasing of the vibrational mode (the load) due to fluctuations in the trap RF power, D L h;M ðρ EþL Þ for heating of the vibrational mode due to other environmental factors, and D E M ðρ EþL Þ for the decay of the two-level atom (the engine) due to spontaneous emission 35,51 . In more detail, D L ϕ;M ðρ EþL Þ is given by where γ L ϕ;M is the dephasing rate of the vibrational mode, n is the phonon number and the brackets denote the anti-commutator.
Here γ L h;M is the heating rate of the vibrational mode, n m is the target occupation of the mode, toward which equation (4) drives the harmonic oscillator, while a † and a are the creation and annihilation operators for the harmonic oscillator, respectively. D E M ðρ EþL Þ is given by where γ E M is the spontaneous emission rate of the excited electronic state of the atom and σ ± are the raising and lowering operators for the electronic states 51 .
Throughout a given stroke M, we have the parameter of the engine Hamiltonian ν = 170 THz (the frequency difference between the two levels), while for the load Hamiltonian ω = 1.7 MHz (the oscillation frequency of the ion). The coupling between the engine and the load is set to zero both for the first and the third strokes; that is, M = (I) and (III).
The dissipation rates for the load have been measured in separate experiments to be γ L ϕ;M ¼ 318 and γ L h;M 1 Hz (we use γ L h;M ¼ 0:4 s −1 in our simulations). The motional heating rate, γ L h;M , is consistent with the size of the trap. The atomic decay rate for the engine is measured to be <1 Hz, so we use γ E M ¼ 0:4 s −1 in the numerics. The dominating decay is thus due to γ L ϕ;M , the dephasing of the motional oscillation. These parameters are fixed in all strokes except the optical pumping stroke. In strokes (I a ) and (III), the optical pumping to the ground state is modeled by using γ E I ¼ γ E III % 700 kHz. Experimentally, this is achieved by transferring the population to a third excited state, which spontaneously decays at a similar rate as modeled. In stroke (I b ), an extra term ℏΩ 0 σ x , where σ x = σ + + σ − , is added to the engine Hamiltonian to effect a Rabi transfer between the S and D levels. The on-resonance coupling strength used in our experiment is measured to be Ω 0 = 121.7 kHz. This results in an evolution of the population of the excited D state as a function of time given by ref. 35 . To set the desired population ratio for the two-level system, Δt is adjusted while γ E M and Ω 0 are fixed by their experimental values. Strokes (II) and (IV) are executed either via a resonant sideband Rabi pulse or a sideband RAP protocol. The only difference between strokes (II) and (IV) is the frequency of the applied laser, which either corresponds to the first red sideband, which couples #; n j i with "; n À 1 j i, or to the first blue sideband, which couples #; n À 1 j i with "; n j i. For the resonant sideband transfer, the coupling between the engine and the load is given by VðtÞ res ðIIÞ ¼ _g n;n 0 ðtÞðσ þ a þ σ À a y Þ VðtÞ res ðIVÞ ¼ _g n;n 0 ðtÞðσ þ a y þ σ À aÞ where g n;n 0 is the sideband Rabi frequency when the states #; n j i and "; n 0 j i are coupled. The sideband Rabi frequency g n;n 0 is given by g n;n 0 ¼ η ffiffiffiffiffiffi n > p Ω 0 s ðtÞ, where n > denotes the greater of the two values, n and n 0 , and η = 0.012 is the Lamb-Dicke parameter. The amplitude Ω 0 s ðtÞ is 0 before and after the stroke, and it takes the constant value Ω 0 s t M ¼ π, where Ω 0 s is the sideband Rabi frequency for the transition between #; 0 j i and "; 1 j i, during the stroke. Thus, letting t M be the duration of the strokes M = (II), (IV), we use t M = π/g 0,1 for a complete population inversion when n = 0. Since the coupling strength g n;n 0 depends on n, the coupling strength increases with n. However, as t M is fixed, the percentage of the population transferred for a given time t M is lower for higher n values.
We also performed experiments using the RAP protocol, which has a weaker theoretical dependence on n. The coupling in the RAP interaction Hamiltonian is of Landau-Zener type, and it acts simultaneously on multiple levels n of the load. It is given by VðtÞ RAP ðIVÞ ¼ _ΔðtÞσ z þ 2π_g 0 ðσ À a þ σ þ a y Þ; where g 0 = ηΩ 0 ≈ 1.5 kHz. Here Δ(t) = −Δ 0 (1 − 2t/τ). Δ 0 is the range of frequencies across which the laser is swept, on either side of the sideband transition. σ z is the Pauli matrix, and τ is a parameter that is used to determine the sweep rate. The sweep rate is dictated by the ratio Δ 0 /τ. For the simulations, we use Δ 0 = ±30 kHz and τ = 4.0 ms. These values are based on results obtained from many experiments, performed while varying Δ 0 and τ to optimize the RAP transfer protocol for maximum In a, the error bars are all identical and based on a single measurement of the phase error, estimated from >150 replicates to be~0.1. In b, the reduced χ 2 is calculated as for Fig. 3 and depends on the number of data points in a given fit, ranging from 25 to 200. The phase error is the same as in a, and all error bars in a,b represent one sigma standard deviation.
transfer efficiency. In both strokes (II) and (IV), we achieve maximum transfer efficiency rates of~80%.
To simulate steps (I)-(IV) of the engine cycle, the time-dependent Hamiltonian is solved numerically using the python QuTiP package 52,53 . This gives the density matrix of the engine and the load at each point in time. The density matrix, ρ E+L , is then used to evaluate the observables of interest, to extract results from the observables, and to compare to experimental measurements.

Data analysis
The heat engine or refrigeration operations are implemented for a certain number of complete cycles (N c = 2, 4, 6, 8 or 15 for resonant transfer and N c = 1, 3 and 5 for the RAP transfer). At the end of a given number of cycles, the blue sideband laser is applied for a duration t. Then, a measurement on the (S state to P state) transition gives an outcome indicating whether the ion is in the S state or the D state. This procedure is repeated 150 times for each duration of the application of the blue sideband laser. The 150 experiments are then averaged to yield the probability that, given the operations to which the ion was previously subjected (the cycles), it is in the S state on measurement. This probability is called p S . p S is then measured for different excitation times (t + 3 μs, t + 6 μs and so on), with 150 experiments each time. For a typical scan, this process is repeated up to t ≥ 100 μs. For specific cases, to establish reference values, scans are run up to t = 600 μs. An example of a reference curve, along with the experimental 1-sigma error, is shown in Fig. 5a. This curve corresponds to the case N c = 8 and p A S ¼ 0:5. Outlier data points, p S , were removed manually by visually monitoring scans as they were in progress and noting the time when the photo-multiplier-tube detector signal dropped suddenly (due to occasional collisions) or increased suddenly (due to occasional laser instabilities).
For each number of cycles N c , the final state of the load is estimated from a scan such as just described, using the protocol outlined in ref. 54 . Theoretically, the p S (t) due to resonant sideband excitation is a linear function of the initial population distribution in the load (harmonic oscillator). The probability of the ion being in a given level of the harmonic oscillator, p n , is related to p S by p S ¼ X n p n cos 2 ðΩ n;nþ1 tÞe Àγ n t ; where Ω n,n+1 and γ n are the blue sideband Rabi frequency and the decay rate for the nth motional state, respectively 35 . Ω n,n+1 is determined from the experimental value of the Ω 0,1 . For γ n , we use the experimentally measured value γ n ¼ γ L h;M ffiffiffiffiffiffiffiffiffiffiffi n þ 1 p . To extract the distribution that is most likely to describe the experimental result, a least-squared fit is performed on the data using the model curve described by equation (9). The fit is constrained using the minimum number of n values that accurately capture the distribution. Typically, this is around 12-15 n values. As a starting distribution, the fit routine uses the expected distribution obtained from numerical simulations. The fit is then restricted to search for values of p n , which are within ±5% of the numerical simulation results. In most cases, the resulting reduced χ 2 value is <1, suggesting an overestimate of the phase error in the experiment. The phase error is estimated to be~0.1 based on >150 repetitive measurements of p S . The error was measured independently for two scenarios: after no heating cycles, and after eight heating cycles, to verify that running cycles does not affect the error on the phase. In both cases, the error was found to be similar. In Fig. 5a, the blue continuous line shows the fit for the corresponding data. Figure 5b shows the distribution of p n derived from numerical simulation (empty bars), as well as the fitted distribution of p n (shaded bars). The error on the fitted values of p n is calculated using a standard technique of error estimation for parameters of a least-squares fit 55 . We note that, to reduce the running time of the overall experiment, we have only produced reference scans for N c = 0 and N c = 8 cycles. The number of data points in these scans was chosen to be up to eight times greater than for other numbers of cycles. Therefore, for these scans the uncertainties on the derived observable are correspondingly smaller (Figs 3 and 4).