# First-passage information engine

Aubin Archambault  0009-0002-3373-357X CNRS, ENS de Lyon, Laboratoire de
Physique, F-69342 Lyon, France  Caroline Crauste-Thibierge
0000-0001-5502-0445 CNRS, ENS de Lyon, Laboratoire de Physique, F-69342 Lyon,
France  Alberto Imparato  0000-0002-7053-4732 Department of Physics and
Astronomy, Aarhus University, Aarhus, Denmark  Christopher Jarzynski
0000-0002-3464-2920 Department of Chemistry and Biochemistry, Institute for
Physical Science and Technology, Department of Physics, University of
Maryland, College Park, Maryland 20742, USA  Sergio Ciliberto
0000-0002-4366-6094 CNRS, ENS de Lyon, Laboratoire de Physique, F-69342 Lyon,
France  Ludovic Bellon  0000-0002-2499-8106<EMAIL_ADDRESS>CNRS,
ENS de Lyon, Laboratoire de Physique, F-69342 Lyon, France

###### Abstract

We investigate the thermodynamic properties of an information engine that uses
feedback control to extract work from a manipulated mechanical oscillator. The
feedback is triggered by the first passage of the system across a fixed
threshold. In this setting, we derive and experimentally verify two distinct
fluctuation theorems that involve the information associated with the
feedback-controlled stochastic trajectories. Our experimental setup consists
of a cantilever submitted to an electrostatic feedback force, and our protocol
improves the thermodynamic performances of the engine by a factor of 5,
compared with previously proposed protocols.

Information plays a fundamental role in the thermodynamics of mesoscopic
systems, where the influence of thermal fluctuations cannot be ignored [1, 2,
3, 4]. The erasure of information costs energy [2, 3, 4], in accordance with
Landauer’s principle [5]. Conversely, heat can be converted into work by a
machine that uses, as fuel, information gathered through measurements,
realizing in this way a Maxwell demon [6, 7, 1]. When such an information
engine switches from one equilibrium state to another, the work performed on
the system, $w$, the information, $I$, and the free energy difference, $\Delta
F$, are related by the Sagawa-Ueda equality [8],

$\langle{e^{-w-I}}\rangle=e^{-\Delta F}\ ,$ (1)

where $\langle{\cdot}\rangle$ is an ensemble average over independent
realisations of the process. Here and throughout the paper, $w$ and $\Delta F$
are expressed in units of $k_{B}T$, where $k_{B}$ is Boltzmann’s constant and
$T$ denotes temperature. Eq. 1 combines with Jensen’s inequality [9] to give a
bound for the extracted work 111 Throughout this paper, we use $w$ to denote
the work performed on the system, hence $-w$ is the work extracted from it. :

$-\langle{w}\rangle\leq\langle{I}\rangle-\Delta F.$ (2)

Eqs. 1 and 2 were originally obtained by Sagawa and Ueda [8] for a single
feedback loop, and extended by Horowitz and Vaikuntanathan [11] to the case of
repeated discrete feedback. Several feedback protocols have been proposed in
theoretical models [12, 13, 14, 15, 16] and in experiments [17, 18, 19, 20,
21, 22, 23, 24, 25, 26] in order to demonstrate information engines, to
optimize the power they produce, and to test bounds such as Eq. 2 or stronger
fluctuation theorems such as Eq. 1.

The derivation of Eq. 1 given in Ref. 8 inherently assumes that measurements
are made with errors. Subsequently, Ashida and coworkers [16] obtained an
equality that applies to error-free measurements,

$\langle{e^{-w-I+I_{u}}}\rangle=e^{-\Delta F},$ (3)

where the _unavailable information_ , $I_{u}$, quantifies information that is
measured but unused by the protocol.

In this Letter, we develop theoretically and demonstrate experimentally an
information engine whose feedback protocol is triggered by the system’s first
passage across a threshold. That is, the position $x$ of the system is
continuously monitored by an external agent, who takes action only when $x$
first crosses a fixed location, $h$. We prove that our engine satisfies both
Eq. 3 and a new relationship between work and information:

$\langle{e^{-w+\Delta F}}\rangle=\langle{e^{I-I_{u}}}\rangle.$ (4)

We present experimental verification of these predictions in an underdamped
system, where inertial effects cannot be neglected.

In the protocol originally proposed by Sagawa and Ueda [8] (SU protocol) and
tested by Toyabe et al [17], a bead is in equilibrium in a harmonic potential
$U(x,-L)=\frac{1}{2}(x+L)^{2}$. An external agent, or “demon”, measures the
bead position, $x$. If $x>h$, where $h\geq 0$ denotes a fixed threshold, the
demon shifts the potential’s center from $-L$ to $+L$, thereby extracting an
amount of work $-w=U(x,-L)-U(x,L)=2Lx$. If instead the demon measures $x<h$
then it does nothing and $w=0$. After each measurement, and independently of
the outcome, the demon waits for a time interval $\tau$ that is much longer
than the system’s relaxation time $\tau_{r}$, allowing the bead to equilibrate
before measuring its position again. The direction of $x$ is reversed if
needed so that $-L$ is always the center of the potential at the beginning,
and the protocol is cycled. In Ref. 27 we apply this approach to an
underdamped oscillator, successfully extending beyond the overdamped realm the
results of Ref. 17, and verifying Eq. 1. This protocol is not efficient, as
many waiting intervals $\tau$ might pass before a measurement $x>h$ occurs,
but it has the advantage that the information is easily defined and the
derivation of Eq. 1 is straightforward.

