# Conditional work statistics of quantum measurements

M. Hamed Mohammady  Department of Physics, Lancaster University, LA1 4YB,
United Kingdom  RCQI, Institute of Physics, Slovak Academy of Sciences,
Dúbravská cesta 9, Bratislava 84511, Slovakia  Alessandro Romito  Department
of Physics, Lancaster University, LA1 4YB, United Kingdom

###### Abstract

In this paper we introduce a definition for conditional energy changes due to
general quantum measurements, as the change in the conditional energy
evaluated before, and after, the measurement process. By imposing minimal
physical requirements on these conditional energies, we show that the most
general expression for the conditional energy after the measurement is simply
the expected value of the Hamiltonian given the post-measurement state.
Conversely, the conditional energy before the measurement process is shown to
be given by the real component of the weak value of the Hamiltonian. Our
definition generalises well-known notions of distributions of internal energy
change, such as that given by stochastic thermodynamics. By determining the
conditional energy change of both system and measurement apparatus, we obtain
the full conditional work statistics of quantum measurements, and show that
this vanishes for all measurement outcomes if the measurement process
conserves the total energy. Additionally, by incorporating the measurement
process within a cyclic heat engine, we quantify the non-recoverable work due
to measurements. This is shown to always be non-negative, thus satisfying the
second law, and will be independent of the apparatus specifics for two classes
of projective measurements.

##  1 Introduction

Measurements play an important role in thermodynamic processes. This has been
established ever since the introduction of Maxwell’s demon [1] and the
subsequent insights gained in the thermodynamic role of information [2, 3, 4,
5, 6, 7]. In the quantum regime, measurements are even more intimately linked
to thermodynamics [8, 9, 10]. On the one hand, energy measurements are
essential to extend the laws of thermodynamics in the form of fluctuation
theorems [11, 12, 13, 14, 15, 16, 17]. On the other hand, measurement
processes typically involve the exchange of energy between a system and
detector, and the fundamental energy cost of quantum measurements is a subject
of intense study [18, 19, 20, 21, 22].

In quantum mechanics, measurements induce an unavoidable stochastic change in
the state of a system, which will generally modify its energy. How the energy
will change on average is well understood, and is simply given by the
difference in the system’s average energy, evaluated before and after the
measurement. Quantifying the change in energy, _conditional_ on observing a
given measurement outcome, however, is still lacking a general answer. A well
known method used to establish the energetic fluctuations due to dynamical
processes, such as measurement, is the Two-Point-Measurement (TPM) protocol,
which uses projective energy measurements before, and after, the dynamical
process in question [11]. This protocol, however, is known to break down when
the system initially has coherences with respect to its Hamiltonian [13, 17].
An alternative approach is that used in quantum stochastic thermodynamics [23,
24, 25, 26, 27, 28, 29], wherein the system follows a trajectory of pure
states that are not necessarily eigenstates of the Hamiltonian. The change in
energy is thus defined as the difference in expected values of the Hamiltonian
at the start and end of the trajectory in question. Such an approach, however,
implicitly assumes that we know which pure state the system initially
occupies.

In the present paper we provide a general definition for conditional energy
changes, for general quantum measurements and initial system states, as the
difference in conditional energies evaluated before and after the measurement
process. By imposing three minimal physical requirements on these conditional
energies, we show that the most general expresion for the conditional energy
after the measurement is simply the expected value of the Hamiltonian given
the post-measurement state. Conversely, the conditional energy before the
measurement process is shown to be given by the real component of the
generalised weak value of the Hamiltonian [30, 31, 32, 33, 34]. The energetic
statistics obtained by the proposed definition generalises existing results in
the literature, which are valid in specific circumstances: (i) if the measured
observable involves an initial and final energy measurement, we regain the
work distribution of the TPM protocol; (ii) if the observable measured is the
Heisenberg-evolved Hamiltonian, the energy statistics is equivalent to the
quasi-probability distribution over the random variable of work introduced in
[13]; and (iii) if the measurement process first projects the system onto one
of its pure state components, we obtain the definition for internal energy
change along a quantum trajectory used in stochastic thermodynamics.

By evaluating the conditional energy change of both system and measurement
apparatus, we obtain the full conditional work statistics of quantum
measurements. We show that when the measurement process conserves the total
energy, the conditional work vanishes for all measurement outcomes, and not
just on average. Finally, by incorporating the measurement process within a
cyclic heat engine involving a single heat bath of temperature $T$, we define
the non-recoverable, or irreversible, work due to measurement. This is shown
to be non-negative, thus satisfying the second law of thermodynamics. In
general, the non-recoverable work will depend on the specifics of the
measurement apparatus. However, we show that it becomes a system-only property
for two classes of projective measurements: (i) repeatable projective
measurements, which is a generalisation of ideal projective measurements (the
case for ideal projective measurements has already been shown in [21]); and
(ii) “noisy” projective measurements where the apparatus has the same
dimension as the system. Here, a noisy projective measurement is to be
understood as the necessarily non-repeatable measurement of an observable by
use of a measurement apparatus that is initially prepared in a state of full-
rank.

##  2 General Measurements

Figure 1: Conditional energy changes due to a measurement model
${\mathcal{M}}$. Initially, the energy of system ${\mathcal{S}}$ and apparatus
${\mathcal{A}}$ are measured “weakly”. Subsequently, ${\mathcal{S}}$ is
measured by the POVM $M$ via a unitary coupling $U$ with ${\mathcal{A}}$,
followed by a projective measurement of ${\mathcal{A}}$ by
$Z_{\\!{\,{\mathcal{A}}}}$. For each outcome $x$ of $M$, the system is
transformed to $\rho(x)$. At the end of the measurement process, the average
energy of both ${\mathcal{S}}$ and ${\mathcal{A}}$ are measured. The
conditional energy change of ${\mathcal{S}}$ is $\Delta
E_{\rho}^{\mathcal{M}}(x)$, while that of the compound system is the
conditional work ${\mathcal{W}}_{\rho}^{\mathcal{M}}(x)$.

Observables on a quantum system ${\mathcal{S}}$, with Hilbert space
${\mathcal{H}}_{\\!{\,{\mathcal{S}}}}$, are described by positive operator
valued measures (POVMs) $M:=\\{M_{x}\\}_{x\in{\mathcal{X}}}$. Here
${\mathcal{X}}$ denotes the outcome set (readouts) of the measurement, and
$M_{x}$ are positive operators (referred to as effects or POVM elements)
acting on ${\mathcal{H}}_{\\!{\,{\mathcal{S}}}}$ that sum to the identity, and
give the probability of observing outcome $x$ via the Born rule [35, 36, 37].
The POVM description of measurements, however, is insufficient for energetic
considerations. Measurement, seen as a _physical process_ , is implemented by
coupling the system to a detecting apparatus, which is then subjected to
projective measurements. Indeed, each POVM $M$ admits infinitely many physical
implementations, or measurement models/processes, described by the tuple
${\mathcal{M}}:=({\mathcal{H}}_{\\!{\,{\mathcal{A}}}},\xi,U,Z_{\\!{\,{\mathcal{A}}}})$
[37]. Here ${\mathcal{H}}_{\\!{\,{\mathcal{A}}}}$ is the Hilbert space of
apparatus ${\mathcal{A}}$, and $\xi$ is the state in which the apparatus is
initially prepared; $U$ is a “premeasurement” unitary operator acting on
${\mathcal{H}}_{\\!{\,{\mathcal{S}}}}\otimes{\mathcal{H}}_{\\!{\,{\mathcal{A}}}}$
due to turning on an interaction between ${\mathcal{S}}$ and ${\mathcal{A}}$
at time $t=0^{+}$ and turning it off again at $t=\tau^{-}$; and
$Z_{\\!{\,{\mathcal{A}}}}=\sum_{x\in{\mathcal{X}}}xP_{\\!{\,{\mathcal{A}}}}^{x}$
is a self-adjoint operator defining a sharp observable, or projective valued
measure (PVM), which ${\mathcal{A}}$ is measured by after the premeasurement
interaction with ${\mathcal{S}}$, i.e. at time $t=\tau$, such that each
outcome $x$ of $Z_{\\!{\,{\mathcal{A}}}}$ is associated with the same for the
POVM $M$ on ${\mathcal{S}}$. The measurement model is depicted in Fig. 1.

For each measurement outcome $x$, the measurement model defines an instrument
[38] on ${\mathcal{S}}$, given as

$\displaystyle{\mathcal{I}}_{x}^{\mathcal{M}}(\rho):=\mathrm{tr}_{\\!{\,{\mathcal{A}}}}[(\mathds{1}_{\\!{\,{\mathcal{S}}}}\otimes
P_{\\!{\,{\mathcal{A}}}}^{x})U(\rho\otimes\xi)U^{\dagger}].$ (1)

The instrument describes how the state of the system changes due to
measurement. An ideal measurement of a PVM $M$ is implemented by a Lüders
instrument ${\mathcal{I}}_{x}^{\mathcal{M}}(\rho)=M_{x}\rho M_{x}$.

At the end of the measurement process, the compound system
${\mathcal{S}}+{\mathcal{A}}$ will be in the state

$\displaystyle\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}$
$\displaystyle:=\sum_{x\in{\mathcal{X}}}P_{\\!{\,{\mathcal{A}}}}^{x}U(\rho\otimes\xi)U^{\dagger}P_{\\!{\,{\mathcal{A}}}}^{x},$
$\displaystyle=\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}(x),$
(2)

where
$p_{\rho}^{M}(x):=\mathrm{tr}[M_{x}\rho]\equiv\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]$
is the probability of observing outcome $x$ of $M$, given the initial system
state $\rho$, and
$\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}(x):=P_{\\!{\,{\mathcal{A}}}}^{x}U(\rho\otimes\xi)U^{\dagger}P_{\\!{\,{\mathcal{A}}}}^{x}/p_{\rho}^{M}(x)$.
Since the states $\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}(x)$ are
orthogonal with respect to the Hilbert-Schmidt inner product,
$\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}$ is a statistical ensemble, or
“Gemenge”,
$\\{p_{\rho}^{M}(x),\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}(x)\\}$ and
thus offers an ignorance interpretation. As a result, the ideal projective
measurement of ${\mathcal{A}}$ by the observable $Z_{\\!{\,{\mathcal{A}}}}$,
after premeasurement, is often referred to as the “objectification” process
[39]. Finally, we shall refer to the conditional states of ${\mathcal{S}}$
after observing the measurement outcome $x$ as
$\rho(x):={\mathcal{I}}_{x}^{\mathcal{M}}(\rho)/p_{\rho}^{M}(x)\equiv\mathrm{tr}_{\\!{\,{\mathcal{A}}}}[\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}(x)]$,
and similarly the orthogonal states of ${\mathcal{A}}$ representing outcome
$x$ will be denoted
$\xi(x):=P_{\\!{\,{\mathcal{A}}}}^{x}\xi^{\prime}P_{\\!{\,{\mathcal{A}}}}^{x}/p_{\rho}^{M}(x)\equiv\mathrm{tr}_{\\!{\,{\mathcal{S}}}}[\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}(x)]$,
where
$\xi^{\prime}:=\mathrm{tr}_{\\!{\,{\mathcal{S}}}}[U(\rho\otimes\xi)U^{\dagger}]$
is the state of ${\mathcal{A}}$ after premeasurement.

##  3 Energy change conditional on measurement outcome

We wish to quantify the increase in energy of the system, conditional on
observing outcome $x$ of the POVM $M$. Before doing so, it will be instructive
to consider the same question for a classical probabilistic system. Consider
the time-dependent and time-independent random variables $A(t)$ and $B$,
respectively, with the joint probability distributions $p(a(t),b)$ such that
$\sum_{a(t)}p(a(t),b)=p(b)$ for all $t$. The change in the expected value of
$A(t)$, for $t=0$ and $t=\tau$, conditional on $B=b$, can be defined as

$\displaystyle\Delta\langle A(t)\rangle_{b}$ $\displaystyle:=\langle
A(\tau)\rangle_{b}-\langle A(0)\rangle_{b}.$ (3)

Here, the expected value of $A(t)$ conditional on $B=b$ is defined as $\langle
A(t)\rangle_{b}:=\sum_{a(t)}a(t)\,p(a(t)|b)$, where
$p(a(t)|b):=p(a(t),b)/p(b)=p(a(t),b)/\sum_{a(t)}p(a(t),b)$ is the probability
of $A(t)=a(t)$ conditional on $B=b$. Clearly, averaging $\Delta\langle
A(t)\rangle_{b}$ with respect to the probability distribution $p(b)$ yields
$\sum_{b}p(b)\Delta\langle
A(t)\rangle=\sum_{a(\tau)}p(a(\tau))a(\tau)-\sum_{a(0)}p(a(0))a(0)\equiv\langle
A(\tau)\rangle-\langle A(0)\rangle$. If $A(t)$ is the energy of the system,
while $B$ is another physical quantity, then Eq. (3) will quantify the
conditional increase in energy for classical systems.

Now consider a quantum measurement process ${\mathcal{M}}$ which takes place
during the time interval $(0,\tau)$. We wish to quantify the increase in
energy of the system, conditional on observing outcome $x$ of the POVM $M$. To
this end, we may define the conditional energies $E_{x,t}^{\mathcal{M}}(\rho)$
for $t=0$ and $t=\tau$, from which the conditional increase in energy will be
given as

$\displaystyle\Delta E_{\rho}^{\mathcal{M}}(x)$
$\displaystyle:=E_{x,\tau}^{\mathcal{M}}(\rho)-E_{x,0}^{\mathcal{M}}(\rho).$
(4)

Eq. (4) can be seen as a quantum analogue to Eq. (3). Here, we replace $A(t)$
with the time-dependent Hamiltonian
$H_{\\!{\,{\mathcal{S}}}}(t):=\sum_{j}\epsilon_{j}(t)P_{\\!{\,{\mathcal{S}}}}^{j}(t)$,
where $\epsilon_{j}(t)$ are the energy-eigenvalues and
$P_{\\!{\,{\mathcal{S}}}}^{j}(t)$ the corresponding spectral projections.
Similarly, $B$ is replaced with the POVM $M$. For the two equations to be
fully analogous, however, we must obtain a quantum version of the joint
probability distribution $p(\epsilon_{j}(t),x)$. Prima facie, this would be
determined by the Born rule, given the initial state $\rho$ and the joint
measurement of $H_{\\!{\,{\mathcal{S}}}}(t)$ and $M$. However, due to
contextuality, $p(\epsilon_{j}(t),x)$ is generally not uniquely defined, and
will depend on the _order_ in which we measure $H_{\\!{\,{\mathcal{S}}}}(t)$
and $M$: if we first perform an ideal measurement of
$H_{\\!{\,{\mathcal{S}}}}(t)$, and then measure $M$, we obtain
$p(\epsilon_{j}(t),x)=\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{j}(t)\rho
P_{\\!{\,{\mathcal{S}}}}^{j}(t))]$, whereas if we first measure $M$, and then
$H_{\\!{\,{\mathcal{S}}}}(t)$, we obtain
$p(\epsilon_{j}(t),x)=\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{j}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]$.
Note that these joint probability distributions may differ even if $\rho$ is a
classical probabilistic mixture of energy eigenstates – it is the quantum
nature of measurements that leads to the contextuality of the joint
probability distribution. We define the “classical” (non-contextual) limit as
being characterised by measurement processes ${\mathcal{M}}$ which satisfy
$\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{j}(t)\rho
P_{\\!{\,{\mathcal{S}}}}^{j}(t))]=\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{j}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]$
for all $\rho,j,x$, thereby providing a uniquely defined
$p(\epsilon_{j}(t),x)$, so that Eq. (4) reduces to Eq. (3).

