1 Introduction

Since its first appearance in 1867, the thought experiment of James Clerk Maxwell has given rise to many ideas and probably more than a 1000 papers [1,2,3]Footnote 1. In the thought experiment a demon controls a small door between two gas chambers. When single gas molecules approach the door, the demon opens and closes the door quickly, so that only fast molecules enter one of the chambers, while slow molecules enter the other one. In this way the demon’s behavior causes one chamber to heat up and the other to cool down, reducing entropy and violating the 2nd law of thermodynamics.

Among the most influential defenses of the 2nd law are those of Szilard [4] and Landauer and Bennett [5, 6]. Szilard proposes his own version (“Szilard’s engine”) of the original thought experiment that consists only of one gas particle which can be found in the right or the left chamber of a cylindrical box divided by a piston. Depending on its position an isothermal expansion of the one-molecule gas is performed to the left or to the right thereby converting heat from a heat bath completely into work, see Fig. 1. Szilard argues that the entropy decrease of the system is compensated by the entropy costs of acquiring information about the position of the gas particle (“Szilard’s principle”). His arguments are formulated within classical physics and not easy to understand, see also the analysis and reconstruction of Szilard’s reasoning in [3, 7].

Based on Landauer’s calculations [5] on the thermodynamics of computing Bennett has shifted the focus from the entropy costs of acquiring to erasing information [6]. He argues that for a cyclic operation of a Szilard engine converting heat completely into work the memory device that contains the information about the initial measurement should be set to a default value each time. This erasure of information produces at least the entropy needed to compensate the entropy decrease caused by the engine. This explanation (“Landauer’s principle”) has today been adopted by the main stream of physicists, but has also been criticized by a minority of scholars, see [2, 3, 8] and further references cited there. For the present paper it will be sensible to distinguish between the principle that erasure of memory produces entropy (“Landauer’s principle” in the narrow sense) and the position that this effect constitutes the solution of the apparent paradox of Maxwell’s demon (henceforward called “Landauer/Bennett principle”).

Fig. 1
figure 1

Schematic representation of Szilard’s engine. A volume is separated by a piston into two chambers \({{\mathcal {V}}}_R\) and \({{\mathcal {V}}}_L\) of equal volume. A molecule is localized by a measurement in one of these chambers and, depending on the result of the measurement, an isothermal expansion of the one-molecule gas in contact with a heat bath will be performed to the right or to the left. In the figure we show the case where the molecule has been found in the left chamber and the expansion is performed to the right

Whereas the arguments of Szilard and Landauer/Bennett are mainly classical, it appears plausible that a proper account of entropy increase due to measurements should be discussed within the realm of quantum theory. A first attempt of a quantum-theoretical account of Szilard’s engine has been given by Zurek [9], followed by [10,11,12,13]. More recently, the paradigm of Maxwell’s demon has been used in connection with quantum information theory, especially quantum error correction, see [14] and [15].

Zurek in his [9] considered a one-particle quantum system in a box described by a Gibbs ensemble and calculated the increase of free energy due to the measurement of whether the particle is in the right or in the left chamber. In the section of his paper headlined “Measurement by ‘quantum Maxwell’s demon’ ” Zurek presented a model of the measurement using ideas of decoherence and finally also incorporated the Landauer/Bennett issue of memory erasure. However, the complete entropy balance remains opaque. In terms of content, it would be plausible to regard the paper as a quantum mechanical justification of the Szilard principle. But then the statement in the summary

“Moreover, we show that the ultimate reason for the entropy increase can be traced back to the necessity to ‘reset’ the state of the measuring apparatus, which, in turn, must involve a measurement.”

would appear as an unfounded tribute to the Landauer/Bennett principle. Therefore the general message is not quite clear. Further, there are three questions left open:

  • Are the information-theoretic concepts used in [9] only an illustration of the theoretical account or are they crucial to solve the Maxwell’s demon problem? This question is the more important since there exist suggestions of extending the framework of statistical mechanics by information-theoretic notions, see, e. g., [16, 17].

  • Similarly, are the ideas from theories of decoherence, see also [10] and [11], really necessary to solve the Maxwell’s demon problem?

  • Since the paper follows very closely the details of Szilard’s engine, one wonders which assumptions and approximations are decisive for the solution presented and which are only made for convenience. In other words, a more abstract representation of the “quantum Maxwell’s demon” would be desirable.

In the present paper we will pursue a similar approach but try to amend and extend Zurek’s results in the way indicated above. Our explanation of the apparent paradoxical results of Maxwell’s demon acting on a quantum system (also called “object system”) will be given in three steps:

  • First we define the concept of “conditional action” that comprises the original version of Maxwell’s demon as well as Szilard’s engine and Landauer’s erasure of memory. The mathematical representation of “conditional action” on quantum systems results in a special kind of instruments, in the sense of [20], that we will call “Maxwell instruments”.

  • We show that the total operation of a Maxwell instrument may decrease the von Neumann entropy of the object system depending on the initial state. If this happens we will call the Maxwell instrument “demonic”.

  • A demonic Maxwell instrument always has a physical realization of the following kind: The object system is extended by an auxiliary system and the total system undergoes a unitary time evolution followed by a Lüders measurement at the auxiliary system. If reduced to the object system the final state will have a smaller entropy than at the beginning although the total entropy will increase in accordance with what a 2nd law of quantum mechanics presumably would predict.

It has been criticized [2, 3] that the Landauer/Bennett defense of the 2nd law against Maxwell’s demon in turn presupposes the 2nd law. We avoid these pitfalls of circularity since we do not assume any general 2nd law in quantum mechanics but only a few well-established theorems about the increase of von Neumann entropy during Lüders measurements and state separation. Actually we would not know how to formulate such a general 2nd quantum law. In this respect the role of Maxwell’s thought experiment is different in classical and in quantum theory: In classical theory it is a potential paradox since it seems to contradict the well-established 2nd law. In quantum theory it is rather a tool to find such a general 2nd law. Fortunately, Maxwell-demonic interventions can be formalized within the realm of quantum measurement theory where already fragments of a 2nd law exist that are sufficient to explain the demon’s actions.