[width=]continuous_protocol.pdf

Figure 1:  First-passage protocol. Initially, the demon is locked and the bead
equilibrates in the potential $U_{A}(x)=U(x,-L)=\frac{1}{2}(x+L)^{2}$ for a
time $\tau\gg\tau_{r}$. The demon is then activated and continuously monitors
the bead position $x$. As soon as $x>h$ (which might occur at the first
sampling), the potential is switched to
$U_{B}(x)=U(x,+L)=\frac{1}{2}(x-L)^{2}$, the demon is locked and the protocol
is repeated (with a symmetry $x\leftrightarrow-x$ to recover the same initial
state).

To increase the information engine’s efficiency, here we consider a protocol
in which the demon measures the bead position quasi-continuously, switching
the potential’s minimum from $-L$ to $+L$ as soon as the threshold $x=h$ is
crossed, and only then waiting for a time $\tau\gg\tau_{r}$. As illustrated in
Fig. 1, the protocol is initiated at $t=0$, with the system in equilibrium. If
$x>h$ at $t=0$, then the potential is switched, extracting a work $-w=2Lx$.
The feedback is then locked (i.e. the demon waits) for a time
$\tau\gg\tau_{r}$, allowing the system to relax to equilibrium, before
repeating the protocol. If instead at $t=0$ the measurement yields $x<h$, then
the bead position is continuously monitored until the threshold at $h$ is
reached. At that point, the potential is instantaneously switched, extracting
work $-w=2Lh$, and the feedback is locked for a time $\tau$, letting the
system relax to equilibrium. Redefining the direction of $x$, we are then
ready for the next repetition of the protocol.

We have experimentally realized this protocol using an underdamped oscillator,
as described in Ref. 27, 28, 29, 30 and in appendix A. In a nutshell, the
oscillator is a cantilever subject to thermal noise, whose position $x$ is
measured precisely with an interferometer. The standard deviation $\sigma$ of
$x$ in thermal equilibrium is used as the unit of length, and all energetic
quantities are directly expressed in units of $k_{B}T$. The position of center
of the well $\pm L$ is set by an external electrostatic force, driven by a
feedback loop following the rules of the prescribed protocol, defined in Fig.
1. The feedback response time is several orders of magnitude smaller than any
characteristic time of the oscillator and can be neglected.

The experiments are performed for a range of values of $h$ and $L$, and we
always use $\tau=5\tau_{r}$, so that after each work extraction we restart at
$t=0$ from a fresh equilibrium state. At each value of $h$ and $L$, we record
for a few minutes at a sampling time $\delta t=$0.5\text{\,}\mu\mathrm{s}$$:
the position $x$ , the state of the demon (locked or active) and the center of
the trap $\pm L$. We extract for each trigger of the demon the time
$t_{k}=k\delta t$ and the position $x(t_{k})$ at which it occurred. The
measured stochastic work is simply $w=-2Lx(t_{k})$, and we record the values
of $w$ and $k$ to evaluate their statistics.

As an example, we plot in Fig. 2 the probability distribution function (pdf)
of the extracted work $-w$ during an experiment performed at $L=0.6$ and
$h=0.25$. The pdf can be decomposed into two contributions by conditioning on
the value of $k$. The prominent peak at $w_{0}=2Lh$ corresponds to $k>0$: in
such a case $x(t_{k-1})\leq h<x(t_{k})$ with the system barely moving during
the tiny sampling time $\delta t=t_{k}-t_{k-1}$, so $-w=2Lx(t_{k})\simeq
2Lh\equiv w_{0}$. In contrast, the tail at $-w>w_{0}$ represents all
trajectories with $k=0$ starting at $x(t_{0})>h$, which triggered the demon at
the very first reading. This tail can be easily computed taking into account
that $w=-2Lx(t_{0})$ and that the distribution of $x(t_{0})$ is the
equilibrium Boltzmann distribution, i.e.
$\pi_{-L}(x)=\exp[-\frac{1}{2}(x+L)^{2}]/\sqrt{2\pi}$. This prediction (full
expression Eq. 30 in the appendix) perfectly matches the measurement.

pdfwork.pdf

Figure 2:  Probability distribution function (pdf) of extracted work, $P(-w)$,
for $L=0.9$ and $h=0.3$. For each event, the number of readings $k$ performed
before the switching is measured. The full pdf consists of a peak near
$w_{0}=2Lh$ from events $k>0$ ($+$) and a tail from events $k=0$ ($\times$),
in line with theoretical expectations. The finite sampling time $\delta t$
produces the spread around $w_{0}$ (rather than a Dirac delta distribution,
$\filledmedtriangleup$) shown in the inset, as the trigger does not occur
exactly at $x(t_{k})=h$.

meanwandP.pdf