We are therefore interested in obtaining the most general expressions of
$E_{x,t}^{\mathcal{M}}(\rho)$, for $t=0$ and $t=\tau$, that are valid for all
states $\rho$ and POVMs $M$, so that Eq. (4) will be a physically meaningful
definition for conditional energy change which, in the “classical” limit, will
reduce to Eq. (3). To this end, we impose the following three minimal
requirements on $E_{x,t}^{\mathcal{M}}(\rho)$:

######  Requirement 1.

For all $\rho$ and ${\mathcal{M}}$,

$\displaystyle\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)E_{x,t}^{\mathcal{M}}(\rho)=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t)\rho_{t}],$
(5)

where $\rho_{0}:=\rho$, and
$\rho_{\tau}:=\sum_{x\in{\mathcal{X}}}{\mathcal{I}}_{x}^{\mathcal{M}}(\rho)$.

######  Requirement 2.

For all $\rho$ and ${\mathcal{M}}$, and all ensembles $\\{p_{k},\rho^{(k)}\\}$
satisfying $\sum_{k}p_{k}\rho^{(k)}=\rho$,

$\displaystyle\sum_{k}\frac{p_{k}p_{\rho^{(k)}}^{M}(x)}{p_{\rho}^{M}(x)}E_{x,t}^{\mathcal{M}}(\rho^{(k)})=E_{x,t}^{\mathcal{M}}(\rho),$
(6)

where $\sum_{k}p_{k}p_{\rho^{(k)}}^{M}(x)=p_{\rho}^{M}(x)$.

######  Requirement 3.

If

$\displaystyle\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{j}(t)\rho
P_{\\!{\,{\mathcal{S}}}}^{j}(t))]=\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{j}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]$
(7)

for all $\rho$ and $j$, then

$\displaystyle E_{x,t}^{\mathcal{M}}(\rho)$
$\displaystyle=\sum_{j}\epsilon_{j}(t)\frac{p(\epsilon_{j}(t),x)}{p(x)},$
$\displaystyle=\sum_{j}\epsilon_{j}(t)\frac{\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{j}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]}{\sum_{j}\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{j}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]},$
$\displaystyle=\frac{\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]}{\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]}=:\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t)\rho(x)].$
(8)

Requirement 1 is necessary for the average conditional increase in energy to
equal the increase in average energy, i.e.
$\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)\Delta
E_{\rho}^{\mathcal{M}}(x)=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)\rho_{\tau}]-\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(0)\rho]$;
Requirement 2 is needed to ensure that the conditional increase in energy is
not dependent on how the state $\rho$ is prepared; and Requirement 3 follows
from the fact that in the “classical” limit, achieved when Eq. (7) is
satisfied, the conditional energies $E_{x,t}^{\mathcal{M}}(\rho)$ will be
evaluated by sampling the energy eigenvalues by the conditional probability
distribution
$p(\epsilon_{j}(t)|x):=p(\epsilon_{j}(t),x)/p(x)=\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{j}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]/\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]$.

Following the logic of conditional expectation values in classical probability
theory, we may be tempted to define the conditional energy before the
measurement, $E_{x,0}^{\mathcal{M}}(\rho)$, as

$\displaystyle\langle
H_{\\!{\,{\mathcal{S}}}}(0)\rangle_{(\rho,x)}:=\sum_{j}\epsilon_{j}(0)\frac{\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{j}(0)\rho
P_{\\!{\,{\mathcal{S}}}}^{j}(0))]}{\sum_{j}\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{j}(0)\rho
P_{\\!{\,{\mathcal{S}}}}^{j}(0))]},$ (9)

and the conditional energy after the measurement,
$E_{x,\tau}^{\mathcal{M}}(\rho)$, as

$\displaystyle\langle H_{\\!{\,{\mathcal{S}}}}(\tau)\rangle_{(\rho,x)}$
$\displaystyle:=\sum_{j}\epsilon_{j}(\tau)\frac{\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{j}(\tau){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]}{\sum_{j}\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{j}(\tau){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]},$
$\displaystyle=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)\rho(x)].$ (10)

Here, Eq. (9) obtains the joint probabilities $p(\epsilon_{j}(0),x)$ by
performing an ideal measurement of $H_{\\!{\,{\mathcal{S}}}}(0)$ at $t=0$,
i.e. before the measurement process ${\mathcal{M}}$. In contrast, Eq. (3)
obtains $p(\epsilon_{j}(\tau),x)$ by performing an ideal measurement of
$H_{\\!{\,{\mathcal{S}}}}(\tau)$ at $t=\tau$, i.e., after the measurement
process ${\mathcal{M}}$. These equations trivially satisfy Requirement 3.
Moreover, as shown in Appendix (A), Eq. (3) is the most general expression for
$E_{x,\tau}(\rho)$ that will satisfy all three requirements. Consequently, we
may safely choose

$E_{x,\tau}^{\mathcal{M}}(\rho):=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)\rho(x)].$
(11)

However, Eq. (9) does not satisfy Requirement 1 and Requirement 2, as Eq. (5)
and Eq. (6) are satisfied only if either $\rho$ or $M_{x}$ commute with
$H_{\\!{\,{\mathcal{S}}}}(0)$. In Appendix A we prove that the most general
form of $E_{x,0}^{\mathcal{M}}(\rho)$ that is compatible with all three
physical requirements is

$\displaystyle E_{x,0}^{\mathcal{M}}(\rho)=\lambda\,{}_{x}\langle
H_{\\!{\,{\mathcal{S}}}}(0)\rangle_{\rho}+(1-\lambda)\,{}_{x}\langle
H_{\\!{\,{\mathcal{S}}}}(0)\rangle_{\rho}^{*}$ (12)

where $\lambda\in[0,1]$ and

$\displaystyle{}_{x}\langle
H_{\\!{\,{\mathcal{S}}}}(0)\rangle_{\rho}:=\frac{\mathrm{tr}[M_{x}H_{\\!{\,{\mathcal{S}}}}(0)\rho]}{p_{\rho}^{M}(x)}\equiv\frac{\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(0)\rho)]}{p_{\rho}^{M}(x)}$
(13)

is the generalised weak value of the Hamiltonian
$H_{\\!{\,{\mathcal{S}}}}(0)$, given the initial state $\rho$, and
postselected by outcome $x$ of the POVM $M$ [30, 31, 32, 33].

The weak value ${}_{x}\langle H_{\\!{\,{\mathcal{S}}}}(0)\rangle_{\rho}$ is
generically a complex number associated with conditional observables in
quantum mechanics. While its imaginary part is a non-universal feature usually
associated with the dynamics and back-action of the measurement process [40],
the real part is the universal (independent of the particular measurement
implementation) response of a detector in the limit of a vanishing measurement
disturbance, and can be associated with the physical estimation of conditional
quantities [41, 42]; indeed, as discussed in [43], the real component of
${}_{x}\langle H_{\\!{\,{\mathcal{S}}}}(0)\rangle_{\rho}$ can be understood as
the limit of Eq. (9) as the disturbance of $\rho$ due to the initial
measurement of $H_{\\!{\,{\mathcal{S}}}}(0)$ becomes vanishingly small.

Therefore, Eq. (12) has an operationally meaningful interpretation when
$\lambda=1/2$, in which case it reduces to the real part of the weak value,
and we shall use it as the definition of the initial conditional energy in Eq.
(4), i.e.

$\displaystyle E_{x,0}^{\mathcal{M}}(\rho)$
$\displaystyle:=\mathrm{Re}\left({}_{x}\langle
H_{\\!{\,{\mathcal{S}}}}(0)\rangle_{\rho}\right)$
$\displaystyle\equiv\frac{\mathrm{tr}[(M_{x}H_{\\!{\,{\mathcal{S}}}}(0)+H_{\\!{\,{\mathcal{S}}}}(0)M_{x})\rho]}{2p_{\rho}^{M}(x)}.$
(14)

We note that in the stochastic thermodynamics literature [23, 24, 25, 26, 27,
28, 29], the conditional change in energy along “trajectories”, which can be
thought of as being determined by outcomes of a general measurement, is
defined as

$\displaystyle\Delta\tilde{E}_{\rho}^{\mathcal{M}}(x):=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)\rho(x)]-\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(0)\rho].$
(15)

Here, the first term coincides with our definition for the conditional energy
after the measurement process, i.e. $E_{x,\tau}^{\mathcal{M}}(\rho)$. However,
the second term is the average _unconditional_ energy of the system prior to
measurement. While Eq. (15) satisfies Requirement 1, it will fail to satisfy
Requirement 2, since Eq. (6) will only be satisfied if $\rho$ is a pure state.
Moreover, Eq. (15) clearly fails to satisfy Requirement 3.

In Appendix (B) we show how Eq. (4) can be generalised so as to give an
additive value for conditional energy change due to any measurement
${\mathcal{M}}_{i}$ from the sequence of measurements
${\mathcal{M}}:=\\{{\mathcal{M}}_{i}\\}_{i=1}^{I}$, with outcomes
$x:=\\{x_{i}\\}_{i=1}^{I}$. This is done by introducing a trivial measurement
${\mathcal{M}}_{I+1}$, with only one outcome, at the end of the sequence
${\mathcal{M}}$, so that
$\mathrm{tr}[{\mathcal{I}}_{x}^{{\mathcal{M}}_{I+1}}(A)]=\mathrm{tr}[A]$ for
any operator $A$. The conditional increase in energy due to the
$i\textsuperscript{th}$ measurement in the sequence can therefore be defined
as $\Delta
E_{\rho}^{{\mathcal{M}}_{i}}(x)=E_{x_{i+1},t_{i+1}}^{{\mathcal{M}}_{i+1}}(\rho)-E_{x_{i},t_{i}}^{{\mathcal{M}}_{i}}(\rho)$,
where

$\displaystyle
E_{x_{i},t_{i}}^{{\mathcal{M}}_{i}}(\rho):=\frac{\mathrm{Re}\left(\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(i)(H_{\\!{\,{\mathcal{S}}}}(t_{i})\rho(x_{i-1}))]\right)}{\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(i)(\rho(x_{i-1}))]}.$
(16)

Here
${\mathcal{I}}_{x}^{\mathcal{M}}(i):={\mathcal{I}}_{x_{I+1}}^{{\mathcal{M}}_{I+1}}\circ\dots\circ{\mathcal{I}}_{x_{i}}^{{\mathcal{M}}_{i}}$
is the instrument implemented by the measurements ${\mathcal{M}}_{i}$ through
to ${\mathcal{M}}_{I+1}$; $H_{\\!{\,{\mathcal{S}}}}(t_{i})$ is the system
Hamiltonian before the measurement of ${\mathcal{M}}_{i}$ in the sequence
${\mathcal{M}}$; and
$\rho(x_{i})={\mathcal{I}}_{x_{i}}^{{\mathcal{M}}_{i}}\circ\dots\circ{\mathcal{I}}_{x_{1}}^{{\mathcal{M}}_{1}}(\rho)/\mathrm{tr}[\mathrm{idem}]$
is the state of the system after the $i$th measurement in the sequence. Here
we denote $\rho(x_{0}):=\rho$. It follows that $\sum_{i=1}^{I}\Delta
E_{\rho}^{{\mathcal{M}}_{i}}(x)=\Delta E_{\rho}^{\mathcal{M}}(x)$, in full
agreement with the conditional energy increase when the full sequence of
measurements are considered.

###  3.1 Relation between the proposed definition and previous work

The proposed definition of conditional energy change is rather general, and it
encompasses and generalises known protocols. First, if a quantum system is
measured by the instruments
${\mathcal{I}}_{(m,n)}^{\mathcal{M}}(\rho):=P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)UP_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho
P_{\\!{\,{\mathcal{S}}}}^{m}(0)U^{\dagger}P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)$,
where $U$ is a unitary operator while $P_{\\!{\,{\mathcal{S}}}}^{m}(0)$ and
$P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)$ are the spectral projections of
Hamiltonians $H_{\\!{\,{\mathcal{S}}}}(0)$ and
$H_{\\!{\,{\mathcal{S}}}}(\tau)$, respectively, then we obtain the probability
distribution $p_{\rho}^{M}(m,n)$ over the random variable of work,
$\epsilon_{n}(\tau)-\epsilon_{m}(0)$, given by the TPM protocol for an
isolated quantum system that unitarily evolves by $U$ (see Appendix (C C.1)).
Secondly, if the system is subject to an ideal measurement of the Heisenberg
evolved Hamiltonian $U^{\dagger}H_{\\!{\,{\mathcal{S}}}}(\tau)U$, the
resulting probability distribution $p_{\rho}^{M}(n)$ over the general energy
difference $\Delta E_{\rho}^{\mathcal{M}}(n)$ will be equivalent to the quasi-
probability distribution
$\tilde{p}_{(m,n)}=\mathrm{Re}(\mathrm{tr}[U^{\dagger}P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)UP_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho])$,
introduced in [13], over the random variable
$\epsilon_{n}(\tau)-\epsilon_{m}(0)$ (see Appendix (C C.2)). Finally, if
$\rho$ is a mixture of pure states $|{\psi_{m}}\rangle$, and the POVM $M$
defines a sequence of measurements with outcomes $x=(m,n,...)$, with the first
outcome $m$ being due to a projective measurement with respect to the
orthonormal basis $|{\psi_{m}}\rangle$, then the conditional initial energy of
$\rho$ will be
$E_{x,0}^{\mathcal{M}}(\rho)=\langle\psi_{m}|H_{\\!{\,{\mathcal{S}}}}(0)|\psi_{m}\rangle$
(see Appendix (C C.3)). This coincides with the definition of initial internal
energy of a system along a quantum trajectory [23, 24, 25, 26, 27, 28, 29].

As an illustrative example for the last case mentioned above, let us consider
a system that is a qubit with the time-independent Hamiltonian
$H_{\\!{\,{\mathcal{S}}}}=(\hbar\omega/2)(|e\rangle\langle e|-|g\rangle\langle
g|)$. The qubit is initially prepared in the pure state
$|{\psi}\rangle=|{\theta_{1},+}\rangle$, with
$|{\theta,\pm}\rangle:=\pm\cos(\theta/2)|{g/e}\rangle+\sin(\theta/2)|{e/g}\rangle$,
and is then measured by the sequential observable
${\mathcal{M}}:=\\{{\mathcal{M}}_{1},{\mathcal{M}}_{2}\\}$. The first
observable ${\mathcal{M}}_{1}$ is a projective measurement with respect to the
orthonormal basis $|{\theta_{2},\pm}\rangle$, while the second observable
${\mathcal{M}}_{2}$ has the POVM elements $\\{M_{e}^{(2)},M_{g}^{(2)}\\}$ so
that for outcome $e$ ($g$), the qubit is brought to the pure state
$|{e}\rangle$ ($|{g}\rangle$). The details of this measurement scheme are
shown in Appendix (E). In Fig. 2 we plot the conditional change in energy for
the sequence of outcomes $x=(+,e)$, $\Delta E_{\rho}^{\mathcal{M}}(+,e)$, when
$\theta_{1}=\pi/2$. This is generally different to the unconditional energy
change $\Delta\tilde{E}_{\rho}^{\mathcal{M}}(+,e)$, as defined in Eq. (15),
with the two definitions coinciding only when $\theta_{2}=\theta_{1}$. This is
the limit implicitly used in stochastic thermodynamics, where the first
observable in the sequence, i.e. ${\mathcal{M}}_{1}$, is ignored. Here, the
change in energy is computed given the assumption that the initial state is
$|{\theta_{1},+}\rangle$ and the outcome of the observable ${\mathcal{M}}_{2}$
is $e$. Consequently, the definition for conditional energy change we propose
can be seen as a generalisation of the conventional methods used in stochastic
thermodynamics, and dispenses with the requirement that the starting point of
the trajectory must be a known pure state.