The paper is organized as follows: In Sect. 2 we recapitulate some well-known definitions and results from quantum measurement theory for the convenience of the reader. These concepts are applied in Sect. 3 to explain why the conditional action of Maxwell’ demon possibly lowers the entropy of the object system but leads to an at least equal amount of entropy increase in some auxiliary system. The following Sect. 4 contains two simple examples illustrating the former considerations. A classical version of “conditional action” will be sketched in Sect. 5, followed by a Summary in Sect. 6. We have deferred some proofs (A, B) and the explicit construction of a measurement dilation of a Maxwell instrument (C) into the Appendix, as well as the detailed account of Szilard’s engine (D) according to our approach.

2 Operations and Instruments

In the following sections we will heavily rely upon the mathematical notions of operations and instruments. Although these notions are well-known it will be in order to recall the pertinent definitions adapted to the present purposes and their interpretations in the context of measurement theory. In order to keep the presentation as simple as possible we restrict ourselves to the case of finite dimensional Hilbert spaces \({{\mathcal {H}}}\) and refer the reader to the literature on the general case of separable Hilbert spaces.

Let \(B({{\mathcal {H}}})\) denote the space of Hermitean operators \(A:{{\mathcal {H}}}\longrightarrow {{\mathcal {H}}}\) and \(B_+({{\mathcal {H}}})\) the cone of positively semi-definite operators, i. e., having only non-negatives eigenvalues. Moreover, let \(T:B({{\mathcal {H}}})\longrightarrow B({{\mathcal {H}}})\) be a linear map satisfying

  • T is positive, i. e., maps \(B_+({{\mathcal {H}}})\) into itself,

  • T is completely positive. This means that \(T\otimes {\mathbb {1}}:B({{\mathcal {H}}}\otimes \mathbb {C}^N)\longrightarrow B({{\mathcal {H}}}\otimes \mathbb {C}^N)\) will be positive for all positive integers N.

Then T will be called an operation. It may be trace-preserving or not.

Operations are intended to describe state changes due to measurements. By definition, a Lüders measurement (without selection according to the outcomes) induces the state change

$$\begin{aligned} \rho \mapsto L(\rho )=\sum _{n\in {{\mathcal {N}}}} P_n\,\rho \,P_n \;, \end{aligned}$$
(1)

where \(\left( P_n\right) _{n\in {{\mathcal {N}}}}\) denotes a complete family of mutually orthogonal projections \(P_n\in B_+({{\mathcal {H}}})\). The Lüders operation L is an example of a trace-preserving operation. Note that the map (1) is defined for all \(\rho \in B({{\mathcal {H}}})\) whereas the physical interpretation holds only for statistical operators \(\rho \), i. e., for positively semi-definite operators with \(\text {Tr}(\rho )=1\).

We mention the following representation theorem for operations, see, e. g., [20, Proposition 7.7], or [15, Chapter 8.2.3]. A is an operation iff it can be written as

$$\begin{aligned} A(\rho )= \sum _{i\in {{\mathcal {I}}}}A_i\,\rho \,A_i^*\;, \end{aligned}$$
(2)

with the Kraus operators \(A_i:{{\mathcal {H}}}\rightarrow {{\mathcal {H}}}\) and a finite index set \({{\mathcal {I}}}\). Comparison of (1) and (2) shows that for the Lüders operation one may choose \({{\mathcal {I}}}={{\mathcal {N}}}\) and \(A_n=P_n\) for all \(n\in {{\mathcal {N}}}\).

In (1) we have considered the total state change without any selection. If we select according to the outcome of the Lüders measurement we would obtain a family of (not trace preserving) operations

$$\begin{aligned} L_n(\rho )= P_n\,\rho \,P_n,\quad n\in {{\mathcal {N}}} \;, \end{aligned}$$
(3)

that describe conditional state changes. This situation can be generalized in the following way.

Let \({{\mathcal {N}}}\) be a finite index set. Then the map \({{\mathfrak {I}}}:{{\mathcal {N}}}\times B({{\mathcal {H}}})\longrightarrow B({{\mathcal {H}}})\) will be called an instrument iff

  • \({{\mathfrak {I}}}(n)\) is an operation for all \(n\in {{\mathcal {N}}}\), and

  • \(\text {Tr}\left( \sum _{n\in {{\mathcal {N}}}}{{\mathfrak {I}}}(n)(\rho )\right) =\text {Tr}\rho \) for all \(\rho \in B({{\mathcal {H}}})\).

The second condition can be rephrased by saying that the total operation \({{\mathfrak {I}}}({{\mathcal {N}}})\) defined by

$$\begin{aligned} {{\mathfrak {I}}}({{\mathcal {N}}})(\rho )\equiv \sum _{n\in {{\mathcal {N}}}}{{\mathfrak {I}}}(n)(\rho ) \end{aligned}$$
(4)

will be trace-preserving. The special case (3) will be referred to as a Lüders instrument.

The comparison with the definition 7.5 of [20] shows that, besides neglecting convergence conditions, we have specialized the general definition of an instrument to the case of a finite outcome space \({{\mathcal {N}}}\). Measurements of continuous observables like position or momentum would require to consider elements of the \(\sigma \)-algebra of Borel subsets of, say, \(\mathbb {R}^N\) for the first argument of the instrument. This generalization is not necessary to be considered in the present paper.

We will need a second representation theorem, this time formulated for instruments. It is called a measurement dilation and can be physically viewed as a realization of a non-Lüders instrument \({{\mathfrak {J}}}\) by a time evolution and a Lüders instrument on a larger system. Thus let \({{\mathcal {K}}}\) be another Hilbert space, \(\phi \in {{\mathcal {K}}}\) a vector with \(\Vert \phi \Vert =1\) and corresponding projection \(P_\phi \) and \(V:{{\mathcal {H}}}\otimes {{\mathcal {K}}}\longrightarrow {{\mathcal {H}}}\otimes {{\mathcal {K}}}\) a unitary operator. Further, let \(\left( Q_n\right) _{n\in {{\mathcal {N}}}}\) be a complete family of mutually orthogonal projections in \({{\mathcal {K}}}\). Then the map \({{\mathfrak {D}}}_{{{\mathcal {K}}},\phi ,V,Q}:{{\mathcal {N}}}\times B({{\mathcal {H}}})\longrightarrow B({{\mathcal {H}}})\) defined by