Figure 3: (a) Extracted mean work $\langle{-w}\rangle$ as a function of $L$
and $h$: experimental results (open symbols, statistical uncertainty smaller
than the symbol size), theoretical prediction (solid lines), mean information
upper bound $\langle{\Delta I}\rangle$ (dashed lines), and mean information
for the SU protocol $\Delta I_{\mathrm{SU}}$ (dotted lines). The mean work of
our continuous sampling demon is always greater than the upper bound of the SU
protocol (saturated in this experiment [27]). The bound
$\langle{-w}\rangle\leq\langle{\Delta I}\rangle$ is verified and nearly
saturated in all the measurements: the efficiency
$\langle{-w}\rangle/\langle{\Delta I}\rangle$ tends to 1 when $L$ and $h$ are
large. In that limit, $\lambda$ is rarely switched at the first measurement,
thus $-w=\Delta I=w_{0}$ for most realizations. (b) Extracted mean power as a
function of $L$ and $h$. The protocol explored here always performs better
than the SU one, for equal equilibration time $\tau=5\tau_{r}$. The maximum
power is reached for $L\sim h\sim 1$.

For given parameter values $L$ and $h$, we compute the mean work per trigger
$\langle{-w}\rangle$ and the mean power $\langle{\mathcal{P}}\rangle$ the
demon extracts during operation. The results are plotted in Fig. 3, where we
report experimental results and the expected value for $\langle{-w}\rangle$
from the theoretical description of the work pdf (see Eq. 31 in the appendix).
As a rule of thumb, we see that $\langle{-w}\rangle$ increases with $h$ and
$L$ in the range explored (except for $h=0$): the extracted work is always
greater than $w_{0}=2Lh$. The power $\langle{\mathcal{P}}\rangle$ presents a
maximum value when exploring the ($L$,$h$) parameter space: high power
requires large but frequent work extraction, the latter criterion failing for
large values of $L$ and $h$. Interestingly, we see that our scenario increases
the extracted power of the information engine by a factor up to 5 at least
with respect to the SU protocol by choosing the right values of $L$ and $h$,
both close to 1. On average, the time required to perform $N$ switches of the
potential is less than in the SU protocol, thus increasing the power of this
information engine.

The transformation performed is simply a translation of a harmonic well, thus
$\Delta F=0$ and Eq. 2 becomes $-\langle{w}\rangle\leq\langle{I}\rangle$. For
a given set of parameters $\tau,L,$ and $h$, our extraction of work is above
the information $\langle{\Delta I}\rangle_{\mathrm{SU}}$ that can be computed
(Eq. 34 in the appendix) for the same parameters with the SU protocol [16,
27]. Although the protocols look very similar, a naive extension of this SU
information to the current approach fails. The difficulty comes from the
continuous sampling performed when $x(t_{0})<h$. In such a case, there are
strong correlations between the different samples and information depends on
the whole set of measurements rather than each individual reading. Therefore,
a different theoretical approach has to be developed, and we use a full
stochastic trajectory analysis for a system starting at equilibrium in a
generic potential.

We thus consider a stochastic system evolving in a potential $U_{\lambda}(x)$,
where $x$ is the microscopic coordinate and $\lambda$ is a parameter that is
manipulated by the demon (i.e. the feedback control). In the following
$\lambda$ takes two values: $\lambda=A,B$. While our analysis involves a 1D
system, more generally $x$ can be multidimensional. Starting with the system
at equilibrium in the potential $U_{A}(x)$, the position of the bead
$x_{0},x_{1}\ldots x_{M}$ is measured at discrete times $t_{n}=n\times\delta
t$, with $\delta t$ arbitrarily small. The measured position is compared at
each time step with a threshold $h$. Immediately after the first instant
$t_{k}$ that $x_{k}>h$, the parameter $\lambda$ is switched from $A$ to $B$
and is then kept at $B$ independently of the following measurements. The final
measurement is made at time $t_{M}$. If all $x_{0},x_{2}\ldots x_{M-1}<h$ then
$\lambda$ is switched from $A$ to $B$ at $t=t_{M}$, regardless of the value of
$x_{M-1}$.

This process produces two outputs: a protocol
$\Lambda=(\lambda_{0},\lambda_{1},\ldots,\lambda_{M})$ and a trajectory
$X=(x_{0},x_{1},\ldots,x_{M})$. Here, $\lambda_{0}=A$ and $\lambda_{n>0}$ is
the value of $\lambda$ during the interval $(t_{n-1},t_{n}]$. The protocol has
the form:

$\Lambda=(\underbrace{A,A,\ldots,A}_{k+1},\underbrace{B,\ldots,B}_{M-k})=\Lambda_{k},$
(5)

with a sequence of $k+1$ initial $A$’s followed by $(M-k)$ $B$’s, determined
by the first time $t_{k}$ where $x_{k}>h$. We group the trajectories into sets
$\Omega_{k}$ containing all the trajectories crossing the threshold $h$ for
the first time at time $t_{k}$:

$\Omega_{k}=\\{X|\min\\{n|x_{n}>h\\}=k\\}.$ (6)

We will use the integer variable $k$, which labels the protocol,
$\Lambda_{k}$, to define an information, $I$, and an unavailable information,
$I_{u}$, that impose a constraint on the extracted work in a way similar to
Ref. 16.

Let $P_{\text{FB}}(X,\Lambda_{k})$ denotes the joint probability to obtain
trajectory $X$ and protocol $\Lambda_{k}$ when performing the process
described above. By construction,

$P_{\text{FB}}(X,\Lambda_{k})=0,\ \text{if}\ X\notin\Omega_{k}.$ (7)

