The thermodynamic cost of quantum operations

The amount of heat generated by computers is rapidly becoming one of the main problems for developing new generations of information technology. The thermodynamics of computation sets the ultimate physical bounds on heat generation. A lower bound is set by the Landauer limit, at which computation becomes thermodynamically reversible. For classical computation there is no physical principle which prevents this limit being reached, and approaches to it are already being experimentally tested. In this paper we show that for quantum computation with a set of signal states satisfying given conditions, there is an unavoidable excess heat generation that renders it inherently thermodynamically irreversible. The Landauer limit cannot, in general, be reached by quantum computers. We show the existence of a lower bound to the heat generated by quantum computing that exceeds that given by the Landauer limit, give the special conditions where this excess cost may be avoided, and provide a protocol for achieving the limiting heat cost when these conditions are met. We also show how classical computing falls within the special conditions.


I. INTRODUCTION
Information processing does not come for free.Physical systems are needed to store, transmit and process information, and these come with physical resource costs, in time, space and energy.The heat generated by information processing is becoming one of the most significant of these costs.Modern integrated circuits have power densities of the order 100W/cm 2 with operating temperatures near to their upper limit [1].Thermal management is already the main constraint on the performance of modern electronics and advances in technology will increasingly need to test the fundamental limits of energy consumption.
For classical information processing, Landauer's Principle [2][3][4][5] relates the change in information from a computation to a minimum thermodynamic cost in the form of heat generated in the environment.The information content of a source of signals is measured by the Shannon measure H = − n p n log 2 p n , where p n is the probability of signal n occurring.Landauer's Principle states that the mean heat generated by an information processing device is given by where ∆H is the change in the Shannon information.The limit cost, which corresponds to the condition of thermodynamic reversibility [6,7], is defined purely in terms of the information processing operation itself: every physical system which performs the task must pay at least this cost [6,8,9].Most importantly, it is a tight bound: while there are practical barriers to reaching the limit (finite size and time effects, single shot costs, etc. [10,11]) there is no physical principle that prevents their effects becoming arbitrarily small, with experimental tests increasingly pushing at this boundary [12][13][14].This tight relationship between information theory and thermodynamics makes Landauer's Principle the basis of our understanding of the thermodynamic cost of information processing.
However, both the theoretical studies and experimental tests of the Landauer Limit have almost exclusively considered classical information processing.Quantum computing radically alters the nature of information, leading to many attempts to extend Landauer's Principle to quantum theory [15][16][17][18][19][20][21][22].
Quantum information processing involves a quantum system S with states ρ n S as signal states, undergoing a quantum operation Q, defined by its effect upon the signal states ρ n S → ρ n S = Q(ρ n S ).Given that the input ρ n S appears with probability p n , the average input is ρ S = n p n ρ n S , and the average output is ρ S = n p n ρ n S .The natural quantum generalisation of Shannon information to quantum theory is the Schumacher information measure S(ρ S ) = −Tr[ρ S log 2 ρ S ] [23], which agrees with the Shannon information when the signal states are orthogonal.This suggests that Equation (1) should be replaced by ( While it is well known that Equation (2) must hold, and that reaching the equality is required for thermodynamic reversibility [24,25], we show that it fails as a tight bound for quantum information processing.There is an unavoidable excess heat generation in quantum computation that is not present in the classical case.

Summary of the theorem
For any given quantum operation Q there is non negative quantity Q , defined independently of how the quantum operation is physically implemented, such that the heat generated by the operation is bounded by: In general for quantum operations Q > 0. Barring exceptional symmetric cases, Q = 0 if, and only if, all the output signal states Q(ρ n S ) share a common diagonalised basis, and there exists a common left stochastic map from diagonal elements of the input states (in the diagonal basis of ρ S ) to eigenvalues of the output states.If these conditions do not hold, there is an excess, thermodynamically irreversible cost to any physical process that performs the quantum operation.This paper will define quantum operations, characterise the thermodynamics of implementing quantum operations, state the theorem, and then give examples of operations which meet, and operations which do not meet, the conditions for Q = 0.

II. QUANTUM OPERATIONS
While classical information processing is built up from logical operations such as AND, OR and NOT gates, the fundamental element in quantum information processing is the quantum operation [26].This acts upon one of a number of possible input states, each represented by a different quantum density matrix, {ρ n S }, and maps each one to a specific output state ρ n S → ρ n S .Not all maps of the form ρ n S → ρ n S are physically possible.A quantum operation, Q, must be a completely positive, trace preserving linear map: When it is not a pure unitary rotation, a quantum operation requires the use of an auxiliary system A, initially in a standard state, ρ A .A joint unitary V acting on ρ n S ⊗ ρ A → ρ n SA = V ρ n S ⊗ ρ A V † results in an entangled state of system and auxiliary (see Figure 1).The reduced state of the system, is the output state (see [26] Chapter 8, for a textbook presentation).

III. THERMODYNAMICS OF QUANTUM OPERATIONS
It is essential, when quantifying the thermodynamic costs of operations, to keep track of the effects upon auxiliary systems.If an auxiliary is disregarded, then the quantum operation would appear to be performed without generating heat.However, this leaves the auxiliary in a state Simply discarding the auxiliary would, on average, change the entropy of the environment by ln 2 [S(ρ A ) − S(ρ A )] where A .The most straightforward way to deal with this is to reset the auxiliary to its original state ρ A .To do this a thermal environment is introduced in the form of a heat bath in a canonical state ρ B at temperature T .The FIG. 1: (i) The basic operation we consider involves a unitary V to convert an input system state ρ n S into an output state ρ n S .An auxiliary input ρA typically becomes entangled with the system and is discarded at the end of the operation.In order to understand the energy cost of the operation we should reset the auxiliary to its standard state ρA in preparation for further uses.This is done via interaction with a heat bath which starts in the canonical state ρB.
(ii) An energetically suboptimal way to do this ignores any correlations between S and A and directly resets the auxiliary using the unitary W which acts on the joint auxiliary-heat bath state.The output auxiliary state ρn ] should be such that ρA = n pn ρn A where pn is the probability of input n; the auxiliary is reset on average.(iii) The optimal method typically cannot be decomposed in this way and requires a unitary U defined to act on system, auxiliary, and heat bath.U should result in the same output state ρ n S and reset the auxiliary: the output auxiliary state ρ n A should be such that ρA = n pnρ n A .For given average input ρS and output ρ S , the average energy change which occurs in the heat bath will be lower bounded.
reset can be performed by some unitary W acting on both the auxiliary and the heat bath such that ρ A = Tr B [W ρ A ⊗ ρ B W † ] (see Figure 1).This operation would transfer at least kT ln 2 [S(ρ A ) − S(ρ A )] of heat to the heat bath [24].Either way, the cost to the environment will generally be more than required by Equation (2).A quantum operation typically leaves correlations between system and auxiliary, with a mutual information [18] of S(ρ S : Simply resetting (or discarding) the auxiliary will pay kT ln 2S(ρ S : ρ A ) as an excess cost unless there is no correlation: To find the minimum thermodynamic cost of the quantum operation, the auxiliary must be reset more efficiently, exploiting correlations with the system.The unitary V must be embedded in a larger unitary U which includes interactions between system, auxiliary, and heat bath.U must preserve the output of the computation while resetting the auxiliary (see Figure 1).Standard calculations show that this implies Equation (2) (see Appendix B).If the quantum operation is only defined for a single signal state, then physical implementations are possible which can get arbitrarily close to the equality in (2) (Appendix C).
In general, a quantum operation must produce the result ρ n S = Q(ρ n S ), for multiple signal states {ρ n S }.The same U must satisfy (3) for all n.Our principal result is to show this additional constraint forces a higher thermodynamic cost than Equation ( 2).An operation which generates a quantity of heat, Q , in excess of this bound will be thermodynamically irreversible, as any second operation which restores the original average state ρ S = Q (ρ S ) must necessarily leave a net heat gain in the heat bath of at least Q over the complete cycle.Quantum computations cannot, in general, be performed in a thermodynamically reversible manner.
be a quantum operation Q where ρ B is the state of a canonical heat bath at temperature T , and ρ A is a standard state of an auxiliary which should be restored by the operation [see Equation (4)].
The average system input state ρ S can be expressed in terms of its diagonal basis vectors {|φ i } as Similarly the average system output state can be expressed in terms of its diagonal basis vectors {|φ k } as In terms of these basis vectors the individual inputs and outputs are represented by We now state the theorem: If there exists a stochastic map, P Q (k|i) for all n, then the minimum thermodynamic cost of the operation can approach Q = 0. Otherwise, provided there are no symmetries of the form λ i /λ j = λ k /λ l where i = j or k = l, then necessarily Q > 0.
Note that the set of properties {{λ i }, {λ k }, {µ n ij }, {µ n kl }}, used to state the theorem are defined solely in terms of the quantum operation, independently of the particular physical process used to implement it.

Outline of proof
In Appendix A we show that the implementation of the operation can be re-written in the form where the complex coefficients q(kl|ij) carry the effects of interaction with the environment.They have the properties q(kk|ii) = q * (kk|ii) ≥ 0, and k q(kk|ij) = δ ij .
In Appendix B we show that for a given physical implementation of the quantum operation where Finally in Appendix D we show that It follows that if there is a value of |q(kl|ij)| > 0 for which λ i /λ j = λ k /λ l , then the implementation has an excess thermodynamic cost.The coefficients q(kk|ii) imply no bound as λ i /λ j = λ k /λ l automatically holds for them.If Equation (5) holds, then q(kk|ii) = P Q (k|i) gives an implementation with no excess cost (see Appendix F for an explicit construction).Otherwise, there must be some |q(kl|ij)| > 0 for i = j or k = l.If λ i /λ j = λ k /λ l for any of these ijkl values, then there is an excess cost for that implementation.We can therefore use numerical optimisation techniques to find the coefficients satisfying (6) which minimise the largest value of (8), and Equation (7) shows this gives a lower bound for Q .
When the output states do not have a shared diagonalised basis, so that there is some µ n kl > 0 for k = l, there is also an analytical bound: For further details see Appendix E. This energy bound and others derived here may not be tight.It is an open problem to demonstrate a protocol which reaches Q -our results only place a non-zero lower bound on the excess energy cost.

V. EXAMPLES OF THERMODYNAMICALLY REVERSIBLE OPERATIONS
There are well known cases of quantum operations where Q = 0. We now show how they fit into our proof.
Pure unitary.In a pure unitary quantum operation, ρ n S = U ρ n S U † .This does not involve an auxiliary or heat bath, and does not change the eigenvalues of any input signal states.Solutions with q(kl|ij) = δ ik δ jl satisfy the operation, and the exceptional symmetry condition applies: the only terms which contribute to Equation ( 6) are ones for which λ i /λ j = λ k /λ l .
Single input.When there is only one possible input Single output.Resetting to a standard state is known to satisfy Q = 0 [16,17].In this case the output states for all inputs are of the form Equation (5) holds.Classical information processing.For classical information processing, where the signal states correspond to orthogonal quantum states, Q = 0 [6,7,27].
In general the outputs take the form ρ n S = k P Q (k|n)|φ k φ k |, representing a distribution of possible outputs |φ k , so µ n kl = δ kl P Q (k|n), and Equation ( 5) holds.

VI. CASE STUDY OF A THERMODYNAMICALLY IRREVERSIBLE OPERATION
In general it will not be the case that Q = 0.Even the simplest quantum operations will fail to satisfy Equation (5).As an example, we consider single qubit dephasing operations, which exhibit all the features of the Theorem.Inputs of the form . From left to right the value of p varies from 0 to 1.For given p the shaded region contains the vectors |v 2 S for which Q = 0 and the operation can be thermodynamically reversible.When p = 0.5 this region contains only the points on the same circle of latitude as |v 1  S and the point opposite |v 1 S .When p = 0 the shaded region does not correspond to the entire Bloch sphere since we still demand that the implementation should give that correct output for both possible inputs (similarly for p = 1).The images are symmetric when viewed from the opposite hemisphere.Also, if we include a phase shift to the vector |v 1 S the regions rotate around the Bloch sphere with |v 1 S , maintaining their form.
, with Q 1 the identity, and Q 0 completely dephasing the qubit.
The operation Q r can be implemented straightforwardly by a quantum CNOT gate and an auxiliary, making our Theorem open to experimental investigation [28].With the auxiliary initially prepared in the state α|0 A + β|1 A acting as the target, we have r = (α * β + αβ * ).
Non-diagonalisable outputs.When 0 < r < 1, the outputs, ρ n S (r), will not typically be simultaneously diagonalisable.Consider r = 1 √ 2 with two possible inputs: |0 S occurring with probability 0.3, and S occurring with probability 0.7.After tracing away the auxiliary we find that the individual outputs are not simultaneously diagonalisable.There is enough information to calculate the lower bound on Q from Equation (9) and this is found to be 0.0007×kT .This can be compared with the bound kT ln 2 [S(ρ S ) − S(ρ S )] = −0.15×kT .An overall negative value of ∆E Q indicates that this operation may still be used to extract energy from the heat bath.
Diagonalisable outputs.For Q 0 , the outputs will be simultaneously diagonalised in the basis {|0 S , |1 S }.We choose two pure state inputs: ρ 1 S with probability p, and ρ 2 S with probability 1 − p.The average input density matrix is therefore ρ S = pρ 1 S + (1 − p)ρ 2 S .Figure 2 shows the minimum energy change in the heat bath with p for four different pairs of inputs.We see that for some combinations of inputs there are no values of p for which the operation can be thermodynamically reversible, and it necessarily requires an excess energy cost.For other inputs there are regions of p where there is no excess cost and regions where there is a minimum non zero excess cost.Figure 3 shows, for a given ρ 1 S , the regions of ρ 2 S on the Bloch sphere where a zero excess cost is possible for various values of p.Further details of how to determine the minimum energy change in the heat bath can be found in Appendix G.
The qubit dephasing example shows, in particular, that Q = 0 is possible both with ∆E Q < 0 and with nontrivial non-orthogonal input states, and that Q > 0 is possible even when the output states share a common diagonalisation.

VII. DISCUSSION
The excess thermodynamic costs of quantum operations stem from the requirement that the operation should get the computation right for every individual in-put, and not just on average.For well known cases, including classical information processing, we have shown how thermodynamic reversibility can be reached as a special case.However, for general quantum operations, with non-orthogonal signal states, an excess thermodynamic cost must be paid.
This might seem counter intuitive, since quantum computations can always be represented as unitary operations, which can always be run in reverse.How can thermodynamic irreversibility arise with a reversible unitary operation?Simply running the overall unitary operation in reverse does not just tidy up the auxiliary, returning it to its initial state, but it also undoes the computation, converting the output back to the input.If we wish to retain the result of the computation, we cannot simply reverse the unitary operation.In the classical reversible computing model of Bennett [29], we save a copy of the output before reversing the computation.For quantum operations this is forbidden by the no-cloning theorem, and no quantum generalisation of Bennett's procedure is possible [30].
As long as we keep the results of the computation, we are left with the changes in the auxiliaries, representing spent resources and a cost to reset them to their initial states.This is the stage at which thermodynamic costs are incurred.We have shown that in general, for quantum operations this cost is necessarily in excess of the Landauer Limit given in Equation ( 2).Quantum computing requires a thermodynamically irreversible generation of heat.

Given an input ρ n
S and an output Q(ρ n S ) = ρ n S of a quantum operation Q on a quantum system S we can describe the operation as where the subscript on the trace indicates which components have been traced over.The unitary U acts on an initial state ρ n S ⊗ ρ A ⊗ ρ B which includes, besides the system, a thermal environment in the form of a canonical heat bath, ρ B , and an auxiliary to be used as a catalyst ρ A .Given that inputs ρ n S appear with probability p n we can define an average system input state and an average system output state by respectively.The auxiliary is a resource which is spent by the operation.In order to account for this cost we demand that it must be returned to the same standard state ρ A at the end of the computation This ensures that the auxiliary can be reused in subsequent computations.We need only demand that the auxiliary is reset on average.
For convenience we define the following notation We can choose to work in a basis in which ρ S is diagonal.In general ρ S will not be diagonal in this basis but we can perform a final rotation to make it so: Now drop the bars from the notation and assume without loss of generality that the average system inputs and outputs are diagonalised in the same basis.Let us denote these diagonal basis states by {|φ i }.We can write In this basis an individual input and output state can in general be expressed as We define This is a bounded operator acting on the total environment of auxiliary and heat bath.
These operators must satisfy The unitary operation on the complete state results in It will also be useful to define the state ρ = ρ S ⊗ ρ AB which we can express as and we denote The result of the quantum operation on individual inputs (A1) can be written using (A2) and (A3) as We will also use the notation Appendix B: Quantum thermodynamics Lemma B.1.The energy change in the heat bath as a result of a quantum operation Q on a system S implemented by some unitary U ρ S ⊗ ρ A ⊗ ρ B U † = ρ , involving a resetting of the auxiliary system A, is given by The Schumacher information measure is given by S(ρ) = −Tr [ρ log 2 ρ] and we use a definition of the relative entropy using log base 2

Proof. The energy change in the bath is given by ∆E
It follows that Since the last term in square brackets in the last line must be positive by subadditivity and the relative entropy term must be positive as a result of Klein's inequality, we must have The operation satisfies thermodynamic reversibility if the inequality is saturated.This can be seen by forming a second operation ρ S = Q (ρ S ) which restores the original average state.There must be a net heat gain in the heat bath if, for any part of the cycle, the equality in (B3) does not hold.
As a result of the fact that ρ factorises we find that The quantity S(ρ ||ρ ) ≥ 0 therefore encodes the extent to which the thermodynamic bound on the energy change (B3) is breached.
The demand for S(ρ ||ρ ) = 0 requires from (B4) that both S(ρ ) = S(ρ S ) + S(ρ A ) + S(ρ B ) and S(ρ B ||ρ B ) = 0.In particular the second of these conditions suggests an output state with ρ B = ρ B and therefore no energy change in the heat bath.In fact, in the limit where the dimension of the heat bath becomes large, it is possible to have ρ B sufficiently close to ρ B such that S(ρ B ||ρ B ) < s for some arbitrarily small s whilst at the same time ∆E Q > E for some fixed non zero E. To see this we write ρ B = ρ B + ε∆ where ∆ is a fixed traceless matrix and ε is a small parameter.The change in energy of the heat bath is given by Now suppose that we have N identical independent copies of the same heat bath (this will also be a canonical state).If we further suppose that each copy undergoes the same uncorrelated change ρ B = ρ B + ε∆, then to lowest order, the energy change of the N -copy heat bath is This means that we can take ε ∝ 1/N and as N becomes large, ∆E The correction to the relative entropy is at least quadratic in ε.The relative entropy for the N -copy heat bath is Therefore, in the limit that N becomes large and ε ∝ 1/N tends to zero, the relative entropy for the N -copy heat bath tends to zero.This simple example demonstrates that it is legitimate for the relative entropy to tend to zero whilst the energy change in the heat bath remains non zero.
Corollary B.1.The energy change in the heat bath is bounded by Proof.We use [31,32] The result follows from Equation (B1).

Appendix C: Standard thermodynamically reversible protocol
There is a standard protocol for reaching the bound given in Equation (B3), appearing in various forms in the literature ( [18,25] for examples), when the quantum operation is defined only to act upon an individual density matrix ρ S = Q(ρ S ) of a system S (see also [33,34] for alternative protocols to reach the bound).Note that these protocols do not require that either the initial or final states are in thermal equilibrium.
The density matrix is initially in the state where {|φ i } are orthonormal eigenstates.The result of the operation Q is a state for a possibly different set of orthonormal eigenstates {|φ i }.We assume that both the initial and final sets of eigenstates are fully degenerate in energy with energy level zero.This avoids the complication of the system being used as a source or sink of energy.
Step 1. Starting with ρ S , manipulate the energy levels E i of each eigenstate |φ i until λ i = e −βEi j e −βEj .where β = 1/kT .This has a mean cost ∆E 1 = i λ i E i .The new density matrix will now be canonically distributed at temperature T .
Step 2. Bring the system into contact with a heat bath at temperature T .
Step 3. Slowly, isothermally, change the energy eigenstates until they satisfy .
The energy requirement for this is ∆E 2 = kT ln j e −βEj − kT ln j e −βE j .The density matrix is now canonically distributed at temperature T , with eigenvalues {λ i }.
Step 4. Remove the system from contact with the heat bath.
Step 5. Change the energy levels of the eigenstates back to zero, with a mean cost ∆E 3 = − i λ i E i .
Step 6. Perform a unitary rotation to the final eigen- The operation is complete with a cost of It is worth noting that this protocol works even when the system is a joint system with non-trivial correlations or entanglement between subsystems [18].During the stages in which we manipulate the energy levels of the system we are assuming a time-dependent Hamiltonian H(t) for the system and a standard definition of the mean rate of work given by Tr[ρ∂H/∂t].This presupposes some idealised work reservoir, capable of doing work on (or taking work from) the system by manipulation of the Hamiltonian.
We will denote this operation T ρS→ρ S .As shown in [11], the theoretical energy cost can only be acheived in an aymptotic limit.Nevertheless, there is no physical principle which prevents us from getting arbitrarily close this value.
Lemma D.2.The following bound can be placed on the output state ρ : Proof.We start by defining operators acting on the complete state of system, auxiliary, and heat bath in terms of which we define We can then express (D1) as Let us define some arbitrary basis states {|ψ x } for the complete system, auxiliary, and heat bath.We can write Then where the second line follows from the triangle inequality and the third line follows from the Cauchy-Schwartz inequality. Similarly . (D5) Next we show that and The operator products can be written as We also have which follows from (A4) and (A5).Since the identity is expressed as a sum of positive operators and since ijkl is a sum of a subset of these positive operators, it must be the case that the diagonal elements of G L ijkl G L † ijkl in the arbitrary basis {|ψ x } must belong to the range [0, 1] from which (D6) follows.Similarly for (D7).We can therefore write, from (D4) and (D5), , .
If we choose the basis states Finally from (D3), using the triangle inequality which completes the proof.

Lemma D.3 (Special case when dimension d = 2).
When the dimension of the system space d = 2, the following bound can be placed on the output state ρ for i = j: If i = j both sides of this equation are zero.If i = j we can define operators acting on the complete system, auxiliary, and heat bath and then express (D8) as Define arbitrary basis states {|ψ x } for the complete system, auxiliary, and heat bath.We can write . (D10) Next we show that The operator product can be written We also have Since (D12) is the sum of two constituent positive terms of the sum of positive operators (D13) then the same argument as that used in Lemma D.2 can be used to show that (D11) holds.It follows from (D10) that , and if we choose the basis states Inserting into (D9) we have and choosing d = 2 completes the proof.
Note that Lemma D.2 can also be applied to the case of k = l and i = j for general d with the result which is half the size of the bound of Lemma D.3 in the case of d = 2.
Appendix E: Proof of Theorem 1 Theorem 1 is stated in the main text.We repeat it here for convenience Theorem 1.If there exists a stochastic map, P Q (k|i) for all n, then the minimum thermodynamic cost of the operation can approach Q = 0. Otherwise, provided there are no symmetries of the form λ i /λ j = λ k /λ l where i = j or k = l, then necessarily Q > 0.
Proof.In general the output state of the quantum operation is given by (A9) It is helpful to separate Equation (E2) into three terms: The first and second terms only deal with the diagonal elements of the output signal states in the basis of the average output density matrix.The third term deals with the off-diagonal elements.By Lemma D.2, the first sum implies only ||ρ −ρ || 1 ≥ 0, as λ i λ k −λ i λ k = 0 for q(kk|ii).If Equation (E1) holds then P Q (k|i) = q(kk|ii) gives an implementation in which all other terms are zero, and there is no excess cost.The numbers q(kk|ii) are real, non negative and satisfy by Equation (A5).If Equation (E1) does not hold, then some values of q(kl|ij) with i = j or k = l must be non-zero, in any implementation.For a given implementation, the largest value of the lower bound of Equation (D2) across all ijkl determines an excess thermodynamic cost.If there are no symmetries of the form λ i /λ j = λ k /λ l with i = j or k = l, then this lower bound must be greater than zero.The minimum such value across all possible implementations gives a lower bound for Q > 0.
It should be noted that the existence of some values of ijkl for which λ i /λ j = λ k /λ l holds is not sufficient for Q = 0. To avoid an excess cost from our Theorem through the exceptional symmetry condition, it must be possible to implement the operation in such a way that q(kl|ij) = 0 for every ijkl value for which λ i /λ j = λ k /λ l .
When the output signal states do not share a common diagonalisation, we can give a general lower bound for Q .The third sum in Equation (E3) is non-zero whenever there exists k = l for which µ n kl > 0. For these cases, from Equation (E2), using the triangle inequality From Equation (D2) this implies where the maximum is taken across all k and l such that k = l, and across all inputs n.As the right hand side only involves terms independent of the specific implementation, then this bound must hold for all implementations and so by Corollary B.1, If all µ n kl = 0, with k = l, but Equation (E1) does not hold, then µ n kl = δ kl i q(kk|ii)µ n ii + δ kl i,j =i q(kk|ij)µ n ij , (E4) and any implementation must have values of |q(kk|ij)| > 0 with i = j.We can find complex coefficients q(kk|ij), which satisfy Equation (E4), while minimising the largest value of the lower bound of (D2), 1  2 |λ i − λ j | |q(kk|ij)|.This must be done using numerical optimisation techniques on a case-by-case basis.Given the set {{λ i }, {λ k }, {µ n ij }, {µ n kl }}, this establishes a minimum value for ||ρ − ρ || 1 and therefore, by Corollary B.1, a minimum excess cost across all possible implementations, so again Q > 0.
Appendix F: Thermodynamically reversible protocol for special cases We now demonstrate a protocol which can achieve Q = 0 for the special class of quantum operations which satisfy Equation (E1).For these operations there exists a stochastic map P Q (k|i) such that the input and output states of a quantum operation are related by µ n kl = δ kl i P Q (k|i)µ n ii .Let the initial state of the auxiliary be |0 A 0 A |, so the combined system and auxiliary is initially Step 1. Use the auxiliary to measure the input system in the basis of the average input density matrix.Correlate the auxiliary to the system using a unitary with Step 2. The operation T |φi φi |→ρ (i)

S
(see Appendix F) performs a thermodynamically optimal conversion of |φ i φ i | to ρ Step 3. We now exploit the correlations between system and auxiliary to optimally reset the auxiliary.The operation T ρ (k) A →|0A 0A | performs an optimal conversion of ρ (k) A

=
i P Q (k|i)λ i / j P Q (k|j)λ j |i A i A | to |0 A 0 A |, where P Q (k|i)λ i / j P Q (k|j)λ j is the mean conditional probability of the auxiliary state being |i A given that the system state is |φ k .The conditional operation k |φ k φ k | ⊗ T ρ (k) A →|0A 0A | resets the auxiliary to |0 A 0 A | while transferring mean heat ∆E 2 = kT ln 2 ki P Q (k|i)λ i S(ρ (k) A ).The joint state is now and provided the conditions of the theorem hold, the system is in the correct output state, up to a unitary.The average heat production is readily confirmed to be ∆E Q = ∆E 1 + ∆E 2 = kT ln 2[S(ρ S ) − S(ρ S )] thus proving that Q = 0.It is important to note that, if the conditions of the theorem do not apply, this protocol not only fails to be optimal, but fails to correctly implement the operation at all, i.e. ρ n S is not mapped to the correct ρ n S .
(N ) Q remains fixed.Now consider the relative entropy between ρ B and ρ B

S
= k P Q (k|i) |φ k φ k |.The conditional operation i T |φi φi |→ρ (i) S ⊗ |i A i A | puts the joint system in the state ki P Q (k|i)µ n ii |φ k φ k | ⊗ |i A i A | ,transferring mean heat to the heat bath ∆E 1 = −kT ln 2 ni p n µ n ii S(ρ(i) S).The average state takes the formki P Q (k|i)λ i |φ k φ k | ⊗ |i A i A | .
with FIG.3: The figure shows the Bloch sphere from one side.For a given pure state input ρ 1 S = |v 1 S v 1 S |, occurring with probability p, each figure shows the regions of a second pure state input ρ 2 S = |v 2 S v 2 S |, occurring with probability p − 1, such that the condition of thermodynamic reversibility can be satisfied for a qubit dephasing operation Q0.In the top row, the fixed input vector is |v 1 S = cos π 8 |0 + sin π 8 |1 (marked by a black dot); in the bottom row the fixed input vector is |v 1 S That it is bounded can be demonstrated as follows: U is a bounded operator since |U |ψ | = ||ψ | for a state of system, auxiliary, and heat bath |ψ .This means that the product of the bounded operators |φ i φ i |U |φ j φ j | is also bounded.In fact ||φ i φ i |U |φ j φ j |ψ | ≤ ||ψ |.If we choose |ψ = |χ |φ j where |χ is an arbitrary total environment state we then find that |A ij |χ | ≤ ||χ | so that A ij is a bounded operator.We can express the unitary operator U as