Figure 2: Conditional change in energy of a qubit due to a sequence of
measurements ${\mathcal{M}}:=\\{{\mathcal{M}}_{1},{\mathcal{M}}_{2}\\}$. The
system is initially prepared in a pure state $|{\pi/2,+}\rangle$. The first
observable ${\mathcal{M}}_{1}$ projects the system onto states
$|{\theta_{2},\pm}\rangle$, while the measurement of the observable
${\mathcal{M}}_{2}$ takes it to states $|{e/g}\rangle$. The conditional change
of energy $\Delta E_{\rho}^{\mathcal{M}}(x)$ can be computed by Eq. (4).
Alternatively, the unconditional change in energy
$\Delta\tilde{E}_{\rho}^{\mathcal{M}}(x)$ may be computed by using Eq. (15).
For the outcome $(+,e)$, $\Delta E_{\rho}^{\mathcal{M}}(+,e)$ (blue full) is
compared to $\Delta\tilde{E}_{\rho}^{\mathcal{M}}(+,e)$ (red dashed) as
$\Delta\theta:=\pi/2-\theta_{2}$ is varied. $\Delta
E_{\rho}^{\mathcal{M}}(+,e)=\Delta\tilde{E}_{\rho}^{\mathcal{M}}(+,e)$ when
$\Delta\theta=0$. The inset shows the work statistics
$\mathcal{W}_{\rho}^{\mathcal{M}}(x)$ given a specific measurement model. The
work vanishes when the premeasurement unitary commutes with the total
Hamiltonian at $\theta_{2}=0$, i.e., $\Delta\theta=\pi/2$.

##  4 Work statistics for measurements

In order to define the work statistics for a measurement model
${\mathcal{M}}$, we must extend the above defined conditional energy increase
to the measurement apparatus. The premeasurement and objectification steps of
the measurement process can be defined by the instrument
${\mathcal{J}}_{x}^{\mathcal{M}}(\rho\otimes\xi):=P_{\\!{\,{\mathcal{A}}}}^{x}U(\rho\otimes\xi)U^{\dagger}P_{\\!{\,{\mathcal{A}}}}^{x}$.
Therefore, by Eq. (4), the conditional increase in energy of the compound
system ${\mathcal{S}}+{\mathcal{A}}$, given outcome $x$ of the POVM $M$, is

$\displaystyle\Delta{\mathcal{E}}_{\rho}^{\mathcal{M}}(x)$
$\displaystyle:=\frac{\mathrm{tr}[(H_{\\!{\,{\mathcal{S}}}}(\tau)+H_{\\!{\,{\mathcal{A}}}}(\tau)){\mathcal{J}}_{x}^{\mathcal{M}}(\rho\otimes\xi)]}{p_{\rho}^{M}(x)}$
$\displaystyle\qquad-\frac{\mathrm{Re}\left(\mathrm{tr}[{\mathcal{J}}_{x}^{\mathcal{M}}((H_{\\!{\,{\mathcal{S}}}}(0)+H_{\\!{\,{\mathcal{A}}}}(0))\rho\otimes\xi)]\right)}{p_{\rho}^{M}(x)}.$
(17)

$\Delta{\mathcal{E}}_{\rho}^{\mathcal{M}}(x)$ can be identified as the
conditional work, ${\mathcal{W}}_{\rho}^{\mathcal{M}}(x)$, if it is in
principle possible for this quantity to account for all the energy change in
the universe as a result of this measurement. We must therefore be able to
implement an ideal measurement of the observable
$Z_{\\!{\,{\mathcal{A}}}}=\sum_{x\in{\mathcal{X}}}xP_{\\!{\,{\mathcal{A}}}}^{x}$
on the apparatus ${\mathcal{A}}$, by an inclusion of a second apparatus
${\mathcal{B}}$, such that the conditional energy change of the larger system
${\mathcal{S}}+{\mathcal{A}}+{\mathcal{B}}$ will equal that of
${\mathcal{S}}+{\mathcal{A}}$ given by Eq. (4). This way all the energy
changes due to measurement will be accounted for, and the source of this
energy can be understood as originating from an (implicit) external work
storage device, which is outside of the quantum description, the effect of
which is the time-dependence of the Hamiltonian of
${\mathcal{S}}+{\mathcal{A}}$. In Appendix (D) we show that this is possible
for all states $\rho$ and observables $M$ if and only if we ensure that
$Z_{\\!{\,{\mathcal{A}}}}$ commutes with the Hamiltonian of ${\mathcal{A}}$
when the objectification step of the measurement process is assumed to take
place, which is $H_{\\!{\,{\mathcal{A}}}}(\tau)$. This is a consequence of the
Wigner-Araki-Yanase (WAY) theorem [44, 45, 46]. Given this restriction on
$Z_{\\!{\,{\mathcal{A}}}}$, Eq. (4) becomes

$\displaystyle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)$
$\displaystyle=\frac{\mathrm{tr}[P_{\\!{\,{\mathcal{A}}}}^{x}(H_{\\!{\,{\mathcal{S}}}}(\tau)+H_{\\!{\,{\mathcal{A}}}}(\tau))U(\rho\otimes\xi)U^{\dagger}]}{p_{\rho}^{M}(x)}$
$\displaystyle-\frac{\mathrm{Re}\left(\mathrm{tr}[P_{\\!{\,{\mathcal{A}}}}^{x}U(H_{\\!{\,{\mathcal{S}}}}(0)+H_{\\!{\,{\mathcal{A}}}}(0))(\rho\otimes\xi)U^{\dagger}]\right)}{p_{\rho}^{M}(x)}.$
(18)

The above expression implies that, if $U$ commutes with the total Hamiltonian
$H=H_{\\!{\,{\mathcal{S}}}}(\tau)+H_{\\!{\,{\mathcal{A}}}}(\tau)=H_{\\!{\,{\mathcal{S}}}}(0)+H_{\\!{\,{\mathcal{A}}}}(0)$,
then ${\mathcal{W}}_{\rho}^{\mathcal{M}}(x)=0$ for all outcomes $x$ and
initial states $\rho$. This strengthens previous results, which only
established that the average work vanishes when $U$ and
$Z_{\\!{\,{\mathcal{A}}}}$ commute with the total Hamiltonian [47].

In the inset of Fig. 2 we plot ${\mathcal{W}}_{\rho}^{\mathcal{M}}(x)$ for a
specific implementation of the sequential measurement introduced in the
previous section (see Appendix (E)). The work statistics vanishes when $U$
commutes with the total Hamiltonian, achieved at $\theta_{2}=0$.

##  5 Non-recoverable work and the second law of thermodynamics

In order to relate the obtained work statistics of measurement with the second
law of thermodynamics, we make the measurement process cyclic by use of a
single thermal bath of temperature $T$. Namely, at the end of the measurement
process we must return the Hamiltonian of system and apparatus to the initial
configuration $H_{\\!{\,{\mathcal{S}}}}(0)+H_{\\!{\,{\mathcal{A}}}}(0)$, while
also returning the state of the compound system to $\rho\otimes\xi$. The
average “non-recoverable” or “irreversible” work for the measurement process
${\mathcal{M}}$ will therefore be given by the average work of performing the
measurement,
$\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle:=\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x){\mathcal{W}}_{\rho}^{\mathcal{M}}(x)$,
plus the _minimal_ average work of returning the system to its initial
configuration. Below, we shall show that the non-recoverable work will always
be non-negative, thus satisfying the second law.

The average work $\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle$ is
obtained from Eq. (4) to be
$\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle=\mathrm{tr}[(U^{\dagger}H(\tau)U-H(0))(\rho\otimes\xi)]$,
where $H(0)=H_{\\!{\,{\mathcal{S}}}}(0)+H_{\\!{\,{\mathcal{A}}}}(0)$ and
$H(\tau)=H_{\\!{\,{\mathcal{S}}}}(\tau)+H_{\\!{\,{\mathcal{A}}}}(\tau)$.
Recall that the average state of ${\mathcal{S}}+{\mathcal{A}}$ at the end of
the measurement process is $\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}$,
defined in Eq. (2). Denoting the average state of the system at the end of
measurement as
$\rho_{\tau}:=\mathrm{tr}_{\\!{\,{\mathcal{A}}}}[\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}]$,
and the average state of the apparatus at the end of premeasurement and
objectification as respectively
$\xi^{\prime}:=\mathrm{tr}_{\\!{\,{\mathcal{S}}}}[U(\rho\otimes\xi)U^{\dagger}]$
and
$\xi_{\tau}:=\mathrm{tr}_{\\!{\,{\mathcal{S}}}}[\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}]$,
the average work can be recast in terms of free energy and information related
quantities as

$\displaystyle\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle$
$\displaystyle=\Delta F_{\\!{\,{\mathcal{S}}}}+\Delta
F_{\\!{\,{\mathcal{A}}}}+k_{B}T\big{(}I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}+\mathscr{H}-\mathscr{X}_{\\!{\,{\mathcal{A}}}}\big{)},$
$\displaystyle=\Delta
F_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}+k_{B}T\big{(}I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}-I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}^{\prime}+\mathscr{H}-\mathscr{X}_{\\!{\,{\mathcal{A}}}}\big{)}.$
(19)

Here $k_{B}$ is Boltzmann’s constant; $\Delta F_{\\!{\,{\mathcal{S}}}}$ and
$\Delta F_{\\!{\,{\mathcal{A}}}}$ are the increase in free energy of system
and apparatus due to the transformations $\rho\mapsto\rho_{\tau}$ and
$\xi\mapsto\xi_{\tau}$, respectively, while $\Delta
F_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}$ is the increase in free energy of the
compound system due to the transformation
$\rho\otimes\xi\mapsto\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}$;
$I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}:=S(\rho_{\tau})+S(\xi^{\prime})-S(U(\rho\otimes\xi)U^{\dagger})$
is the quantum mutual information between ${\mathcal{S}}$ and ${\mathcal{A}}$
after premeasurement, where $S(\rho)$ is the von Neumann entropy of $\rho$;
$I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}^{\prime}:=S(\rho_{\tau})+S(\xi_{\tau})-S(\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}})$
is the quantum mutual information between ${\mathcal{S}}$ and ${\mathcal{A}}$
after the measurement process;
$\mathscr{H}:=-\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)\,\mathrm{ln}\left({p_{\rho}^{M}(x)}\right)$
is the Shannon entropy of the measurement probability distribution
$p_{\rho}^{M}(x)$; and
$\mathscr{X}_{\\!{\,{\mathcal{A}}}}:=S(\xi^{\prime})-\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)S(\xi(x))$
is the Holevo information of the apparatus with respect to the ideal
measurement of $Z_{\\!{\,{\mathcal{A}}}}$ and its state after premeasurement,
$\xi^{\prime}$. See Appendix (F) for details.

There are two ways of returning the compound system to its initial state
$\rho\otimes\xi$ by use of a single thermal bath with temperature $T$: (a)
first couple ${\mathcal{S}}$ with the bath to realise the desired
transformation on ${\mathcal{S}}$, and then repeat the process with
${\mathcal{A}}$; or (b) couple the compound system
${\mathcal{S}}+{\mathcal{A}}$ with the bath to bring the total system to the
desired state. In case (a) the minimum work cost is $-\Delta
F_{\\!{\,{\mathcal{S}}}}-\Delta F_{\\!{\,{\mathcal{A}}}}$, whereas in case (b)
the minimum work cost is $-\Delta F_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}$.
Both of these are achieved in the limit when the process by which the systems
are coupled with the bath is quasi-static [48]. Therefore, in case (a) the
non-recoverable work of measurement will be

$\displaystyle{\mathcal{W}}_{\mathrm{irr}}^{\mathcal{M}}(\rho)$
$\displaystyle:=\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle-\Delta
F_{\\!{\,{\mathcal{S}}}}-\Delta F_{\\!{\,{\mathcal{A}}}},$
$\displaystyle=k_{B}T\big{(}I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}+\mathscr{H}-\mathscr{X}_{\\!{\,{\mathcal{A}}}}\big{)},$
(20)

whereas in case (b) the non-recoverable work will be

$\displaystyle{\mathcal{W}}_{\mathrm{inc.irr}}^{\mathcal{M}}(\rho)$
$\displaystyle:=\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle-\Delta
F_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}},$
$\displaystyle={\mathcal{W}}_{\mathrm{irr}}^{\mathcal{M}}(\rho)-k_{B}T\,I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}^{\prime}.$
(21)

Since case (b) uses the correlations between ${\mathcal{S}}$ and
${\mathcal{A}}$ to effect the desired transformation, whereas case (a) does
not, we refer to ${\mathcal{W}}_{\mathrm{inc.irr}}^{\mathcal{M}}(\rho)$ and
${\mathcal{W}}_{\mathrm{irr}}^{\mathcal{M}}(\rho)$ as the “inclusive” and
“non-inclusive” non-recoverable work, respectively [49].

The non-negativity of ${\mathcal{W}}_{\mathrm{irr}}^{\mathcal{M}}(\rho)$
follows from the fact that $I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}\geqslant 0$
and $\mathscr{H}\geqslant\mathscr{X}_{\\!{\,{\mathcal{A}}}}\geqslant 0$.
Similarly, the non-negativity of
${\mathcal{W}}_{\mathrm{inc.irr}}^{\mathcal{M}}(\rho)$ can be shown by re-
expressing it as
$k_{B}T(S(\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}})-S(\rho\otimes\xi))$,
and noting that the measurement process is unital [50, 51]. Therefore, the
work statistics of measurement as defined by Eq. (4) will obey the Kelvin
statement of the second law [52]. Moreover, the non-negativity of the mutual
information implies that
${\mathcal{W}}_{\mathrm{irr}}^{\mathcal{M}}(\rho)\geqslant{\mathcal{W}}_{\mathrm{inc.irr}}^{\mathcal{M}}(\rho)$.
We note that the non-inclusive non-recoverable work of measurement is related
to the work cost of measurement, $E_{\\!{\,\mathrm{cost}}}$, discussed in [18,
21]. Here, only the apparatus is returned to its initial configuration by
interacting with the bath. Consequently, it is related to the non-inclusive
non-recoverable work by the equality
$E_{\\!{\,\mathrm{cost}}}={\mathcal{W}}_{\mathrm{irr}}^{\mathcal{M}}(\rho)+\Delta
F_{\\!{\,{\mathcal{S}}}}$.

###  5.1 Non-recoverable work of projective measurements

In [21] it was shown that the work cost of ideal projective measurements is
given as
$E_{\\!{\,\mathrm{cost}}}^{\mathrm{proj}}=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\rho_{\tau}-\rho)]+k_{B}T\mathscr{H}$,
i.e. it only depends on the observable measured and the system states;
quantities pertaining to the apparatus do not appear (unlike the case for
general observables). We may generalise this for both the inclusive and non-
inclusive non-recoverable work, and for repeatable projective measurements of
a sharp observable $M$. Recall that an ideal measurement of $M$ is implemented
by the instrument ${\mathcal{I}}_{x}^{\mathrm{Ideal}}(\rho)=M_{x}\rho M_{x}$.
A repeatable measurement of $M$ can be implemented by the instrument
${\mathcal{I}}_{x}^{\mathrm{Rep}}(\rho)=\sum_{i}q_{i}V_{x,i}{\mathcal{I}}_{x}^{\mathrm{Ideal}}(\rho)V_{x,i}^{\dagger}$,
where $q_{i}$ is a probability distribution, and $V_{x,i}$ are unitaries
acting non-trivially only on the subspace projected onto by $M_{x}$. Such a
measurement is called repeatable because
$\mathrm{tr}[{\mathcal{I}}_{x}^{\mathrm{Rep}}\circ{\mathcal{I}}_{x}^{\mathrm{Rep}}(\rho)]=\mathrm{tr}[{\mathcal{I}}_{x}^{\mathrm{Rep}}(\rho)]$,
i.e. if we measure the system and obtain outcome $x$, performing the same
measurement will reveal $x$ with certainty. Clearly,
${\mathcal{I}}_{x}^{\mathrm{Rep}}={\mathcal{I}}_{x}^{\mathrm{Ideal}}$ if
$V_{x,i}=\mathds{1}$ for all $i$. It follows that the non-recoverable work for
repeatable measurements reduces from Eq. (5) and Eq. (5) to