Let $P_{k}$ be the probability of obtaining the protocol $\Lambda_{k}$:

$P_{k}=\sum_{X}P_{\text{FB}}(X,\Lambda_{k})=\sum_{X\in\Omega_{k}}P_{\text{FB}}(X,\Lambda_{k}).$
(8)

Thus,

$P_{\text{FB}}(X|\Lambda_{k})=P_{\text{FB}}(X,\Lambda_{k})/P_{k}$ (9)

is the probability to obtain the trajectory $X$, conditioned on obtaining the
protocol $\Lambda_{k}$.

Now consider a different scenario, in which we first choose a protocol
$\Lambda_{k}$ and then apply it without feedback. Let
$P_{\text{no}}(X|\Lambda_{k})$ denote the probability of obtaining a
trajectory $X$ under this no-feedback protocol $\Lambda_{k}$. It follows that

$P_{\text{FB}}(X,\Lambda_{k})=P_{\text{no}}(X|\Lambda_{k})\ \text{if}\ \
X\in\Omega_{k}.$ (10)

Explicitly, we have

$\displaystyle P_{\text{no}}(X|\Lambda_{k})$ $\displaystyle=$
$\displaystyle\pi_{A}(x_{0})\cdot p_{A}(x_{1}|x_{0})\cdots$ (11)
$\displaystyle p_{A}(x_{k}|x_{k-1})\cdot p_{B}(x_{k+1}|x_{k})$
$\displaystyle\cdots p_{B}(x_{M}|x_{M-1}),$

where $\pi_{\lambda}$ is the equilibrium distribution in potential
$U_{\lambda}$ and $p_{\lambda}(x^{\prime}|x)$ is the transition probability
from $x$ to $x^{\prime}$, in time $\delta t$, with control parameter
$\lambda$. Eq. (11) holds both when $X\in\Omega_{k}$ and when
$X\not\in\Omega_{k}$. If $X\in\Omega_{k}$, then $P_{\text{FB}}(X,\Lambda_{k})$
has the same expression as the rhs of Eq. (11), which establishes Eq. (10).

Let $q(l,k)$ denote the probability to obtain a trajectory in $\Omega_{l}$
when imposing a protocol $\Lambda_{k}$ without feedback:

$q(l,k)=\sum_{X\in\Omega_{l}}P_{\text{no}}(X|\Lambda_{k}).$ (12)

Defining

$Q_{k}=q(k,k),$ (13)

we have by summing Eq. 10 over all $X\in\Omega_{k}$,

$P_{k}=Q_{k}.$ (14)

Given a protocol $\Lambda_{k}=(\lambda_{0},\ldots,\lambda_{M})$, let
$\Lambda_{k}^{\dagger}=(\lambda_{M},\ldots,\lambda_{0})$ denote the reverse
protocol and $P^{R}_{\text{no}}(X^{\dagger}|\Lambda_{k}^{\dagger})$ the
probability of observing a trajectory $X^{\dagger}$, which is the
time–reversed image of $X$, when applying protocol $\Lambda_{k}^{\dagger}$
without feedback. We define $Q_{k}^{R}$ similarly to $Q_{k}$:

$Q_{k}^{R}=q^{R}(k,k),\text{ with
}q^{R}(l,k)=\sum_{X\in\Omega_{l}}P^{R}_{\text{no}}(X^{\dagger}|\Lambda_{k}^{\dagger}).$
(15)

$Q_{k}$ is the probability that a trajectory generated using protocol
$\Lambda_{k}$, without FB, first crosses the threshold after $k$ steps.
$Q_{k}^{R}$ is the probability that the time-reverse of a trajectory generated
using protocol $\Lambda_{k}^{R}$, without FB, first crosses the threshold
after $k$ steps. From these definitions, there is no a priori reason to expect
that either $Q_{k}$ or $Q_{k}^{R}$ sums to unity, upon summing over $k$, since
each term in the sum is defined with respect to a different protocol. We have
shown that $Q_{k}$ does in fact sum to unity (Eq. 14), but the same is not
true of $Q_{k}^{R}$.

From Crooks’s theorem [31] we have:

$P_{\text{no}}(X|\Lambda_{k})=P^{R}_{\text{no}}(X^{\dagger}|\Lambda_{k}^{\dagger})e^{w(X,\Lambda_{k})-\Delta
F}.$ (16)

where $w(X,\Lambda)$ is the work performed on the system along a trajectory
$X$ under protocol $\Lambda$, and $\Delta F$ is the free energy difference
between potentials $U_{A}$ and $U_{B}$.

We now use $Q_{k}$ and $Q^{R}_{k}$ (Eqs. 13, 15) to define the information,
$I$, and its unused part, $I_{u}$:

$I=-\ln Q_{k},\quad I_{u}=-\ln Q_{k}^{R}.$ (17)

These definitions are equivalent to Eqs. (3) and (5) of Ref. 16. Defining the
protocol information as

$\Delta I=I-I_{u}=-\ln\left(\frac{Q_{k}}{Q_{k}^{R}}\right),$ (18)

we derive Eq. 3:

$\displaystyle\langle{e^{-w+\Delta F-\Delta I}}\rangle_{FB}$
$\displaystyle=\sum_{X,\Lambda_{k}}P_{\text{FB}}(X,\Lambda_{k})e^{-w+\Delta
F}\frac{Q_{k}}{Q_{k}^{R}}$
$\displaystyle=\sum_{\Lambda_{k}}\frac{Q_{k}}{Q_{k}^{R}}\sum_{X\in\Omega_{k}}P_{\text{no}}(X|\Lambda_{k})e^{-w+\Delta
F}$
$\displaystyle=\sum_{\Lambda_{k}}\frac{Q_{k}}{Q_{k}^{R}}\sum_{X\in\Omega_{k}}P^{R}_{\text{no}}(X^{\dagger}|\Lambda_{k}^{\dagger})$
$\displaystyle=\sum_{\Lambda_{k}}Q_{k}=\sum_{\Lambda_{k}}P_{k}=1.$ (19)

This result, first obtained by Ashida and coworkers (Eq. 12 of Ref. 16),
applies to error-free measurements. The analogous result for measurements with
errors is the Sagawa-Ueda equality, Eq. 1 above (Eq. 4 of Ref. 8).

We additionally have, for each protocol $\Lambda_{k}$,

$\displaystyle\langle{e^{-w+\Delta F}}\rangle_{FB,k}$
$\displaystyle=\sum_{X}P_{\text{FB}}(X|\Lambda_{k})e^{-w+\Delta F}$
$\displaystyle=\sum_{X\in\Omega_{k}}\frac{P_{\text{FB}}(X,\Lambda_{k})}{P_{k}}e^{-w+\Delta
F}$
$\displaystyle=\frac{1}{P_{k}}\sum_{X\in\Omega_{k}}P_{\text{no}}(X|\Lambda_{k})e^{-w+\Delta
F}$
$\displaystyle=\frac{1}{Q_{k}}\sum_{X\in\Omega_{k}}P^{R}_{\text{no}}(X^{\dagger}|\Lambda_{k}^{\dagger})=\frac{Q^{R}_{k}}{Q_{k}}=e^{\Delta
I}.$ (20)

Averaging Eq. 20 over all values of $k$, we obtain our Eq. 4:

$\displaystyle\langle{e^{-w+\Delta F}}\rangle_{FB}$
$\displaystyle=\sum_{k}P_{k}\langle{e^{-w+\Delta F}}\rangle_{FB,k}$
$\displaystyle=\sum_{k}P_{k}e^{\Delta I}=\langle{e^{\Delta I}}\rangle_{FB}.$
(21)

As with Eqs. 19, this result applies to error-free measurements. Combining
Eqs. 14 and 18 with the second line of Eq. 21, we obtain

$\langle{e^{-w+\Delta F}}\rangle_{FB}=\sum_{k}Q_{k}^{R},$ (22)

confirming our earlier statement that $Q_{k}^{R}$ (unlike $Q_{k}$) does not
generally sum to unity. Eq. 6 of Ref. 8 is the analogue of Eq. 22 for
measurements with errors.

We now return to the harmonic potential with the feedback control depicted in
Fig. 1, with $\Delta F=0$. As intuited from the experimental data, we
distinguish the two cases $k=0$ and $k>0$. For all trajectories where $k=1$,
the first reading when the demon is active is beyond the threshold: $x_{0}>h$.
Since this first measurement occurs in equilibrium, we can compute $Q_{0}$,
$Q_{0}^{R}$ and $\Delta I$ analytically:

$\displaystyle Q_{0}$
$\displaystyle=P_{0}=P(x_{0}>h)=\int_{h}^{+\infty}\pi_{A}(x)dx$ (23)
$\displaystyle=\int_{h}^{+\infty}\frac{e^{-\frac{1}{2}(x+L)^{2}}}{\sqrt{2\pi}}dx=\frac{1}{2}\operatorname{erfc}\left(\frac{h+L}{\sqrt{2}}\right),$
(24) $\displaystyle Q_{0}^{R}$
$\displaystyle=P(X^{\dagger}\in\Omega_{0}|\Lambda_{0}^{\dagger})=\int_{h}^{+\infty}\pi_{B}(x)dx$
(25)
$\displaystyle=\int_{h}^{+\infty}\frac{e^{-\frac{1}{2}(x-L)^{2}}}{\sqrt{2\pi}}dx=\frac{1}{2}\operatorname{erfc}\left(\frac{h-L}{\sqrt{2}}\right),$
(26) $\displaystyle\Delta I_{0}$
$\displaystyle=-\ln\left(\frac{Q_{0}}{Q_{0}^{R}}\right)=-\ln\left(\frac{\operatorname{erfc}(\frac{h+L}{\sqrt{2}})}{\operatorname{erfc}(\frac{h-L}{\sqrt{2}})}\right).$
(27)

When $k>0$, the potential is switched just as the bead crosses the threshold,
$x=h$, and the extracted work is therefore $-w=w_{0}\equiv 2Lh$. Hence,
$\langle{e^{-w}}\rangle_{k}=e^{2Lh}$ for all $k>0$. Eq. 20 then immediately
implies

$\Delta I_{k}=2Lh,\ \text{for all}\ k>0.$ (28)