$$\begin{aligned}&{{\mathfrak {D}}}_{{{\mathcal {K}}},\phi ,V,Q}(n)(\rho ) \end{aligned}$$
(5)
$$\begin{aligned}&\quad \equiv \text {Tr}_{{\mathcal {K}}}\left( \left( {\mathbb {1}}\otimes Q_n\right) V\left( \rho \otimes P_\phi \right) V^*\left( {\mathbb {1}}\otimes Q_n\right) \right) \end{aligned}$$
(6)

will be an instrument. Here \(\text {Tr}_{{\mathcal {K}}}\) denotes the partial trace that reduces a state of the total system to a state of the subsystem given by the Hilbert space \({{\mathcal {H}}}\). If \({{\mathfrak {J}}}\) is a given instrument then \({ {\mathfrak {D}}}_{{{\mathcal {K}}},\phi ,V,Q}\) will be called a measurement dilation of \({{\mathfrak {J}}}\) iff \({{\mathfrak {J}}}={{\mathfrak {D}}}_{{{\mathcal {K}}},\phi ,V,Q}\). The mentioned representation theorem guarantees the existence of measurement dilations for any given instrument, see Theorem 7. 14 of [20] or Exercise 8. 9 of [15]. The last reference also contains an explicit construction procedure for \({ {\mathfrak {D}}}_{{{\mathcal {K}}},\phi ,V,Q}\) that will be reproduced for the special case of a Maxwell instrument in Appendix C and will henceforward be referred to as the “standard realization”.

3 The Quantum Version of Maxwell’s Demon (QMD)

The activity of Maxwell’s demon can be abstractly characterized as performing a conditional action, i. e., an action depending on the results of a previous measurement. Additionally, it is required that this conditional action leads to an entropy decrease of the system if applied to a certain set \({{\mathcal {A}}}\) of admissible initial states. In this paper we will interpret these notions quantum mechanically, especially the states as statistical operators \(\rho \) of a so-called object system defined on some Hilbert space \({{\mathcal {H}}}\), and the measurement as a Lüders instrument

$$\begin{aligned} {\mathfrak {I}}(n)(\rho )={P}_n\,\rho \,{P}_n \;, \end{aligned}$$
(7)

where n runs through some finite index set \({{\mathcal {N}}}\) and \(\left( {P}_n\right) _{n\in {{\mathcal {N}}}}\) is a complete family of mutually orthogonal projections. The total Lüders operation

$$\begin{aligned} {\mathfrak {I}}({{\mathcal {N}}})(\rho )=\sum _{n\in {{\mathcal {N}}}}{P}_n\,\rho \,{P}_n \end{aligned}$$
(8)

represents the state change after the Lüders measurement without any selection. More general instruments may be used to model the demon’s measurement but this possibility will not be considered in the present paper.

Further, the entropy is taken as the von Neumann entropy [18]

$$\begin{aligned} S(\rho )=-{\text{ T}r}\left( \rho \,\log \,\rho \right) \;, \end{aligned}$$
(9)

where \(\log \) is chosen as the natural logarithm. It is well-known [15, 18, 23] that the entropy of a state never decreases during a Lüders measurement, i. e.,

$$\begin{aligned} S(\rho )\le S\left( \sum _{n\in {{\mathcal {N}}}}{P}_n\,\rho \,{P}_n \right) \equiv {\widetilde{S}}_1 \;. \end{aligned}$$
(10)

Hence a Lüders measurement alone cannot be used to model a QMD. Additionally, we need to give a quantum-theoretical definition of a conditional action relative to a Lüders measurement. This will be done by considering a family \(\left( U_n\right) _{n\in {{\mathcal {N}}}}\) of unitary operators in \({{\mathcal {H}}}\) such that the combined state change will be given by the instrument

$$\begin{aligned} {\mathfrak {J}}(n)(\rho )= U_n\,P_n\,\rho P_n\,U_n^*\;, \end{aligned}$$
(11)

henceforward called a “Maxwell instrument”, with total operation (“Maxwell operation”)

$$\begin{aligned} \rho \mapsto \rho _1={\mathfrak {J}}({{\mathcal {N}}})(\rho )=\sum _{n\in {{\mathcal {N}}}} U_n\,P_n\,\rho P_n\,U_n^*\;. \end{aligned}$$
(12)

Again the Kraus operators \(A_n=U_n\,P_n\) of the operation \({\mathfrak {J}}({{\mathcal {N}}})\) may be read off the representation (12).

We stress that we will use the mathematical notion of an instrument that was originally designed to characterize state changes due to measurements in order to describe the more general state changes caused by a measurement and a conditional action. A similar approach has been adopted in chapter 12.4.4 of [15] in connection with quantum error correction.

It can be shown that a Maxwell operation always decreases the entropy of the corresponding post-measurement state:

Proposition 1

$$\begin{aligned} S_1\equiv S\left( \sum _{n\in {{\mathcal {N}}}} U_n\,P_n\,\rho P_n\,U_n^*\right) \le S\left( \sum _{n\in {{\mathcal {N}}}}P_n\,\rho P_n\right) ={\widetilde{S}}_1 \;. \end{aligned}$$
(13)

For a proof see Appendix B.

It is obvious that the \(U_n\) are not uniquely determined by (11), for example, \(U_n\) must only be defined on the support of \(P_n\) and can be arbitrarily extended to its orthogonal complement. In other words: the conditional action must be only defined for those cases where the condition holds.

In passing we note that the concept of “conditional action” is also used in quantum teleportation, see [15], chapter 1.3.7. Here Alice makes two quantum measurements and sends her results to Bob via a classical communication channel, who in turn performs certain operations depending on the measurement results. However, the total entropy increases during teleportation and hence it cannot be considered as a QMD.