$\displaystyle{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Rep}}(\rho)$
$\displaystyle=k_{B}T\big{(}\mathscr{H}+S(\rho_{\tau}^{\mathrm{Rep}})-S(\rho)\big{)},$
$\displaystyle{\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Rep}}(\rho)$
$\displaystyle=k_{B}T\big{(}S(\rho_{\tau}^{\mathrm{Ideal}})-S(\rho)\big{)},$
(22)

where
$\rho_{\tau}^{\mathrm{Rep}}:=\sum_{x\in{\mathcal{X}}}{\mathcal{I}}_{x}^{\mathrm{Rep}}(\rho)$
and
$\rho_{\tau}^{\mathrm{Ideal}}:=\sum_{x\in{\mathcal{X}}}{\mathcal{I}}_{x}^{\mathrm{Ideal}}(\rho)$.
Note that while the non-inclusive non-recoverable work depends on the
particular instrument ${\mathcal{I}}_{x}^{\mathrm{Rep}}$, the same is not true
for the inclusive non-recoverable work. The reason that Eq. (5.1) is obtained
is that for repeatable measurements, $S(\xi(x))=S(\xi)$ for all
$x\in{\mathcal{X}}$ (see Appendix (G)).

As discussed in [53, 22], ideal (or repeatable) projective measurements
require that the initial apparatus state $\xi$ not have full rank. Therefore,
by the third law of thermodynamics, such measurements will require infinite
resources [53, 54, 55, 56]. To account for this, [22] introduced measurement
models of a PVM wherein the apparatus is initially in a thermal state of
finite temperature. These measurements will necessarily be unrepeatable. We
show in Appendix (G) that the non-recoverable work for projective measurements
that use a full-rank apparatus of dimension
$\dim({\mathcal{H}}_{\\!{\,{\mathcal{A}}}})=\dim({\mathcal{H}}_{\\!{\,{\mathcal{S}}}})$,
which we call noisy projective measurements, is of the form

$\displaystyle{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Noisy}}(\rho)$
$\displaystyle={\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Noisy}}(\rho)=k_{B}T\big{(}S(\rho_{\tau}^{\mathrm{Ideal}})-S(\rho)\big{)}.$
(23)

Here, the premeasurement unitary is a SWAP operation, followed by an
appropriate local unitary on ${\mathcal{A}}$. Consequently the mutual
information terms in Eq. (5) and Eq. (5) vanish, and we are left with
$\mathscr{H}-\mathscr{X}_{\\!{\,{\mathcal{A}}}}=S(\rho_{\tau}^{\mathrm{Ideal}})-S(\rho)$.
As with the case of ideal and repeatable measurements, the non-recoverable
work for such noisy measurements is purely determined by the instrument
implementing $M$, and $\rho$; the non-recoverable work is independent of the
apparatus state. However, since noisy measurements require the apparatus to
have the same Hilbert space as the system, the independence of the non-
recoverable work on the apparatus is not as general as the case for repeatable
measurements.

Finally, comparing all three classes of projective measurements, we observe
the following relations:

$\displaystyle{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Rep}}(\rho)$
$\displaystyle\geqslant{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Ideal}}(\rho)\geqslant{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Noisy}}(\rho),$
$\displaystyle{\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Rep}}(\rho)$
$\displaystyle={\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Ideal}}(\rho)={\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Noisy}}(\rho).$
(24)

The first inequality in the top line is due to the random unitary mixing in
${\mathcal{I}}_{x}^{\mathrm{Rep}}$, with the equality condition being
satisfied if $V_{x,i}=V_{x}$ for all $i$ and $x$. Meanwhile, the second
inequality in the top line follows from the fact that
${\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Ideal}}(\rho)-{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Noisy}}(\rho)=k_{B}T\,\mathscr{H}$,
and so the equality condition is only obtained if $\mathscr{H}=0$. However,
these inequalities are replaced with equalities on the bottom line, showing
that the inclusive non-recoverable work of repeatable, ideal, and noisy
measurements is identical.

##  6 Conclusions

In the present work we have defined the change of energy, conditional on the
outcome of a general quantum measurement, as the difference in conditional
energies of the system, evaluated before and after the measurement process. In
order for this definition to be physically meaningful, we imposed three
requirements on the definitions for the initial and final conditional
energies. We showed that the most general expression for the conditional
energy of the system, after the measurement process, is simply the expected
value of the Hamiltonian, given the transformed state of the system after a
measurement outcome. This is as one would expect. However the most general,
and operationally meaningful, expression for the conditional energy of the
system, evaluated before the measurement process, is not the expected value of
the Hamiltonian given the initial state, but rather the real component of the
weak value of the Hamiltonian. We have shown that our definition provides a
unified platform which, in specific cases, reproduces previously existing
results such as the TPM or quasi-probability distributions for work in
isolated systems, and energy change along pure-state quantum trajectories. By
extending our definition to the apparatus used to measure an observable, we
determine the work statistics for general quantum measurements, and show that
these vanish for all measurement outcomes when the measurement process
conserves energy. Finally, to link the work distribution to the second law of
thermodynamics, we characterise the non-recoverable work when the measurement
process is embedded within a cyclic heat engine in contact with a single
thermal bath. The non-recoverable work is non-negative, thus satisfying the
second law. Moreover, we show that the non-recoverable work is purely
determined by system quantities for two classes of projective measurements:
repeatable projective measurements, and non-repeatable, noisy projective
measurements. Here, noisy projective measurements are implemented by use of an
apparatus that has the same dimension as the system, and is initially in a
state of full-rank.

## Acknowledgements

The authors thank K. V. Hovhannisyan, H. J. D. Miller, C. Elouard and L.
Loveridge for their useful comments. We acknowledge research support from
EPSRC (Grant EP/P030815/1).

## References

  * Maxwell [2011] J. C. Maxwell,  _Theory of Heat_ (Cambridge University Press, Cambridge, 2011).
  * Szilard [1929] L. Szilard, Z. Phys. 53, 840 (1929).
  * Landauer [1961] R. Landauer, IBM J. Res. Dev. 5, 183 (1961).
  * Penrose [1970] O. Penrose,  _Foundations of Statistical Mechanics_ (Elsevier, 1970).
  * Landauer [1996] R. Landauer, Phys. Lett. A 217, 188 (1996).
  * Bennett [2003] C. H. Bennett, Stud. Hist. Philos. Sci. A 34, 501 (2003).
  * Maruyama  _et al._ [2009] K. Maruyama, F. Nori, and V. Vedral, Rev. Mod. Phys. 81, 1 (2009).
  * Goold  _et al._ [2016] J. Goold, M. Huber, A. Riera, L. del Rio, and P. Skrzypczyk, J. Phys. A 49, 143001 (2016).
  * Vinjanampathy and Anders [2016] S. Vinjanampathy and J. Anders, Contemp. Phys. 57, 545 (2016).
  * Millen and Xuereb [2016] J. Millen and A. Xuereb, New J. Phys. 18, 011002 (2016).
  * Campisi  _et al._ [2011] M. Campisi, P. Hänggi, and P. Talkner, Rev. Mod. Phys. 83, 771 (2011).
  * Funo  _et al._ [2013] K. Funo, Y. Watanabe, and M. Ueda, Phys. Rev. E 88, 052121 (2013).
  * Allahverdyan [2014] A. E. Allahverdyan, Phys. Rev. E 90, 032137 (2014).
  * Miller and Anders [2017] H. J. D. Miller and J. Anders, New J. Phys. 19, 062001 (2017).
  * Åberg [2018] J. Åberg, Phys. Rev. X 8, 011019 (2018).
  * Perarnau-Llobet  _et al._ [2017] M. Perarnau-Llobet, E. Bäumer, K. V. Hovhannisyan, M. Huber, and A. Acin, Phys. Rev. Letters 118, 070601 (2017).
  * Lostaglio [2018] M. Lostaglio, Phys. Rev. Letters 120, 040602 (2018).
  * Sagawa and Ueda [2011] T. Sagawa and M. Ueda, Phys. Rev. Letters 106, 189901 (2011).
  * Jacobs [2012] K. Jacobs, Phys. Rev. E 86, 040106 (2012).
  * Navascués and Popescu [2014] M. Navascués and S. Popescu, Phys. Rev. Letters 112, 140502 (2014).
  * Abdelkhalek  _et al._ [2016] K. Abdelkhalek, Y. Nakata, and D. Reeb,  (2016), arXiv:1609.06981 .
  * Guryanova  _et al._ [2018] Y. Guryanova, N. Friis, and M. Huber,  (2018), arXiv:1805.11899 .
  * Horowitz [2012] J. M. Horowitz, Phys. Rev. E 85, 031110 (2012).
  * Hekking and Pekola [2013] F. W. J. Hekking and J. P. Pekola, Phys. Rev. Letters 111, 093602 (2013).
  * Alonso  _et al._ [2016] J. J. Alonso, E. Lutz, and A. Romito, Phys. Rev. Letters 116, 080403 (2016).
  * Elouard  _et al._ [2017] C. Elouard, D. A. Herrera-Martí, M. Clusel, and A. Auffèves, npj Quantum Inf. 3, 9 (2017).
  * Naghiloo  _et al._ [2017] M. Naghiloo, D. Tan, P. M. Harrington, J. J. Alonso, E. Lutz, A. Romito, and K. W. Murch,  (2017), arXiv:1703.05885 .
  * Naghiloo  _et al._ [2018] M. Naghiloo, J. J. Alonso, A. Romito, E. Lutz, and K. W. Murch, Phys. Rev. Letters 121, 030604 (2018).
  * Elouard and Mohammady [2018] C. Elouard and M. H. Mohammady, in  _Thermodynamics in the quantum regime: Fundamental Aspects and New Directions_, Fundamental Theories of Physics, Vol. 195, edited by F. Binder, L. A. Correa, C. Gogolin, J. Anders, and G. Adesso (Springer International Publishing, Cham, 2018) pp. 363–393.
  * Aharonov  _et al._ [1988] Y. Aharonov, D. Z. Albert, and L. Vaidman, Phys. Rev. Letters 60, 1351 (1988).
  * Haapasalo  _et al._ [2011] E. Haapasalo, P. Lahti, and J. Schultz, Phys. Rev. A 84, 052107 (2011).
  * Romito and Gefen [2010] A. Romito and Y. Gefen, Physica E 42, 343 (2010).
  * Dressel  _et al._ [2014] J. Dressel, M. Malik, F. M. Miatto, A. N. Jordan, and R. W. Boyd, Rev. Mod. Phys. 86, 307 (2014).
  * Hovhannisyan and Imparato [2019] K. V. Hovhannisyan and A. Imparato, New J. Phys. 21, 052001 (2019).
  * Busch  _et al._ [1995] P. Busch, M. Grabowski, and P. J. Lahti,  _Operational Quantum Physics_, Lecture Notes in Physics Monographs, Vol. 31 (Springer Berlin Heidelberg, Berlin, Heidelberg, 1995).
  * Busch  _et al._ [1996] P. Busch, P. J. Lahti, and Peter Mittelstaedt,  _The Quantum Theory of Measurement_, Lecture Notes in Physics Monographs, Vol. 2 (Springer Berlin Heidelberg, Berlin, Heidelberg, 1996).
  * Busch  _et al._ [2016] P. Busch, P. Lahti, J.-P. Pellonpää, and K. Ylinen,  _Quantum Measurement_, Theoretical and Mathematical Physics (Springer International Publishing, Cham, 2016).
  * Heinosaari and Ziman [2011] T. Heinosaari and M. Ziman,  _The Mathematical language of Quantum Theory_ (Cambridge University Press, Cambridge, 2011).
  * Mittelstaedt [1997] P. Mittelstaedt,  _The Interpretation of Quantum Mechanics and the Measurement Process_ (Cambridge University Press, Cambridge, 1997).
  * Dressel and Jordan [2012] J. Dressel and A. N. Jordan, Phys. Rev. A 85, 012107 (2012).
  * Steinberg [1995] A. Steinberg, Phys. Rev. Letters 74, 2405 (1995).
  * Romito and Gefen [2014] A. Romito and Y. Gefen, Phys. Rev. B 90, 085417 (2014).
  * Dressel  _et al._ [2010] J. Dressel, S. Agarwal, and A. N. Jordan, Phys. Rev. Lett. 104, 240401 (2010).
  * Wigner [1952] E. P. Wigner, Z. Phys. 133, 101 (1952).
  * Araki and Yanase [1960] H. Araki and M. M. Yanase, Phys. Rev. 120, 622 (1960).
  * Loveridge and Busch [2011] L. Loveridge and P. Busch, The Eur. Phys. J. D 62, 297 (2011).
  * Mohammady and Anders [2017] M. H. Mohammady and J. Anders, New J. Phys. 19, 113026 (2017).
  * Anders and Giovannetti [2013] J. Anders and V. Giovannetti, New J. Phys. 15, 033022 (2013).
  * Manzano  _et al._ [2018] G. Manzano, J. M. Horowitz, and J. M. R. Parrondo, Phys. Rev. X 8, 031037 (2018).
  * D’enes Petz [2008] D’enes Petz,  _Quantum Information Theory and Quantum Statistics_, Theoretical and Mathematical Physics (Springer Berlin Heidelberg, Berlin, Heidelberg, 2008).
  * Sagawa [2012] T. Sagawa, in  _Lectures on Quantum Computing, Thermodynamics and Statistical Physics_ (2012) pp. 125–190.
  * Balian [1991] R. Balian,  _From Microphysics to Macrophysics_ (Springer Berlin Heidelberg, Berlin, Heidelberg, 1991).
  * Allahverdyan  _et al._ [2011] A. E. Allahverdyan, K. V. Hovhannisyan, D. Janzing, and G. Mahler, Phys. Rev. E 84, 041109 (2011).
  * Wu  _et al._ [2013] L.-A. Wu, D. Segal, and P. Brumer, Sci. Rep. 3, 1824 (2013).
  * Reeb and Wolf [2014] D. Reeb and M. M. Wolf, New J. Phys. 16, 103011 (2014).
  * Masanes and Oppenheim [2017] L. Masanes and J. Oppenheim, Nat. Commun. 8, 14538 (2017).
  * Wehrl [1978] A. Wehrl, Rev. Mod. Phys. 50, 221 (1978).

##  Appendix A General form of conditional energy change

We show here that Eq. (12) and Eq. (11) are the most general forms of the
average conditional energies $E_{x,0}^{\mathcal{M}}(\rho)$ and
$E_{x,\tau}^{\mathcal{M}}(\rho)$, respectively, that fulfill all three
physical requirements. To this aim, first it is easy to show that a function
$E_{x,t}^{\mathcal{M}}(\rho)$ will satisfy both Requirement 1 and Requirement
2 if and only if it can be written as

$\displaystyle
E_{x,t}^{\mathcal{M}}(\rho)=\frac{f_{x,t}^{\mathcal{M}}(\rho)}{p_{\rho}^{M}(x)},$
(25)

such that (i) $f_{x,t}^{\mathcal{M}}(\rho)$ is linear in $\rho$, and (ii)
$\sum_{x\in{\mathcal{X}}}f_{x,0}^{\mathcal{M}}(\rho)=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(0)\rho]$,
while
$\sum_{x\in{\mathcal{X}}}f_{x,\tau}^{\mathcal{M}}(\rho)=\sum_{x\in{\mathcal{X}}}\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]=:\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)\rho_{\tau}]$.