Despite the fact that multiple measurements of position are involved in this
protocol, the information $\Delta I$ is determined entirely from the length
$k$ of the protocol, by a binary criterium: $k=0$ or $k>0$. Using Eqs. 27 and
28, we can evaluate $e^{-w+\Delta I}$ from experimental data, and then take
the average of this quantity to test Eq. 3. Figure 4(a) shows these averages
for a range of values of $L$ and $h$, revealing agreement with the theoretical
prediction. We can also compute $\langle{e^{-w}}\rangle_{k}$ separately for
both the $k=0$ and $k>0$ cases and compare it to the prediction of Eq. 20,
again obtaining agreement as seen in Fig. 4(b). Finally, averaging over all
the data (rather than separately for $k=0$ and $k>0$), Fig. 4(b) reveals
excellent experimental verification of Eq. 4.

meanexp.pdf

Figure 4:  (a) $\langle{e^{-w-\Delta I}}\rangle$ as a function of $L$ for
different values of $h$. As predicted by Eq. 3, this average is close to $1$
for all values of $L$ and $h$. (b) $\langle{e^{-w}}\rangle$ for $k=0$
($\times$), $k>0$ ($+$) and over all $k$ ($\circ$) as a function of $L$, for
$h=0.3$, and comparison with the corresponding theoretical predictions
$\langle e^{\Delta I}\rangle$ (solid lines). Above $L=1.5$, the number of
measured values corresponding to $k=0$ fall below 100, which is insufficient
to estimate $\langle{e^{-w}}\rangle$ with good precision. Error bars in this
figure correspond to one standard deviation of the measured values divided by
the square root of the number of samples.

For an engine, the interesting quantity is the mean extracted work, upper
bounded by the mean information: $-\langle{w}\rangle\leq\langle{\Delta
I}\rangle$. Fig. 3(a) reveals that, with our first-passage protocol, the mean
information provides a tight bound on the mean extracted work.

Finally, we emphasize that our theoretical framework is broader than the
application to the current experiment. It can generally be applied to assess
the thermodynamic performances of information engines in which a demon acts on
a system with an assigned feedback protocol and where the trajectories are
experimentally accessible so that their probability with and without feedback
can be estimated.

###### Acknowledgements.

The data supporting this study will be available in an open public repository
upon acceptance of the manuscript.
This work has been partially funded by project ANR-22-CE42-0022. C.J.
acknowledges support from the Simons Foundation (award no. 681566) and from
the École Normale Supérieure de Lyon. A.I. acknowledges support from the CNRS
as an invited researcher in the ENS de Lyon.

## Appendix

##  Appendix A Experimental setup

In our experiment a $1\text{\,}\mathrm{m}\mathrm{m}$ long conductive
cantilever acts as an underdamped mechanical oscillator subject to thermal
fluctuations. Fig. 5 sketches our setup, which is similar to the one described
in Refs. 28, 29, 30. Specifically the first resonant mode of the cantilever is
used as a underdamped harmonic oscillator characterized by a stiffness
$\kappa\simeq$5\text{\times}{10}^{-3}\text{\,}\mathrm{N}\text{\,}{\mathrm{m}}^{-1}$$,
an eigenfrequency $f_{0}=$1087\text{\,}\mathrm{Hz}$$, a quality factor around
$\mathcal{Q}=7$ at atmospheric pressure, and an effective mass $m=\kappa/(2\pi
f_{0})^{2}$. The tip deflection $x$ follows the dynamics of a 1D underdamped
Brownian particle. The standard deviation of $x$ in thermal equilibrium is
$\sigma=\sqrt{k_{B}T/\kappa}\simeq$0.8\text{\,}\mathrm{nm}$$, which is used as
the length unit so that all energetic quantities are directly expressed in
units of $k_{B}T$.

The deflection of the cantilever is measured with a quadrature phase
interferometer [32]. Its outputs are sampled at
$100\text{\,}\mathrm{M}\mathrm{H}\mathrm{z}$ ($\delta
t=$10\text{\,}\mathrm{ns}$$) and processed with a field-programmable gate
array device (National Instruments NI FPGA 7975R) that computes the deflection
$x$ in real time. The device can be programmed to output a feedback voltage
$V_{FB}$ computed using $x$ and a set of rules implemented by the user. The
delay of this feedback is negligible with respect to the oscillator dynamics:
it is smaller than $1$\mathrm{\SIUnitSymbolMicro s}$$, thus three order of
magnitude smaller than the period of the oscillator $T_{0}=1/f_{0}\simeq
1$\mathrm{ms}$$.

[width=.95]setup.pdf

Figure 5:  Experimental setup. The deflection $x$ of a cantilever is measured
using an interferometer. $x$ is then used by the feedback loop to compute a
voltage $V_{FB}(x)$ that generates a force on the cantilever, shifting the
central position of the harmonic potential.

The feedback voltage $V_{FB}$ output by the FPGA is applied to the conductive
cantilever, while a constant DC voltage $V_{DC}=$90\text{\,}\mathrm{V}$$ is
applied to a plane electrode about $500\text{\,}\mu\mathrm{m}$ away. This
results in a feedback force $F_{FB}$ on the cantilever:

$F_{FB}\propto(V_{DC}-V_{FB})^{2}=(V_{DC}^{2}-2V_{DC}V_{FB}+V_{FB}^{2}).$ (29)