It is well-known that in the case of a more general instrument than that of Lüders type a statement analogous to (10) may fail, i. e., a generalized measurement can decrease entropy, see [15], Exercise 11.15. We will provide two examples in Sect. 4 showing that this may also happen for an instrument of the form (12) and hence the Maxwell instrument is a possible candidate for a QMD.

We know from classical thermodynamics that the decrease of entropy of some system would not contradict the 2nd law of thermodynamics if it is accompanied by an equal or larger increase of entropy in some other parts of the world. This strategy of explaining the decrease of entropy can also be tried in the case of quantum mechanics. It is highly plausible that the demon needs some auxiliary system to perform the measurement and the conditional action. We will call this auxiliary system again the “demon” and assume that it can be modelled as another quantum system with Hilbert space \({{\mathcal {K}}}\). How can the quantum demon be realized? It is tempting to use the measurement dilation sketched in Sect. 2 that was originally intended to merely give a physical realization of a non-Lüders measurement. But there is no reason not to apply this construction to Maxwell instruments \({{\mathfrak {J}}}\) as well.

Hence we will assume that at the beginning the state of the combined system, object system and demon, is assumed to be

$$\begin{aligned} \rho \otimes P_\phi \;, \end{aligned}$$
(14)

where \(P_\phi \) is a one-dimensional projector in \({{\mathcal {K}}}\). Then a unitary time evolution V of the combined system takes place with the resulting state being

$$\begin{aligned} V\,\left( \rho \otimes P_\phi \right) \,V^*\;, \end{aligned}$$
(15)

followed by a Lüders measurement at the demon with projectors \(Q_n:{{\mathcal {K}}}\rightarrow {{\mathcal {K}}}\). This leads to a (not normalized) state

$$\begin{aligned} \left( {\mathbb {1}}\otimes Q_n\right) \, V\,\left( \rho \otimes P_\phi \right) \,V^*\,\left( {\mathbb {1}}\otimes Q_n\right) \;. \end{aligned}$$
(16)

Finally this state is reduced to the object system by performing the partial trace \(\text {Tr}_{{\mathcal {K}}}\). This yields the measurement dilation of \({{\mathfrak {J}}}\) of the form

$$\begin{aligned}&{{\mathfrak {D}}}_{{{\mathcal {K}}},\phi ,V,Q}(n)(\rho )\nonumber \\&\quad \equiv \text {Tr}_{{\mathcal {K}}}\left( \left( {\mathbb {1}}\otimes Q_n\right) \, V\,\left( \rho \otimes P_\phi \right) \,V^*\,\left( {\mathbb {1}}\otimes Q_n\right) \right) \;, \end{aligned}$$
(17)

with corresponding total operation

$$\begin{aligned}&{{\mathfrak {D}}}_{{{\mathcal {K}}},\phi ,V,Q}({{\mathcal {N}}})(\rho )\nonumber \\&\quad =\sum _{n\in {{\mathcal {N}}}}\text {Tr}_{{\mathcal {K}}}\left( \left( {\mathbb {1}}\otimes Q_n\right) \, V\, \left( \rho \otimes P_\phi \right) \,V^*\,\left( {\mathbb {1}}\otimes Q_n\right) \right) \end{aligned}$$
(18)

Before entering into the proposed solution of the mentioned paradox we would like to point out that the measurement dilation (17) in a sense reverses the temporal order of measurement and (conditional) action. In the original description of the demon we imagine a measurement followed by an action depending on the result of that measurement. In the dilation (17) there is first an unconditioned time evolution of the combined system followed by a state change due to a Lüders measurement at the demon and the state reduction. This resembles the difference between a classical computer that executes an “if-else” command thereby performing a conditional action and a quantum computer that performs all possible actions simultaneously until a final measurement selects which condition is satisfied. Such a realization seems strange at first sight but is a consequence of our decision to describe the demon purely as a quantum system.

Coming back to the apparent violation of a tentative \(2^{nd}\) law it is clear that the entropy of the quantum state remains constant during the first steps of the operation \({{\mathfrak {D}}}({\mathcal {N}})\):

$$\begin{aligned} S_0\equiv S(\rho )=S\left( \rho \otimes P_\phi \right) =S\left( V\,\left( \rho \otimes P_\phi \right) \,V^*\right) \;, \end{aligned}$$
(19)

since the entropy is additive for tensor products, vanishes for pure states and is unitarily invariant. By the following Lüders measurement the entropy increases (or remains constant) according to (10):

$$\begin{aligned} S(\rho )\le & {} S(\rho _{12})\;, \end{aligned}$$
(20)
$$\begin{aligned} \rho _{12}\equiv & {} \sum _{n\in {{\mathcal {N}}}} \left( {\mathbb {1}}\otimes Q_n\right) \, V\,\left( \rho \otimes P_\phi \right) \,V^*\,\left( {\mathbb {1}}\otimes Q_n\right) \;. \end{aligned}$$
(21)

If we reduce \(\rho _{12}\) to both subsystems,

$$\begin{aligned} \rho _{12}\mapsto \rho _1\otimes \rho _2\equiv \left( \text {Tr}_{{\mathcal {K}}}\rho _{12}\right) \otimes \left( \text {Tr}_{{\mathcal {H}}}\rho _{12}\right) \;, \end{aligned}$$
(22)

the entropy further increases:

$$\begin{aligned} S_0\le S(\rho _{12})\le S(\rho _1)+S(\rho _2) \;. \end{aligned}$$
(23)

This is a consequence of the so-called subadditivity of the von Neumann entropy, see [15], 11.3.4. The inequality (23) is compatible with the condition for a QMD

$$\begin{aligned} S(\rho _1)<S_0 \;, \end{aligned}$$
(24)

since it only implies

$$\begin{aligned} S(\rho _2){\mathop {\ge }\limits ^{(23)}}S_0-S(\rho _1){\mathop {>}\limits ^{(24)}}0 \;. \end{aligned}$$
(25)

This means that the decrease of the entropy of the object system will be, at least, compensated by an increase of the demon’s entropy. In this case the total entropy of the object system and the demon does not decrease in accordance with a tentative \(2^{nd}\) law.

