Introducing one-shot work into fluctuation relations

Two approaches to small-scale and quantum thermodynamics are fluctuation relations and one-shot statistical mechanics. Fluctuation relations (such as Crooks' Theorem and Jarzynski's Equality) relate nonequilibrium behaviors to equilibrium quantities such as free energy. One-shot statistical mechanics involves statements about every run of an experiment, not just about averages over trials. We investigate the relation between the two approaches. We show that both approaches feature the same notions of work and the same notions of probability distributions over possible work values. The two approaches are alternative toolkits with which to analyze these distributions. To combine the toolkits, we show how one-shot work quantities can be defined and bounded in contexts governed by Crooks' Theorem. These bounds provide a new bridge from one-shot theory to experiments originally designed for testing fluctuation theorems.


FIG. 1:
A synopsis of how our results relate to Crooks' Theorem: Crooks' fluctuation theorem links a probability distribution P fwd (W ) over work expended during one process to the distribution P rev (−W ) over the work recouped during the reverse process. One-shot statistical mechanics concerns functions of probability distributions, such as the order-∞ Rényi entropy H ∞ , the order-0 Rényi entropy H 0 , and the one-shot work quantities W ε and w δ . We derive properties of the forward protocol from properties of the reverse, without profiling entire distributions.
the system ends any forward trial. Then, the system may be allowed to thermalize to γ −τ .
If the system is a gas, the forward protocol can manifest as compression, and the reverse can manifest as expansion. 1 Suppose that an agent implements both protocols many times, measuring the work invested in each forward trial and the work extracted from each reverse. The measurements can be encapsulated in two probability distributions: P fwd (W ) denotes the probability that some forward trial will require work W (or the probability per unit work, if P fwd denotes a probability density), and P rev (−W ) denotes the probability that some reverse trial will output work W (or the probability per unit work). Let ∆F denote the difference between the Helmholtz free energies F (γ τ ) = −T log Z τ and F (γ −τ ) ≡ −T log Z −τ : ∆F = T log(Z −τ /Z τ ). (We use units in which k B = 1.) If the system's interactions with the bath satisfy assumptions discussed in Appendix A, the distributions and ∆F satisfy Crooks' Theorem [5], Though originally derived in a classical setting, Eq. (1) has been shown to govern quantum processes [6][7][8][9][10][11][12][13][14][15][16]. Finite-time changes of a quantum system's Hamiltonian can create superpositions of energy eigenstates. Measurements of the energy suffer from "quantum fluctuations." Our main results, relying primarily on Eq. (1), govern the classical and quantum systems that obey Crooks' Theorem. 1 To simplify notation, we label with the subscripts −τ and τ the values assumed by λ(t), H(λ(t)), the partition function, and the equilibrium state at times t = ±τ : λ ±τ , H ±τ , Z ±τ , and γ ±τ . When clarification is needed, we denote the inverse temperature β with a superscript: Z β ±τ and γ β ±τ .
We will focus mostly on continuous sets {W }, which have described classical and quantum systems (e.g., [9,12,16]). Multiplying each side of Crooks' Theorem by P rev (−W )e −βW and integrating over W yields Jarzynski's Equality [3], wherein . fwd denotes an expectation value calculated from P fwd . Applied to statistics about nonequilibrium processes, Jarzynski's Equality can be used to calculate the equilibrium quantity ∆F . An analog of Eq. (2) results from multiplying each side of Crooks' Theorem by P rev (−W )e β∆F and integrating: The left-hand side (LHS) of Jarzynski's Equality has been recognized as the characteristic function, or Fourier transform, of P fwd (W ) [9,16]. If u = iβ denotes the variable conjugate to W , the characteristic function is In terms of χ fwd (β), Jarzynski's Equality reads, and Equation (3) reads, χ rev (β) = e β∆F , wherein B. One-shot statistical mechanics Fuctuation theorems, we have seen, extend idealized quasistatic protocols to realistic finite-time protocols. One-shot information theory extends idealized protocols that involve n → ∞ trials to realistic finite-n protocols that might fail. Conventional statistical mechanics describes the optimal rate at which work can be extracted asymptotically. Consider extracting work maximally efficiently from n copies ρ ⊗n of a nonequilibrium state ρ. In the asymptotic, or thermodynamic, limit n → ∞, the average work extractable per copy approaches the free energy of ρ. The free energy depends on the von Neumann entropy H vN (ρ). In reality, work extraction is performed finitely many times, and realistic processes have probabilities δ of failing to accomplish their purposes. Finite-n work-extraction rates have been quantified by one-shot entropies [25,[29][30][31][32][33]. So have data compression, randomness extraction, quantum key distribution, and hypothesis testing [36][37][38][39].
One-shot entropies include the order-∞ Rényi entropy H ∞ , the order-0 Rényi entropy H 0 , the order-∞ relative entropy D ∞ , and the order-0 relative entropy D 0 . The order-∞ entropy of a discrete probability distribution P is [35] H ∞ (P ) ≡ − log ||P || ∞ , wherein ||P || ∞ denotes the infinity norm. The order-0 entropy is H 0 (P ) ≡ log |supp(P )|, wherein |supp(P )| denotes the size of the support of P . H ∞ has been called the minentropy, and H 0 has been called the max-entropy [25,26] (as has the order-1/2 Rényi entropy H 1/2 [36][37][38]). The quantum extensions H ∞ (ρ) and H 0 (ρ) are defined in terms of the greatest eigenvalue of ρ and the size |supp(ρ)| of the support of ρ. An extension of Eq. (7) is defined in §II.C, and D ∞ and D 0 are defined in §V. These one-shot entropies describe single implementations, or "single shots," of protocols.

C. Outline
We will unify fluctuation-dissipation relations with one-shot statistical mechanics as follows. In §II, we define the minimum work w δ that one reverse trial has a probability 1 − δ of outputting and the maximum work W ε that one forward trial has a probability 1 − ε of absorbing. w δ and W ε are shown to feature in generalizations of Jarzynski's Equality. Crooks' Theorem is used to bound w δ and W ε . The bounds contain H ∞ terms that quantify dissipated heat.
Section III contains three applications of §II. First, one-shot theory is shown to provide the natural language for a bound, derived by Jarzynski, on the success probability 1 − ε of a forward process. An H ∞ term is introduced into Jarzynski's bound. Second, we describe and numerically simulate an information-theoretic Carnot engine. The simulation is found to be consistent with our work bounds. Third, we test the work bounds with data from DNA experiments previously used to test Crooks' Theorem [20,22].
In §IV, H 0 quantifies the memory needed to store the amount of work associated with one trial. Section V combines the fluctuation-dissipation concept of dissipated work with one-shot relative entropies. Order-∞ relative entropies D ∞ between P fwd (W ) and P rev (−W ) are shown to signify the work dissipated during the worst possible trials. D 0 surprisingly fails to distinguish between P fwd (W ) and P rev (−W ).
In §VI, we model the forward and reverse protocols with two frameworks used in oneshot statistical mechanics: the work-extraction game in [26,40] and the resource theories in [29,30,41,42]. A bound on w δ derived in [26] is tightened and generalized with Crooks' Theorem. To verify that the game's and the resource theories' models of heat exchange are consistent with Crooks' Theorem, we clarify relationships among models of thermal interactions. Our unifying framework bridges fluctuation relations with one-shot statistical mechanics to draw mathematical tools from theory to experiment.

II. THEORY OF ONE-SHOT WORK QUANTITIES IN FLUCTUATION CON-TEXTS
We introduce into fluctuation problems the δ-extractable work w δ and the ε-required work W ε defined in one-shot statistical mechanics. The work quantities are called "oneshot" because they characterize every trial-every shot-not only averages. The definitions suggest generalizations of Jarzynski's Equality, and the generalizations imply bounds on w δ and W ε .

FIG. 2:
Illustrations of required work W ε and extractable work w δ : The shaded region under the P fwd (W ) curve has an area ε; that under the P rev (−W ) curve, an area δ. The forward and reverse work distributions intersect at ∆F , the difference between the free energies of the equilibrium states with which the forward protocol ends and begins.
A. Definitions of one-shot work quantities w δ and W ε in fluctuation contexts The work required to complete some forward trial, and the work outputted during some reverse process, cannot be predicted. Yet the minimum work required "up to some failure probability" ε, and the maximum work extractable "up to some failure probability" δ, can. Definition 1. Each implementation of the reverse protocol has a probability 1 − δ of outputting at least the δ-extractable work w δ that satisfies The trial has a probability δ ∈ [0, 1] of outputting less work than w δ .
An agent infers the form of P rev (−W ) by recording the work outputted by each of many reverse trials. From P rev (−W ) and Definition 1, the agent can calculate w δ . If the failure probability is small, then on a plot of P rev (−W ) vs. W , w δ appears leftward of W = ∆F . An example appears in Fig. 2.
Our w δ is the w δ s of Egloff et al. [25,26]. s denotes a strategy. The agent's strategy dictates which path H(λ(t)) follows through the space of possible Hamiltonians and which heat exchanges occur when. Maximizing w δ s over strategies yields the "guaranteed work" in the language of Egloff et al. To avoid confounding extracted work with required work, we call w δ "the work δ-guaranteed to be extracted" (or "the δ-extractable work") and call W ε "the work ε-guaranteed to be required" (or "the ε-required work"). Definition 2. Each implementation of the forward protocol has a probability 1−ε of requiring no more work than the ε-required work W ε that satisfies The trial has a probability ε ∈ [0, 1] of requiring more work than W ε .
An agent builds P fwd (W ) by recording the work needed to implement each of many forward trials. From P fwd (W ) and Definition 2, W ε can be calculated. W ε appears on the right-hand side (RHS) of a plot of P fwd (W ) vs. W if the failure probability is small (Fig. 2).
The failure probability ε has two interpretations. First, suppose an agent invests only the work W ε in a forward trial. λ(t) has a probability ε of failing to reach λ τ . Alternatively, suppose the agent invests all the work required to evolve λ(t) to λ τ . The agent has a probability ε of overshooting the "work budget" W ε . Different definitions of ε suit different contexts; the second definition suits the cyclic engine in §III.B.
B. Calculations of w δ and W ε from Crooks' Theorem We have explained how to calculate w δ from data about reverse trials and how to calculate W ε from data about forward trials. Even if only forward trials have been performed, w δ can be calculated via Crooks' Theorem; and even if only reverse trials have been performed, W ε can be calculated. Lemma 1. Each reverse trial has a probability 1 − δ of outputting at least the amount w δ of work that satisfies wherein generalizes the characteristic function χ fwd (β).
Just as w δ can be calculated from P fwd (W ), W ε can be calculated from P rev (−W ) via Crooks' Theorem.
Lemma 2. Each forward trial has a probability 1 − ε of requiring no more work than the W ε that satisfies wherein generalizes the characteristic function χ rev (β).
Proof. Upon multiplying each side of Crooks' Theorem [Eq. (1)] by P rev (−W )e β∆F , we integrate from −∞ to W ε . The proof continues analogously to the proof of Lemma 1.
The confluence of w δ and ∆F in Eq. (10), and the confluence of W ε and ∆F in Eq. (12), might surprise us. Whereas w δ and W ε characterize one-shot contexts, ∆F characterizes an asymptotic limit. This juxtaposition resembles the interrelation of the equilibrium quantity ∆F with the nonequilibrium quantity W by Crooks' Theorem.
Lemmas 1 and 2 describe open systems (that interact with the bath throughout t ∈ [−τ, τ ]) and closed systems (that do not). An alternative derivation of Lemma 2, specific to closed quantum systems, appears in Appendix B.
C. Bounds on w δ and W ε from Crooks' Theorem Though able to compute w δ from P fwd (−W ), an agent might prefer to bound w δ . One might want a quick-and-dirty estimate, and using the full distribution might be impractical. w δ can be bounded by one characteristic of the distribution, H ∞ , which offers physical insights about heat dissipation. Analogous statements describe W ε .
for any discrete probability distribution P whose greatest element is P max . (All logarithms in this paper have base e). We use continuous probability densities P (W ) in keeping with e.g., [9,12,16]. Let P max denote the greatest value of P (W ). The analog of Eq. (14) is − log(P max ), whose argument has dimensions of inverse energy. The awkwardness of these dimensions can be avoided as follows. Throughout the derivations in this paper, log(β) appears wherever − log(P max ) appears. We combine these terms into for a probability density P (W ) over work W exchanged at inverse temperature β. The log's argument has unit dimensions, and the behavior of H ∞ is analyzed below.
Proof. Let P max fwd denote the greatest value of P fwd (W ): P max fwd ≥ P fwd (W ) ∀ W . We can upper-bound the integral implicit in the χ δ fwd (β) of Eq. (10): Solving for w δ yields Ineq. (16).
Just as one might prefer not to calculate, but to bound, w δ , one might prefer to bound W ε .
Theorem 4. The work ε-required during each forward trial is bounded by for failure probability ε ∈ [0, 1).
Proof. Beginning with Eq. (12), we unpack the LHS's definition [Eq. (13)] and redefine the integration variable −W as W . The rest of the proof precedes analogously to the proof of Lemma 3.
We can interpret Ineq. (17) as follows: To a first approximation, the ε-required work equals ∆F , the work needed to switch λ(t) from λ −τ to λ τ quasistatically. In the forward and reverse protocols, λ(t) switches nonquasistatically. The system leaves equilibrium, and W fluctuates from trial to trial. These fluctuations necessitate a correction H ∞ (P rev ), whose argument P rev depends on the switching speed. If H ∞ (P rev ) ≥ 0, H ∞ raises the bound (as elaborated on below). As the switching speed rises from its quasistatic value, work is increasingly dissipated, and the required work increases. The log(1 − ε) corrects for the tradeoff between work and failure probability. The agent lowers the bound on the required work by raising the failure probability ε: As ε increases, log(1 − ε) decreases. Inequality (16) can be interpreted similarly.
The inverse temperature β sets the problem's energy scale. When H ∞ is positive, tightening Ineqs. (16) and (17). When Ineq. (18) is violated, H ∞ < 0 loosens the bounds. 2 Inequality (18) holds when the distribution lacks sufficiently tall peaks. Tall peaks, such as sharp Gaussians, describe quasistiatic processes and that obey conventional statistical mechanics. In contexts described poorly by conventional statistical mechanicscontexts for which one-shot statistical mechanics was designed-Ineq. (18) holds. Hence the one-shot quantity H ∞ tends to tighten Ineqs. (16) and (17) in contexts that require one-shot theory, appropriately. Such contexts include DNA-hairpin experiments used to test Crooks Theorem, as shown in §III.C. Other work quantities parameterized by ε have been bounded by the smooth order-∞ entropy H ε ∞ [25,26]. Whereas the argument of the H ε ∞ in [25,26] is a state, the arguments of the H ∞ in Ineqs. (16) and (17) are distributions P (W ) over work.
We have defined, calculated, and bounded the one-shot work quantities w δ and W ε in fluctuation contexts. Next, we apply our results.

III. THREE APPLICATIONS OF ONE-SHOT WORK QUANTITIES IN FLUC-TUATION CONTEXTS
Our unification of fluctuation relations with one-shot statistical mechanics is applied and tested in three ways. First, we recast and strengthen a bound, derived by Jarzynski, on the success probability 1 − ε. Second, we numerically simulate an information-theoretic Carnot engine. Third, we test our bounds with data from DNA experiments used previously to test Crooks' Theorem.
A. Tightening Jarzynski's bound on the success probability 1 − ε Dissipated work features implicitly in a bound derived by Jarzynski [44]. Without invoking one-shot language, Jarzynski bounds a success probability with a one-shot work quantity.
He uses the bound to explain why macroscopic systems rarely "disobey" the Second Law. Recasting Jarzynski's argument in terms of 1 − ε and W ε , we demonstrate its relevance to one-shot statistical mechanics. We also introduce an extra factor his bound using Theorem 4.

FIG. 3:
Recasting and tightening Jarzynski's bound on 1 − ε: Jarzynski's argument is recast in one-shot language under the assumption that the success probability 1 − ε is small. Each forward trial has a probability 1 − ε of requiring the amount W ε = ∆F − ζ of work or less. Some positive quantity ζ = ∆F − W ε separates this ε-required work from the work ∆F required during every quasistatic trial. Jarzynski's bound on 1 − ε is recast in Lemma 5 and tightened in Theorem 6.
Lemma 5 (Recast Jarzynski bound). Let W ε denote the work ε-required in any forward trial. The success probability obeys the bound wherein the failure probability is ε ∈ [0, 1] and W ε − ∆F denotes the maximum work that can be dissipated during any successful trial.
Proof. Let ζ denote an amount of work. Initially, we follow Jarzynski by assuming ζ > 0. Let us bound the probability P (W < ∆F − ζ) that some forward trial requires at most the work ∆F −ζ (which is less than the work ∆F required in any quasistatic forward trial). The calculation of this bound could be motivated by an agent's having budgeted work ∆F −ζ for some trial. The agent might wish to bound the failure probability ε = 1 − P (W ≤ ∆F − ζ) that the trial will overshoot the work budget. The forward trial has a probability 1 − ε of requiring at most the work ∆F − ζ = W ε . Hence −ζ = W ε − ∆F equals the most work dissipated during any successful trial. The dissipated work is defined as the difference between the work required in a finite-time trial and the work ∆F required in a quasistatic trial. Sacrificed for the sake of time, the dissipated work is wasted as heat. Positivity of ζ coincides with negativity of the dissipated work (W ε − ∆F < 0), with a high probability failure, and with the trial's costing less than any quasistatic trial. This scenario is illustrated in Fig. 3.
The probability that some forward trial succeeds is The e βW ε can be factored out. Crooks' Theorem replaces P fwd (W ) with P rev (−W )e β(W −∆F ) , and the W 's cancel: Loosening the bound, we extend the integral to all possible values of W : By the normalization condition, the probabilities sum to one, yielding Eq. (19).
Suppose the dissipated work −ζ = W ε − ∆F is negative. The agent can "save" up to an amount |W ε − ∆F | > 0 of work relative to the amount ∆F spent on a quasistatic trial. The bound on the success probability 1 − ε decays exponentially with this saved work. Jarzynski interprets the decay as follows: "[W]hile microscopic 'violations' of the Clausius inequality (W < ∆F ) might occasionally be observed, large violations (ζ k B T ) are effectively forbidden, in agreement with macroscopic experience" [44]. Agents rarely save positive work: If the dissipated work W ε − ∆F is negative, then the greater the saved work |W ε − ∆F | is, the lesser the bound on 1 − ε is, and the lesser can be the probability that the trial succeeds. The success probability trades off with saved work, as expected. An analogous argument concerns P rev (−W ).
Though Jarzynski assumes ζ > 0, Ineq. (19) holds when ζ = ∆F − W ε < 0. This scenario is illustrated in Fig. (2). A negative ζ = ∆F − W ε corresponds to a large work budget (W ε > ∆F ) and a small failure probability ε. The greatest amount W ε − ∆F of work that can be dissipated during any successful trial is positive. As the magnitude of this dissipated work grows, the bound on the success probability 1 − ε grows exponentially. The more work an agent is willing to sacrifice during a successful trial, the more likely a trial is to be successful.
The bound on ε implied by Lemma 5 complements the bound on W ε in §II.C. In §II.C, we fixed the failure tolerance ε, then inferred about W ε . Here, we fix W ε , then infer about the failure probability ε. Using the W ε bound, we can introduce another factor into Jarzynski's bound on 1 − ε.
Theorem 6. Let W ε denote the work ε-required in any forward trial. The probability 1 − ε that some forward trial succeeds obeys the bound wherein the failure probability is ε ∈ [0, 1], and W ε − ∆F denotes the most work that can be dissipated during any successful trial.

B. Numerical simulation of information-theoretic Carnot engine
The results of §II are illustrated with a Carnot engine, which we simulated numerically. In §1, we show that a Carnot cycle consists of forward and reverse protocols governed by Crooks' Theorem. In §2, we cast the cycle in information-theoretic terms. Our informationtheoretic Carnot engine is compared, in Appendix C, to other engines in the literature. Appendix D details how we simulated the engine numerically. The simulation is found to be consistent with the results in §II, as explained in §3.

Carnot cycle in terms of forward and reverse protocols
Upon reviewing the Carnot cycle, we cast it in terms of forward and reverse processes governed by Crooks' Theorem. The Carnot cycle involves two isothermal steps and two adiabatic steps (e.g., [45]). Consider implementing a forward (work-costing) protocol on a system in thermal contact with a temperature-T 1 heat bath. Consider then implementing the reverse (work-outputting) protocol at a temperature T 2 . If T 1 < T 2 , net positive work is extracted. If T 1 > T 2 , net positive work is spent on refrigeration, the cooling of an already-cold body.
Consider extracting net positive work from a Carnot engine. The first isothermal step can manifest as compression at a cold temperature T C ≡ 1/β C . Let P C fwd (W ) denote the probability that some instance of this process consumes work W . The second isothermal step can manifest as expansion at a hot temperature T H > T C . Let P H rev (−W ) denote the distribution over the extracted work. The work invested and extracted during the adiabatic steps is assumed to be negligible. This assumption is justified by the largeness of a parameter E max introduced in §1. Upon running many cycles, an agent infers the forms of P C fwd (W ) and P H rev (−W ). As P C fwd (W ) and P H rev (−W ) correspond to different temperatures, Crooks' Theorem does not interrelate them. The label "fwd" signifies work investment within one engine cycle. (Each cycle consists of net work extraction or of refrigeration.) The "rev" signifies work extraction within one cycle. To distinguish work extraction during a reverse process from the net extraction of work during an engine cycle (which involves one forward and one reverse process), we call work extraction during a reverse process reverse-extraction and call net work extraction during an engine cycle engine-extraction.
Running the engine in reverse (refrigerating) yields two more distributions, P H fwd (W ) and . Upon refrigerating many times, one can calculate not only the w δ and W ε for refrigeration, but also those for engine-extraction. Crooks' Theorem halves the number of trials needed to calculate the four one-shot work quantities.

Carnot cycle in information-theoretic terms
To merge fluctuation relations with one-shot information theory, we cast the Carnot cycle in information-theoretic terms. Consider a two-level system S governed by the Hamiltonian H(λ(t)) = 0|0 0| + E(t)|E E|. Suppose S exchanges energy with a heat bath whose If ρ represents the location of a particle in a two-compartment box, the agent has no idea which compartment the particle occupies.
Transforming ρ(−τ ) into a pure state-forcing the particle into one half of the box-is called bit reset, or Landauer erasure. Bit reset involves Crooks' forward process. From t = −τ to t = τ , S is coupled with a heat bath. By expending work, the agent increases the upper level's energy E(t) from 0 to infinity in small steps. [In our simulation, E(t) rises to a very large, but finite, value E max .] If the upper energy level is occupied, raising the level's eigenvalue by a small amount dE costs work dE. If the level has a probability p of being occupied, the average work cost of raising the energy by dE is dW = p dE. If the evolution proceeds quasistatically, S always occupies a Gibbs state relative to H(λ(t)): The system has a probability p = e −βE /Z of occupying the upper level. On average, raising E(t) from zero to infinity costs in the limit as dE becomes infinitesimally small. (Recall that we use units in which k B = 1.) Landauer predicted that T log 2 equals the minimum cost of resetting a bit [46]. If the bit is reset in a finite time, W might assume a greater value [34]. Once E(t) reaches E τ = ∞, S equilibrates to |0 . During the second leg of the bit reset, S is isolated from the bath, and E(t) is returned to zero. Since S does not occupy the upper energy level, this step costs no work.
Reversal of the bit reset amounts to Szilárd work extraction. Leó Szilárd envisioned the conversion of information into work in 1929 [47]. S begins thermally isolated, in the pure state |0 , and governed by H(λ(t)) = 0. During the first leg of Szilárd work extraction, the agent raises E(t) to infinity. The raising costs no work because S occupies the lower level. The second leg is an implementation of the reverse protocol (of reverse-extraction, in the language introduced in §1). S is coupled to the bath, then performs positive work as E(t) decreases to zero. By erasing at a low (high) temperature and Szilárd-extracting at higher (lower) temperature, one implements engine-extraction (refrigeration).
Let us define failure in a manner suited to a cyclic engine, an engine that completes every cycle initiated. We say that a forward trial fails if it consumes more work than the budgeted work W ε . If the trial consumes W ≤ W ε , it succeeds. We say that a reverse trial fails if it outputs less work than w δ . If the trial outputs W ≥ w δ , it succeeds. If either process fails or if both processes fail, the cycle fails. If both processes succeed, the cycle succeeds. 3

Numerical simulation
The information-theoretic Carnot engine was simulated numerically with a Monte Carlo method. A description of the simulation appears in Appendix D. The simulation supports the results in §II. Figure 4 illustrates data about refrigeration. The top plot describes the reverse process, cold Szilárd extraction at T C = 100 K. The bottom plot describes the forward process, hot Landauer erasure at T H = 300 K. Most of the curves (as explained below) represent data gathered by an agent who has performed many engine-extraction cycles and who infers about FIG. 4: w δ and W ε vs. failure probability for numerical simulations of an information-theoretic Carnot engine: An agent who performed many engine-extraction cycles, then inferred about refrigeration using the results in §II, was simulated. The dark blue curves' coinciding with the light blue curves supports Lemmas 1 and 2. The dark blue and light blue curves' locations relative to the red dashed curves support Theorems 3 and 4.
refrigeration using the results in §II. Each plot illustrates a one-shot work quantity (w δ or W ε ) as a function of failure probability. Energies have units of Kelvins because k B = 1. The upper energy level had a minimum energy of 0 Kand a maximum of E max = 3, 000 K. Let us focus on the top plot. The simulation of 50,000 cold Szilárd-extraction trials generated the probability distribution P C rev . From P C rev , w δ was calculated via Definition 1. This w δ appears as a light blue curve and serves as a benchmark against which to test the results in §II. Those results were tested as follows.
An agent who has performed many engine-extraction cycles (which involve cold erasures), and who wishes to infer about refrigeration (which involves cold Szilárd extraction) was simulated. The simulation of 50,000 cold erasures generated P C fwd . From P C fwd , ∆F = 72.0804 K was calculated via Jarzynski's Equality. From ∆F , w δ was calculated via Lemma 1. This w δ appears as a dark blue curve. The dark blue curve's lying almost atop the light blue curve implies the accuracy of Jarzynski's Equality, Crooks' Theorem, and Lemma 1.
Finally, the bound in Theorem 3 was calculated from P C fwd . The dashed red curve represents this bound. As the dashed red curve lies above the light blue and dark blue curves, the simulation obeys the bound. The simulation supports the results in §II, lending weight to the unification of one-shot statistical mechanics with fluctuation theorems. As does the simulation, so does experimental data.

C. DNA-hairpin experiments
When single molecules are manipulated experimentally, "fluctuations are relevant and deviations from the average behaviour are observable" [22]. Some such experiments are known to obey fluctuation-dissipation relations. We show that data from DNA-hairpin experiments used previously to test Crooks' Theorem agree with the one-shot results in §II. The agreement suggests that one-shot statistical mechanics may shed light on similar single-molecule experiments and applications. Crooks' Theorem and Jarzynski's Equality have been tested with colloidal particles [17], RNA [18,19], and DNA [20][21][22]. Data from DNA-hairpin experiments are used below. A DNA hairpin is a short double helix that consists of about 21 base pairs [20][21][22]. The helix's two strands are called legs. One end of one leg is attached to one end of the other leg, forming a shape like a hairpin's. The other end of each leg ends in a handle formed from DNA. To each handle is attached a polystyrene or silica bead. One bead remains anchored on a micropipette. The other is caught in an optical trap that exerts a force. During the forward protocol, these optical tweezers pull the legs apart, unzipping the DNA into one strand. The more quickly the hairpin is split (the greater the pulling speed ), the more work is dissipated. During the reverse protocol, the helix is rezipped. Probability distributions over the values of the work involved appear in [20,22].
Those distributions were combined with the results in §II, as illustrated in Fig. 5. The top plot derives from trials in which DNA hairpins were pulled at approximately 15 nm/s. The middle plot corresponds to 60 nm/s; and the bottom plot, to 180 nm/s. Each graph shows the work W ε that some unzipping is ε-guaranteed to require, plotted against the failure probability ε.
W ε was calculated from the distribution P fwd generated during unzippings and from Definition 2. This W ε appears as a light blue curve. Next, information about unzipping was inferred from the distribution P rev generated during rezippings (during reverse trials) and from the results in §II. ∆F was calculated from Jarzynski's Equality. From ∆F , P rev , and Lemma 2, W ε was calculated. This W ε appears as a dark blue curve. The dark blue curve's closeness to, and frequent overlapping of, the light blue curve illustrates the accuracy of Crooks' Theorem, Jarzynski's Equality, and Lemma 2. (These light blue and dark blue curves appear to coincide less often than the light blue and dark blue curves in Fig. 4 because the scale in Fig. 5 is more zoomed-in, so the lines' jitterings are more visible.) Finally, the bound in Theorem 4 was calculated from P rev and was plotted as a dashed red curve. The hairpin is plotted against the failure probability ε. Each plot corresponds to one pulling speed and agrees with results in §II.
red curve remains below the dark blue and light blue curves, confirming the lower bound in Theorem 4. Lemma 1 and Theorem 3, which contain an expression for and a bound on w δ , can be tested similarly.
The data from DNA-hairpin experiments used to test Crooks' Theorem supports the unification of fluctuation theorems with one-shot statistical mechanics. The agreement between theory and experiment suggests that the unification may shed light on similar single-molecule experiments and on applications such as molecular motors, thermal ratchets, and nanoscale engines [48][49][50].

IV. QUANTIFICATION OF MEMORY BY THE ORDER-0 RÉNYI ENTROPY H 0
We have applied the one-shot entropy H ∞ to fluctuation contexts. The order-0 entropy H 0 will be shown to quantify the memory needed to record the work exchanged during one forward or reverse trial. Even if P rev (−W ) is unknown, the memory associated with a reverse trial can be calculated from P fwd (W ) and Crooks' Theorem. This section concerns discrete, bounded {W }, motivated by quantum systems that have discrete, bounded energy spectra. If P (W ) denotes a discrete probability distribution whose support has the size | supp(P )|, the order-0 entropy is Lemma 7. The distributions P fwd and P rev over the work invested in a forward process and the work extracted during a reverse process have the same support and so the same order-0 entropy: Proof. We multiply each side of Crooks' Theorem [Eq. (1)] by P rev (−W ), then calculate the size of each side's support: Since the exponential cannot vanish, it does not influence the RHS's support. The sizes of the supports must equal each other: Taking the logarithm of each side yields Eq. (22).
H 0 (P fwd ) implies how large a memory one should prepare to record the amount of work a forward trial consumes and the amount of work a reverse trial outputs. Consider a quantum system governed by a discrete, bounded Hamiltonian. The work W performed in the forward process can be defined as the difference between the outcomes E n (τ ) and E m (−τ ) of projective energy measurements performed at t = −τ and t = τ : W ≡ E n (τ ) − E m (−τ ) (e.g., [10,16,51]). Alternatively, W can be defined as a sum of differences between many measurements' outcomes, as in Appendix A. Since these work quantities are discrete and bounded, so is P fwd (W ), and H 0 (P fwd ) is finite. Suppose an agent has generated P fwd (W ) and plans to reverse the protocol. How large a memory should be prepared to record the amount W of work outputted during the first reverse trial? H 0 (P rev ) equals the least number of bits into which W can be compressed [37]. By Lemma 7, H 0 (P rev ) = H 0 (P fwd ), which the agent can compute after constructing the forward distribution. One-shot information theory and Crooks' Theorem enable an agent to infer an operationally useful memory size related to the reverse protocol from the forward distribution. Further consequences of Lemma 7 will be explored in §V.C.

V. WORST-CASE DISSIPATED WORK FROM ONE-SHOT RELATIVE EN-TROPIES
The irreversible entropy production and dissipated work (also called the irreversible work ) quantify a nonequilibrium process's deviation from a quasistatic evolution [4,52,53]. If work is invested quasistatically, the system remains in equilibrium, and the work performed is called the equilibrium work W eq . The W eq associated with Crooks' forward process equals ∆F . Because heat flows from the bath to the system, the composite system's entropy increases. This increase is called the reversible entropy production ∆S rev . The name highlights the agent's ability to recoup the invested work-to reverse the entire loss of work-by reversing the protocol. Now, suppose the process lasts for a finite time. Denote by W the average of the work invested in a forward trial. Some work is dissipated as heat. The average dissipated work is denoted by W diss : W = W eq + W diss . This W diss is related to the irreversible entropy production ∆S irr , the average amount by which work dissipation increases the compositesystem entropy: ∆S irr = β W diss [3,52]. The average of the total increase in the composite system's entropy is ∆S = ∆S rev + ∆S irr . Hence W diss and ∆S irr quantify a finite-time process's average deviation from a quasistatic process.
Analyses of dissipated work and irreversible entropy production have focused on averages. In the spirit of one-shot statistical mechanics, we define the one-shot dissipated work W diss . Because work can be measured more directly than entropy, we deemphasize entropy production. W diss has been shown to be proportional to the relative entropy D(P fwd (W )||P rev (−W )) [53]. We show that interchanging the arguments yields the average forfeited work, the mean work that the agent could extract from a quasistatic reverse process but misses out on by switching λ(t) quickly. The relative entropy has the one-shot analogs D 0 and D ∞ . 4 We show that the D ∞ 's between P fwd (W ) and P rev (−W ) equal oneshot dissipated-work and forfeited-work quantities. Though one might expect to interpret D 0 analogously, the D 0 's vanish. This surprising failure of a relative entropy to distinguish between probability densities relates to the calculation of memory in §IV.

A. Average dissipated and forfeited work
First, we rederive the average dissipated work and its nonnegativity from a relative entropy [53]. Then we relate the average forfeited work to a relative entropy. The (average) relative entropy between probability densities P (x) and Q(x) is Integrals are assumed to run over all possible values of the integration variables.
Lemma 8. The average relative entropy is proportional to the mean dissipated work, the average of the work dispelled as heat during a forward trial: wherein . fwd denotes an average with respect to P fwd (W ). This W diss is nonnegative: We substitute in P fwd (W ) = P rev (−W )e β(W −∆F ) from Crooks' Theorem, then evaluate the integral.
To show that W diss is nonnegative, we start with Jarzynski's Equality, e −βW fwd = e −β∆F . Applying Jensen's Inequality, e x ≥ e x , yields Upon taking logs, we divide by −β to recover Ineq. (27). Alternatively, we could have applied the nonnegativity of the relative entropy to Eq. (26) [56].
Inequality (27) has been interpreted as the Second Law of Thermodynamics (e.g., [14,44]). Combined with Eq. (26), the inequality confirms physically D(P fwd (W )||P rev (−W )) ≥ 0, which can be viewed mathematically as the relative entropy's nonnegativity. A relation between the Second Law and the nonnegativity of a relative entropy between states has been noted in [57].
The relative entropy D(P ||Q) vanishes if and only if P = Q [56]. Equation (26) shows that P fwd (W ) = P rev (−W ) if and only if the system dissipates no work. The system dissipates no work if the process proceeds quasistatically and the system remains in equilibrium. According to Stein's Lemma, D(P ||Q) quantifies the probability that attempts to distinguish between P and Q will fail [56,58]. D(P fwd (W )||P rev (−W )) quantifies the distinguishability of P fwd (W ) from P rev (−W ). Since the distributions differ insofar as the system leaves equilibrium, D quantifies how far from equilibrium the system evolves.
Interchanging the arguments of D in Eq. (26) yields the average forfeited work. We define the forfeited work as the extra work that Crooks' agent could have extracted by switching λ(t) infinitely slowly. The agent sacrifices the forfeited work for time. To our knowledge, the forfeited work has not been studied. Lemma 9. The average relative entropy between P rev (−W ) and P fwd (W ) is proportional to the mean forfeited work: wherein . rev denotes an average with respect to P rev (−W ). The mean forfeited work is nonnegative: Proof. Equation (29) follows from the relative entropy's definition and from Crooks' Theorem. Care must be taken with minus signs. W rev denotes the average work extracted during a reverse trial. Hence ∆F − W rev denotes the extra work that the agent could have extracted by switching λ(t) infinitely slowly, but misses out on by switching λ(t) quickly. Inequality (30) follows from Jensen's Inequality, as well as from the relative entropy's nonnegativity. The inequality implies that the agent "cannot win." Switching λ(t) at a finite speed, one forfeits positive (or zero) work: Less work is extracted than if the protocol proceeded infinitely slowly.

B. Worst-case dissipated and forfeited work (D ∞ )
From the average relative entropy, we progress to the one-shot order-∞ relative entropy. If P (x) and Q(x) denote probability densities, We will show that D ∞ (P fwd (W )||P rev (−W )) is proportional to the worst-case dissipated work, the most work that can be dissipated during any completed forward trial. Interchanging the entropy's arguments yields the worst-case forfeited work, the most work that an agent can miss out on by extracting work in finite time.
Lemma 10. Let W max denote the greatest amount of work W that can be invested in a forward trial. The order-∞ relative entropy between P fwd (W ) and P rev (−W ) is proportional to the worst-case dissipated work, the most work that can be dissipated during any completed forward trial: Proof. By definition, Let us solve for the minimal λ-value that satisfies the inequality, λ min . First, we prove that we can divide the inequality by Substituting into the RHS from Crooks' Theorem [Eq. (1)] yields λ min ≥ e β(W −∆F ) . The bound saturates when W assumes its maximal value W max : λ min = e β(Wmax−∆F ) . Substituting into Eq. (32) yields Consider an agent who invests in each forward trial all the work needed to switch λ(t) to λ τ . W max equals the most work that any trial might require. 1 β D ∞ (P fwd (W )||P rev (−W )) equals the most work that can be dissipated during any forward trial.
Equation (31) is finite if the set {W } of possible work values is bounded from above. {W } is bounded, for example, if work is extracted from a quantum system whose energy spectrum is discrete and finite. Just as 1 β D(P fwd (W )||P rev (−W )) equals the average, over many trials, of dissipated work, 1 β D ∞ (P fwd (W )||P rev (−W )) equals work dissipated in one trial.
Lemma 11. Let W min denote the least work that any reverse trial can output. The order-∞ relative entropy between P rev (−W ) and P fwd (W ) is proportional to the worst-case forfeited work, the most work an agent can sacrifice for time by performing a reverse trial at a finite speed: Proof. By definition, As in the proof of Lemma 10, we assume P fwd (W ) = 0 to divide each side of the inequality by P fwd (W ). Then we invoke Crooks' Theorem: The inequality saturates when the exponential maximizes, when W = W min : λ min = e β(∆F −W min ) . Substitution into Eq. (34) implies Eq. (33). At worst, a finite-time trial outputs work W min . The greatest possible difference between the work extractable from a quasistatic trial (∆F ) and the work extractable from a poor reverse trial-the work forfeited for time's sake-is ∆F − W min . The average relative entropies D and the order-∞ relative entropies D ∞ between P fwd (W ) and P rev (−W ) quantify the discrepancy between P fwd (W ) and P rev (−W ). One might expect the order-0 relative entropy D 0 to do the same. Yet D 0 vanishes, failing to distinguish between P fwd (W ) and P rev (−W ). This failure turns out to be related to the memory calculation in §IV.
The order-0 relative entropy between probability densities P (x) and Q(x) is projects onto the support of P .
Proof. By definition, projects onto the support of P fwd (W ). According to Lemma 7, supp(P fwd (W )) = supp(P rev (−W )). Hence The vanishing of D 0 may surprise us because P fwd (W ) = P rev (−W ) for finite-speed protocols, and relative entropies signal that probability densities are distinct by failing to vanish. The seeming inconsistency can be resolved as follows. D 0 distinguishes between one characteristic of two probability densities: the densities' supports. P fwd (W ) and P rev (−W ) have the same support, due to Crooks' Theorem, so D 0 fails to distinguish between them. This sharing of supports is shown, in §IV, to facilitate calculations of the memory needed to record the amount of work involved in one trial.

D. Comparison of relative entropies
Just as the average relative entropies D between P fwd (W ) and P rev (−W )) are proportional to the average dissipated work W diss and the average forfeited work, the one-shot analogs D ∞ are proportional to single-trial dissipated work and forfeited work. The inequality D 0 ≤ D ∞ is known [54], as is H ∞ ≤ H vN ≤ H 0 (wherein H vN denotes the von Neumann entropy [38]). Lemmas 8-12 confirm that D 0 (P fwd (W )||P rev (−W )) ≤ D(P fwd (W )||P rev (−W )) ≤ D ∞ (P fwd (W )||P rev (−W )) and that interchanging each entropy's arguments preserves the ordering.
The work-related significance of D ∞ ≡ D max resembles the significance of the D max in [29]. In [29], a resource theory models the extraction of work from, and the investment of work in, a "working body" coupled to a heat bath. Let β denote the bath's inverse temperature, ρ denote the working body's state, and H denote the Hamiltonian that governs ρ. The least work needed to create ρ is shown to equal 1 β D ∞ ρ || e −βH /Z , and the most work extractable from ρ during thermalization is shown to equal 1 β D 0 ρ || e −βH /Z . Above, as in [29], one-shot relative entropies are proportional to extreme values of work associated with single trials. The relative entropies in [29] are of quantum states, whereas those above are of probability distributions. One-shot relative entropies between quantum states in fluctuation contexts merit investigation.

VI. MODELING FLUCTUATION CONTEXTS WITH TWO ONE-SHOT FRAME-WORKS
Two frameworks used in one-shot statistical mechanics-a work extraction game [26,28] and resource theories [29,30,33,41,42]-are shown to model protocols governed by Crooks' Theorem. Theorems 3 and 4 are shown to strengthen bounds on w δ and W ε derivable from [26]. Appendix E contains details about the game, and Appendix F contains details about the resource theories. The game, the resource theories, and Crooks model heat exchanges slightly differently. The relationships among these models are explained in §C and are proved in Appendix G.

A. Modeling fluctuation contexts with a one-shot work-extraction game
In the work-extraction game described by Egloff et al. [26], a player transforms a state ρ governed by a Hamiltonian H ρ into a state σ governed by H σ : (ρ, H ρ ) → (σ, H σ ). For simplicity, states are assumed to commute with their Hamiltonians. The agent has access to a heat bath whose inverse temperature is β.
The agent can perform operations of two type: (1) Without investing work, the player can couple ρ to the bath in any manner modeled by a stochastic matrix that preserves the Gibbs state γ(H ρ ) = e −βHρ /Z. (Such matrices are elaborated on in Sec. C.) For example, the agent can partially thermalize the state. Partial thermalization is represented by a partial swap that replaces ρ with the convex combination pρ + (1 − p)γ(H ρ ), wherein p ∈ (0, 1). (2) By investing or extracting work, the agent can shift the Hamiltonian's levels.
The primary result in [26] implies a bound on the work δ-extractable during the transformation (ρ, H ρ ) → (σ, H σ ). The player chooses some strategy, e.g., changes the Hamiltonian a great deal, then thermalizes the system completely; or changes the Hamiltonian infinitesimally, thermalizes partially, and repeats. If the player uses the optimal strategy during some trial, the trial outputs the most work consistent with a failure probability δ. Egloff et al.
show that the optimal strategy has a probability 1 − δ of outputting at least the work each some trial. M denotes the relative mixedness, a measure of how much more mixed one state is than another. G T denotes Gibbs-rescaling relative to the temperature T . M and G T are defined in [26] and are explained in Appendix B. They facilitate a comparison of the extents to which states governed by distinct Hamiltonians have thermalized. Since dissipative processes yield less than the optimal amount of work, Eq. (36) upper-bounds the w δ δ-extractable via an arbitrary strategy. Using Theorems 3 and 4, we tighten the bound, implied by Eq. (36), on the work w δ extracted during a sub-optimal implementation of the reverse protocol. We can also extend the bound to work expenditure. The sub-optimal protocols, lasting for finite times, are more realistic than the optimal protocols focused on in [26].
First, we cast the forward protocol in the language of the game. The initial state γ −τ transforms into some nonequilibrium state σ as the Hamiltonian changes. This σ thermalizes to γ τ : The following bounds' proofs appear in Appendix B.

Theorem 14.
The work ε-required during each implementation of the forward protocol satisfies for ε ∈ [0, 1).
Each of these theorems consists of a bound derived from [26] and an H ∞ introduced by Crooks' Theorem. The H ∞ tightens each bound if the corresponding H ∞ is positive. The H ∞ is positive if the probability density's greatest value P max satisfies P max < β [Ineq. (18)]. This inequality holds if the probability density lacks a sufficiently tall peak. Recall that the probability density associated with a quasistatic process is a Dirac delta function centered at W = ∆F . The lack of a tall peak is associated with realistic, dissipative finite-time processes [34]. Hence the H ∞ quantifies a process's sub-optimality.
This H ∞ can tighten the bound, derived from [26], on realistic work exchanges because Egloff et al. address optimal protocols, whereas the H ∞ encodes information about the realistic process's speed. Incorporating this extra information into the bound improves the bound (when the process deviates sufficiently from the quasistatic ideal), as expected.

B. Modeling fluctuation contexts with resource theories
Resource theories facilitate the calculation of how much value a quantum state has if certain operations are easy to perform, or "free." In the resource theory of pure bipartite entanglement, for example, local operations and classical communications (LOCC) are free [59]. Agents use LOCC to transform products of partially entangled states into maximally entangled Bell states. Bell states have value because they can be used to simulate quantum channels. Helmholtz resource theories for thermodynamics model the exchange of heat between systems and baths [29,30,41,42]. Each Helmholtz theory is defined by the inverse temperature β of a heat bath from which Gibbs states can be drawn for free. More generally, energy-conserving thermal operations can be performed for free. Thermal operations are shown, in §C and in Appendix G, to include heat exchanges that satisfy the assumptions from which Crooks' Theorem is derived.
In Appendix F, we model processes governed by Crooks' Theorem with a Helmholtz theory. We introduce a battery B that stores work [29,32,33] and a clock C that models the evolution of H(λ(t)) [29,42]. B and C are used to define the work extracted from a reverse protocol and the work invested in a forward protocol. The resource-theory framework has provided insights into similar work quantities [29,30,32]. We hope to bridge, via Crooks' Theorem, mathematical tools from resource theories to testable contexts.

C. Relationships among models of heat exchanges
We have modeled processes governed by Crooks' Theorem with the work-extraction game in [26] and with thermodynamic resource theories. Crooks' theory, the game, and the resource theories (we will call these three objects frameworks) model thermal interactions in related ways. We introduce several thermalization models and relationships among them. The relationships are summarized in Fig. 6 and  justifies our modeling, by the game and by resource theories, of processes governed by Crooks' Theorem.
Consider a system S governed by a discrete N -level Hamiltonian H. Suppose that S interacts with a heat bath whose inverse temperature is β. An N -dimensional probability vector s represents the system's state. Whole or partial thermalization of S can be modeled as a sequence of discrete steps, each represented by a stochastic matrix. Different possible properties of such matrices characterize different models of heat exchanges. We address the properties of Gibbs-preservation, detailed balance, and thermalization. By g, we denote the probability vector that represents the Gibbs state associated with H and β: A matrix M is Gibbs-preserving relative to H and β if M maps the corresponding Gibbs state to itself: Gibbs preservation constrains the unit-eigenvalue eigenspace of M . The set G of Gibbspreserving matrices is equivalent to the set of thermal operations [29] and to the set of thermal interactions in the game [26]. A strict subset of G is the set D of detailed-balanced matrices: D ⊂ G. Let A and B denote microstates associated with the energies E A and E B . M encodes the probabilities that S transitions from A to B, and vice versa, during one heat-exchange step. If these probabilities satisfy M obeys detailed balance.
If the steps in an extended heat exchange obey detailed balance, the extended heat exchange obeys microscopic reversibility [4]. From the assumption that heat exchanges are microscopically reversible, Crooks derives his theorem [5]. Hence if the heat exchanges in a process obey detailed balance (and if the process obeys the other assumptions in Appendix A), the process obeys Crooks' Theorem.
Crooks defines microscopic reversibility as follows while deriving his theorem [5]. Let P (x(t)|λ(t)) denote the probability that, if the external parameter varies as λ(t) during some forward trial, the state of the classical system S follows the phase-space trajectory x(t). The "corresponding time reversed path" is denoted by (λ(−t),x(−t)). Let the functional Q[x(t), λ(t)] denote the heat that S ejects if λ(t) and x(t) characterize the forward trial. The heat exchange obeys microscopic reversibility if The definition is generalized to quantum systems in Appendix A.
Another strict subset of Gibbs-preserving matrices is the set T of thermalizing matrices: T ⊂ G. We call a matrix M thermalizing if it evolves every state s of S toward the Gibbs state associated with H and β: lim Equation (43) encapsulates intuitions about what "thermalization" means. Some matrices that model thermal interactions in the game and in the resource theories violate Eq. (43), as do some thermal interactions governed by Crooks' Theorem. T overlaps with D.
The properties we have introduced-Gibbs preservation, detailed balance, and thermalizationimply relationships among Crooks' Theorem, theorems about the game, and resource-theory theorems. The game, as well as the resource theories, model the heat exchanges in some processes governed by Crooks' Theorem. Crooks' Theorem does not necessarily govern all heat exchanges in the game or in the resource theories. Also, the game and the resource theories might fail to model heat exchanges in some processes governed by Crooks' Theorem (heat exchanges not modeled by detailed-balanced matrices).

VII. CONCLUSIONS AND DISCUSSION
Fluctuation-dissipation relations and one-shot statistical mechanics describe small scales, realistic protocols, and probability distributions. This paper has unified the two toolkits. We introduced the one-shot work quantities w δ and W ε into protocols governed by Crooks' Theorem. The parameters δ and ε generalized Jarzynski's Equality, and the generalizations implied bounds on w δ and W ε .
Our unification scheme was applied to three examples. One-shot terminology was shown to be the natural language for a fluctuation-theorem inequality that H ∞ tightened (in the appropriate parameter regime). The forward and reverse protocols were combined into an information-theoretic Carnot cycle, numerical simulations of which supported our generalized Jarzynski equalities and our bounds on w δ and W ε . The equalities and bounds were consistent also with data from DNA experiments used previously to test Crooks' Theorem.
The memory needed to store the amount W of work involved in one trial was quantified with H 0 . Finally, we developed one-shot analogs of the equality between the relative entropy D(P fwd (W )||P rev (−W )) and the average work dissipated during a forward trial.
Two frameworks used in one-shot statistical mechanics, a work-extraction game and resource theories, were shown to model fluctuation-dissipation contexts. Crooks' Theorem was used to tighten (in the appropriate parameter regime) bounds, derived from the game, on w δ and W ε . To show that the heat-exchange models used in the game, the resource theories, and Crooks' Theorem are consistent, we presented relationships among matrices that model thermal interactions.
Our unification of fluctuation-dissipation relations with one-shot statistical mechanics enriches both fields. Crooks' Theorem tightened a bound in the one-shot literature (in the appropriate parameter regime), and a one-shot entropy tightened a bound in the fluctuation literature. Experimental data gathered to test fluctuation relations supported results dependent on one-shot entropies. The one-shot and fluctuation communities have developed elaborate mathematical tools, and fluctuation tools withstood experimental tests. The unification of the two fields is intended to bridge one-shot tools from theory to experiment and to applications. the dynamics obey microscopic reversibility [4].
Having clarified our notation, we derive Crooks' Theorem. The probability p(T ) that the system follows T during some forward trial and the probability p(T −1 ) that the system follows T −1 during some reverse trial form the ratio Because the outcome of each protocol's zeroth measurement obeys a Boltzmann distribution, To rewrite the ratio of conditional probabilities in Eq. (45), we return to the definition of microscopic reversibility. The Q(T ) in the LHS of Eq. (44) can be rewritten due to the First Law of Thermodynamics: wherein W (T ) denotes the work invested in a system that follows T . Substituting into Eq. (44) yields When Eqs. (46) and (47) are substituted into Eq. (45), the exponentials of energies cancel: Equation (48) interrelates trajectories' probabilities, whereas Crooks' Theorem interrelates work quantities' probabilities. From the former relation, we derive the latter. Denote by S fwd (W ) ≡ {T 1 , T 2 , . . . , T m } the set of forward trajectories that require work W . The reverse trajectories that output work W form S rev (W ) ≡ {T −1 1 , T −1 2 , . . . , T −1 m }. Summing over trajectories in Eq. (48) yields the probabilities in Crooks' Theorem: Using Eq. (48), we substitute in The sum over T −1 i transforms into a sum over T i :

Appendix B QUANTUM DERIVATION OF GENERALIZED JARZYNSKI EQUAL-ITIES
The results in §II describe classical and quantum systems. To shed extra light on quantum applications, we derive Eq. (12) for a quantum system whose energy spectrum is discrete and that lacks contact with the heat bath while its Hamiltonian changes. Such a system appears in, e.g., [16].
Work is defined as the difference between the outcomes of energy measurements near the protocol's start and end. This definition of work, which appears in [10,16,51], differs from the definition in [9]. The discrete version of χ ε rev (β) will be defined via analogy with Eq. (13): Let S denote a quantum system characterized by an external parameter λ(t) and governed by a Hamiltonian H(λ(t)) whose energy spectrum is discrete. Let β denote the inverse temperature of the heat bath with which S interacts at times t ∈ (−∞, −τ ). Let λ −τ , H −τ , and γ −τ be defined as in §I.
At t = −τ , S is projectively measured in the energy eigenbasis, then isolated from the bath. Until t = τ , a unitary U (2τ ) evolves H(λ(t)) to H τ , and S is perturbed out of equilibrium. At t = τ , the energy of S is measured projectively. Define the work W performed on S as the difference between the measurements' outcomes. The time-reversed protocol proceeds from t = ∞ to t = −∞ and is defined as in the introduction. Let p n (τ ) denote the probability that the first measurement during a reverse trial yields E n (τ ); and let p rev (m|n) denote the probability that, if the first measurement yields E n (τ ), the second yields E m (−τ ). By definition, wherein Invoking p n (τ ) = e −βEn(τ ) /Z τ , we cancel the E n (τ )-dependent exponentials. p rev (m|n) equals the probability p fwd (n|m) that, if an energy measurement at t = −τ yields E m (−τ ) during a forward trial, an energy measurement at τ yields E n (τ ): Substitution into Eq. (51) yields Upon multiplying by Z −τ /Z −τ , we replace e −βEm(−τ ) /Z −τ with p m (−τ ): The final equality follows from F (γ) = −T log Z and from the definition of ε.

Appendix C COMPARISON OF INFORMATION-THEORETIC CARNOT EN-GINE WITH PREDECESSORS
The erasure described in §1 has appeared in [26,28,34], and a related protocol appears in [40]. In [26,28], the system thermalizes completely at each time step; [40] concerns quasistatic thermalization. Complete thermalization requires an infinitely long time; finitetime bit reset is modeled by partial swap in [34]. That paper's results can be extended to Szilárd extraction via our results.
Half of the Carnot cycle described in §1 has been realized experimentally [60,61]. Brownian particles underwent a forward protocol realized as Landauer erasure. Optical tweezers performed the work, and Jarzynski's Equality was tested.
A variation on Crooks' Theorem is derived in [28]. Roughly, if W denotes the work absorbed by the system and δ > 0 quantifies the precision with which W is measured, for w ≥ 0. Using Ineq. (56),Åberg bounds the minimal work inf ∆ δ W required to implement a forward protocol by Apart from containing −δ, this bound equals that derived from the work-extraction game, as detailed below. Inequality (57) is consistent with Ineq. (17), whose H ∞ tightens the bound.

Appendix D NUMERICAL SIMULATION: DETAILS
Our simulation resembles that in [34] and models a two-level quasiclassical system S. At each time t, the energy E(t) of S equals E 0 or E 1 (t). The state of S is represented by a vector s(t) = (p(t), 1 − p(t)), wherein p(t) equals the probability that E(t) = E 0 .
If observers have different amounts of information about E(t), they ascribe different values to p(t). Suppose an agent draws S from a temperature-(1/β) heat bath. According to this ignorant agent, According to an omniscient observer, s(t) = (1, 0) or (0, 1). The code is written from the perspective of an omniscient observer. On average, the code's predictions coincide with the predictions that code written by an ignorant agent would make. While t ∈ (−∞, −τ ) during the forward (erasure) protocol, E 1 (t) = E 0 = 0, and S is thermally equilibrated. According to the ignorant agent, s(t) = ( 1 2 , 1 2 ). Beginning at t = −τ , the agent raises E 1 by the infinitesimal amount dE while preserving s(t). Then, the agent couples S to the bath for some time interval. The raising and coupling are repeated until t = τ and E 1 (τ ) = E max .
The agent's actions are simulated as follows: Our code has a probability 1 2 of representing the initial state s(−τ ) with (1, 0) and a probability 1 2 of representing s(−τ ) with (0, 1). Consider one thermal interaction that occurs at some t ∈ (−τ, τ ). If s(t) = (1, 0) before the thermal interaction, the agent invests no work to raise E 1 . If s(t) = (0, 1), the agent invests work dE.
A probabilistic swap models each interaction with the heat bath [34]. s(t) has a probability P swap of being exchanged with a pure state sampled from a Gibbs distribution. That is, s(t) has a probability P swap e −βE 0 /Z(t) of being interchanged with (1, 0), a probability P swap e −βE 1 (t) /Z(t) of being interchanged with (0, 1), and a probability 1 − P swap of remaining unchanged: s(t + dt) = s(t). The longer S couples to the reservoir, the greater the P swap . The ignorant agent represents this thermalization with s(t + dt) = M (t; P swap ) s(t), wherein M (t; P swap ) is a thermalizing matrix that obeys detailed balance (see the proof of Lemma 21). Because s(t + dt) depends on no earlier state except s(t), the evolution is Markovian.
Ideally, the agent increases E 1 (t) and thermalizes S repeatedly until t = τ , E 1 (τ ) = ∞, and s(τ ) = (1, 0) according to both observers. The simulated E 1 (t) peaks at some large E max , and the final state has a high probability of being (1, 0) [34]. During stage two of erasure, S is thermally isolated, and E 1 decreases to zero. Because s has no weight on E 1 , this stage costs no work.

A Description of the game
Consider the most efficient transformation (ρ, H ρ ) → (σ, H σ ) that has a probability 1 − δ of failing. That is, one sacrifices the certainty that the transformation will succeed, in hopes of extracting more work than can be gained from a certain-to-succeed transformation. All work that the system can output is collected; none is wasted. According to [26], the transformation has a probability 1 − δ of outputting at least the work Let us briefly review the geometric definitions of Gibbs-rescaling (G T ) and the relative mixedness (M ). Details appear in [26]. Let ρ have the spectral decomposition Consider the histogram that represents the r i . Gibbs-rescaling ρ resizes each box in the histogram. The width of box i changes from unity to e −βE i , and the box's height increases by a factor of e βE i . Denote by h T ρ (u) the height of the point, on the rescaled histogram, whose x-coordinate is u ∈ [0, Z(H ρ )]. Integrating h T ρ (u), we define the Gibbs-rescaled Lorenz curve as the set of points The (unscaled) Lorenz curve L ρ is equivalent to L 0 ρ . Upon Gibbs-rescaling ρ and σ, we can compare the states' resourcefulness even though different Hamiltonians govern the states.
To incorporate the failure probability into the curve, we stretch L T ρ upward by a factor of 1/(1 − δ). The resulting curve, L T,δ ρ , encodes more reliable resourcefulness than (ρ, H ρ ) possesses, because extractable work trades off with the failure probability δ. Consider plotting L T,δ ρ on the same graph as L T σ . The curves are concave, bowing outward from the x-axis or stretching straight from (0, 0) to y = 1. Consider compressing L T σ leftward. M denotes the inverse of the greatest factor by which L T σ can compress without popping above L T,δ ρ : Illustrations appear in [26]. While transforming (ρ, H ρ ) into (σ, H σ ), the player can extract no more work than T log M : According to Eq. (59), Theorem. The work δ-extractable from each Crooks-type reverse trial satisfies Proof. During the reverse protocol, the state of a system S transforms as wherein σ denotes some density operator that likely is not an equilibrium state. Suppose that one player, Player A, implements the first transformation with the optimal strategy for the failure probability δ, then implements the second with the optimal strategy for zero failure probability. Player A has a probability 1 − δ of extracting at least the work Suppose Player B transforms (γ τ , H τ ) into (γ −τ , H −τ ) with the optimal strategy for the failure probability δ. Since B's strategy generalizes A's, B has a probability 1−δ of extracting The final term describes an interaction with the bath. Such interactions cost no work according to the game's rules. The final term vanishes: Now, let us compare w δ best to the most work w δ guaranteed up to probability δ to be extracted via a not-necessarily-optimal strategy (Definition 1). Work that could be extracted via an optimal strategy is dissipated as heat: Combining Ineqs. (64) and (65) yields By Ineq. (62), Let us calculate M . L T γ −τ stretches straight from (0, 0) to (Z −τ , 1), whereas L T γτ /(1 − δ) stretches straight to (Z τ , 1 1−δ ). Compressing L T γτ (u)/(1 − δ) leftward by a factor of M −1 = Zτ (1−δ) Z −τ keeps the latter curve from dipping below L T γ −τ (u). Hence wherein ∆F ≡ F (γ τ ) − F (γ −τ ). We substitute from Eq. (67) into the inequality (16) derived from Crooks' Theorem.
Crooks' Theorem introduces an H ∞ into the bound, derived from [26], on extractable work. If P fwd satisfies Ineq. (18), this H ∞ strengthens the bound. A work cost can similarly be derived from [26], then enhanced with Crooks' Theorem.
Theorem. The work ε-required during each forward trial satisfies Proof. This proof resembles the forgoing one. Each forward trial involves the transformations whereinσ denotes some density operator that likely is not an equilibrium state. Suppose Player A implements the first transformation with the optimal strategy consistent with a failure probability ε, then implements the second transformation with the optimal strategy consistent with zero failure probability. Player A has a probability 1 − ε of extracting at least the (negative) amount of work Equivalently, Player A has a probability 1 − ε of needing at most the work Suppose Player B transforms (γ −τ , H −τ ) into (γ τ , H τ ) via the optimal strategy consistent with the failure probability ε. Player B has a probability 1 − ε of expending at most the work As thermal exchanges cost no work, the final term is nonpositive: The LHS is calculated as in the proof of Theorem 13.

Appendix F MODELING FLUCTUATION CONTEXTS WITH RESOURCE THE-ORIES: DETAILS
Like the work-extraction game, thermodynamic resource theories model processes governed by Crooks' Theorem. Resource theories have been used to calculate how efficiently scarce quantities can be distilled and converted into other forms via cheap, or "free," operations. Perhaps the most famous example is the resource theory of pure bipartite entanglement. In the entanglement theory, agents can perform local operations and classical communications (LOCC) for free [59]. Products of partially entangled states are transformed into maximally entangled Bell pairs. Entanglement has value because it, combined with LOCC, can simulate quantum channels. In Helmholtz resource theories, nonequilibrium states have value because work can be extracted from them [29,30,33,41,42].
Each Helmholtz theory models energy-preserving transformations performed with a heat bath characterized by an inverse temperature β. To specify a state, one specifies a density operator and a Hamiltonian: (ρ, H). Sums of Hamiltonians will be denoted by H 1 + H 2 ≡ Thermal operations can be performed for free. Each consists of three steps: (1) A Gibbs state relative to β and relative to any Hamiltonian H γ can be drawn from the bath: [Below, the Gibbs state relative to β and to H γ will be denoted also by γ(H γ ).] Any unitary U that conserves the total energy can be implemented, and any subsystem A associated with its own Hamiltonian can be discarded. Each thermal operation on (ρ, H) has the form If the Hamiltonians' spectra are discrete, the set of thermal operations is equivalent to the set G of Gibbs-preserving stochastic matrices [29]. G includes the set D of detailed-balanced stochastic matrices (see Appendix G). Sequences of detailed-balanced steps obey microscopic reversibility [4,5]. Microscopic reversibility, stochasticity, and the Markovian property are used to derive Crooks' Theorem [5]. Thermal operations include all detailed-balanced stochastic operations, which can be strung together into processes that obey Crooks' Theorem. Crooks' Theorem does not govern all thermal operations, however.
We can model, with Helmholtz resource theories, processes governed by Crooks' Theorem if we define a battery and a clock. Our model for the battery appears in [33] and resembles the model in [32]. The quasiclassical battery B has closely spaced energy levels and occupies an energy eigenstate: If E B i is large, a work-costing (forward) process can transfer work from the battery to S. If E B i is small, a work-extraction (reverse) process can transfer work from S to the battery.
We model the evolution of H with a clock C [29,42]. The clock's energy levels are all degenerate, and C occupies a pure state |C j . The changing of |C j , like the movement of a clock hand, models the passing of instants. In processes governed by Crooks' Theorem, H = H(λ(t)). We discretize t such that the system's Hamiltonian is H(λ(t j )) when the clock occupies the state |C j . In the notation introduced earlier, t 1 = −τ , and t n = τ . The composite-system Hamiltonian Having defined the battery and clock, we define the work extractable from, and the work cost of, a protocol. Let E B 0 = 0. The most work extractable from the reverse protocol equals the greatest E Bm for which some sequence of thermal operations evolves the state of SCB as wherein ρ(t i ) represents the state occupied by S at time t i . The forward protocol's minimum work cost equals the least E Bn for which a sequence of thermal operations implements The maximum work yield, or minimum work cost, of any transformation (ρ, H ρ ) → (σ, H σ ) by thermal operations is calculated in [29,30]. Also calculated are faulty transformations' work yields and work costs. A faulty transformation generates a state (σ , H σ ) that differs from the desired state. The discrepancy is quantified by the trace distance between the density operators: According to [29], this can be interpreted as the probability that the process fails to accomplish its mission, as ε and δ do above. We leave for future work the derivation, from resource-theory results, of testable predictions about Crooks' problem. Considerable mathematical tools, such as montones [29,30,55] and catalysts [30,55], have been developed within the resource-theory framework. We look to bridge these mathematical tools to experiments via Crooks' Theorem. elements of a density matrix relative the eigenbasis of H. The Gibbs state relative to H and to β is denoted by g.
To prove some of the foregoing claims, we characterize thermalizing matrices with the Perron-Frobenius Theorem [62]. The theorem governs irreducible aperiodic nonnegative matrices M . 5 Consider the eigenvalue λ of M that has the greatest absolute value. According to the Perron-Frobenius Theorem, λ is the only positive real eigenvalue of M , and λ is associated with the only nonnegative eigenvector v λ of M . Suppose that M is stochastic, such that λ = 1. By the spectral decomposition theorem, lim n→∞ M n s = v λ . If v λ = g, the matrix is thermalizing. Let M 1 be defined on the first n 1 energy levels, and let M 2 be defined on the remaining n 2 energy levels. Denote by g 1 the Gibbs state associated with the first n 1 energies (and the partition function Z 1 ), and by g 2 the Gibbs state associated with the final n 2 energies (and the partition function Z 2 ). Suppose that g 1 ≡ g 1 ⊕ (0, 0, . . . , 0 is also a normalized probability eigenvector of M associated with the unit eigenvalue. The possible forms of ν α form a family. One member of the family is the Gibbs state g, which corresponds to α = Z 1 /Z (wherein Z denotes the total partition function). Hence g ∈ { ν α } α∈[0,1] is an eigenvector of M , and M is Gibbs-preserving. However, g is not the only eigenvector associated with the unit eigenvalue. M does not evolve every initial state toward g. In general, lim n→∞ M n s = ν α , wherein α is the total occupation probability of the first n 1 energy levels of s. As some states s correspond to α = Z 1 /Z and to ν α = g, M does not map every initial state to the Gibbs state. Hence M is not thermalizing. Our claim has been proved by example.
Together, Lemmas 16 and 17 imply the strict relation T ⊂ G.
The second line follows from the substitution of Eq. (74) for M ii . The third line follows from the substitution of Eq. (72) into the elements of first sum.
We have shown that g is an eigenvector of M that corresponds to the unit eigenvalue. An N × N matrix M that obeys detailed balance relative to H and β preserves the Gibbs state associated with H and β.
Lemma 19. Not every Gibbs-preserving matrix for some Hamiltonian H and inverse temperature β satisfies detailed balance for H and β.

FIG. 7:
Directed graph that illustrates a four-level quasicycle: The associated matrix fails to satisfy detailed balance, but cunning choice of the p i ensures that the matrix is thermalizing.
Proof. To prove the lemma by example, we invoke the quasicycles described in [29]. A quasicycle is a process that has a probability P (i → (i + 1) mod N ) ≡ p i of evolving a system S that occupies energy eigenstate i to eigenstate i + 1 and has a probability 1 − p i of keeping S in state i. All p i > 0, and for at least one value of i, p i < 1. The directed graph of a quasicycle forms a ring in which at least one node also has a loop to itself, corresponding to a value of (1 − p i ) > 0. An example appears in Fig. 7. The probability that i evolves to j forms element M ij of matrix M . The matrix fails to satisfy detailed balance if S has more than three energy eigenstates, because P (i → (i + 1) mod N ) is finite, though P ((i + 1) mod N → i) = 0. We will show that, if the p i assume certain values, the Gibbs state g is an eigenvector of M . Let level i = 1 correspond to the lowest energy eigenvalue. Solutions of the form wherein p ∈ (0, 1) denotes a free parameter in the range (0, 1) are Gibbs-preserving. Roughly, the greater the value of p, the more quickly the quasicycle is traversed.
To verify that Eq. (76) describes a Gibbs-preserving matrix, we express the matrix multiplication M g in index form: Upon substituting in from Eq. (76), we can simplify the equations to (M g) 1 = g 1 (79) (M g) i = g i i = 2 . . . N.
Hence M g = g, so M preserves Gibbs states.
Together, Lemmas 18 and 19 imply the strict relation D ⊂ G.
Lemma 20. Obeying detailed balance is not equivalent to thermalizing: D = T .
Proof. We will show that the quasicycle matrix M described in the proof of Lemma 18-a matrix that does not obey detailed balance-is thermalizing. Because M is stochastic by construction, its greatest eigenvalue equals one. In addition to being stochastic, M is irreducible, aperiodic 6 and non-negative. By the Perron-Frobenius Theorem, the greatest eigenvalue λ of M corresponds to the only nonnegative eigenvector v λ of M . This λ = 1, because M is stochastic. As shown in the proof of Lemma 18, v λ = g. As explained below the proof of Lemma 16, lim n→∞ M n maps every vector s to g: The matrices that represent quasicycles thermalize. M does not obey detailed balance, as discussed in the proof of Lemma 18. Hence thermalizing is not equivalent to obeying detailed balance: D = T . Proof. We can prove this lemma by example. After reviewing the form of the partial-swap matrix M , we show that M thermalizes, then show that M obeys detailed balance.
Partial swap was introduced in Appendix D. A partial-swap operation has some probability p of replacing the operated-on state s with a thermal state and a probability 1 − p of preserving s. If s denotes the state of an N -level system, wherein 1 N denotes the N × N identity and every column of the matrix G is the thermal state g.
Let us prove that M thermalizes. M is stochastic, as it is the probabilistic combination of 1 N and G, which are stochastic. If N is finite, G is positive; so when p > 0, M is positive. Positivity implies irreducibility and aperiodicity. Hence the Perron-Frobenius Theorem 7 implies that M has just one nonnegative eigenvector v λ and that this eigenvector corresponds to λ = 1. Direct multiplication shows M g = g. Thus, g = v λ is the only nonnegative eigenvector of M and corresponds to the largest eigenvalue. By the argument above Lemma 16, M thermalizes. 6 Though quasicycles look cyclic, they are aperiodic. For the purposes of the Perron-Frobenius Theorem, a matrix's period is the maximum value of k max of k that satisfies the statement "A system prepared in level A has a nonzero probability of evolving to level A only (but not necessarily) after multiples of k steps". For irreducible matrices, the possible values of k do not depend on the form of A [62]. When this index k max = 1, the matrix is aperiodic. Every quasicycle contains at least one node that transitions to itself [not all p i = 1 so at least one loop satisfies P (i → i) = (1 − p i ) > 0]. Thus any value of k satisfies the above statement. Hence k max = 1, and quasicycles are aperiodic. 7 For strictly positive matrices, the earlier Perron Theorem implies the same result.
To show that M obeys detailed balance, we compare the matrix elements that represent the probabilities of transitions between states i and j: wherein δ ij denotes the Kronecker delta. This equation recapitulates the definition of detailed balance [Eq. (41)]. Hence matrices-such as the partial swap-can obey detailed balance while thermalizing.