Thermodynamic Implementations of Quantum Processes

Recent understanding of the thermodynamics of small-scale systems have enabled the characterization of the thermodynamic requirements of implementing quantum processes for fixed input states. Here, we extend these results to construct optimal universal implementations of a given process, that is, implementations that are accurate for any possible input state even after many independent and identically distributed (i.i.d.) repetitions of the process. We find that the optimal work cost rate of such an implementation is given by the thermodynamic capacity of the process, which is a single-letter and additive quantity defined as the maximal difference in relative entropy to the thermal state between the input and the output of the channel. Beyond being a thermodynamic analogue of the reverse Shannon theorem for quantum channels, our results introduce a new notion of quantum typicality and present a thermodynamic application of convex-split methods.


Introduction
In the information-theoretic approach to thermodynamics, a careful analysis of the resources required to perform thermodynamic tasks has allowed to consistently and systematically describe the thermodynamic behaviour of quantum systems at the nanoscale [1]. In particular, thermodynamics can be phrased as a resource theory [2][3][4]. In a resource theory, one specifies which operations can be carried out at no cost-the free operations-and then one studies how much of external resources (e.g., thermodynamic work) one needs to provide to carry out operations that are not free. Two established resource theories for quantum thermodynamics are thermal operations [2,3] and Gibbspreserving maps [5,6]. In the former, the free operations consist of energy-conserving interactions of the system with a heat bath, while in the latter, the free operations are any quantum operation that preserves the thermal state. It is reasonable to assume that thermal operations can be realized in an idealized setting, making them a good choice of framework for constructing explicit protocols, whereas Gibbs-preserving maps encompass a broader class of operations, allowing us to derive stronger fundamental limits.
The resource theory approach to thermodynamics has revealed close connections with measures of information known from quantum information theory [7,8]. Namely, singleshot thermodynamic and information-theoretic tasks are both quantified by relevant entropy measures [9][10][11]. Consequently, tools from quantum Shannon theory can be used to characterize tasks in thermodynamics, for instance to derive second-order asymptotics of the work cost of state transformations [12]. Recently, focus was shifted to understand the resource costs of quantum processes, rather than state transformations [13][14][15][16]. The information measure associated with quantum processes is the quantum capacity, along with its many variants [17]. A natural question arises: What is the thermodynamic analogue of the quantum capacity?
Here, we ask how much work is required to implement a given quantum process, with the requirement that the implementation is accurate for any possible input state. In the single-instance regime, we find that the answer is a variation of the results obtained in Ref. [16]. However, in the regime where we consider many independent and identically distributed (i.i.d.) copies of the process, important differences arise due to typicality. We find that the optimal work cost of such an implementation in the i.i.d. regime is given by the thermodynamic capacity, defined as the maximal difference between the input and output free energy of the process over all possible input states. The fact that no implementation can perform better than the thermodynamic capacity follows fairly straightforwardly from the results of Ref. [16]. The technically challenging part of the present paper is to show that there exist protocols that achieve this limit.
We provide three different constructions of such protocols, each valid in different settings. In the first construction, we make the simplifying assumption that Hamiltonian of the system is trivial as in Ref. [13]. We then show that simple properties of one-shot entropy measures, coupled with the post-selection technique [18], provide an existence proof of the required implementation. The implementation is given in terms of thermal operations. In our second construction, we develop novel quantum typicality tools which we use along with the post-selection technique to explicitly construct an implementation in terms of Gibbs-preserving maps for any i.i.d. process and for any system Hamiltonian. In our third construction, we assume that the i.i.d. process is time-covariant, i.e., commutes with the time evolution. We then use recent results on the convex-split lemma and position-based decoding [19] to construct an implementation of a time-covariant i.i.d. process with thermal operations.
Our results imply that the thermodynamic resource theory of channels becomes reversible in the i.i.d. limit [20]. Namely, invoking the results in Ref. [21], we see that the work rate that is required to implement a given i.i.d. process is the same as what can be extracted if the i.i.d. process is provided to us as a black box. This provides a thermodynamic analogue of the reverse Shannon theorem from quantum information theory. This theorem states that the quantum mutual information of the channel uniquely characterizes the resources required to simulate the channel with noiseless channel uses and shared entanglement, as well as to distil a noiseless channel from many uses of the channel and shared entanglement [22,23]. Indeed, our proof techniques are inspired by Refs. [22,[24][25][26].
The remainder of this paper is structured as follows. Section 2 gives the necessary preliminaries and fixes some notation. Section 3 introduces two resource theories for thermodynamics, thermal operations and Gibbs-preserving maps. In Sect. 4 we introduce the thermodynamic capacity and present some elementary properties. In Sect. 5, we provide our first construction for a trivial Hamiltonian. In Sect. 6 we provide our second construction, which is valid in the general setting and provides an implementation in terms of Gibbs-preserving maps. Section 7 provides our third construction, valid for time-covariant i.i.d. processes, and built with thermal operations. Our conclusions are presented in Sect. 8. Various more technical proof details are deferred to "Appendices A-F".

Preliminaries
2.1. Quantum states, quantum processes, and distance measures. Each quantum system considered lives in a finite-dimensional Hilbert space. A quantum state is a positive semidefinite operator ρ satisfying tr[ρ] = 1. A sub-normalized quantum state is a positive semi-definite operator ρ satisfying tr[ρ] 1. To each system S is associated a standard basis, usually denoted by {|k S }. For any two systems A, A , we denote by A A the fact that they are isometric. In that case, we consider a representation in which the isometry maps the standard basis onto the standard basis, i.e., id A→A (|k k| A ) = |k k| A for all k, where id A→A denotes the identity process. For any two systems A A , we define the non-normalized maximally entangled reference ket |Φ A:A = k |k A ⊗ |k A . Matrix inequalities are with respect to the positive semi-definite cone: A B signifies that B − A is positive semi-definite. A completely positive map E X →X is a linear mapping that maps Hermitian operators on X to Hermitian operators on X and that satisfies E X →X (Φ X :R X ) 0, where R X X . The adjoint E † X ←X of a completely positive map E X →X is the unique completely positive map X → X that satisfies Proximity of quantum states can be measured by the fidelity F(ρ, σ ) = √ ρ √ σ 1 , where the one-norm of an operator is defined as A 1 = tr √ A † A . The fidelity is extended to sub-normalized states ρ, σ as the generalized fidelity,F(ρ, σ ) = √ ρ √ σ 1 + √ (1 − tr[ρ])(1 − tr[σ ]), noting that F(·, ·) =F(·, ·) whenever at least one of the states is normalized. An associated metric can be defined for any sub-normalized states as P(ρ, σ ) = 1 −F 2 (ρ, σ ), called the purified distance [10,11,27], or root infidelity, and is closely related to the Bures distance and the quantum angle [28]. The proximity of two sub-normalized quantum states ρ, σ may also be measured in the trace distance D(ρ, σ ) = 1 2 ρ − σ 1 . We note that the one-norm of a Hermitian operator A can be expressed as where the first optimization ranges over Hermitian Z operators and where the second over positive semi-definite operators Δ ± . For any two states ρ, σ (one can even be sub-normalized), the purified distance and the trace distance are related via Similarly, we may define a distance measure for channels: For two completely positive, trace non-increasing maps T X →X and T X →X , the diamond norm distance is defined as where the optimization ranges over all bipartite quantum states over X and a reference system R X . The optimization may be restricted to pure states without loss of generality.

Entropy measures.
The von Neumann entropy of a quantum state ρ is H (ρ) = − tr[ρ ln ρ]. In this work, all entropies are defined in units of nats, using the natural logarithm ln(·), instead of units of (qu)bits. A number of nats is equal to ln(2) times the corresponding number of qubits. The conditional von Neumann entropy of a bipartite state ρ AB is given by The quantum relative entropy is defined as where ρ is a quantum state and where σ is any positive semi-definite operator whose support contains the support of ρ.

Schur-Weyl duality. Consider a Hilbert space H
acts as X ⊗n and where the permutation group permutes the tensor factors. We follow closely the notation of Refs. [24,25]. Schur-Weyl tells us that the full Hilbert space decomposes as where λ ∈ Young(n, d) are Young diagrams with n boxes and (at most) d rows, and where Q λ , P λ are irreducible representations of GL(d A ) and S n , respectively. The number of Young diagrams in the decomposition above is at most poly(n), if d A is kept constant. We write poly(n) = O(poly(n)) in big O notation for terms whose absolute value is upper bounded by some polynomial n c for c ∈ N in the asymptotic limit n → ∞. We denote by Π λ A n the projector in H ⊗n A onto the term labelled by λ in the decomposition above. We denote by q λ (X ) a representing matrix of X ∈ GL(d A ) in the irreducible representation labelled by λ; the operator q λ (X ) lives in Q λ . We furthermore introduce the following notation, for any Y ∈ Q λ ⊗ P λ , which represents the canonical embedding of an operator Y on Q λ ⊗ P λ into the space H ⊗n A , i.e., mapping Y onto the corresponding block in (6). In particular, Any operator X A n acting on the n copies which commutes with all the permutations admits a decomposition of the form for some set of operators X λ ∈ Q λ . In particular, [X A n , Π λ A n ] = 0. We can make this more precise for i.i.d. states. For any X ∈ GL(d A ), we have that For a given λ ∈ Young(n, d), it is often useful to consider the corresponding normalized probability distribution λ/n = (λ i /n) i . The entropy of this distribution is given bȳ where λ i is the number of boxes in the i-th row of the diagram.
Proof. Π λ A n ⊗ 1 B n is invariant under the action of S n permuting the copies of A ⊗ B, and so it admits a decomposition of the form (9) and commutes with Π λ A n B n . The following is another lemma about how much overlap Schur-Weyl blocks have on a bipartite system versus on one of the two systems. This lemma forms the basis of our universal typical subspace. Lemma 2.2. Consider n ∈ N copies of a bipartite system H A ⊗ H B . Then, for any λ ∈ Young(d A d B , n) and λ ∈ Young(d B , n), we have noting that [1 A n ⊗ Π λ B n , Π λ A n B n ] = 0. The proof is provided in "Appendix A".

Estimating entropy.
Measuring the Young diagram λ-that is, performing the projective measurement with operators {Π λ A n } λ -yields a good estimation of the spectrum of a state ρ A when given ρ ⊗n A [25]. An estimate for the entropy of ρ is thus obtained by calculating the entropy H (λ/n) corresponding to the probability distribution λ/n. Proposition 2.1 (Spectrum and entropy estimation [22,24,25] The proof is provided in "Appendix A".
and where for any h ∈ R we define (iv) For any h ∈ R, we have The proof is provided in "Appendix A".  [18]). Let X, X be quantum systems, E X →X be a completely positive, trace-preserving map, and T X n →X n be a completely positive, trace non-increasing map. Furthermore, letR X, where dφ XR denotes the Haar-induced measure on the pure states on X ⊗R, and dσ X its induced measure on X after partial trace, and let |ζ X n R be a purification of ζ X n . Then, we have Moreover, for all n ∈ N there exists a set |φ i XR of at most poly(n) states, and a probability distribution { p i }, providing a purification of ζ X n as with a register R of size poly(n).
The first part of the theorem is [18,Eq. (4)] and the second part is, e.g., found as [23,Cor. D.6]. The following proposition shows that a given channel is close to an i.i.d. channel, if it behaves as expected on all i.i.d. states with exponentially good accuracy. Proposition 2.3. For three systems X, X , E, let V X →X E be an isometry and W X n →X n E n be an isometry which commutes with the permutations of the n systems. Furthermore, assume that there exists η > 0 independent of n such that for all pure states |σ σ | X R X with a reference system R X X , we have For E X →X (·) = tr E V X →X E (·) V † and T X n →X n (·) = tr E n W X n →X n E n (·) W † we then have The proof is provided in "Appendix A".

Gibbs-preserving maps.
We consider the framework of Ref. [16], where for each system S considered a positive semi-definite operator Γ S 0 is associated. A trace nonincreasing, completely positive map Φ A→B is allowed for free if it satisfies Φ A→B (Γ A ) Γ B . In the case of a system S with Hamiltonian H S , and in the presence of a single heat bath at inverse temperature β, the relevant thermodynamic framework is given by setting Γ S = e −β H S . In the remainder of this paper, when using the present framework, it is convenient to work with the Γ operators on an abstract level. The results then also apply to situations where several different thermodynamic baths are considered, or in more general settings where a specific operator needs to be conserved by the spontaneous evolution of the system [16]. The resources required to enable non-free operations are counted using an explicit system that provides these resources, such as an information battery. An information battery is a large register W whose associated operator Γ W is simply Γ W = 1 W (i.e., H W = 0). The information battery is required to be in a state of the special form τ m W = P m W / tr[P m W ] where P m W is a projector of rank e m . That is, τ m W has uniform eigenvalues over a given rank e m . We denote the charge or resource value of a battery state τ m W by w(τ m W ) = ln(d) − m, where d is the dimension of the information battery. The value w(τ ) measures the amount of purity present in the state τ , which is the basic resource required to implement maps that are not already Gibbs-preserving maps. We choose to measure w(τ ) in units of number of pure nats, equal to ln(2) times a number of pure qubits. A Gibbs-preserving map that acts jointly on a system and an information battery, and which maps the input battery state τ to the output battery state τ , is deemed to consume an amount of work w = w(τ ) − w(τ ).
The resources can be counted in terms of thermodynamic work in units of energy if we are given a heat bath at inverse temperature T . Recall that a pure qubit can be converted to kT ln(2) work using a Szilárd engine, where k is Boltzmann's constant [29]. By counting purity in nats instead of qubits, we get rid of the ln(2) factor: A number λ of pure nats can be converted into λ kT thermodynamic work using a Szilárd-type engine. We count work exclusively in equivalent of pure nats, for simplicity, as opposed to units of energy. The two are directly related by a factor β −1 = kT . Furthermore, this eliminates the factor β from otherwise essentially information-theoretic expressions, and our theorems thus directly apply to cases where Γ X , Γ X are any abstract positive semi-definite operators which are not necessarily defined via a Hamiltonian.
Let Φ X W →X W be a Gibbs-preserving map acting on an information battery W , and let τ m W , τ m W be two information battery states. An implementation running the operation Φ X W →X W with the given input and output battery states is tasked to (a) make available the input battery state, (b) apply the operation Φ X W →X W , and (c) check that the output battery state is appropriate (e.g., for possible future re-use). For the verification in Point (c) it is sufficient to measure the two-outcome POVM {P m W , 1 − P m W }; as long as the first outcome is observed, it is always possible to bring the state to τ m W by applying a completely thermalizing operation on the support of P m W (here, this is a completely randomizing or completely symmetrizing operation). In the constructions presented in the present paper, we allow this verification measurement to fail with a small fixed probability > 0.
A convenient mathematical object to characterize what the operation does on the system is the following. The effective work process T X →X F associated with Φ X W →X W and (τ m W , τ m W ) is the trace non-increasing map defined as The question of implementing a process E becomes the issue of finding a Gibbspreserving map along with battery states such that the associated effective work process is close to E . Specifically, if T X →X − E X →X , then we can assert that the failure probability in Point (c) above is bounded by for all possible inputs on X ; the operation therefore implements E X →X accurately with high success probability.
A useful characterization of which processes can be implemented using an information battery is given by the following proposition. . Let Γ X , Γ X 0, T X →X be a completely positive, trace non-increasing map, and w ∈ R. Then, the following are equivalent: (ii) For all δ > 0 there exists an information battery W and two battery states τ W , τ W such that w(τ W ) − w(τ W ) w + δ, and there exists a Gibbs-preserving map Φ X W →X W with T X →X the effective work process associated with Φ X W →X W and (τ W , τ W ).
Therefore, to show that one can implement E X →X with Gibbs-preserving maps while expending work w, it suffices to exhibit a map T X →X that is -close to E X →X in diamond distance and that satisfies T X →X (Γ X ) e w Γ X . From the proof in [16] we know in Point (ii) above that W , τ W ≡ τ m W and τ W ≡ τ m W can be chosen freely as long as m − m = w(τ W ) − w(τ W ) w and that the corresponding Gibbs-preserving map is given by In Ref. [16], the resource cost w of implementing a process E X →X (any completely positive, trace-preserving map) up to an accuracy 0 in terms of proximity of the process matrix given a fixed input state σ X , counted in pure nats, was shown to be given by the coherent relative entropy where σ X R X is the purification of σ X on a system R X X given by |σ X R = σ 1/2 X |Φ X : R X , and where the optimization ranges over completely positive, trace non-increasing maps T X →X . The coherent relative entropy enjoys a collection of properties in relation to the conditional min-and max-entropy, and to the min-and max-relative entropy. It satisfies the following asymptotic equipartition property: For a completely positive, trace-preserving map E X →X and quantum state σ X we have for 0 < < 1 that 3.2. Thermal operations. The framework of Gibbs-sub-preserving maps is technically convenient, but it is unclear whether any Gibbs-sub-preserving operation can be implemented at no work cost using other frameworks. This includes for example thermal operations that might be considered more operational Here, we consider the alternative framework of thermal operations [2,3,8]. Each system S of interest has an associated Hamiltonian H S and is not interacting with the other systems. For a given fixed inverse temperature β, we allow the following operations to be carried out for free: (i) Apply any unitary operation that commutes with the total Hamiltonian; (ii) Bring in any ancillary system in its Gibbs state at inverse temperature β; and (iii) Discard any system.
The most general transformation a system S can undergo under this set of rules is a thermal operation. A thermal operations is any process that can be implemented using where γ B = e −β H B / tr[e −β H B ] is the Gibbs state of the bath system B. Observe that any concatenation of thermal operations is again a thermal operation. Clearly, any thermal operation Φ S leaves the thermal state γ S = e −β H S / tr[e −β H S ] on S invariant. Hence, any lower bound on the work cost of an implementation derived in the framework of Gibbs-preserving maps also applies to thermal operations. We use the same definitions of work and the effective work process for thermal operations as we defined for Gibbs-preserving maps earlier: an information battery is used to account for work, and the effective work process associated with a thermal operation Φ X W →X W with respect to battery states (τ m W , τ m W ) is also defined by (24). When considering only states that commute with the Hamiltonian, a powerful tool to characterize possible state transformations is the notion of thermomajorization [8]. In the fully quantum regime, there is in contrast no known simple mathematical characterization of the work required to implement a quantum process with thermal operations. In fact, because thermal operations are time-covariant, it is impossible to implement processes that are not time-covariant, even if the latter might admit an implementation with a Gibbs-preserving map [6].
We will later use a primitive that transforms a thermal state into a pure energy eigenstate. The next statement follows directly from [8,Eq. (8) and Suppl. Note 4].

Thermodynamic Capacity
4.1. Definition. Let X, X be quantum systems, E X →X be a quantum process, and > 0. We seek a free thermodynamic operation (either a thermal operation or a Gibbs preserving map) Φ X n W →X n W that acts on X ⊗n and a battery W , with output on X ⊗n and W , as well as information battery states τ (i) W and τ (f) W , such that: We seek to minimize the work consumption per copy w given by Our main result is a collection of three independent constructions of such implementations in different regimes, using either Gibbs-preserving maps or thermal operations. In each case, the amount of work consumed per copy is given by a quantity which we call the thermodynamic capacity of the process, and which turns out to be the minimal work cost an implementation satisfying the above conditions can achieve. The thermodynamic capacity of a completely positive, trace-preserving map E X →X relative to operators Γ X , Γ X > 0 is defined as In a fully thermodynamic context where Γ X = e −β H X and Γ X = e −β H X , one can choose to express the thermodynamic capacity in units of energy rather than in nats, in which case a pre-factor β −1 may be included in the definition above such that the thermodynamic capacity is a difference of free energies Construction for trivial Hamiltonians First, in Sect. 5 we consider the special case where Γ X = 1 X and Γ X = 1 X corresponding to trivial Hamiltonians and show that simple considerations based on properties of known entropy measures guarantee the existence of a universal implementation of E ⊗n with either thermal operations or Gibbs-preserving maps.
Construction using Gibbs-preserving maps Second, in Sect. 6 we consider the case of general Γ X , Γ X and we construct a universal implementation of E ⊗n X →X with Gibbspreserving maps, based on new typicality considerations.
Construction using thermal operations Third, for arbitrary Hamiltonians we construct in Sect. 7 a universal implementation of E ⊗n X →X with thermal operations, assuming that E is time-covariant, i.e., that it commutes with the time evolution operation.

Properties.
The thermodynamic capacity is a convex optimization program. Namely, the objective function of the optimization in (30) can be written as where we defined the state and the quantum relative entropy is jointly convex. The other terms in (32) are linear. Hence, the optimization (30) is a convex optimization that can be carried out efficiently for small system sizes [30]. Indeed, we have successfully computed the thermodynamic capacity of simple example quantum channels acting on few qubits with Python code, using the QuTip framework [31,32] and the CVXOPT optimization software [33] (see also [34] for a direct algorithm). The thermodynamic capacity is additive [21]. As a consequence of this property, it is not necessary to include a stabilization over a reference system in the definition of the thermodynamic capacity. That is, had we optimized over bipartite states σ X R with a reference system R for any Γ R , on which the process acts as the identity process, we would be effectively computing

Proposition 4.1 (Additivity of thermodynamic capacity [21]). For
For completeness we provide an independent proof of additivity, to ensure validity in the general setting of abstract Γ operators.
Proof. Let σ X , τ Z be states achieving the thermodynamic capacity of T (E ) and T (F ), respectively. Then, σ X ⊗ τ Z is a candidate for T (E ⊗ F ), yielding Now, let ζ X Z achieve the optimum for since ln(A ⊗ B) = ln(A) ⊗ 1 + 1 ⊗ ln(B). Invoking the chain rule of the von Neumann entropy, and then strong sub-additivity of the entropy, we see that where the last inequality holds because the reduced states ζ X , ζ Z are optimization candidates for T (E ) and T (F ), respectively. A special case worth mentioning is when Γ X = 1 X , Γ X = 1 X , which corresponds to the situation where the Hamiltonians of X and X are trivial. For any quantum channel That is, the thermodynamic capacity characterizes by how much the channel is capable of reducing the entropy of its input, or equivalently, how much entropy the channel is capable of dumping into the environment when conditioned on the output. We note that the quantity −T (E ) has previously been studied in the information theory literature as the entropy gain of quantum channels [35][36][37][38][39][40][41][42]. Our work can be seen as giving a precise operational interpretation to this quantity.

Optimality.
Here, we show that any universal implementation that obeys our stated conditions in Sect. 4.1 must necessarily consume an amount of work that is lower bounded by the thermodynamic capacity. That is, any universal implementation that consumes an amount of work equal to the thermodynamic capacity is optimal. This lower bound is simple to prove, because a universal implementation of a process must necessarily be a good implementation for any individual i.i.d. input state, a situation where the optimal work cost is known [16]. Furthermore, any scheme that satisfies the requirements of Sect. 4 at work cost w per copy counted with standard battery states of Ref. [16], has an effective process T X n →X n on the systems that obeys T (Γ ⊗n X ) e nw Γ ⊗n X . This is because any thermal operation is in particular a Gibbs-preserving map, and the work cost is characterized by Proposition 3.1. The following shows that for any such implementation, the work consumed w per copy cannot be less than the thermodynamic capacity of the process. Proposition 4.2. Let > 0, Γ X , Γ X > 0, E X →X a completely positive, trace-preserving map, and T X n →X n a completely positive, trace non-increasing map such that we have We have that T is a valid optimization candidate for the definition of the coherent relative entropy and thus For n → ∞, we can employ the asymptotic equipartition of the coherent relative entropy (27) to see that Since this inequality holds for all σ X , we deduce that T (E ) w.

Statement and proof sketch.
Instead of constructing explicitly an implementation that satisfies the requirements of Sect. 4, one might hope that the implementation could be given implicitly as the solution of a semi-definite program representing an entropy measure. This proof idea was indeed exploited in other contexts in Refs. [23,43]. Here, we define the one-shot entropy-like quantity where T X →X ranges over all trace non-increasing, completely positive maps. The proof strategy would then be to relate this entropy measure to the coherent relative entropy, and to exploit known properties of the latter in the i.i.d. regime to provide an upper bound to the expression Should this upper bound behave like T (E ) to leading order, then the T equal to the optimal solution to (40) defines an implementation in terms of Gibbs-preserving maps thanks to Proposition 3.1. It turns out that this proof strategy works well in the special case of trivial Hamiltonians, but fails in the general case.
The core technical statement that underlies our Construction #1 is summarized in the following theorem. where This implementation is constructed by taking the implicit optimal solution T X n →X n in the semi-definite program (40) for 1 n W X n →X n (E ⊗n X →X 1 X n , 1 X n ), and using Proposition 3.1 to construct an associated Gibbs-preserving map acting on battery states via (25). In summary, for any δ > 0, for n large enough and choosing any m, m such that m − m nT (E ) + δ , the full implementation map in terms of T X n →X n becomes We emphasise that Theorem 5.1 exactly covers the entropy gain of quantum channels as studied in [35][36][37][38][39][40][41][42].
Proof. (Theorem 5.1) By using the post-selection technique (Theorem 2.1) and recalling that the fixed-input state case is given by the coherent relative entropy, we find In the case of trivial Hamiltonians, the coherent relative entropy reduces to the smooth max-entropy (cf. [16,Props. 28 and 26] and also Ref. [44]). More precisely, we havê where |ρ X R X E is a pure state, where c > 0, 0 < α < 1, g( ) are universal and do not depend on the state or the dimensions of the systems, and the smooth max-entropy is defined as Thus, we have where At this point we invoke two facts. First, note that the de Finetti state can be written as a mixture of only poly(n) i.i.d. states, instead of a continuous average (Theorem 2.1): There exists a set {σ i } of at most poly(n) states and a distribution { p i } such that ζ X n = i p i σ ⊗n i . Second, we invoke the property that the conditional max-entropy is quasi-convex up to a penalty term, namely, that the conditional max-entropy of i p i ρ i is less than or equal to the maximum over the set of max-entropies corresponding to each ρ i , plus a term proportional to the logarithm of the number of terms in the sum [45, Lemma 11]. Hence, Now, we are in business because the max-entropy is evaluated on an i.i.d. state, and we know that it asymptotically goes to the von Neumann entropy in this regime [46]. Also, lim n→∞ (1/n) ln(poly(n)) + g( ) = 0 and hence

Challenges for extension to non-trivial
Hamiltonians. Naturally, one might ask whether it is possible to extend this proof to the case of non-trivial Γ operators. Interestingly, this is not possible, at least not in a naive way. The problem is that we need a quasi-convexity property of the form where σ X = p i σ i X and |σ X R = σ where M is the number of terms in the convex decomposition as for the max-entropy. In fact, Eq. (51) is false, as can be shown using an explicit counterexample on a twolevel system which we present below. As this example is based on physical reasons, the coherent relative entropy is not even approximately quasi-convex. We note that a priori we cannot rule out a quasi-convexity property that might have a penalty term that depends on properties of the Γ operators, yet such a term is likely to scale unfavourably with n.
For = 0, we can see this because the input state is full rank, hence T = E ; then E (Γ ) = tr[Γ ]|+ +| and the smallest α such that E (Γ ) αΓ is given by Noting that tr[Γ ] 1, we have α e β E 1 /2, and hence the energy cost of the transfor- Clearly, this work cost can become arbitrarily large if E 1 → ∞. On the other hand, we can perform the transformation |+ → |+ obviously at no work cost; similarly, |− → |+ can be carried out by letting the system time-evolve under its own Hamiltonian for exactly the time interval required to pick up a relative phase (−1) between the |0 and |1 states. This also costs no work because it is a unitary operation that commutes with the Hamiltonian. We thus have our counter-example to the quasi-convexity of the coherent relative entropy. The transformation 1/2 → |+ is very hard, but the individual transformations |± → |+ are trivial, noting that 1/2 = (1/2)|+ +| + (1/2)|− −|. We show in "Appendix D" how to make the above claim robust against an accuracy tolerance ≥ 0.

Statement and proof sketch.
Here, we present a general construction of a universal implementation of an i.i.d. process using Gibbs-preserving maps according to the requirements of Sect. 4.1. The idea is to explicitly construct an implementation using a novel notion of quantum typicality. We introduce notions of quantum typicality that apply to quantum processes and universally capture regions of the Hilbert space where the conditional entropy (respectively the relative entropy difference) has a given value. This generalizes existing notions of typical projectors to a quantum typical operator that applies to bipartite states, is relative to a Γ operator, and universal.
The main result behind the construction in this section is the following theorem.
Theorem 6.1. Let Γ X , Γ X > 0, E X →X be a completely positive, trace-preserving map, and > 0. Then, for δ > 0 and n ∈ N large enough there exists a completely positive map T X n →X n such that: Note that we have n −1 ln(poly(n)) → 0 as n → ∞, and that we can take δ → 0 after taking n → ∞. Thanks to Proposition 3.1, the mapping T X n →X n defines an implementation of the i.i.d. process E ⊗n X →X in terms of Gibbs-preserving maps and a battery, whose work cost rate is given to leading order by the thermodynamic capacity T (E ) after taking δ → 0.
As for Construction #1, the full Gibbs-preserving map implementing the required process is assembled in two steps, first constructing the map T X n →X n in Theorem 6.1 and then using Proposition 3.1 to obtain the full Gibbs-preserving map. Let V X →X E be a Stinespring dilation isometry of E X →X . For δ > 0, we introduce a universal conditional and relative typical smoothing operator M x,δ E n X n (see later Definition 6.1 and Proposition 6.1) with x = −nT (E ) and relative to Γ X E ≡ V Γ X V † and Γ X . The map T X n →X n is then constructed as Finally, we employ Proposition 3.1 to construct an associated Gibbs-preserving map acting on battery states via (25). For any δ > 0, for n large enough and choosing any m, m such that m − m nT (E ) + 4δ + n −1 ln poly(n) + δ , the full implementation map in terms of T X n →X n becomes 6.2. Construction via universal conditional and relative typicality. The main ingredient of our proof is a notion of a universal conditional and relative typical smoothing operator that enables us to discard events that are very unlikely to appear in the process while accounting for how much they contribute to the overall work cost. This operator is inspired by similar constructions in Refs. [47,48]. However, in additional to being "relative" as in [47] our smoothing operator is also simultaneously "conditional" and "universal".
Note that the smoothing operator is defined as a general operator of norm bounded by one, as opposed to the usual definition of typical subspaces or typical projectors. The main reason is that it is not known to us in general if such an object can be chosen to be a projector. By using the real part in Point (ii) above, we ensure that a process that applies the operator M x,δ A n B n preserves coherences when it is applied to a superposition of several states {|ρ ⊗n AB R }. This property would not have been ensured if instead, we had merely asserted that M x,δ A n B n |ρ ⊗n AB R and |ρ ⊗n AB R have high absolute value overlap or are close in fidelity. If M x,δ A n B n is a projector then the expression reduces to tr(M x,δ A n B n ρ) as one usually considers for projectors on typical subspaces.
The core technical statement of Construction #2 is to show the existence of a universal conditional and relative smoothing operator, which is as follows. In the following, we present the proof of Theorem 6.1 based on the existence of such the smoothing operator from Proposition 6.1. The more technical proof of Proposition 6.1 is then given in Sect. 6.3.
Proof (Theorem 6.1). Let V X →X E be a Stinespring dilation of E X →X into an environment system E X ⊗ X . For n ∈ N we need to find a suitable candidate implementation T X n →X n . Let For any δ > 0 let M x,δ E n X n be the operator constructed by Proposition 6.1, with the system E playing the role of the system A, with V X →X E Γ X V † X ←X E as Γ AB and with Γ X as Γ B . Now, define noting that T X n →X n is trace non-increasing by construction thanks to Property (i) of Definition 6.1.
Let |σ X R X be any pure state, and define |ρ x. Then Property (ii) of Proposition 6.1 tells us that there exists a ξ > 0 independent of both ρ and n such that The conditions of Proposition 2.3 are fulfilled, with W X n →X n E n = M x,δ A n B n V ⊗n X →X E , thanks furthermore to the fact that M x,δ E n X n is permutation-invariant as guaranteed by Proposition 6.1. Hence, we have For n ∈ N large enough this becomes smaller than any fixed > 0. Furthermore, by Property (iii) of Definition 6.1, we have that as required.
6.3. Universal conditional and relative typical smoothing operator. We now turn to the proof of Proposition 6.1, giving an explicit construction of a universal conditional and relative typical smoothing operator. As the proof of Proposition 6.1 is quite lengthy, it can be instructive to consider a simpler version of our typical smoothing operator which applies in the case where the Hamiltonians are trivial. We carry out this analysis in "Appendix E".
Proof (Proposition 6.1). First, we claim that we can assume Γ AB > 0 and Γ B > 0 without loss of generality. Indeed, if either operator is not positive definite, then we can first construct the operator M x,δ A n B n associated with modified operators Γ AB > 0 and Γ B > 0 where all the zero eigenvalues of Γ AB and Γ B are replaced by some arbitrary fixed strictly positive constant (e.g., one); we can then set M x,δ is the projector onto the support of Γ ⊗n AB (respectively Γ ⊗n B ). The operator M x,δ A n B n constructed in this way satisfies all of the required properties. For the remainder of this proof we thus assume that Γ AB > 0 and Γ B > 0.
Let R k A n B n be the POVM constructed by Proposition 2.2 for H AB = − ln(Γ AB ). Similarly, let S B n be the corresponding POVM constructed in Proposition 2.2 for H B = − ln(Γ B ). Also, as before, we denote by Π λ A n B n and by Π μ B n the projectors on the Schur-Weyl blocks labelled by the Young diagrams λ ∈ Young(d A d B , n) and μ ∈ Young(d B , n). Let A n B n ] = 0 for the same reason. The operator M x,δ A n B n is permutation-invariant by construction. Then, we have recalling that the operators (Π λ A n B n , Π μ B n , S B n ) form a commuting set of projectors, and where in the third line the inner sum is taken to be the zero operator if no triplet ( , λ, μ) satisfies the given constraints. This shows Property (i). Now, consider any state |ρ AB R , where R is any reference system, and assume that We write where we define further noting that the conditions in the sum defining 1 We first consider 1 . Define the projectors and observe that Re ρ| ⊗n AB R X 4 X 3 |ρ ⊗n