The term $V_{DC}^{2}$ is constant and only shifts the equilibrium position of
the oscillator. It is included by defining the origin $x=0$ to the center of
the new harmonic potential. Since the maximum output voltage $V_{FB}$ possible
for the FPGA is $1\text{\,}\mathrm{V}$, we can further simplify $F_{FB}$
noting that $V_{FB}^{2}\ll V_{DC}V_{FB}$. The resulting expression for the
force is thus $F_{FB}\propto 2V_{DC}V_{FB}$. The DC bias acts as an
amplification factor which is experimentally used to tune the sensitivity of
the cantilever to the feedback voltage.

##  Appendix B Work distribution

Work is performed when the demon is triggered by the condition $x>h$. This can
occur when the demon is initially activated, that is when the system is in
equilibrium in the potential $U_{-L}(x)=\frac{1}{2}(L+x)^{2}$ and $x>h$, or it
can occur later when the threshold is crossed, thus at $x=h$. The probability
distribution function (pdf) of $-w$ is thus

$\begin{split}P(-w)=\frac{1}{2L\sqrt{2\pi}}\exp\left[-\frac{1}{2}\left(\frac{w}{2L}-L\right)^{2}\right]\theta(-w-2Lh)\\\
+\left[1-\frac{1}{2}\operatorname{erfc}\left(\frac{L+h}{\sqrt{2}}\right)\right]\delta(w+2Lh),\end{split}$
(30)

where $\theta(-w-w_{0})$ is the Heaviside function ($0$ if $-w<w_{0}$, $1$
otherwise). An example of this pdf is plotted in Fig. 2 of the Letter for an
experiment carried out at $L=0.6$ and $h=0.25$, and it provides an excellent
match to the experimental data.

From the pdf, we can compute the mean work:

$\begin{split}\langle{-w}\rangle=L\left[2h-(h+L)\operatorname{erfc}\left(\frac{L+h}{\sqrt{2}}\right)\right]\\\
+\frac{2L^{2}}{\sqrt{2\pi}}\exp\left[-\frac{(L+h)^{2}}{2}\right]\end{split}$
(31)

The resulting prediction is plotted in Fig. 3(a) of the Letter along the
experimental data and the upper bound given by $\langle{\Delta I}\rangle$, all
in very good agreement.

##  Appendix C Mean information of the SU protocol

Following Ref. 16, we derive in Ref. 27 the following expression of the
information $\Delta I_{\mathrm{SU}}$ valid for the Sagawa-Ueda (SU) protocol:

$\begin{split}\text{if }x<h,\quad\Delta I_{\mathrm{SU}}(x)&=0\\\ \text{if
}x>h,\quad\Delta I_{\mathrm{SU}}(x)&=2Lx\end{split}$ (32)

where $x$ is the outcome of the measurement in equilibrium in the potential
$U(x,-L)$. We easily compute:

$\displaystyle\langle{\Delta I}\rangle_{\mathrm{SU}}$
$\displaystyle=\int_{h}^{\infty}2Lx\frac{1}{\sqrt{2\pi}}\exp\left[-\frac{\left(x+L\right)^{2}}{2}\right]\differential
x$ (33)
$\displaystyle=\frac{2L}{\sqrt{2\pi}}\exp\left[-\frac{\left(h+L\right)^{2}}{2}\right]-L^{2}\operatorname{erfc}\left(\frac{h+L}{\sqrt{2}}\right)$
(34)

This expression is plotted in Fig. 3 of the Letter with dotted lines.