The if statement of the proof is trivial. To prove the only if statement, we
first note that Eq. (6) can be re-expressed as
$\sum_{k}p_{k}(p_{\rho^{(k)}}^{M}(x)E_{x,t}^{\mathcal{M}}(\rho^{(k)}))=p_{\rho}^{M}(x)E_{x,t}^{\mathcal{M}}(\rho)$.
By introducing the relabeling
$f_{x,t}^{\mathcal{M}}(\rho):=p_{\rho}^{M}(x)E_{x,t}^{\mathcal{M}}(\rho)$, Eq.
(6) can therefore be rewritten as
$\sum_{k}p_{k}f_{x,t}^{\mathcal{M}}(\rho^{(k)})=f_{x,t}^{\mathcal{M}}(\rho)$.
It follows that in order for Requirement 2 to be satisfied, we must have (i).
Finally, inserting
$f_{x,t}^{\mathcal{M}}(\rho):=p_{\rho}^{M}(x)E_{x,t}^{\mathcal{M}}(\rho)$ in
Eq. (5) proves that in order for Requirement 1 to also be satisfied, we must
have (ii).

Now we turn to Requirement 3. The most general form of $E_{x,t}(\rho)$ that
can be written in the form of Eq. (25) while also satisfying Requirement 3,
can be expressed as

$\displaystyle
E_{x,t}(\rho)=\frac{\gamma\,\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]+(1-\gamma)\,\left(\lambda\,\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(t)\rho)]+(1-\lambda)\,\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(t)\rho)]^{*}\right)}{p_{\rho}^{M}(x)},$
(26)

where $\gamma,\lambda\in[0,1]$. Clearly, the numerator in Eq. (26) is linear
in $\rho$ thus satisfying (i), and when
$\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{j}(t)\rho
P_{\\!{\,{\mathcal{S}}}}^{j}(t))]=\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{j}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]$,
Eq. (26) will reduce to $\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t)\rho(x)]$,
thus satisfying Requirement 3. To see this, we note that given this relation,
it follows that

$\displaystyle\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(t)\rho)]$
$\displaystyle=\sum_{j}\epsilon_{j}(t)\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{j}(t)\rho)],$
$\displaystyle=\sum_{j,k}\epsilon_{j}(t)\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{k}(t){\mathcal{I}}_{x}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{j}(t)\rho)],$
$\displaystyle=\sum_{j}\epsilon_{j}(t)\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{j}(t)\rho
P_{\\!{\,{\mathcal{S}}}}^{j}(t))],$
$\displaystyle=\sum_{j}\epsilon_{j}(t)\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{j}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)].$
(27)

Finally, in order for Eq. (26) to satisfy (ii), thus fulfilling all three
physical requirements, we must have $\gamma=0$ for $t=0$, and $\gamma=1$ for
$t=\tau$. This is because
$\sum_{x\in{\mathcal{X}}}\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t){\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t)\rho_{\tau}]$,
whereas

$\displaystyle\sum_{x\in{\mathcal{X}}}\lambda\,\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(t)\rho)]+(1-\lambda)\,\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(t)\rho)]^{*}=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t)\rho].$
(28)

Therefore, the most general expression for the conditional energies which
satisfy all three physical requirements are

$\displaystyle E_{x,0}^{\mathcal{M}}(\rho)$
$\displaystyle=\frac{\lambda\,\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(0)\rho)]+(1-\lambda)\,\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(0)\rho)]^{*}}{p_{\rho}^{M}(x)},$
$\displaystyle\equiv\lambda\,{}_{x}\langle
H_{\\!{\,{\mathcal{S}}}}(0)\rangle_{\rho}+(1-\lambda)\,{}_{x}\langle
H_{\\!{\,{\mathcal{S}}}}(0)\rangle_{\rho}^{*},$ (29)

and

$\displaystyle
E_{x,\tau}^{\mathcal{M}}(\rho)=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)\rho(x)].$
(30)

##  Appendix B Conditional change in energy given multiple measurements

In many situations, a system may be subject to a sequence of measurements.
However, care must be taken when considering the corresponding conditional
energy changes, since these are not additive when only one measurement is
considered at a time. Specifically, consider the measurement
${\mathcal{M}}:=\\{{\mathcal{M}}_{i}\\}_{i=1}^{I}$, with the corresponding
outcomes $x:=\\{x_{i}\\}_{i=1}^{I}$. Here, the system is sequentially measured
by the observables ${\mathcal{M}}_{i}$, with the recorded outcomes
$x_{i}\in{\mathcal{X}}_{i}$. Given the initial preparation of the system as
$\rho$, and assuming that the Hamiltonians before and after the $i$th
measurement are $H_{\\!{\,{\mathcal{S}}}}(t_{i})$ and
$H_{\\!{\,{\mathcal{S}}}}(t_{i+1})$ respectively, the corresponding energy
change given the full sequence of measurements is given as $\Delta
E_{\rho}^{{\mathcal{M}}}(x)=E_{x,t_{I+1}}^{{\mathcal{M}}}(\rho)-E_{x,t_{1}}^{{\mathcal{M}}}(\rho)=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t_{I+1})\rho(x_{I})]-\mathrm{Re}(\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(t_{1})\rho)])/\mathrm{tr}[{\mathcal{I}}_{x}^{\mathcal{M}}(\rho)]$,
where $\rho(x_{i})$ is the normalised state of ${\mathcal{S}}$ after the $i$th
measurement in the sequence, and
${\mathcal{I}}_{x}^{\mathcal{M}}={\mathcal{I}}_{x_{I}}^{{\mathcal{M}}_{I}}\circ\dots\circ{\mathcal{I}}_{x_{1}}^{{\mathcal{M}}_{1}}$
the sequential application of instruments
${\mathcal{I}}_{x_{i}}^{{\mathcal{M}}_{i}}$. Denoting $\rho\equiv\rho(x_{0})$,
the sum of conditional energy changes for each measurement will be

$\displaystyle\sum_{i=1}^{I}\Delta
E_{\rho(x_{i-1})}^{{\mathcal{M}}_{i}}(x_{i})$
$\displaystyle=\sum_{i=1}^{I}\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t_{i+1})\rho(x_{i})]$
$\displaystyle-\sum_{i=1}^{I}\mathrm{Re}\left(\frac{\mathrm{tr}[{\mathcal{I}}_{x_{i}}^{{\mathcal{M}}_{i}}(H_{\\!{\,{\mathcal{S}}}}(t_{i})\rho(x_{i-1}))]}{\mathrm{tr}[{\mathcal{I}}_{x_{i}}^{{\mathcal{M}}_{i}}(\rho(x_{i-1})]}\right),$
$\displaystyle\neq\Delta E_{\rho}^{{\mathcal{M}}}(x).$ (31)

The reason for the non-additivity is two-fold. First, the final energy after
measuring ${\mathcal{M}}_{i}$, namely,
$\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(t_{i+1})\rho(x_{i})]$, does not equal
the initial energy before measuring ${\mathcal{M}}_{i+1}$, namely,
$\mathrm{Re}(\mathrm{tr}[{\mathcal{I}}_{x_{i+1}}^{{\mathcal{M}}_{i+1}}(H_{\\!{\,{\mathcal{S}}}}(t_{i+1})\rho(x_{i}))])/\mathrm{tr}[{\mathcal{I}}_{x_{i+1}}^{{\mathcal{M}}_{i+1}}(\rho(x_{i}))]$.
Secondly, the weak value of the Hamiltonian evaluated at any point in the
sequence of measurements depends on the full sequence of measurements
performed afterwards, and not just the measurement performed immediately
after.

In order to have an additive notion of conditional energy changes, we must
extend our definition as follows: first, augment the sequence of measurements
by including a trivial measurement at the end, i.e., let
${\mathcal{M}}:=\\{{\mathcal{M}}_{i}\\}_{i=1}^{I+1}$, such that
${\mathcal{M}}_{I+1}$ is a trivial observable that does not reveal any
information about the system, and is equivalent to not performing any
measurement at all. In other words let ${\mathcal{M}}_{I+1}$ have only one
outcome $x_{I+1}$, with the instrument satisfying
$\mathrm{tr}[{\mathcal{I}}_{x_{I+1}}^{{\mathcal{M}}_{I+1}}(A)]=\mathrm{tr}[A]$.
The conditional energy of the system, before measuring the $i$th observable in
the sequence, can thus be given as

$\displaystyle
E_{x_{i},t_{i}}^{{\mathcal{M}}_{i}}(\rho):=\frac{\mathrm{Re}(\mathrm{tr}[({\mathcal{I}}_{x_{I+1}}^{{\mathcal{M}}_{I+1}}\circ\dots\circ{\mathcal{I}}_{x_{i}}^{{\mathcal{M}}_{i}})(H_{\\!{\,{\mathcal{S}}}}(t_{i})\rho(x_{i-1}))])}{\mathrm{tr}[({\mathcal{I}}_{x_{I+1}}^{{\mathcal{M}}_{I+1}}\circ\dots\circ{\mathcal{I}}_{x_{i}}^{{\mathcal{M}}_{i}})\rho(x_{i-1}))]}.$
(32)

Note that
$E_{x_{I+1},t_{I+1}}^{{\mathcal{M}}_{I+1}}(\rho)=E_{x,t_{I+1}}^{\mathcal{M}}$,
and
$E_{x_{1},t_{1}}^{{\mathcal{M}}_{1}}(\rho)=E_{x,t_{1}}^{\mathcal{M}}(\rho)$.
By defining the change in conditional energy during the $i$th measurement as
$\Delta
E_{\rho}^{{\mathcal{M}}_{i}}(x_{i}):=E_{x_{i+1},t_{i+1}}^{{\mathcal{M}}_{i+1}}(\rho)-E_{x_{i},t_{i}}^{{\mathcal{M}}_{i}}(\rho)$,
we therefore obtain an additive notion of conditional energy change which
satisfies $\sum_{i=1}^{I}\Delta E_{\rho}^{{\mathcal{M}}_{i}}(x_{i})=\Delta
E_{\rho}^{{\mathcal{M}}}(x)$.

For long sequences of measurements, such as those encountered in stochastic
quantum thermodynamics, calculating Eq. (32) can be very arduous. However, as
shown in Appendix (C C.3), if the measurement of ${\mathcal{M}}_{i}$ first
projects $\rho(x_{i-1})$ onto one of its pure state components
$|{\psi(x_{i-1})}\rangle$, then Eq. (32) is reduced to the simple expression
$\langle\psi(x_{i-1})|H_{\\!{\,{\mathcal{S}}}}|\psi(x_{i-1})\rangle$.

##  Appendix C Limiting cases of conditional energy change

###  C.1 Connection to the TPM protocol

Consider the measurement model ${\mathcal{M}}$ which induces the instruments
${\mathcal{I}}_{(m,n)}^{\mathcal{M}}(\rho)=P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)UP_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho
P_{\\!{\,{\mathcal{S}}}}^{m}(0)U^{\dagger}P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)$,
and the associated effect operators
$M_{(m,n)}:=P_{\\!{\,{\mathcal{S}}}}^{m}(0)U^{\dagger}P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)UP_{\\!{\,{\mathcal{S}}}}^{m}(0)$
for the POVM $M$ with outcomes $x:=(m,n)$. Here, $U$ is a unitary operator,
while $P_{\\!{\,{\mathcal{S}}}}^{n}(t)$ are time-local spectral projections of
a Hamiltonian $H_{\\!{\,{\mathcal{S}}}}(t)$, with energy eigenvalues
$\epsilon_{n}(t)$. By Eq. (4) and Eq. (3), the conditional change in energy
for each outcome can thus be written as

$\displaystyle\Delta E_{\rho}^{\mathcal{M}}(m,n)$
$\displaystyle=\frac{\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau){\mathcal{I}}_{(m,n)}^{\mathcal{M}}(\rho)]}{p_{\rho}^{M}(m,n)}-\frac{\mathrm{Re}\left(\mathrm{tr}[{\mathcal{I}}_{(m,n)}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(0)\rho)]\right)}{p_{\rho}^{M}(m,n)},$
$\displaystyle=\epsilon_{n}(\tau)-\epsilon_{m}(0),$ (33)

which is a difference in energy eigenvalues. This is the work distribution one
obtains from the TPM protocol, wherein a quantum system undergoing unitary
evolution $U$ generated by its Hamiltonian is projectively measured by its
time-local Hamiltonian at two points of its evolution. The average change in
energy, over all measurement outcomes, is thus given by the probabilities
$p_{\rho}^{M}(m,n):=\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}^{m}(0)U^{\dagger}P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)UP_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho]$
to be

$\displaystyle\sum_{m,n}p_{\rho}^{M}(m,n)\Delta
E_{\rho}^{\mathcal{M}}(m,n)=\sum_{m}\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)UP_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho
P_{\\!{\,{\mathcal{S}}}}^{m}(0)U^{\dagger}]-\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(0)\rho].$
(34)

###  C.2 Connection to quasi-probability distributions of work in isolated
systems

As is well known, Eq. (34) will fail to equal the increase in average energy
of an isolated system as it unitarily evolves by $U$, namely
$\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)U\rho
U^{\dagger}]-\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(0)\rho]$, except for when
$\rho$ commutes with $H_{\\!{\,{\mathcal{S}}}}(0)$. Let us therefore consider
a different measurement model ${\mathcal{M}}$, which induces the instruments
${\mathcal{I}}_{n}^{\mathcal{M}}(\rho)=P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)U\rho
U^{\dagger}P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)$ with the associated effect
operators $M_{n}:=U^{\dagger}P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)U$ for the POVM
$M$ with outcomes $n$. This is equivalent to the ideal measurement of the
Heisenberg evolved Hamiltonian
$\tilde{H}_{\\!{\,{\mathcal{S}}}}(\tau):=U^{\dagger}H_{\\!{\,{\mathcal{S}}}}(\tau)U$,
with spectral projections
$\tilde{P}_{\\!{\,{\mathcal{S}}}}^{n}(\tau):=U^{\dagger}P_{\\!{\,{\mathcal{S}}}}^{n}(\tau)U$.
The conditional change in energy now becomes

$\displaystyle\Delta E_{\rho}^{\mathcal{M}}(n)$
$\displaystyle=\frac{\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau){\mathcal{I}}_{n}^{\mathcal{M}}(\rho)]}{p_{\rho}^{M}(n)}-\frac{\mathrm{Re}\left(\mathrm{tr}[{\mathcal{I}}_{n}^{\mathcal{M}}(H_{\\!{\,{\mathcal{S}}}}(0)\rho)]\right)}{p_{\rho}^{M}(n)},$
$\displaystyle=\epsilon_{n}(\tau)-\frac{\mathrm{Re}\left(\mathrm{tr}[\tilde{P}_{\\!{\,{\mathcal{S}}}}^{n}(\tau)H_{\\!{\,{\mathcal{S}}}}(0)\rho]\right)}{p_{\rho}^{M}(n)},$
(35)

which always averages to

$\displaystyle\sum_{n}p_{\rho}^{M}(n)\Delta E_{\rho}^{\mathcal{M}}(n)$
$\displaystyle=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)U\rho
U^{\dagger}]-\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(0)\rho].$ (36)