4 Examples

4.1 Erasure of N Qubits

As a first example of a demonic Maxwell instrument \({{\mathfrak {E}}}\) and its standard realization we consider a system with a Hilbert space being an N-fold tensor product of two-dimensional ones

$$\begin{aligned} {{\mathcal {H}}}=\bigotimes _{\nu =1}^N \mathbb {C}^2_{(\nu )} \end{aligned}$$
(26)

and an orthonormal basis of vectors \(|n\rangle ,\; n\in {{\mathcal {N}}}\equiv \{0,\ldots ,2^N-1\}\) where n is identified with the string of length N consisting of its binary digits. Especially, 0 represents the string consisting of N zeroes. Further we choose an initial Lüders measurement with projectors

$$\begin{aligned} P_n=|n\rangle \langle n|,\; n\in {{\mathcal {N}}} \;, \end{aligned}$$
(27)

and the unitaries \(U_n\) corresponding to the Maxwell instrument (11) such that

$$\begin{aligned} U_n\,|n\rangle = |0\rangle \end{aligned}$$
(28)

for all \(n\in {{\mathcal {N}}}\). After a short calculation we obtain

$$\begin{aligned} {{\mathfrak {E}}}({{\mathcal {N}}})(\rho ) =\sum _{n\in {{\mathcal {N}}}}U_n\,P_n\,\rho \,P_n\,U_n=P_0 \;, \end{aligned}$$
(29)

for all statistical operators \(\rho \) in \({{\mathcal {H}}}\) and hence the description of the Maxwell instrument \({{\mathfrak {E}}}\) as “erasure of N qubits” seems adequate. Since

$$\begin{aligned} S\left( {{\mathfrak {E}}}({{\mathcal {N}}})(\rho )\right) =S(P_0)=0 \;, \end{aligned}$$
(30)

the entropy decrease of the corresponding Maxwell operation is maximal and we may call it “demonic”.

Its standard realization is given by \({{\mathcal {K}}}={{\mathcal {H}}}\), \(\phi =|0\rangle \), \(Q_n=P_n\) for all \(n\in {{\mathcal {N}}}\) and

$$\begin{aligned} V:{{\mathcal {H}}}\otimes {{\mathcal {K}}}\longrightarrow {{\mathcal {H}}}\otimes {{\mathcal {K}}},\quad V\left( \phi _1\otimes \phi _2\right) = \phi _2\otimes \phi _1 \;. \end{aligned}$$
(31)

After a short calculation we obtain, in accordance with (29),

$$\begin{aligned} \rho _1=\text {Tr}_{{\mathcal {K}}}\left( \rho _{12} \right) =P_0 \;, \end{aligned}$$
(32)

where

$$\begin{aligned} \rho _{12}\equiv \sum _{n\in {{\mathcal {N}}}}\left( {\mathbb {1}}\otimes Q_n \right) \,V\,\left( \rho \otimes P_0\right) \,V^*\,\left( {\mathbb {1}}\otimes Q_n \right) \;, \end{aligned}$$
(33)

and

$$\begin{aligned} \rho _2=\text {Tr}_{{\mathcal {H}}}\left( \rho _{12} \right) = \sum _{n\in {{\mathcal {N}}}}P_n\,\rho \,P_n \;. \end{aligned}$$
(34)

Moreover,

$$\begin{aligned} S\left( \rho _2\right) = S\left( \sum _{n\in {{\mathcal {N}}}}P_n\,\rho \,P_n \right) \ge S(\rho ) \;, \end{aligned}$$
(35)

by virtue of (10).

This means that the standard realization of the Maxwell instrument \({{\mathfrak {E}}}\) erasing N qubits proceeds by shifting the post-measurement state of the Lüders measurement corresponding to (27) into an auxiliary system of the same size as the object system. According to (35) this overcompensates the decrease of entropy due to the erasure. Since we have not precisely stated a quantum version of Landauer’s principle (in the narrow sense) we cannot claim that this would represent a proof of this principle. A possible obstacle would be that such a principle is usually formulated to make a statement about all possible realizations of the erasure process, whereas we have only said what would be obtained for realizations by measurement dilations \({{\mathfrak {E}}}={{\mathfrak {D}}}_{{{\mathcal {K}}},\phi ,V,Q}\).

Note finally that the usual statement about the entropic costs for erasure of at least \( k_{\mathrm{B}}\, \log 2\) per bit (re-introducing the Boltzmann constant \(k_{\mathrm{B}}\)) follows from

$$\begin{aligned} S\left( \sum _{n\in {{\mathcal {N}}}}P_n\,\rho \,P_n \right) =-\sum _{n\in {{\mathcal {N}}}}p_n\,\log \, p_n \;, \end{aligned}$$
(36)

if all \(p_n\equiv \text {Tr} \left( \rho \,P_n\right) \) are equal and hence \(p_n=2^{-N}\) which entails \(-\sum _{n\in {{\mathcal {N}}}}p_n\,\log \, p_n= N\, \log 2\).

4.2 A Simple Model of a QMD

Similarly as in the case of Szilard’s engine [4] we simplify the QMD scenario to a one-particle problem. Further, we consider only two pairs of yes-no-properties of the particle:

  • Position: right or left (r/l),

  • Speed: hot or cold (h/c).

This leads to a 4-dimensional Hilbert space \({{\mathcal {H}}}=\mathbb {C}^4\) spanned by the four orthogonal states \(|rh\rangle , |rc\rangle ,|lh\rangle ,|lc\rangle \). For the Lüders measurement we assume

$$\begin{aligned} P_1=|rh\rangle \langle rh|,\quad P_2={\mathbb {1}}-P_1,\quad {{\mathcal {N}}}=\{1,2\}. \end{aligned}$$
(37)

As the conditional action we choose

$$\begin{aligned} U_1=\left( \begin{array}{cccc} 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 \\ 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 \\ 1 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 \\ \end{array} \right) ,\quad U_2={\mathbb {1}} \;. \end{aligned}$$
(38)