AB R
Re ρ| ⊗n AB R X 4 |ρ ⊗n AB R − poly(n) exp(−nη/2) ; Re ρ| ⊗n AB R X 4 |ρ ⊗n We take all these η's to be the same, by choosing if necessary the minimum of the four possibly different ηs. Hence, we have Now we consider the term 2 . We know that using the Cauchy-Schwarz inequality and because at least one of the four conditions is violated, causing at least one of the two the norms to decay exponentially (noting also that S B n , Π μ B n , Π λ A n B n all commute). Because there are only at most poly(n) terms, we have Hence, we have proving Property (ii) for ξ = η/2. Note that ξ does not depend on the state |σ X R . Now, we prove Property (iii). Using Lemma B.1 and dropping some subsystem indices for readability, we have Let > 0. Let δ > 0 be small enough and n ∈ N be large enough. Then, there exists an information battery W , a thermal operation Φ X n W , and battery states τ (i) W and τ (f) W such that: (i) The effective work process T X n →X n associated with Φ X n W and τ (i) (ii) The work cost per copy satisfies The main idea in the present construction is to first carry out a Stinespring dilation unitary explicitly using suitable ancillas as the environment system, and then to apply a conditional erasure process that resets the ancillas to a standard state while using the output of the process as side information. The idea of implementing a process in this fashion was also employed in Ref. [13].
Our core technical contribution for Construction #3 is to show how to build a thermodynamic protocol for universal conditional erasure, using the idea of position-based decoding [19,[49][50][51][52][53][54][55]. The assembly of the full thermal operation is slightly more involved than Constructions #1 and #2, because we cannot use Proposition 3.1. The construction will be illustrated in Figure 2, using a conditional erasure primitive whose construction is illustrated in Figure 1. 7.2. Universal conditional erasure. Conditional erasure is a task that is of independent interest because it generalizes Landauer's erasure principle to situations where a quantum memory is available. A protocol for thermodynamic conditional erasure of a system using a memory as quantum side information was given in ref. [56] for trivial Hamiltonians. Here, we study the problem of finding a universal protocol for conditional erasure, whose accuracy is guaranteed for any input state on n copies of a system, and where the system and memory Hamiltonians can be arbitrary.