However, this comes at the expense of the energy change to no longer
necessarily be equal to the difference in energy eigenvalues when $\rho$
commutes with $H_{\\!{\,{\mathcal{S}}}}(0)$. This is because unless $\rho$
only has support on a single energy subspace, then the conditional initial
energy in Eq. (C C.2) will be an average over energy eigenvalues. Indeed, in
order for
$\mathrm{Re}\left(\mathrm{tr}[M_{x}H_{\\!{\,{\mathcal{S}}}}(0)\rho]\right)/p_{\rho}^{M}(x)=\epsilon_{m}(0)$
to obtain for any state $\rho$ that commutes with
$H_{\\!{\,{\mathcal{S}}}}(0)$, then it is necessary for the support of $M_{x}$
to be contained in the energy subspace of $\epsilon_{m}(0)$. It will follow
that $M_{x}$ would be equivalent to
$P_{\\!{\,{\mathcal{S}}}}^{m}(0)M_{x}P_{\\!{\,{\mathcal{S}}}}^{m}(0)$,
resulting in the instruments
${\mathcal{I}}_{x}^{\mathcal{M}}(\rho)={\mathcal{I}}_{x}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho
P_{\\!{\,{\mathcal{S}}}}^{m}(0))$ and, hence, the channel
${\mathcal{I}}^{\mathcal{M}}(\rho):=\sum_{x\in{\mathcal{X}}}{\mathcal{I}}_{x}^{\mathcal{M}}(\rho)=\sum_{m}{\mathcal{I}}^{\mathcal{M}}(P_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho
P_{\\!{\,{\mathcal{S}}}}^{m}(0))$. We may conclude that the channel
${\mathcal{I}}^{\mathcal{M}}$ cannot model the unitary evolution of a system
with a state $\rho$ that does not commute with $H_{\\!{\,{\mathcal{S}}}}(0)$.
As such, when the state $\rho$ does not commute with the Hamiltonian, it
follows that the measurement will not result in an average work that equals
$\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)U\rho
U^{\dagger}]-\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(0)\rho]$. In other words a
measurement model ${\mathcal{M}}$ that obtains the TPM statistics of work,
when the system is prepared as a mixture of energy eigenstates, cannot give
the average work as being the increase in average energy, as the system
transforms unitarily, for arbitrary states. Our definition for conditional
energy change is therefore in full agreement with the no-go theorem of [16].

We now show that the generalisation of conditional energy change beyond energy
eigenvalue differences is equivalent to the generalisation of probabilities to
quasiprobabilities introduced in [13]. The summand in Eq. (36) can be written
as

$\displaystyle p_{\rho}^{M}(n)\Delta E_{\rho}^{\mathcal{M}}(n)$
$\displaystyle=\epsilon_{n}(\tau)\mathrm{tr}[\tilde{P}_{\\!{\,{\mathcal{S}}}}^{n}(\tau)\rho]-\sum_{m}\epsilon_{m}(0)\mathrm{Re}\left(\mathrm{tr}[\tilde{P}_{\\!{\,{\mathcal{S}}}}^{n}(\tau)P_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho]\right),$
$\displaystyle=\sum_{m}\epsilon_{n}(\tau)\mathrm{Re}\left(\mathrm{tr}[\tilde{P}_{\\!{\,{\mathcal{S}}}}^{n}(\tau)P_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho]\right)$
$\displaystyle\qquad-\sum_{m}\epsilon_{m}(0)\mathrm{Re}\left(\mathrm{tr}[\tilde{P}_{\\!{\,{\mathcal{S}}}}^{n}(\tau)P_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho]\right),$
$\displaystyle=\sum_{m}\tilde{p}_{(m,n)}(\epsilon_{n}(\tau)-\epsilon_{m}(0)).$
(37)

On the left hand side, we have a real probability distribution
$p_{\rho}^{M}(n)$, and energy change $\Delta E_{\rho}^{\mathcal{M}}(n)$ which
may lie outside the range of energy eigenvalue differences. Meanwhile, on the
right hand side, the energy change of ${\mathcal{S}}$ is defined with respect
to the random variable $\epsilon_{n}(\tau)-\epsilon_{m}(0)$, which is sampled
by the quasi-probability distribution
$\tilde{p}_{(m,n)}:=\mathrm{Re}\left(\mathrm{tr}[\tilde{P}_{\\!{\,{\mathcal{S}}}}^{n}(\tau)P_{\\!{\,{\mathcal{S}}}}^{m}(0)\rho]\right)$.

###  C.3 Connection to quantum stochastic thermodynamics

Consider a quantum state
$\rho=\sum_{m}q_{m}P_{\\!{\,{\mathcal{S}}}}[{\psi_{m}}]$, where
$P_{\\!{\,{\mathcal{S}}}}[{\psi}]\equiv|\psi\rangle\langle\psi|$ is a
projection on the vector
$|{\psi}\rangle\in{\mathcal{H}}_{\\!{\,{\mathcal{S}}}}$. We may define a
quantum trajectory induced by the POVM $M:=\\{M^{(1)},M^{(2)}\\}$ as the
sequence of measurement outcomes $x:=(m,n)$, with $m$ the outcome of an ideal
projective measurement of the observable
$M^{(1)}:=\sum_{m}mP_{\\!{\,{\mathcal{S}}}}[{\psi_{m}}]$, and $n$ the outcome
of a subsequent measurement of a general POVM $M^{(2)}$. Given that the effect
operators for the POVM $M$ defined by the sequence of measurements are
$M_{x}:=P_{\\!{\,{\mathcal{S}}}}[{\psi_{m}}]M_{n}^{(2)}P_{\\!{\,{\mathcal{S}}}}[{\psi_{m}}]$,
the conditional initial energy of the system is given by Eq. (3) as

$\displaystyle E_{x,0}^{\mathcal{M}}(\rho)$
$\displaystyle=\frac{\mathrm{Re}\left(\mathrm{tr}[P_{\\!{\,{\mathcal{S}}}}[{\psi_{m}}]M_{n}^{(2)}P_{\\!{\,{\mathcal{S}}}}[{\psi_{m}}]H_{\\!{\,{\mathcal{S}}}}(0)\rho]\right)}{p_{\rho}^{M}(x)},$
$\displaystyle=\frac{q_{m}\langle\psi_{m}|M_{n}^{(2)}|\psi_{m}\rangle\langle\psi_{m}|H_{\\!{\,{\mathcal{S}}}}(0)|\psi_{m}\rangle}{q_{m}\langle\psi_{m}|M_{n}^{(2)}|\psi_{m}\rangle},$
$\displaystyle=\langle\psi_{m}|H_{\\!{\,{\mathcal{S}}}}(0)|\psi_{m}\rangle.$
(38)

Therefore, the conditional initial energy of the system, along the quantum
trajectory $x=(m,n)$, is the expected energy of the system when it is in the
pure state $|{\psi_{m}}\rangle$ that defines the starting point of the
trajectory in question. We note that this result holds even when $\rho$ is
already a pure state $|{\psi_{m}}\rangle$. Of course, the preparation of a
quantum system in a pure state can also be recast in terms of projective
measurements. Cast in this light, this means that in order for
$E_{x,0}^{\mathcal{M}}(\rho)=\langle\psi_{m}|H_{\\!{\,{\mathcal{S}}}}(0)|\psi_{m}\rangle$
to hold, then $M$ must also account for the preparation of the system in state
$|{\psi}\rangle$. This should not be too surprising, however, since when we
say that we “know” that the system starts in a given pure state
$|{\psi_{m}}\rangle$, operationally this means that we must have performed a
projective measurement to verify this fact.

##  Appendix D When extending the measurement apparatus will not change the
total conditional increase in energy

Let us augment the measurement model
${\mathcal{M}}:=({\mathcal{H}}_{\\!{\,{\mathcal{A}}}},\xi_{\\!{\,{\mathcal{A}}}},U,Z_{\\!{\,{\mathcal{A}}}})$
by including a measurement model for $Z_{\\!{\,{\mathcal{A}}}}$. The augmented
model is denoted
${\mathcal{M}}^{\prime}:=({\mathcal{H}}_{\\!{\,{\mathcal{A}}}}\otimes{\mathcal{H}}_{\\!{\,{\mathcal{B}}}},\xi_{\\!{\,{\mathcal{A}}}}\otimes\xi_{\\!{\,{\mathcal{B}}}},VU,Z_{\\!{\,{\mathcal{B}}}})$.
Here $\xi_{\\!{\,{\mathcal{B}}}}$ is the initial state of apparatus
${\mathcal{B}}$, and $V$ is a unitary operator that acts on
${\mathcal{H}}_{\\!{\,{\mathcal{A}}}}\otimes{\mathcal{H}}_{\\!{\,{\mathcal{B}}}}$
after the application of $U$ on
${\mathcal{H}}_{\\!{\,{\mathcal{S}}}}\otimes{\mathcal{H}}_{\\!{\,{\mathcal{A}}}}$.
Finally,
$Z_{\\!{\,{\mathcal{B}}}}=\sum_{x\in{\mathcal{X}}}xP_{\\!{\,{\mathcal{B}}}}^{x}$
is the observable on apparatus ${\mathcal{B}}$. Denoting
$H(t):=H_{\\!{\,{\mathcal{S}}}}(t)+H_{\\!{\,{\mathcal{A}}}}(t)+H_{\\!{\,{\mathcal{B}}}}(t)$
for $t\in\\{0,\tau\\}$, and remembering that ${\mathcal{M}}^{\prime}$ and
${\mathcal{M}}$ are models for the same POVM $M$ and, hence, give the same
probabilities, we obtain the conditional energy increase of the compound
system by generalising Eq. (4) as

$\displaystyle\Delta{\mathcal{E}}_{\rho}^{{\mathcal{M}}^{\prime}}(x)$
$\displaystyle:=\frac{\mathrm{tr}[H(\tau)P_{\\!{\,{\mathcal{B}}}}^{x}VU(\rho\otimes\xi_{\\!{\,{\mathcal{A}}}}\otimes\xi_{\\!{\,{\mathcal{B}}}})U^{\dagger}V^{\dagger}P_{\\!{\,{\mathcal{B}}}}^{x}]}{p_{\rho}^{M}(x)}$
$\displaystyle-\frac{\mathrm{Re}\left(\mathrm{tr}[P_{\\!{\,{\mathcal{B}}}}^{x}VUH(0)(\rho\otimes\xi_{\\!{\,{\mathcal{A}}}}\otimes\xi_{\\!{\,{\mathcal{B}}}})U^{\dagger}V^{\dagger}]\right)}{p_{\rho}^{M}(x)}.$
(39)

We now wish to show that it is possible to have
$\Delta{\mathcal{E}}_{\rho}^{{\mathcal{M}}^{\prime}}(x)=\Delta{\mathcal{E}}_{\rho}^{{\mathcal{M}}}(x)$
for all states $\rho$ if $Z_{\\!{\,{\mathcal{A}}}}$ commutes with
$H_{\\!{\,{\mathcal{S}}}}(\tau)$. Let us assume that this commutation relation
holds. By the WAY theorem [44, 45, 46], it follows that we may perform an
ideal measurement of $Z_{\\!{\,{\mathcal{A}}}}$ by a unitary coupling $V$ with
an apparatus ${\mathcal{B}}$, followed by an ideal measurement of this
apparatus by $Z_{\\!{\,{\mathcal{B}}}}$, such that both $V$ and
$Z_{\\!{\,{\mathcal{B}}}}$ commute with
$H_{\\!{\,{\mathcal{A}}}}(\tau)+H_{\\!{\,{\mathcal{B}}}}(\tau)$. If these
conditions, together with
$H_{\\!{\,{\mathcal{B}}}}(\tau)=H_{\\!{\,{\mathcal{B}}}}(0)$, are satisfied,
then Eq. (D) can be shown to reduce to

$\displaystyle\Delta{\mathcal{E}}_{\rho}^{{\mathcal{M}}^{\prime}}(x)$
$\displaystyle=\frac{\mathrm{tr}[V^{\dagger}P_{\\!{\,{\mathcal{B}}}}^{x}V(H_{\\!{\,{\mathcal{S}}}}(\tau)+H_{\\!{\,{\mathcal{A}}}}(\tau))U(\rho\otimes\xi_{\\!{\,{\mathcal{A}}}})U^{\dagger}\otimes\xi_{\\!{\,{\mathcal{B}}}}]}{p_{\rho}^{M}(x)}$
$\displaystyle\,\,-\frac{\mathrm{Re}\left(\mathrm{tr}[V^{\dagger}P_{\\!{\,{\mathcal{B}}}}^{x}VU(H_{\\!{\,{\mathcal{S}}}}(0)+H_{\\!{\,{\mathcal{A}}}}(0))(\rho\otimes\xi_{\\!{\,{\mathcal{A}}}})U^{\dagger}\otimes\xi_{\\!{\,{\mathcal{B}}}}]\right)}{p_{\rho}^{M}(x)},$
$\displaystyle+\frac{\mathrm{tr}[V^{\dagger}P_{\\!{\,{\mathcal{B}}}}^{x}VU(\rho\otimes\xi_{\\!{\,{\mathcal{A}}}})U^{\dagger}\otimes(H_{\\!{\,{\mathcal{B}}}}(\tau)-H_{\\!{\,{\mathcal{B}}}}(0))\xi_{\\!{\,{\mathcal{B}}}}]}{p_{\rho}^{M}(x)}$
$\displaystyle=\frac{\mathrm{tr}[P_{\\!{\,{\mathcal{A}}}}^{x}(H_{\\!{\,{\mathcal{S}}}}(\tau)+H_{\\!{\,{\mathcal{A}}}}(\tau))U(\rho\otimes\xi_{\\!{\,{\mathcal{A}}}})U^{\dagger}]}{p_{\rho}^{M}(x)}$
$\displaystyle\,\,-\frac{\mathrm{Re}\left(\mathrm{tr}[P_{\\!{\,{\mathcal{A}}}}^{x}U(H_{\\!{\,{\mathcal{S}}}}(0)+H_{\\!{\,{\mathcal{A}}}}(0))(\rho\otimes\xi_{\\!{\,{\mathcal{A}}}})U^{\dagger}]\right)}{p_{\rho}^{M}(x)}=\Delta{\mathcal{E}}_{\rho}^{\mathcal{M}}(x)$
(40)

for all $\rho$. In the last line, we have used the fact that
$\mathrm{tr}[V^{\dagger}P_{\\!{\,{\mathcal{B}}}}^{x}V(O_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}\otimes\xi_{\\!{\,{\mathcal{B}}}})]=\mathrm{tr}[P_{\\!{\,{\mathcal{A}}}}^{x}O_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}]$
by construction. Therefore, if $Z_{\\!{\,{\mathcal{A}}}}$ commutes with
$H_{\\!{\,{\mathcal{A}}}}(\tau)$, then it is possible to extend the
measurement model while not changing the total conditional increase in energy
due to measurement.

To show that $Z_{\\!{\,{\mathcal{A}}}}$ commuting with
$H_{\\!{\,{\mathcal{A}}}}(\tau)$ is the only possibility for
$\Delta{\mathcal{E}}_{\rho}^{{\mathcal{M}}^{\prime}}(x)=\Delta{\mathcal{E}}_{\rho}^{\mathcal{M}}(x)$
to hold for all $\rho$, let us look at a counter example. By the WAY theorem,
if $Z_{\\!{\,{\mathcal{A}}}}$ does not commute with
$H_{\\!{\,{\mathcal{A}}}}(\tau)$, then an ideal measurement of this observable
precludes the possibility that $V$ commutes with $H(\tau)$. As such, even if
we choose $Z_{\\!{\,{\mathcal{B}}}}$ to commute with $H(\tau)$, it will
generally not be possible to reduce Eq. (D) to Eq. (4). In such cases, the
energy change of ${\mathcal{S}}+{\mathcal{A}}$ cannot account for the total
energy change due to measurement.

##  Appendix E Model for a sequence of measurements on a two-level system

Let us consider a two-level system ${\mathcal{S}}$ with Hamiltonian
$H_{\\!{\,{\mathcal{S}}}}=\frac{\hbar\omega}{2}(P_{\\!{\,{\mathcal{S}}}}[{e}]-P_{\\!{\,{\mathcal{S}}}}[{g}])$.
Let the system interact sequentially with two apparatus systems
${\mathcal{A}}$ and ${\mathcal{B}}$, with Hilbert spaces
${\mathcal{H}}_{\\!{\,{\mathcal{A}}}}\simeq\mathds{C}^{2}$ and
${\mathcal{H}}_{\\!{\,{\mathcal{B}}}}\simeq\mathds{C}^{4}$, and Hamiltonians
$H_{\\!{\,{\mathcal{A}}}}=\mathds{1}_{\\!{\,{\mathcal{A}}}}$ and
$H_{\\!{\,{\mathcal{B}}}}=\hbar\omega\sum_{n=0}^{3}P_{\\!{\,{\mathcal{B}}}}[n]$,
respectively. Defining the angle-dependent states
$|{\theta,\pm}\rangle:=\pm\cos(\theta/2)|{g/e}\rangle+\sin(\theta/2)|{e/g}\rangle$
for the two-level system, let us define the two premeasurement unitary
operators