This means that, if the particle is found at the right hand side and being hot then it is transferred to the left hand side without changing its speed:

$$\begin{aligned} U_1 |rh\rangle =|lh\rangle \;. \end{aligned}$$
(39)

The action of \(U_1\) onto the other three basis vectors is irrelevant since it models a conditional action and will only be applied in the case where the first Lüders measurement has the result “yes” and yields the post measurement state \(|rh\rangle \). If the measurement result is “no” then \(U_2\) will be applied, i. e., there will be no action.

Next we restrict the class \({{\mathcal {A}}}\) of admissible initial states to those of the form

$$\begin{aligned} \rho =\frac{p}{2}\left( |rh\rangle \langle rh|+|lh\rangle \langle lh|\right) + \frac{1-p}{2}\left( |rc\rangle \langle rc|+|lc\rangle \langle lc|\right) \;, \end{aligned}$$
(40)

where \(0<p<1\). This means that initially the particle is in a mixed state with probability p of being “hot” irrespective of its position. It follows that initially the entropy will be

$$\begin{aligned} S_0=S(\rho ) =-\left( p\,\log \frac{p}{2}+(1-p)\log \frac{1-p}{2}\right) \;. \end{aligned}$$
(41)

The final state \(\rho _1\) according to (12) will be

$$\begin{aligned} \rho _1=p\,|rh\rangle \langle rh|+\frac{1-p}{2}\left( |rc\rangle \langle rc|+|lc\rangle \langle lc|\right) \end{aligned}$$
(42)

having the entropy

$$\begin{aligned} S_1=S(\rho _1) = -\left( p\,\log p+(1-p)\log \frac{1-p}{2}\right) \;. \end{aligned}$$
(43)

Comparison with (41) yields

$$\begin{aligned} S_1-S_0=-p\,\log 2 <0 \;, \end{aligned}$$
(44)

and hence the model is a proper QMD since the action of the demon leads to a decrease of the object system’s entropy.

Fig. 2
figure 2

Plot of various entropies of the simple QMD model as functions of the probability p: The initial entropy \(S_0\) of the total system (\(=\) the initial entropy of the object system) (orange curve), the final entropy \(S_1+S_2\) of the total system (blue curve), and the final entropy \(S_1\) of the object system (green curve). We see that always \(S_1<S_0\) but \(S_1+S_2>S_0\) if \(0<p<1\)

Our next aim is to construct a measurement dilation of the form (17) following the prescription given in Appendix C. Hence we choose \({{\mathcal {K}}}=\mathbb {C}^2\) with standard basis \(\phi ={1\atopwithdelims ()0}\) and \(\psi ={0\atopwithdelims ()1}\), and

$$\begin{aligned} Q_1=P_\phi ,\quad Q_2=P_\psi \;. \end{aligned}$$
(45)

The linear operators in \({{\mathcal {H}}}\otimes {{\mathcal {K}}}=\mathbb {C}^4\otimes \mathbb {C}^2 \cong \mathbb {C}^4\oplus \mathbb {C}^4\) will be represented by \(2\times 2\)-matrices the entries of which are \(4\times 4\)-matrices. This simplifies the calculation of partial traces. With this convention we set

$$\begin{aligned} V=\left( \begin{array}{cccc|cccc} 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 \\ 1 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 \\ \hline 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 \\ 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ \end{array} \right) \,. \end{aligned}$$
(46)

One may confirm by direct calculation that with the above definitions \({{\mathfrak {D}}}_{{{\mathcal {K}}},\phi ,V,Q}\) is indeed a measurement dilation of the considered Maxwell instrument.

Additionally, we will explicitly calculate the measurement dilation for admissible initial states stepwise using the fact that all states will be diagonal in the standard basis of \( \mathbb {C}^4\oplus \mathbb {C}^4\). First we note that

$$\begin{aligned} \rho \otimes P_\phi = \text {diag}\left( \frac{p}{2},\frac{1-p}{2}, \frac{p}{2},\frac{1-p}{2},0,0,0,0\right) \;. \end{aligned}$$
(47)

Since \(V\left( \rho \otimes P_\phi \right) V^*\) is already diagonal we obtain

$$\begin{aligned} \rho _{12}= & {} V\left( \rho \otimes P_\phi \right) V^*\end{aligned}$$
(48)
$$\begin{aligned}= & {} \sum _{n=1}^2 \left( {\mathbb {1}}\otimes Q_n\right) \, V\left( \rho \otimes P_\phi \right) V^*\,\left( {\mathbb {1}}\otimes Q_n\right) \end{aligned}$$
(49)
$$\begin{aligned}= & {} \text {diag}\left( 0,0, \frac{p}{2},0,0,\frac{1-p}{2}, \frac{p}{2},\frac{1-p}{2}\right) \;. \end{aligned}$$
(50)

From this we obtain the partial trace \(\rho _1\) as the sum of the two diagonal blocks of \(\rho _{12}\):

$$\begin{aligned} \rho _1= \text {Tr}_{{\mathcal {K}}}\,\rho _{12}=\text {diag}\left( 0,\frac{1-p}{2},p,\frac{1-p}{2}\right) \end{aligned}$$
(51)

in accordance with (42) and its entropy (43). Analogously, the final state of the demon is obtained by taking the traces of the block matrices and has the form

$$\begin{aligned} \rho _2= \text {Tr}_{{\mathcal {H}}}\,\rho _{12}=\text {diag}\left( \frac{p}{2},1-\frac{p}{2}\right) \end{aligned}$$
(52)

with entropy

$$\begin{aligned} S_2=S(\rho _2)=-\left( \frac{p}{2}\,\log \frac{p}{2}+\left( 1-\frac{p}{2}\right) \,\log \left( 1-\frac{p}{2}\right) \right) \;. \end{aligned}$$
(53)

This leads to

$$\begin{aligned} S_1<S_0,\quad \text {but } S_1+S_2>S_0 \;, \end{aligned}$$
(54)

see Fig. 2, and hence the decrease of entropy of the object system is overcompensated by the increase of the demon’s entropy in our example.