Definition 7.1 (Universal conditional erasure). Consider two systems S, M.
Let σ S be a fixed state, let S SM = {ρ SM } be an arbitrary set of states on S ⊗ M, and let δ 0. A universal conditional δ -erasure process of S using M as side information is a completely positive, trace non-increasing map T SM→SM such that for all ρ SM ∈ S SM , and writing |ρ SM R a purification of ρ SM , we have We provide a thermodynamic protocol for universal conditional erasure.  The proof of Proposition 7.1 is developed in the rest of this section. We start by reformulating the ideas of the convex-split lemma, the position-based decoding, and the catalytic decoupling schemes [19,[49][50][51][52][53][54][55] to form a protocol for universal conditional erasure. The underlying ideas of the following proposition are the same as, e.g., in Ref. [19]. Yet, our technical statement differs in some aspects and that is why we provide a proof for completeness. The setting is depicted in Fig. 1.

· · · ⊗ A e m be a collection of ancilla systems with each A j S, and let A = A 1 ⊗ · · · ⊗ A e m be a copy of the full collection of ancilla systems. We write a purification of γ A j on A j as |γ
where we have defined . 1. Construction of the thermal operation for universal conditional erasure using position-based decoding [19], illustrating the construction in the proof of Proposition 7.1 and Lemma 7.1. We define a map R SM J that acts on a system S to reset, a quantum memory M and a register J , which is promised to be initialized in the uniformly mixed state e −m 1 e m of rank e m for a fixed and known value of m. A state ρ SM of the system and the memory is purified by a reference system R (not pictured). The map R SM J outputs the system S in a state close to the thermal state γ S and the register J in a state close to the pure state |0 J , all while ensuring that ρ M R remains unchanged (up to small errors), for all states ρ SM in a given class of states S SM . The routine is provided a POVM effect P SM whose task is to distinguish ρ SM from γ S ⊗ ρ M in a hypothesis test for all ρ SM ∈ S SM . As long as m is not too large (as determined by how well P SM can perform this distinguishing), the procedure completes successfully. To implement R SM J (shaded region) we involve e m ancillas A = A 1 . . . A e m with A j S, each initialized in the thermal state γ A j = γ S . Then S and A j are coherently swapped (F S A j ) conditioned on the value stored in J . If m is not too large, a POVM {Ω j M A } can infer the value j stored in J , up to a small error; the POVM is constructed from P SM . We then coherently reset the J register to zero by conditioning on this outcome (up to a small error). The full procedure is a thermal operation where the ancillas are the heat bath and J is an information battery such that m work has been extracted in units of pure nats (see main text) SM AJ ] = 0, where H A j = H S . Intuitively, we absorb the initial randomness present in the register J , e.g., given to us by the environment in a mixed state, and return it in a pure state; J can therefore be identified as an information battery. Similarly, A can be identified as a heat bath.