$\displaystyle
U_{{\mathcal{S}}+{\mathcal{A}}}:=|{\theta_{2},\pm}\rangle\otimes|{\phi}\rangle\mapsto|{\theta_{2},\pm}\rangle\otimes|{\phi_{\pm}}\rangle,$
(41)

and

$\displaystyle
U_{{\mathcal{S}}+{\mathcal{B}}}:=\begin{cases}|{g}\rangle\otimes|{1}\rangle\mapsto|{e}\rangle\otimes|{0}\rangle,\\\
|{e}\rangle\otimes|{1}\rangle\mapsto|{e}\rangle\otimes|{1}\rangle,\\\
|{g}\rangle\otimes|{2}\rangle\mapsto|{g}\rangle\otimes|{2}\rangle,\\\
|{e}\rangle\otimes|{2}\rangle\mapsto|{g}\rangle\otimes|{3}\rangle.\end{cases}$
(42)

The full premeasurement unitary is then given as
$U=U_{{\mathcal{S}}+{\mathcal{B}}}U_{{\mathcal{S}}+{\mathcal{A}}}$. Let the
systems ${\mathcal{A}}$ and ${\mathcal{B}}$ be initially prepared in states
$\xi_{\\!{\,{\mathcal{A}}}}=P_{\\!{\,{\mathcal{A}}}}[{\phi}]$ and
$\xi_{\\!{\,{\mathcal{B}}}}=qP_{\\!{\,{\mathcal{B}}}}[1]+(1-q)P_{\\!{\,{\mathcal{B}}}}[2]$,
respectively. Finally, let the apparatus observables be
$Z_{\\!{\,{\mathcal{A}}}}=P_{\\!{\,{\mathcal{A}}}}[{\phi_{+}}]-P_{\\!{\,{\mathcal{A}}}}[{\phi_{-}}]$
and
$Z_{\\!{\,{\mathcal{B}}}}=eP_{\\!{\,{\mathcal{B}}}}^{e}+gP_{\\!{\,{\mathcal{B}}}}^{g}$,
where
$P_{\\!{\,{\mathcal{B}}}}^{e}=P_{\\!{\,{\mathcal{B}}}}[0]+P_{\\!{\,{\mathcal{B}}}}[1]$
and
$P_{\\!{\,{\mathcal{B}}}}^{g}=P_{\\!{\,{\mathcal{B}}}}[2]+P_{\\!{\,{\mathcal{B}}}}[3]$.

This model defines the POVM $M_{m,n}$, where
$M_{\pm,e}:=qP_{\\!{\,{\mathcal{S}}}}[{\theta_{2},\pm}]$ and
$M_{\pm,g}:=(1-q)P_{\\!{\,{\mathcal{S}}}}[{\theta_{2},\pm}]$, with the post-
measurement states of ${\mathcal{S}}$ being given as
$\rho(\pm,e)=P_{\\!{\,{\mathcal{S}}}}[{e}]$ and
$\rho(\pm,g)=P_{\\!{\,{\mathcal{S}}}}[{g}]$.

By Eq. (4), the conditional change in energy of ${\mathcal{S}}$ is given as

$\displaystyle\Delta E_{\rho}^{\mathcal{M}}(\pm,e/g)$
$\displaystyle:=\frac{\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}P_{\\!{\,{\mathcal{A}}}}[{\pm}]P_{\\!{\,{\mathcal{B}}}}^{e/g}U(\rho\otimes\xi_{\\!{\,{\mathcal{A}}}}\otimes\xi_{\\!{\,{\mathcal{B}}}})U^{\dagger}]}{p_{\rho}^{M}(\pm,e/g)}$
$\displaystyle-\frac{\mathrm{Re}\left(\mathrm{tr}[P_{\\!{\,{\mathcal{A}}}}[{\pm}]P_{\\!{\,{\mathcal{B}}}}^{e/g}U(H_{\\!{\,{\mathcal{S}}}}\rho\otimes\xi_{\\!{\,{\mathcal{A}}}}\otimes\xi_{\\!{\,{\mathcal{B}}}})U^{\dagger}]\right)}{p_{\rho}^{M}(\pm,e/g)},$
(43)

and similarly the work is given by Eq. (4) as

$\displaystyle{\mathcal{W}}_{\rho}^{\mathcal{M}}(\pm,e/g)$
$\displaystyle:=\frac{\mathrm{tr}[HP_{\\!{\,{\mathcal{A}}}}[{\pm}]P_{\\!{\,{\mathcal{B}}}}^{e/g}U(\rho\otimes\xi_{\\!{\,{\mathcal{A}}}}\otimes\xi_{\\!{\,{\mathcal{B}}}})U^{\dagger}]}{p_{\rho}^{M}(\pm,e/g)}$
$\displaystyle-\frac{\mathrm{Re}\left(\mathrm{tr}[P_{\\!{\,{\mathcal{A}}}}[{\pm}]P_{\\!{\,{\mathcal{B}}}}^{e/g}U(H\rho\otimes\xi_{\\!{\,{\mathcal{A}}}}\otimes\xi_{\\!{\,{\mathcal{B}}}})U^{\dagger}]\right)}{p_{\rho}^{M}(\pm,e/g)},$
(44)

where
$H=H_{\\!{\,{\mathcal{S}}}}+H_{\\!{\,{\mathcal{A}}}}+H_{\\!{\,{\mathcal{B}}}}$
is the total Hamiltonian. It is simple to verify that when $\theta_{2}=0$,
then $U$ commutes with $H$, and so the work values for all four outcomes will
vanish. Fig. 2 shows the conditional energy change and work statistics for
this measurement model, when the initial system state is chosen as
$\rho=P_{\\!{\,{\mathcal{S}}}}[{\theta_{1},+}]$, with $\theta_{1}=\pi/2$.

##  Appendix F Non-recoverable work due to measurement

Recall that at the end of the measurement process, the average state of the
compound system ${\mathcal{S}}+{\mathcal{A}}$ is
$\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}$ defined in Eq. (2), while the
average state of ${\mathcal{S}}$ is
$\rho_{\tau}:=\mathrm{tr}_{\\!{\,{\mathcal{A}}}}[\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}]\equiv\mathrm{tr}_{\\!{\,{\mathcal{A}}}}[U(\rho\otimes\xi)U^{\dagger}]\equiv\sum_{x\in{\mathcal{X}}}{\mathcal{I}}_{x}^{\mathcal{M}}(\rho)$,
and the average state of ${\mathcal{A}}$ is
$\xi_{\tau}:=\mathrm{tr}_{\\!{\,{\mathcal{S}}}}[\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}]\equiv\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)\xi(x)$.
Moreover, the average state of ${\mathcal{A}}$ after premeasurement is
$\xi^{\prime}:=\mathrm{tr}_{\\!{\,{\mathcal{S}}}}[U(\rho\otimes\xi)U^{\dagger}]$.
Using the fact that
$\sum_{x\in{\mathcal{X}}}P_{\\!{\,{\mathcal{A}}}}^{x}=\mathds{1}_{\\!{\,{\mathcal{A}}}}$,
then by Eq. (4) the average work, over all measurement outcomes, can be
expressed as

$\displaystyle\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle$
$\displaystyle:=\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x){\mathcal{W}}_{\rho}^{\mathcal{M}}(x),$
$\displaystyle=\mathrm{tr}[(H_{\\!{\,{\mathcal{S}}}}(\tau)+H_{\\!{\,{\mathcal{A}}}}(\tau))U(\rho\otimes\xi)U^{\dagger}]$
$\displaystyle\qquad-\mathrm{tr}[(H_{\\!{\,{\mathcal{S}}}}(0)+H_{\\!{\,{\mathcal{A}}}}(0))(\rho\otimes\xi)],$
$\displaystyle=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)\rho_{\tau}]-\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(0)\rho]+\mathrm{tr}[H_{\\!{\,{\mathcal{A}}}}(\tau)\xi^{\prime}]-\mathrm{tr}[H_{\\!{\,{\mathcal{A}}}}(0)\xi],$
$\displaystyle=\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(\tau)\rho_{\tau}]-\mathrm{tr}[H_{\\!{\,{\mathcal{S}}}}(0)\rho]+\mathrm{tr}[H_{\\!{\,{\mathcal{A}}}}(\tau)\xi_{\tau}]-\mathrm{tr}[H_{\\!{\,{\mathcal{A}}}}(0)\xi].$
(45)

In the last line, we have used the fact that $Z_{\\!{\,{\mathcal{A}}}}$
commutes with $H_{\\!{\,{\mathcal{A}}}}(\tau)$ to infer that $\xi^{\prime}$
and $\xi_{\tau}$ have the same expected energies.

The free energy of a quantum state $\rho$, with respect to the Hamiltonian $H$
and temperature $T$, is defined as

$\displaystyle F(\rho,H,T):=\mathrm{tr}[H\rho]-k_{B}T\,S(\rho),$ (46)

where $k_{B}$ is Boltzmann’s constant and
$S(\rho):=-\mathrm{tr}[\rho\,\mathrm{ln}\left({\rho}\right)]$ is the von
Neumann entropy of $\rho$. Moreover, we note that since $\xi_{\tau}$ is a
mixture of orthogonal states $\xi(x)$, it follows that
$S(\xi_{\tau})=\mathscr{H}+\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)S(\xi(x))$,
where
$\mathscr{H}:=-\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)\,\mathrm{ln}\left({p_{\rho}^{M}(x)}\right)$
is the Shannon entropy of the measurement probabilities. By using Eq. (46),
and the aforementioned relation, we can restate Eq. (F) as

$\displaystyle\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle$
$\displaystyle=\Delta F_{\\!{\,{\mathcal{S}}}}+\Delta
F_{\\!{\,{\mathcal{A}}}}+k_{B}T\big{(}S(\rho_{\tau})+S(\xi_{\tau})-S(\rho)-S(\xi)\big{)}$
$\displaystyle=\Delta F_{\\!{\,{\mathcal{S}}}}+\Delta
F_{\\!{\,{\mathcal{A}}}}+k_{B}T\big{(}I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}+S(\xi_{\tau})-S(\xi^{\prime})\big{)},$
$\displaystyle=\Delta F_{\\!{\,{\mathcal{S}}}}+\Delta
F_{\\!{\,{\mathcal{A}}}}+k_{B}T\big{(}I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}+\mathscr{H}-\mathscr{X}_{\\!{\,{\mathcal{A}}}}\big{)}.$
(47)

Here $\Delta
F_{\\!{\,{\mathcal{S}}}}:=F(\rho_{\tau},H_{\\!{\,{\mathcal{S}}}}(\tau),T)-F(\rho,H_{\\!{\,{\mathcal{S}}}}(0),T)$
and $\Delta
F_{\\!{\,{\mathcal{A}}}}:=F(\xi_{\tau},H_{\\!{\,{\mathcal{A}}}}(\tau),T)-F(\xi,H_{\\!{\,{\mathcal{A}}}}(0),T)$
are the increase in free energy of ${\mathcal{S}}$ and ${\mathcal{A}}$,
respectively;
$I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}:=S(\rho_{\tau})+S(\xi^{\prime})-S(U(\rho\otimes\xi)U^{\dagger})$
is the quantum mutual information between ${\mathcal{S}}$ and ${\mathcal{A}}$
after the premeasurement unitary evolution; and
$\mathscr{X}_{\\!{\,{\mathcal{A}}}}:=S(\xi^{\prime})-\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)S(\xi(x))$
is the Holevo information of the apparatus with respect to the ideal
measurement of $Z_{\\!{\,{\mathcal{A}}}}$ and state $\xi^{\prime}$, which
obeys the inequality
$\mathscr{H}\geqslant\mathscr{X}_{\\!{\,{\mathcal{A}}}}\geqslant 0$ [50, 51].
Alternatively, the average work can be expressed as

$\displaystyle\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle$
$\displaystyle=\Delta
F_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}+k_{B}T\big{(}S(\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}})-S(\rho\otimes\xi)\big{)}$
$\displaystyle=\Delta
F_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}+k_{B}T\big{(}I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}-I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}^{\prime}+\mathscr{H}-\mathscr{X}_{\\!{\,{\mathcal{A}}}}\big{)},$
(48)

where $\Delta
F_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}:=F(\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}},H(\tau),T)-F(\rho\otimes\xi,H(0),T)$
is the increase in free energy of the compound system, where
$H(t)=H_{\\!{\,{\mathcal{S}}}}(t)+H_{\\!{\,{\mathcal{A}}}}(t)$ for $t=0,\tau$,
and
$I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}^{\prime}:=S(\rho_{\tau})+S(\xi_{\tau})-S(\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}})$
is the mutual information between ${\mathcal{S}}$ and ${\mathcal{A}}$ at the
end of the measurement process.

Returning the Hamiltonian of the compound system to
$H_{\\!{\,{\mathcal{S}}}}(0)+H_{\\!{\,{\mathcal{A}}}}(0)$, while returning the
state of ${\mathcal{S}}$ and ${\mathcal{A}}$ to $\rho$ and $\xi$ respectively,
will incur a minimal work cost of $-\Delta F_{\\!{\,{\mathcal{S}}}}-\Delta
F_{\\!{\,{\mathcal{A}}}}$ and $-\Delta F_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}$
if the systems are coupled to the thermal bath individually, or collectively,
respectively. In either case, the minimal work cost is achieved in the limit
as the process is quasistatic [55, 48]. Therefore, the non-inclusive non-
recoverable work, which does not make use of the correlations between
${\mathcal{S}}$ and ${\mathcal{A}}$ during the closing of the cycle, can be
defined as

$\displaystyle{\mathcal{W}}_{\mathrm{irr}}^{\mathcal{M}}(\rho)$
$\displaystyle:=\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle-\Delta
F_{\\!{\,{\mathcal{S}}}}-\Delta F_{\\!{\,{\mathcal{A}}}},$
$\displaystyle=k_{B}T\big{(}I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}+\mathscr{H}-\mathscr{X}_{\\!{\,{\mathcal{A}}}}\big{)},$
(49)

while the inclusive non-recoverable work, which does make use of the
correlations between ${\mathcal{S}}$ and ${\mathcal{A}}$, is

$\displaystyle{\mathcal{W}}_{\mathrm{inc.irr}}^{\mathcal{M}}(\rho)$
$\displaystyle:=\langle{\mathcal{W}}_{\rho}^{\mathcal{M}}(x)\rangle-\Delta
F_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}},$
$\displaystyle=k_{B}T\big{(}S(\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}})-S(\rho\otimes\xi)\big{)}\equiv{\mathcal{W}}_{\mathrm{irr}}^{\mathcal{M}}(\rho)-k_{B}T\,I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}^{\prime}.$
(50)

We note that the non-negativity of
${\mathcal{W}}_{\mathrm{irr}}^{\mathcal{M}}(\rho)$ is guaranteed by the fact
that $I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}\geqslant 0$ and
$\mathscr{H}\geqslant\mathscr{X}_{\\!{\,{\mathcal{A}}}}\geqslant 0$, while the
non-negativity of ${\mathcal{W}}_{\mathrm{inc.irr}}^{\mathcal{M}}(\rho)$ is
guaranteed by the fact that the quantum channel that implements the
transformation
$\rho\otimes\xi\mapsto\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}$ is unital.
The non-negativity of the mutual information also implies that
${\mathcal{W}}_{\mathrm{irr}}^{\mathcal{M}}(\rho)\geqslant{\mathcal{W}}_{\mathrm{inc.irr}}^{\mathcal{M}}(\rho)$.