## References

  * Leff and Rex [2002] H. Leff and A. Rex,  _Maxwell’s Demon 2: Entropy, Classical and Quantum Information, Computing_, 1st ed. (CRC Press, Baco Raton, 2002).
  * Parrondo  _et al._ [2015] J. M. R. Parrondo, J. M. Horowitz, and T. Sagawa, Thermodynamics of information, Nat. Phys. 11, 131 (2015).
  * Lutz and Ciliberto [2015] E. Lutz and S. Ciliberto, Information: From Maxwell’s demon to Landauer’s eraser, Physics Today 68, 30 (2015).
  * Ciliberto and Lutz [2018] S. Ciliberto and E. Lutz,  _Energy Limits in Computation_, edited by C. Lent, A. Orlov, W. Porod, and G. Snider (Springer, 2018) Chap. 5, pp. 155–176.
  * Landauer [1961] R. Landauer, Irreversibility and heat generation in the computing process, IBM J. Res. Dev. 5, 183 (1961).
  * Bennett [1982] C. H. Bennett, The thermodynamics of computation - a review, Int. J. Theor. Phys. 21, 905 (1982).
  * Bechhoefer [2021] J. Bechhoefer,  _Control Theory for Physicists_ (Cambridge University Press, 2021).
  * Sagawa and Ueda [2010] T. Sagawa and M. Ueda, Generalized jarzynski equality under nonequilibrium feedback control, Phys. Rev. Lett. 104, 090602 (2010).
  * Chandler [1987] D. Chandler,  _Introduction to Modern Statistical Mechanics_ (Oxford Univeresity, New York, 1987) sec. 5.5.
  * Note [1] Throughout this paper, we use $w$ to denote the work performed on the system, hence $-w$ is the work extracted from it.
  * Horowitz and Vaikuntanathan [2010] J. M. Horowitz and S. Vaikuntanathan, Nonequilibrium detailed fluctuation theorem for repeated discrete feedback, Phys. Rev. E 82, 061120 (2010).
  * Horowitz and Parrondo [2011] J. M. Horowitz and J. M. R. Parrondo, Thermodynamic reversibility in feedback processes, EPL 95, 10005 (2011).
  * Abreu and Seifert [2012] D. Abreu and U. Seifert, Thermodynamics of genuine nonequilibrium states under feedback control, Phys. Rev. Lett. 108, 030601 (2012).
  * Lahiri  _et al._ [2012] S. Lahiri, S. Rana, and A. M. Jayannavar, Fluctuation theorems in the presence of information gain and feedback, J. Phys. A: Math. Theor. 45, 065002 (2012).
  * Rosinberg and Horowitz [2016] M. L. Rosinberg and J. M. Horowitz, Continuous information flow fluctuations, EPL 116, 10007 (2016).
  * Ashida  _et al._ [2014] Y. Ashida, K. Funo, Y. Murashita, and M. Ueda, General achievable bound of extractable work under feedback control, Phys. Rev. E 90, 052125 (2014).
  * Toyabe  _et al._ [2010] S. Toyabe, T. Sagawa, M. Ueda, M. Muneyuki, and M. Sano, Experimental demonstration of information-to-energy conversion and validation of the generalized Jarzynski equality, Nat. Phys. 6, 988 (2010).
  * Koski  _et al._ [2014] J. V. Koski, V. F. Maisi, T. Sagawa, and J. P. Pekola, Experimental observation of the role of mutual information in the nonequilibrium dynamics of a Maxwell demon, Phys. Rev. Lett. 113, 030601 (2014).
  * Koski  _et al._ [2015] J. V. Koski, A. Kutvonen, I. M. Khaymovich, T. Ala-Nissila, and J. P. Pekola, On-chip maxwell’s demon as an information-powered refrigerator, Phys. Rev. Lett. 115, 260602 (2015).
  * Camati  _et al._ [2016] P. A. Camati, J. P. S. Peterson, T. B. Batalhão, K. Micadei, A. M. Souza, R. S. Sarthour, I. S. Oliveira, and R. M. Serra, Experimental rectification of entropy production by maxwell’s demon in a quantum system, Phys. Rev. Lett. 117, 240502 (2016).
  * Chida  _et al._ [2017] K. Chida, S. Desai, S. Nishiguchi, and S. Fujiwara, Power generator driven by maxwell’s demon, Nat. Commun. 8, 15301 (2017).
  * Admon  _et al._ [2018] T. Admon, S. Rahav, and Y. Roichman, Experimental realization of an information machine with tunable temporal correlations, Phys. Rev. Lett. 121, 180601 (2018).
  * Paneru  _et al._ [2018] G. Paneru, D. Y. Lee, T. Tlusty, and H. K. Pak, Lossless brownian information engine, Phys. Rev. Lett. 120, 020601 (2018).
  * Ribezzi-Crivellari and Ritort [2019] M. Ribezzi-Crivellari and F. Ritort, Large work extraction and the Landauer limit in a continuous Maxwell demon, Nat. Phys. 15, 660 (2019).
  * Taghvaei  _et al._ [2022] A. Taghvaei, O. M. Miangolarra, R. Fu, Y. Chen, and T. T. Georgiou, On the relation between information and power in stochastic thermodynamic engines, IEEE Control Syst. Lett. 6, 434 (2022).
  * Saha  _et al._ [2022] T. K. Saha, J. N. E. Lucero, J. Ehrich, D. A. Sivak, and J. Bechhoefer, Bayesian information engine that optimally exploits noisy measurements, Phys. Rev. Lett. 129, 130601 (2022).
  * [27] A. Archambault, C. Crauste-Thibierge, S. Ciliberto, and L. Bellon, Inertial effects in discrete sampling information engines, arXiv: 2311.12687 (2024).
  * Dago  _et al._ [2021] S. Dago, J. Pereda, N. Barros, S. Ciliberto, and L. Bellon, Information and Thermodynamics: Fast and Precise Approach to Landauer’s Bound in an Underdamped Micromechanical Oscillator, Phys. Rev. Lett. 126, 170601 (2021).
  * Dago  _et al._ [2022] S. Dago, J. Pereda, S. Ciliberto, and L. Bellon, Virtual double-well potential for an underdamped oscillator created by a feedback loop, J. Stat. Mech. 2022, 053209 (2022).
  * Dago  _et al._ [2024] S. Dago, N. Barros, J. Pereda, S. Ciliberto, and L. Bellon, Virtual potential created by a feedback loop: Taming the feedback demon to explore stochastic thermodynamics of underdamped systems, in  _Crossroad of Maxwell Demon_, edited by X. Bouju and C. Joachim (Springer Nature Switzerland, Cham, 2024) pp. 115–135, also arXiv: 2311.12687 (2023).
  * Crooks [1999] G. E. Crooks, Entropy production fluctuation theorem and the nonequilibrium work relation for free energy differences, Phys. Rev. E 60, 2721 (1999).
  * Paolino  _et al._ [2013] P. Paolino, F. A. Aguilar Sandoval, and L. Bellon, Quadrature phase interferometer for high resolution force spectroscopy, Rev. Sci. Instrum. 84, 095001 (2013).