and by the notation A A \ A j A j we refer to all A A systems except
Proof. First observe that we can assume S SM to be a convex set, because any convex combination of states in S SM also satisfies the conditions (87). For the rest of the proof we assume without loss of generality that S SM = S SM .
The operator W is defined in two steps. The first operation simply consists on conditionally swapping S with A j , depending on the value stored in J . Then, we infer again from M A which j we swapped S with, in order to coherently reset the register J back to the zero state (approximately). We define the first unitary operation as W (1) , acting on systems S AJ where F S A j denotes the swap operator between the two designated systems. Observe that W (1) maps ρ ontoτ j according to The second step is more tricky. We need to infer from the systems M A alone which j was stored in J . Fortunately the answer is provided in the form of position-based decoding [19], using a pretty good measurement. Define We would now like to lower bound tr[Ω j M Aτ j M A ]. Following the proof of [19, Theorem 2], we first invoke the Hayashi-Nagaoka inequality [57], which states that for any operators 0 A 1, B 0, we have (94)

Applying this inequality with
Now, let SHIFT J (x) = j | j + x j| J denote the SHIFT operation on the J register, modulo e m ; note that SHIFT J (x) † = SHIFT J (−x). We define and we see that W † W 1 thanks to Proposition B.3. Then, we have Thanks to Proposition C.1, the operator W SM AJ can be completed to a full unitary W SM AJ by using an extra qubit in the J register, and such that 0| J W SM AJ | j J = 0| J W SM AJ | j J for all j = 1, . . . , e m (with the convention that | j J for j e m forces the extra qubit to be in the zero state). So, recalling (95), Identifying J as an information battery, the associated effective work process of R SM J with respect to (τ m J , |0 J ) is Let ρ SM ∈ S SM and let |ρ SM R be a purification of ρ SM . We have that the state vector is a purification of T SM→SM (ρ SM R ), where R J is an additional register. Similarly, the state vector is a purification of γ S ⊗ ρ M R . Then, with Uhlmann's theorem we find making use of (88).