##  Appendix G Non-recoverable work due to projective measurements

Consider the self adjoint operator $M=\sum_{x\in{\mathcal{X}}}xM_{x}$ that
defines a projective-valued measure on ${\mathcal{H}}_{\\!{\,{\mathcal{S}}}}$.
Here, $M_{x}$ are projection operators of arbitrary rank. We wish to implement
this by the measurement model
${\mathcal{M}}=({\mathcal{H}}_{\\!{\,{\mathcal{A}}}},\xi,U,Z_{\\!{\,{\mathcal{A}}}})$,
where $\xi=\sum_{i=1}^{r}q_{i}P_{\\!{\,{\mathcal{A}}}}[{\phi_{i}}]$ (with
$0<q_{i}<1$ and $\sum_{i}q_{i}=1$) is a mixed state of rank $1\leqslant
r\leqslant\mathrm{dim}({\mathcal{H}}_{\\!{\,{\mathcal{A}}}})$. By linearity,
for each $i$,
$({\mathcal{H}}_{\\!{\,{\mathcal{A}}}},P_{\\!{\,{\mathcal{A}}}}[{\phi_{i}}],U,Z_{\\!{\,{\mathcal{A}}}})$
must also be a measurement model for $M$ [37]. Denoting the eigenstates of $M$
as $|{\psi_{x}^{\alpha}}\rangle$, with $\alpha$ denoting the degeneracy, a
general (albeit not the most general) prescription of premeasurement will be

$\displaystyle
U:|{\psi_{x}^{\alpha}}\rangle\otimes|{\phi_{i}}\rangle\mapsto|{\tilde{\psi}_{x,i}^{\alpha}}\rangle\otimes|{\phi_{x,i}}\rangle,$
(51)

where $|{\phi_{x,i}}\rangle$ is an eigenvector of $Z_{\\!{\,{\mathcal{A}}}}$
with eigenvalue $x$, while for each $i$ and $x$,
$\\{|{\tilde{\psi}_{x,i}^{\alpha}}\rangle\\}_{\alpha}$ is an orthonormal set
of vectors that need not be eigenstates of $M$. This is referred to as a
Type-4 measurement [39].

If upon observing outcome $x$ of $M$, a subsequent measurement of $M$ will
yield $x$ with certainty, the measurement of $M$ is said to be repeatable.
Given the premeasurement unitary defined in Eq. (51), the measurement will be
repeatable if
$|{\tilde{\psi}_{x,i}^{\alpha}}\rangle=V_{x,i}|{\psi_{x}^{\alpha}}\rangle$ are
eigenstates of $M$ with eigenvalue $x$. Here, $V_{x,i}$ is a unitary operator
that acts non-trivially only on the support of $M_{x}$. Such a measurement
model is referred to as a Type-3 measurement, and will implement the
instrument ${\mathcal{I}}_{x}^{\mathrm{Rep}}$ defined as:

$\displaystyle{\mathcal{I}}_{x}^{\mathrm{Rep}}(\rho)$
$\displaystyle=\sum_{i=1}^{r}q_{i}V_{x,i}{\mathcal{I}}_{x}^{\mathrm{Ideal}}(\rho)V_{x,i}^{\dagger},$
$\displaystyle{\mathcal{I}}_{x}^{\mathrm{Ideal}}(\rho)$
$\displaystyle=M_{x}\rho M_{x}.$ (52)

In the special case where, for each $i$, $V_{x,i}=\mathds{1}$, then we have
${\mathcal{I}}_{x}^{\mathrm{Rep}}={\mathcal{I}}_{x}^{\mathrm{Ideal}}$, which
is a Lüders instrument that implements an ideal (also known as a Type-2)
measurement. If $M$ is a non-degenerate observable, then the only repeatable
measurements are automatically ideal. These are the standard von Neumann
measurements, also known as Type-1.

If the measurement is repeatable, it follows that for every $i\neq j$, there
exists a pair of vectors $|{\tilde{\psi}_{x,i}^{\alpha}}\rangle$ and
$|{\tilde{\psi}_{x,j}^{\alpha^{\prime}}}\rangle$ with a non-vanishing inner
product. As unitary operators preserve the inner product, this can only be
achieved if $\langle\phi_{x,i}|\phi_{x,j}\rangle=\delta_{i,j}$. Therefore, the
cardinality of the set of orthonormal vectors

$\displaystyle\left\\{|{\phi_{x,i}}\rangle:x\in\\{1,\dots,|{\mathcal{X}}|\\},i\in\\{1,\dots,r\\}\right\\}$
(53)

must be $r\,|{\mathcal{X}}|$, where $|{\mathcal{X}}|$ is the cardinality of
the outcome set ${\mathcal{X}}$. Since this value cannot exceed the dimension
of ${\mathcal{H}}_{\\!{\,{\mathcal{A}}}}$, the rank of $\xi$ must obey the
inequality

$\displaystyle
r\leqslant\frac{\mathrm{dim}({\mathcal{H}}_{\\!{\,{\mathcal{A}}}})}{|{\mathcal{X}}|}.$
(54)

In other words, $\xi$ cannot have full rank.

Let us express the initial state of the system as
$\rho=\sum_{x,y,\alpha,\beta}c_{x,y,\alpha,\beta}|\psi_{x}^{\alpha}\rangle\langle\psi_{y}^{\beta}|$.
Therefore, the conditional states of the compound system
${\mathcal{S}}+{\mathcal{A}}$, after a repeatable measurement process, will be

$\displaystyle\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}^{\mathrm{Rep}}(x)$
$\displaystyle:=\frac{1}{p_{\rho}^{M}(x)}P_{\\!{\,{\mathcal{A}}}}^{x}U(\rho\otimes\xi)U^{\dagger}P_{\\!{\,{\mathcal{A}}}}^{x},$
$\displaystyle=\sum_{i,x,y,\alpha,\beta}\frac{q_{i}c_{x,y,\alpha,\beta}}{p_{\rho}^{M}(x)}|\tilde{\psi}_{x}^{\alpha}\rangle\langle\tilde{\psi}_{y}^{\beta}|\otimes
P_{\\!{\,{\mathcal{A}}}}^{x}|\phi_{x,i}\rangle\langle\phi_{y,i}|P_{\\!{\,{\mathcal{A}}}}^{x},$
$\displaystyle=\sum_{i,x,\alpha,\beta}\frac{q_{i}c_{x,x,\alpha,\beta}}{p_{\rho}^{M}(x)}|\tilde{\psi}_{x}^{\alpha}\rangle\langle\tilde{\psi}_{x}^{\beta}|\otimes
P_{\\!{\,{\mathcal{A}}}}[{\phi_{x,i}}],$
$\displaystyle=\sum_{i}q_{i}V_{x,i}\rho^{\mathrm{Ideal}}(x)V_{x,i}^{\dagger}\otimes
P_{\\!{\,{\mathcal{A}}}}[{\phi_{x,i}}],$ (55)

where
$\rho^{\mathrm{Ideal}}(x):={\mathcal{I}}_{x}^{\mathrm{Ideal}}(\rho)/p_{\rho}^{M}(x)$.
It is clear from this equation that the apparatus states representing outcome
$x$ will be

$\displaystyle\xi(x):=\mathrm{tr}_{\\!{\,{\mathcal{S}}}}[\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}^{\mathrm{Rep}}(x)]=\sum_{i=1}^{r}q_{i}P_{\\!{\,{\mathcal{A}}}}[{\phi_{x,i}}].$
(56)

Therefore, the von Neumann entropy of $\xi(x)$ will be equal to that of $\xi$
for all $x\in{\mathcal{X}}$. This implies that the Holevo information of the
apparatus, with respect to the state $\xi^{\prime}$ and ideal measurement of
$Z_{\\!{\,{\mathcal{A}}}}$, is

$\displaystyle\mathscr{X}_{\\!{\,{\mathcal{A}}}}$
$\displaystyle:=S(\xi^{\prime})-\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)S(\xi(x)),$
$\displaystyle=S(\xi^{\prime})-S(\xi).$ (57)

It follows that the non-inclusive non-recoverable work is, by Eq. (5), given
as

$\displaystyle{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Rep}}(\rho)$
$\displaystyle=k_{B}T\big{(}I_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}+\mathscr{H}-\mathscr{X}_{\\!{\,{\mathcal{A}}}}\big{)},$
$\displaystyle=k_{B}T\big{(}\mathscr{H}+S(\rho_{\tau}^{\mathrm{Rep}})-S(\rho)\big{)}$
$\displaystyle\quad+k_{B}T\big{(}S(\xi^{\prime})-S(\xi)-\mathscr{X}_{\\!{\,{\mathcal{A}}}}\big{)},$
$\displaystyle=k_{B}T\big{(}\mathscr{H}+S(\rho_{\tau}^{\mathrm{Rep}})-S(\rho)\big{)},$
(58)

where
$\rho^{\mathrm{Rep}}(x):={\mathcal{I}}_{x}^{\mathrm{Rep}}(\rho)/p_{\rho}^{M}(x)$
and
$\rho_{\tau}^{\mathrm{Rep}}:=\sum_{x\in{\mathcal{X}}}{\mathcal{I}}_{x}^{\mathrm{Rep}}(\rho)$.
Similarly, the inclusive non-recoverable work for repeatable measurements can
be obtained from Eq. (5) to be

$\displaystyle{\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Rep}}(\rho)$
$\displaystyle=k_{B}T\big{(}S(\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}^{\mathrm{Rep}})-S(\rho\otimes\xi)\big{)},$
$\displaystyle=k_{B}T\left(\mathscr{H}+\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)S(\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}^{\mathrm{Rep}}(x))-S(\rho)-S(\xi)\right),$
$\displaystyle=k_{B}T\left(\mathscr{H}+\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)\big{(}S(\rho^{\mathrm{Rep}}(x))+S(\xi(x))-{\mathcal{I}}_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}^{\mathrm{Rep}}(x)\big{)}-S(\rho)-S(\xi)\right),$
$\displaystyle=k_{B}T\left(\mathscr{H}+\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)\big{(}S(\rho^{\mathrm{Rep}}(x))-{\mathcal{I}}_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}^{\mathrm{Rep}}(x)\big{)}-S(\rho)\right),$
$\displaystyle=k_{B}T\big{(}S(\rho_{\tau}^{\mathrm{Ideal}})-S(\rho)\big{)},$
(59)

where
${\mathcal{I}}_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}^{\mathrm{Rep}}(x):=S(\rho^{\mathrm{Rep}}(x))+S(\xi(x))-S(\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}^{\mathrm{Rep}}(x))$
is the quantum mutual information between ${\mathcal{S}}$ and ${\mathcal{A}}$
conditional on outcome $x$, and
$\rho_{\tau}^{\mathrm{Ideal}}:=\sum_{x\in{\mathcal{X}}}{\mathcal{I}}_{x}^{\mathrm{Ideal}}(\rho)$.
To see this, first note that because the states
$P_{\\!{\,{\mathcal{A}}}}[{\phi_{x,i}}]$ are all orthogonal, the von Neumann
entropy of the conditional states in Eq. (G) will be given as

$\displaystyle
S(\varrho_{\\!{\,{\mathcal{S}}+{\mathcal{A}}}}^{\mathrm{Rep}}(x))$
$\displaystyle=S(\xi)+\sum_{i}q_{i}S(V_{x,i}\rho^{\mathrm{Ideal}}(x)V_{x,i}^{\dagger}),$
$\displaystyle=S(\xi)+S(\rho^{\mathrm{Ideal}}(x)).$ (60)

Therefore, since $S(\xi(x))=S(\xi)$, the conditional mutual information terms
will be
${\mathcal{I}}_{\\!{\,{\mathcal{S}}:{\mathcal{A}}}}^{\mathrm{Rep}}(x)=S(\rho^{\mathrm{Rep}}(x))-S(\rho^{\mathrm{Ideal}}(x))$.

Note that both ${\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Rep}}(\rho)$ and
${\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Rep}}(\rho)$ do not depend on the
apparatus specifics. However, while
${\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Rep}}(\rho)$ also depends on the
particular instrument ${\mathcal{I}}_{x}^{\mathrm{Rep}}$, the same does not
hold for ${\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Rep}}(\rho)$, as the
inclusive non-recoverable work will be the same for all repeatable
instruments. Moreover, it follows from Uhlmann’s theorem [57] that

$\displaystyle{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Rep}}(\rho)-{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Ideal}}(\rho)$
$\displaystyle=k_{B}T\,\sum_{x\in{\mathcal{X}}}p_{\rho}^{M}(x)\left[S\left(\sum_{i}q_{i}V_{x,i}\rho^{\mathrm{Ideal}}(x)V_{x,i}^{\dagger}\right)-S\left(\rho^{\mathrm{Ideal}}(x)\right)\right]\geqslant
0,$
$\displaystyle{\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Rep}}(\rho)-{\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Ideal}}(\rho)$
$\displaystyle=0$ (61)

with the equality condition in the first line being satisfied if and only if
$V_{x,i}=V_{x}$ for all $i$ and $x$.

It has recently been suggested that, by the third law of thermodynamics, the
preparation of the apparatus in a non-full rank state requires infinite
resources and, as such, ideal (or repeatable) measurements are
thermodynamically impossible [22, 56]. To account for this, we consider
measurement models where $\xi$ has full-rank, i.e.
$r=\dim({\mathcal{H}}_{\\!{\,{\mathcal{A}}}})$. We refer to such measurement
models as “noisy” projective measurements.

Although the smallest dimension permissible for the apparatus is
$\dim({\mathcal{H}}_{\\!{\,{\mathcal{A}}}})=|{\mathcal{X}}|$, wherin
$|{\phi_{x,i}}\rangle=|{\phi_{x}}\rangle$ for all $i$, we shall consider only
the case where
$\dim({\mathcal{H}}_{\\!{\,{\mathcal{A}}}})=\dim({\mathcal{H}}_{\\!{\,{\mathcal{S}}}})$.
Here, $\dim({\mathcal{H}}_{\\!{\,{\mathcal{A}}}})\geqslant|{\mathcal{X}}|$,
with equality only when $M$ is a non-degenerate observable. The simplest
premeasurement unitary which will allow for a measurement of $M$ is a SWAP
operator, followed by an appropriate local unitary on ${\mathcal{A}}$.

We immediately see that here, the mutual information terms in Eq. (5) and Eq.
(5) vanish, and so the inclusive and non-inclusive non-recoverable work will
be identical. Moreover, since $S(\xi^{\prime})=S(\rho)$, and
$S(\xi(x))=S(\rho^{\mathrm{Ideal}}(x))$, we may identify
$\mathscr{H}-\mathscr{X}_{\\!{\,{\mathcal{A}}}}=S(\rho_{\tau}^{\mathrm{Ideal}})-S(\rho)$,
thereby obtaining the non-recoverable work

$\displaystyle{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Noisy}}(\rho)$
$\displaystyle={\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Noisy}}(\rho)=k_{B}T\big{(}S(\rho_{\tau}^{\mathrm{Ideal}})-S(\rho)\big{)}.$
(62)

Comparison between Eqs. (G), (G), (G) and (62) allows us to write the
following relations:

$\displaystyle{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Rep}}(\rho)$
$\displaystyle\geqslant{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Ideal}}(\rho)\geqslant{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Noisy}}(\rho),$
$\displaystyle{\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Rep}}(\rho)$
$\displaystyle={\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Ideal}}(\rho)={\mathcal{W}}_{\mathrm{inc.irr}}^{\mathrm{Noisy}}(\rho).$
(63)

Here, the first inequality in the top line results from Eq. (G), while the
second inequality is a consequence of
${\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Ideal}}(\rho)-{\mathcal{W}}_{\mathrm{irr}}^{\mathrm{Noisy}}(\rho)=k_{B}T\,\mathscr{H}$.