A remarkable detail of our example is the fact that the state of the combined system after the interaction

$$\begin{aligned} V\left( \rho \otimes P_\phi \right) V^*\end{aligned}$$
(55)

commutes with all projections \({\mathbb {1}}\otimes Q_n\) and hence the entropy increase due to the Lüders measurement vanishes. The final entropy increase is completely due to the separation of the total state into reduced states of the subsystems. It has been argued against Szilard’s principle that there are also reversible measurements and hence this principle alone is not sufficient to defense the 2nd law against the Maxwell’s demon objection, see [6], chapter 5. Our example yields a counter argument closely related to Zurek’s consideration of mutual information [9]: In the quantum case there are also entropy costs of state separation that might suffice to compensate the entropy decrease of the object system even if the measurement is reversible (adiabatic).

5 Classical Conditional Action

It will be instructive to investigate the classical counterpart of the conditional action relative to a (Lüders) measurement introduced in Sect. 3. To this end we consider probability distributions

$$\begin{aligned} p:{{\mathcal {I}}}\rightarrow [0,1] \end{aligned}$$
(56)

defined on a finite set \({{\mathcal {I}}}\) of elementary events and subject to the condition

$$\begin{aligned} \sum _{i\in {{\mathcal {I}}}}p_i=1 \;. \end{aligned}$$
(57)

A “measurement” will be represented by a partition of \({{\mathcal {I}}}\), i. e., a disjoint union

$$\begin{aligned} {{\mathcal {I}}} = \biguplus _{j\in {{\mathcal {J}}}}I_j \;. \end{aligned}$$
(58)

As usual, we define the Shannon entropy [19], up to a factor \(\log 2\), by

$$\begin{aligned} H(p)\equiv -\sum _{i\in {{\mathcal {I}}}}p_i\,\log p_i \;. \end{aligned}$$
(59)

Then a “classical conditional action” relative to the measurement \(\left( I_j\right) _{j\in {{\mathcal {J}}}}\) will be defined by a map

$$\begin{aligned} \phi :{{\mathcal {I}}} \rightarrow {{\mathcal {I}}} \;, \end{aligned}$$
(60)

that is injective on the subsets \(I_j\), i. e., if \(i_1, i_2\in I_j\) for some \({j\in {{\mathcal {J}}}}\) and \(i_1\ne i_2\) then \(\phi (i_1)\ne \phi (i_2)\) holds. Each conditional action gives rise to a new probability distribution \(q:{{\mathcal {I}}}\rightarrow [0,1]\) defined by

$$\begin{aligned} q_i\equiv \sum _{\phi (k)=i}p_k \;, \end{aligned}$$
(61)

that has, in contrast to the quantum case, always a lower (or the same) entropy:

$$\begin{aligned} H(q)\le H(p) \;. \end{aligned}$$
(62)

Proof of Eq. 62

If \(\phi \) is a global bijection then (62) is satisfied with equality. Now assume that exactly two events are mapped onto the same one, say, \(\phi (1)=\phi (2)=i\) and \(p_1, p_2 >0\). Then we conclude, for \(j=1,2,\)

$$\begin{aligned} \log p_j< & {} \log (p_1+p_2), \end{aligned}$$
(63)
$$\begin{aligned} - \log p_j> & {} -\log (p_1+p_2), \end{aligned}$$
(64)
$$\begin{aligned} -p_1\log p_1-p_2\log p_2> & {} -(p_1+p_2)\log (p_1+p_2) \end{aligned}$$
(65)
$$\begin{aligned}= & {} -q_i\,\log q_i \;, \end{aligned}$$
(66)

which means that the fusion of two probabilities \(p_1\) and \(p_2\) to \(q_i\) decreases the corresponding term of the entropy. From this the general case follows by induction. \(\square \)

We will give an elementary example. Let \({{\mathcal {I}}}=\{1,2,3,4,5,6\}\) denote the numbers of a die and \(p_i=1/6\) their probabilities. The measurement detects whether the dice roll is low or high, corresponding to the partition \({{\mathcal {I}}}=I_1 \uplus I_2 = \{1,2,3\} \uplus \{4,5,6\}\). If the dice roll is low, the die is flipped so that the new roll is high. If the dice roll is already high, nothing is done. This describes the conditional action

$$\begin{aligned} \phi (i)=\left\{ \begin{array}{rll} i &{}\quad \text {if}&{} i\in I_2,\\ 7-i &{}\quad \text {if}&{} i\in I_1. \end{array} \right. \end{aligned}$$
(67)

The new probability distribution q generated by the conditional action will be given by \(q_1=q_2=q_3=0\) and \(q_4=q_5=q_6=1/3\). It has the entropy \(H(q)=\log 3 <H(p)=\log 6\), in accordance with (62).

Returning to the general case we will define the analogue of the “measurement dilation” considered in Sect. 3. The first step is to consider the extended event space

$$\begin{aligned} \Omega = {{\mathcal {I}}}\times {{\mathcal {J}}} \end{aligned}$$
(68)

and a fixed initial value \(j_0\in {{\mathcal {J}}}\). This means that the initial distribution \(P_2:{{\mathcal {J}}}\rightarrow [0,1]\) is concentrated on the value \(j_0\) and hence has vanishing entropy, \(H(P_2)=0\).

Define the injective map \(\Phi :{{\mathcal {I}}}\times \{j_0\}\rightarrow \Omega \) by

$$\begin{aligned} \Phi (i,j_0)\equiv (\phi (i),\mathsf{j}(i)) \;, \end{aligned}$$
(69)

where we have written \(j=\mathsf{j}(i)\) if \(i\in I_j\). The injectivity of \(\Phi \) follows since \(i_1\ne i_2\) and \(i_1,i_2\in I_j\) for some \(j\in {{\mathcal {J}}}\) implies \(\phi (i_1,j_0)\ne \phi (i_2,j_0)\) by the assumption that \(\phi \) is injective on \(I_j\). If \(i_1,i_2\) lie in different sets \(I_j\) then \(\mathsf{j}(i_1) \ne \mathsf{j}(i_2))\). Hence \(\Phi \) can be extended to a bijective map \({\bar{\Phi }}:\Omega \rightarrow \Omega \) that is the analogue of the unitary operator V introduced in Eq. (15).