Construction via universal conditional erasure.
This section is devoted to the proof of Theorem 7.1. The strategy is to exploit the fact that time-covariant processes admit a Stinespring dilation with an energy-conserving unitary using an environment system with a separate Hamiltonian. This property enables us to map the problem of implementing such a process directly to a conditional erasure problem with a system and memory that are non-interacting.
The following lemma formalizes the property of time-covariant processes we make use of. Various proofs of this lemma can be found in [58], [59,Appendix B] and [60,Theorem 25]. [58][59][60]). Let X be a quantum system with Hamiltonian H X , and E X →X be a completely positive, trace-preserving map that is covariant with respect to time evolution. That is, for all t we have

Lemma 7.2 (Stinespring dilation of covariant processes
Then, there exists a system E with Hamiltonian H E including an eigenstate |0 E of zero energy, as well as a unitary V E X→E X such that We provide an additional proof in "Appendix A". The main idea behind the construction in the following proof of Theorem 7.1 is depicted in Fig. 2.  Fig. 2. The conditional erasure procedure in Figure 1 can be used to construct an i.i.d. implementation of a given time-covariant process (Theorem 7.1). First we apply an energy-conserving Stinespring dilation of the process on all input copies, using a zero-initialized ancilla as environment system E for each copy. We then invoke the conditional erasure procedure R E n X n J to reset E n to the thermal state γ ⊗n E using X n as a memory, while extracting work using an information battery J . Here, the projector that can distinguish ρ ⊗n E X from 1 E n ⊗ ρ X n is the universal conditional typical projector given by Proposition E.2. The fact that R E n X n J preserves the correlations [E (σ X R )] ⊗n between the memory (output systems X n ) and the reference R n ensures that the process is implemented accurately. The amount of work extracted by R E n X n J is m ∼ n[β F E + T (E )] but ∼ nβ F E work has to be paid to prepare the initially pure E n ancillas, where β F E = − ln tr(e −β H E ). The overall work extracted is ∼ T (E ) per copy Proof. (Theorem 7.1) Thanks to Lemma 7.2, there exists an environment system E with Hamiltonian H E , as well as an energy-conserving unitary V X E and a state |0 E of zero energy such that (107) holds. Writing Observe that for any such ρ X E , we have using the sub-additivity of the von Neumann entropy and the fact that relative entropy is positive for normalized states. Hence, we have x β F E . Let noting that for all ρ ⊗n Let P x,δ E n X n be the universal typical and relative conditional operator furnished by Proposition 6.1, where Γ X = e −β H X and Γ X E = e −β(H X +H E ) = Γ X ⊗ Γ E with Γ E = e −β H E . Since Γ X E commutes with 1 E ⊗ Γ X , Proposition 6.1 guarantees that P x,δ E n X n is a projector which furthermore commutes with Γ ⊗n X E and Γ ⊗n X . We proceed to show that P x,δ E n X n can perform a hypothesis test between ρ ⊗n E X and γ ⊗n E ⊗ ρ ⊗n X . Recalling Definition 6.1 we have with κ = poly(n) e −nη for some η > 0 independent of ρ and n. By construction we Let such that tr P x,δ E n X n ρ ⊗n X ⊗ γ ⊗n E e −m κ by choosing κ = poly(n)e −nη . Now let J be a register of dimension at least 2e m and let R E n X n J be the thermal operation furnished by Proposition 7.1 for S = E n , M = X n , S E n X n , P x,δ E n X n , m, κ, and κ as defined above. Here, we have assumed that x > β F E , and that furthermore δ, η are small enough such that 4δ + η < (x − β F E ); if instead x = β F E then we can set e m = 1 and R E n X n J (·) = tr E n (·) ⊗ γ ⊗n E (which is a thermal operation) in the following. We proceed to show that the effective work process T R E n X n →E n X n of R E n X n J with respect to (τ m J , |0 J ) is close to the partial trace map T (0) E n X n →E n X n (·) = tr E n (·) ⊗ γ ⊗n E in diamond distance. We invoke the post-selection technique (Theorem 2.1) to show this.
Let ζ E n X n be the de Finetti state which via (21) can be written as the convex combination of a finite number of i.i.d. states Hence ζ E n X n lies in the convex hull of S E n X n , and from Proposition 7.1 and Definition 7.1 we see that for a purification |ζ E n X n R of ζ E n X n we have Using D(ρ, σ ) ≤ √ 1 − F(ρ, σ ) along with Theorem 2.1 we find We can start piecing together the full process. Our overall protocol needs to (a) bring in a heat bath E n , i.e., ancillas initialized in their thermal state, (b) prepare the states |0 ⊗n E on the ancillas using an auxiliary information battery (denoted by W below), (c) apply the energy-conserving unitary V ⊗n X E , (d) apply R E n X n J using an information battery J initialized in the state τ m J , and (e) discard the ancillas. As explained in Sect. 3, there exists a thermal operation Φ E n W on the ancillas and an information battery W along with battery states (τ (1) W , τ (2) (2) W and with w(τ (1) The map Φ X n W is a thermal operation because it is a concatenation of thermal operations. The overall heat bath is formed of the systems E n , the ancillas A n used in the implementation of R E n X n J , as well as the implicit heat bath used in the implementation of Φ E n W . The system W = J ⊗ W is the information battery. We can verify that the associated effective work process with respect to τ (i) where Δ X n (·) = tr E n T R X n E n (·) − T (0) X n E n (·) satisfies (1/2) Δ X n poly(n)e −nη/2 . Therefore for any fixed and for n large enough we have (1/2) T X n − E ⊗n X →X . The associated work cost per copy satisfies recalling (115), where 0 υ 2 accounts for the rounding error in (115) and a possible arbitrarily small difference between −nβ F E and w(τ (1) W ) − w(τ (2) W ), and recalling that η → 0 as δ → 0.

Discussion
Our results fits in the line of research extending results in thermodynamics from state-tostate transformations to quantum processes. Implementations of quantum processes are difficult to construct because they need to reproduce the correct correlations between the output and the reference system, and not only produce the correct output state. Here, we have seen that it is nevertheless possible to implement any quantum process at an optimal work cost: Any implementation that would use less work would violate the second law of thermodynamics on a macroscopic scale. As a special case this also provides an operational interpretation of the minimal entropy gain of a channel [35][36][37][38][39][40][41][42].
Our three constructions of optimal implementations of processes are valid in different settings, and it remains unclear if they can be unified in a single protocol that presents the advantages of all three constructions. Namely, is it possible to use a physically welljustified framework, e.g. thermal operations, to universally implement any i.i.d. process? We expect this to be possible only if an arbitrary amount of coherence is allowed, in analogy with the entanglement embezzling state required in the reverse Shannon theorem [22,23].
Finally, the notion of quantum typicality that we have introduced in Definition 6.1 and Proposition 6.1 might be interesting in its own right. We anticipate that similar considerations might provide pathways to smooth other information-theoretic quantities [54,61,62] and to study the joint typicality conjecture [26,[63][64][65][66].
Funding Open Access funding enabled and organized by Projekt DEAL.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

A Missing proofs
Proof (Lemma 2.2). A useful expression for Π λ A n B n may be obtained following [25, recalling that Π λ A n B n commutes with any i.i.d. state, with s λ (X ) = tr[q λ (X )] and using bounds on dim(Q λ ) and s λ (diag(λ/n)) derived in Ref. [25]. Here, dU AB denotes the Haar measure over all unitaries acting on H AB , normalized such that dU AB = 1. We then have Observe that for any state ω B , we have as derived e.g. in [25,Eq. (9)], and thus for any state ω B , Hence, we get as required.
where ΔH A is the difference between the maximum and minimum eigenvalue of H A , and ΔH A 2 H A ∞ . Thus, the event consisting of the outcomes k satisfying |k − tr[ρ A H A ]| δ happens with probability at least 1 − 2e −nη , proving (16).
Proof. (Proposition 2.3) We use the post-selection technique (Theorem 2.1) to bound the diamond norm distance between T X n →X n and E ⊗n X →X . Let |ζ X nRn R be the purification of the de Finetti state given by (21). Calculate which implies, recalling that F(|ψ , |φ ) = | ψ|φ | Re{ ψ|φ } and that (1 − x) 2 1 − 2x, and hence P V ⊗n X →E X |ζ X nRn R , W X n →E n X n |ζ X nRn R poly(n) exp(−nη/2) .
Recalling the relations between the trace distance and the purified distance, and noting that these distance measures cannot increase under the partial trace, we obtain The post-selection technique then asserts that as claimed.
Proof (Lemma 7.2). Let V X →X E be any Stinespring dilation isometry of E X →X , such that E X →X (·) = tr E V X →X E (·) V † . For the input state |Φ X :R X , consider the output state |ϕ X E R X corresponding to first time-evolving by some time t, and then applying V Now, let us define |ϕ X E R X = e −i H X t V |Φ X :R X . By the covariance property of E X →X both |ϕ and |ϕ have the same reduced state on X R X . Hence, they are related by some unitary W (t) E on the system E which in general depends on t We have so W (t) E must define a representation of time evolution, at least on the support of the operator tr X V Φ X :R X V † . Hence, we may write W Expanding for infinitesimal t we obtain Proof. Call our system S and consider an additional register C of dimension |C| = M, and let |χ C = M −1/2 M k=1 |k C . Then, we have using |χ χ | C 1 C .
This is a cruder statement than that of, e.g., [69,Lemma 7], allowing for a more straightforward proof.
Proof. We havē Then, we get P(ρ, Then, we have W † W 1.
Proof. Using an additional register K , define Then, we have V † V = Q j 1. Clearly, V V † 1 X K because V V † and V † V have the same non-zero eigenvalues. Now, let Because the middle term in parentheses is unitary, we manifestly have W † W 1.

C. Dilation of Energy-Conserving Operators to Unitaries
This appendix collects a few technical lemmas on constructing an energy-conserving unitary that extends a given operator of norm less than one.
Proposition C.1. Let W X be an operator on a system X , such that W † W 1. Then, there exists a unitary operator U X Q acting on X and a qubit Q such that for any |ψ X , That is, any operator W with W ∞ 1 can be dilated to a unitary, with a post-selection on the output.
and hence V X →X Q is an isometry. We can complete this isometry to a unitary U X Q that acts as V on the support of 1 X ⊗|0 0| Q and that maps the the support of 1 X ⊗|1 1| Q onto the complementary space to the image of V . It then follows that for any |ψ X , we have U X Q (|ψ X ⊗|0 Q ) = V X →X Q |ψ X = (W X |ψ X )⊗|0 Q +(. . .)⊗|1 Q , and the claim follows.
The operator V X →X Q is an isometry, because and thus we find [V X →X Q , H X ] = 0. Let | j X be an eigenbasis of H X , and let |ψ j X Q = V X →X Q | j X , noting that both | j X and |ψ j X Q have the same energy. The two collections of vectors | j X ⊗ |0 Q and |ψ j X Q can thus be completed into two bases |χ i X Q and |χ i X Q of eigenvectors of H X + H Q where the i-th element of both bases have the same energy. Define finally U X Q = i |χ i χ i | X Q , noting that by construction U X Q |0 Q = V X →X Q and [U X Q , H X ] = 0.

E. Universal Conditional Typical Projector for Trivial Hamiltonians
In the case of trivial Hamiltonians, Definition 6.1 can be simplified. We call the corresponding object a universal conditional typical projector Definition E.1. Consider two systems with Hilbert spaces H A , H B and let s ∈ R.
We define a universal conditional typical projector P s,δ A n B n with parameter δ > 0 as a projector acting on (H A ⊗ H B ) ⊗n such that: (i) There exists η > 0 independent of n such that for any quantum state ρ AB with H (A | B) ρ s, we have tr P s,δ A n B n ρ ⊗n AB 1 − poly(n) exp(−nη) ; (ii) tr A n P s,δ A n B n poly(n) e n(s+2δ) 1 B n .
Observe that we choose to define the object in Definition E.1 as a projector whereas we only require the object in Definition 6.1 to be an operator of norm at most 1. The reason is that while we can prove that a projector satisfying the conditions of Definition E.1 exists, we are currently not able to guarantee the existence of a projector satisfying the criteria of Definition 6.1.
Proposition E.2. Consider two systems A, B and let s ∈ R. For any δ > 0 and n ∈ N there exists a universal conditional typical projector P s,δ A n B n that is permutation-invariant. The proof of Proposition E.2 is developed in the rest of this appendix. To understand why the projector of Definition E.1 is conditional-as well as for a simple illustration of its use-consider the smooth Rényi-zero conditional max-entropy, also known as the smooth alternative max-entropy [11]. It is defined for a bipartite state ρ AB aŝ where Πρ AB AB is the projector onto the support ofρ AB , and where the optimization ranges over sub-normalized statesρ AB which are -close to ρ AB in purified distance. We may understand the i.i.d. behaviour of this quantity as follows. For δ > 0 and n ∈ N let P s,δ A n B n be a universal conditional typical projector with s = H (A | B) ρ . We definê ρ A n B n = P s,δ ρ ⊗n AB P s,δ . Then, we haveρ A n B n ≈ ρ ⊗n AB for n ∈ N large enough, thanks to Property (i) and the gentle measurement lemma (Lemma B.2). On the other hand, using Property (ii) we have such that taking the limits n → ∞ and δ → 0, we get that the smooth Rényi-zero conditional entropy is asymptotically upper bounded by the von Neumann conditional entropy in the i.i.d. regime. We proceed to construct a universal conditional typical projector based on ideas from Schur-Weyl duality. The construction presented here is similar to, and inspired by, techniques put forward in earlier work [22,[24][25][26]47,48].

P s,δ
A n B n = λ,λ : where the respective projectors Π λ B n , Π λ A n B n refer to Schur-Weyl decompositions of H ⊗n B and of (H A ⊗H B ) ⊗n , respectively, λ ∈ Young(d A d B , n) and λ ∈ Young(d B , n). Observe that P s,δ A n B n is a projector: Each term in the sum is a projector as a product of two commuting projectors (Lemma 2.1), and each term of the sum acts on a different subspace of (H A ⊗ H B ) ⊗n . The projector P s,δ A n B n corresponds to the measurement of the two commuting POVMs Π λ A n B n and Π λ B n , and testing whether or not the event H (λ)−H (λ ) s +2δ is satisfied. Also by construction P s,δ A n B n is permutation-invariant.
We can use the same η in both cases by picking the lesser of the two values given by recalling that there are only poly(n) many possible Young diagrams and hence at most so many terms in the sum. The case where s = ln(d S ) is uninteresting as we cannot hope to extract any work. In such cases one can simply set m = 0 and take R S n M n J to be the thermal operation that completely thermalizes S n .
Proof. This is in fact a relatively straightforward application of Proposition 7.1 over n copies of SM. Let P s,δ S n M n be given by Proposition E.2. We seek κ, κ that satisfy (87). We can choose κ = poly(n) exp {−nη(δ)} thanks to Definition E. 1 and thus we may take κ = poly(n) e −nδ . Finally, η is given as η = min{δ, η(δ)}.