\(\Phi \) maps p onto a new probability distribution Q on \(\Omega \) defined by

$$\begin{aligned} Q(k,j)=\left\{ \begin{array}{rll} p_i &{}:&{} \text {if }\Phi (i,j_0)=(k,j),\\ 0 &{}:&{} \text {else}, \end{array} \right. \end{aligned}$$
(70)

with the same entropy, \(H(Q)=H(p)\). Let \(Q_1\) denote the first marginal distribution of Q given by

$$\begin{aligned} Q_1(k)=\sum _{j\in {{\mathcal {J}}}}Q(k,j) \;, \end{aligned}$$
(71)

and, analogously,

$$\begin{aligned} Q_2(j)=\sum _{k\in {{\mathcal {I}}}}Q(k,j) \;. \end{aligned}$$
(72)

Then it can be shown that \(Q_1\) coincides with the distribution q defined above. The proof uses

$$\begin{aligned}&Q_1(k){\mathop {=}\limits ^{(71)}}\sum _{j\in {{\mathcal {J}}}}Q(k,j) \end{aligned}$$
(73)
$$\begin{aligned}&\quad {\mathop {=}\limits ^{(70)}} \sum _{j\in {{\mathcal {J}}},\Phi (i,j_0)=(k,j) } p_i \end{aligned}$$
(74)
$$\begin{aligned}&\quad {\mathop {=}\limits ^{(69)}} \sum _{j\in {{\mathcal {J}}},(\phi (i),\mathsf{j}(i))=(k,j) } p_i \end{aligned}$$
(75)
$$\begin{aligned}&\quad = \sum _{\phi (i)=k}p_i \end{aligned}$$
(76)
$$\begin{aligned}&\quad {\mathop {=}\limits ^{(61)}} q(k) \;. \end{aligned}$$
(77)

By the subadditivity of the Shannon entropy, see [15] Theorem 11.3 (4), we have \(H(Q_1)+H(Q_2)\ge H(Q)\) and hence \(H(Q_2)\ge H(Q)-H(Q_1)=H(p)-H(q)\). This means that the entropy decrease \(H(q)-H(p)<0\) due to the conditional action is (over)compensated by entropy increase of \(H(Q_2)-H(P_2)=H(Q_2)\), analogously to the quantum case.

In order to illustrate the measurement dilation for the above example, we first note that \({{\mathcal {J}}}=\{1,2\}\) can be viewed as a kind of memory of whether the die has been flipped (\(j=2\)) or not (\(j=1\)). Let \(j_0\equiv 1\), then the map \(\Phi \) is given by

$$\begin{aligned}&\Phi (1,1)=(6,2),\;\Phi (2,1)=(5,2),\;\Phi (3,1)=(4,2),\nonumber \\&\Phi (4,1)=(4,1),\;\Phi (5,1)=(5,1),\;\Phi (6,1)=(6,1). \end{aligned}$$
(78)

The resulting probability distribution Q satisfies

$$\begin{aligned} Q(4,1)= & {} Q(5,1)=Q(6,1)\nonumber \\= & {} Q(4,2)=Q(5,2)=Q(6,2)=1/6 \;, \end{aligned}$$
(79)

and vanishes for other events. Hence \(H(Q)=\log 6\). The marginal distributions are obtained as \(Q_1=q\) and \(Q_2(1)=Q_2(2)=1/2\). Hence \(H(Q_1)=\log 3\) and \(H(Q_2)=\log 2\). The latter exactly compensates the entropy decrease \(H(q)-H(p)=-\log 2\) due to the conditional action.

6 Summary

We have given an explanation of the apparently paradoxical entropy decrease of a quantum system caused by the external intervention analogous to but more general than Maxwell’s demon. This explanation follows Szilard’s principle [4] and its quantum version given by Zurek [9] in so far as it includes the demon’s state into the entropy balance. But we extend these approaches by introducing the concept of “conditional action” and its mathematical description in terms of a “Maxwell instrument”. The quantum-mechanical description of the demon can then be accomplished by using tools from quantum measurement theory [20], especially the “measurement dilation” of a Maxwell instrument. The entropy decrease due to the conditional action of Maxwell’s demon thus appears as a special case of the entropy decrease due to a non-Lüders measurement and has an analogous explanation, see [21, 22] or [23]. Of course, we have not shown that all physical realizations of Maxwell’s demon would be compatible with a tentative 2nd law, but only those described by measurement dilations.

The relation of our explanation to the Landauer/Bennett principle proves to be ambivalent. On the one hand there is no contradiction: If the conditional action is intended to be part of a cyclic process it would be necessary to reset the state of the demon to its initial value. This is only possible by another conditional action performed by a second demon and ends up with an increased entropy of the second demon’s state. But on the other hand it would not be entirely appropriate to call this process an “erasure of memory” since in our approach the function of the demon cannot be reduced to a mere memory, but also includes the role of a measuring device and of a control unit for the conditional action. Moreover, the reset of the demon’s state was motivated by getting started a cyclic process. If this reset necessarily increases the entropy of some other part of the environment, this simply means that it has not achieved its goal and hence is superfluous. From this perspective the Landauer/Bennett principle appears as a possible supplement to Szilard’s principle but can hardly be viewed as “the ultimate reason for the entropy increase” [9].

It has been argued [3] that current explanations of Maxwell’s demon using principles connecting information and entropy are not yet based on firm grounds. It is therefore worth mentioning that our approach does not rely on concepts from information theory, notwithstanding the frequent citation of a textbook [15] on quantum information theory and the use of von Neumann entropy. One may object, what is information anyway, if not the result of measurements used to trigger conditional action? But what one is actually concerned with here is the methodological distinction between specialization and generalization. It may be possible to introduce new concepts that fit specific situations without extending the theory in question. However, this must be strictly separated from the situation where new terms and laws are required to generalize the theory. Conceptual parsimony can be helpful to clearly distinguish between these two cases.