Universal symmetry of optimal control at the microscale

Optimizing the energy efficiency of driving processes provides valuable insights into the underlying physics and is of crucial importance for numerous applications, from biological processes to the design of machines and robots. Knowledge of optimal driving protocols is particularly valuable at the microscale, where energy supply is often limited. Here we investigate experimentally and theoretically the paradigmatic optimization problem of moving a potential carrying a load through a fluid, in a finite time and over a given distance, in such a way that the required work is minimal. An important step towards more realistic systems is the consideration of memory effects in the surrounding fluid, which are ubiquitous in real-world applications. Therefore, our experiments were performed in viscous and viscoelastic media, which are typical environments for synthetic and biological processes on the microscale. Despite marked differences between the protocols in both fluids, we find that the optimal control protocol and the corresponding average particle trajectory always obey a time-reversal symmetry. We show that this symmetry, which surprisingly applies here to a class of processes far from thermal equilibrium, holds universally for various systems, including active, granular, and long-range correlated media in their linear regimes. The uncovered symmetry provides a rigorous and versatile criterion for optimal control that greatly facilitates the search for energy-efficient transport strategies in a wide range of systems. Using a machine learning algorithm, we demonstrate that the algorithmic exploitation of time-reversal symmetry can significantly enhance the performance of numerical optimization algorithms.

Optimizing the energy efficiency of driving processes provides valuable insights into the underlying physics and is of crucial importance for numerous applications, from biological processes to the design of machines and robots.Knowledge of optimal driving protocols is particularly valuable at the microscale, where energy supply is often limited.Here we investigate experimentally and theoretically the paradigmatic optimization problem of moving a potential carrying a load through a fluid, in a finite time and over a given distance, in such a way that the required work is minimal.An important step towards more realistic systems is the consideration of memory effects in the surrounding fluid, which are ubiquitous in real-world applications.Therefore, our experiments were performed in viscous and viscoelastic media, which are typical environments for synthetic and biological processes on the microscale.Despite marked differences between the protocols in both fluids, we find that the optimal control protocol and the corresponding average particle trajectory always obey a time-reversal symmetry.We show that this symmetry, which surprisingly applies here to a class of processes far from thermal equilibrium, holds universally for various systems, including active, granular, and long-range correlated media in their linear regimes.The uncovered symmetry provides a rigorous and versatile criterion for optimal control that greatly facilitates the search for energy-efficient transport strategies in a wide range of systems.Using a machine learning algorithm, we demonstrate that the algorithmic exploitation of time-reversal symmetry can significantly enhance the performance of numerical optimization algorithms.
The increasing quest of energy-efficient machines and processes is not limited to macroscopic length scales.Due to ongoing miniaturization, micro-and nanoscopic machines are within reach and there is great need for optimal control strategies that enable their efficient operation [1,2].This is also motivated by biological engines (molecular motors) which achieve remarkable efficiencies even at high frequencies and in the presence of liquid environments [3,4].At first glance, this seems to be in contradiction with conventional heat engines where maximal efficiency is only reached for infinitely slow, i.e., quasi-static motion [5][6][7][8][9].Recent studies of molecular machines suggest that by regulating their power according to the external resistance, excessive dissipation can be avoided [10,11].
The energy-efficient operation of nanomachines is a specific example of a finite-time, (near-)optimal driving process [11][12][13][14][15][16][17][18][19].Such processes are not only important for small-scale robotic applications [1,2,20] but also in various other fields like plant physiology [21], molecular biology [22], as well as classical [14] and quantum information processing [13,23].As a generic example of a finite-time optimal process, theoretical studies have considered the most energy-efficient dragging of a micronsized particle through a viscous environment.Surprisingly, this is achieved by a non-steady forcing with jump discontinuities at the beginning and end [12,18].
So far, experimental and theoretical studies on optimal driving processes have mainly considered viscous environments, which remain in equilibrium in the presence of a driven particle.Typically, however, molecular motors or microrobots operate within more complex surroundings.Common environments are viscoelastic media (e.g., intracellular plasma [24], blood [25], polymeric gels [26,27], micellar solutions [28], or colloidal suspensions [29,30]) which do not remain in equilibrium during operation due to their slowly relaxing microstructure.This leads to pronounced memory effects, i.e., non-Markovian behavior of driven particles in such media, which are absent in purely viscous (memory-free) liquids [31,32].
Here, we experimentally and theoretically investigate the optimal control problem of translating optical tweezers containing a Brownian particle over a given distance within a given time, with minimum average work done on the particle.In viscous liquids, our experiments confirm previously predicted driving discontinuities at the beginning and the end of the protocol and a constant driving power in between [12].For viscoelastic fluids, however, no constant driving regime is found due to the presence of memory effects.Astonishingly, despite the fundamentally different optimal protocols in viscous and viscoelastic fluids, we find that both the mean particle trajectory and the protocol for optimal control exhibit a time-reversal symmetry.Starting from a generalized Langevin equation, we theoretically prove that this symmetry generally arises irrespective of the specific memory kernel or noise property, in both the overdamped and underdamped regime, as long as all forces are linear.Therefore, time-reversal symmetry allows a clear distinction to identify optimal control in various systems including granular [33] and active [34,35] media, or fluids with hydrodynamic backflow [36] or anomalous diffusion [37].Beyond their implications for the optimal operation of micromachines in complex environments, our findings suggest that the use of symmetry considerations is a powerful tool to significantly expedite optimization problems.Our experiments were performed using spherical silica particles (diameter ≈ 2.7 µm) suspended in a fluid contained in a sample cell with 100 µm height.In addition to a purely viscous water-glycerol mixture (1:1), we used a viscoelastic solution composed of cetylpyridinium chloride monohydrate (CPyCl) and sodium salicylate (NaSal) (for details see Appendix A).At the used concentration of 8 mM a worm-like micellar micro-network is formed [38] whose relaxation time was experimentally determined to τ b ≈ 17 s (see Appendix B).A laser beam (532 nm) is focused with an objective (NA = 1.45, 100x) into the mid-plane of the sample cell (see Fig. 1a) where it creates a parabolic optical potential

I. EXPERIMENTAL SETUP
Here, κ denotes the trap stiffness, X the particle position and λ the time-dependent trap center location, which is the control parameter.Experimentally, a dynamical variation of λ with time t was realized by translating the sample cell relative to a static optical trap.The positions of the particle and the trap were determined by digital video microscopy with a spatial and temporal resolution of 5 nm and 10 ms, respectively.All experiments were performed at a sample temperature of 25 • C. We applied protocols that shift the trap between an initial λ(t = 0) = 0 and a final position λ(t f ) = λ f within the time interval t f (see Fig. 1b).After each protocol we waited for the system to fully equilibrate.Thus, ⟨X(0)⟩ = λ(0) = 0 for each run.
The work W exerted on the particle during such protocols is determined according to [39,40] Because W fluctuates between individual protocols due to thermal noise, each measurement was repeated at least 100 times to yield mean values ⟨W ⟩ with a relative statistical error < 1 %.In the following, we determine the optimal protocol λ * which requires the smallest ⟨W ⟩.

II. OPTIMAL CONTROL IN VISCOUS LIQUIDS
For viscous liquids, the optimal protocol λ * is known to exhibit symmetric jumps at t = 0 and t = t f and a constant trap velocity in between [12] (see Appendix C).Such protocols are fully quantified by the jump height ∆λ. Figure 2a shows experimental (solid lines) and ideal (dashed lines) protocols for ∆λ = 0, 0.4, and 1 µm with λ f = 2 µm and t f = 1 s.Since the acceleration of the translational stage is finite, instantaneous jumps cannot be perfectly realized in experiments.Compared to ideal protocols, this leads to deviations at the beginning and the end of λ(t) and slightly increases the time during which the optical trap exerts work on the particle.To take this effect into account, when calculating the work [Eq.( 2)] the upper integration limit was increased accordingly (see Appendix B).
Figure 2b shows the experimentally determined mean work ⟨W ⟩ (black symbols), which exhibits a minimum at ∆λ * ≈ 0.5 µm.Despite the above mentioned experimental limitations in realizing ideal jumps, our data are in good agreement with theoretical predictions for protocols with infinitely fast jumps.To match the theoretical prediction with the experiments, we used the relaxation time τ 0 = 0.35 s calculated from the measured equilibrium distribution and the mean square displacement of the particle in the static trap (see Appendix B).Without any adjustable parameters, the theory then gives ∆λ * = 0.41 µm (black line) [12], which agrees well with the experimental findings.
Mean particle trajectories x = ⟨X⟩ corresponding to the executed protocols are plotted in Fig. 2c.Interestingly, we find that only near the optimal protocol, x obeys time-reversal symmetry, which can be formally written as, with f ≡ x.This becomes even clearer when the deviation from time-reversal symmetry of x is quantified.For this purpose we introduce the asymmetry parameter with ∆t corresponding to the temporal resolution.A f is zero for time-symmetric functions f and increases with increasing asymmetry [note that f (0) = 0, namely λ(0) = 0 by choice and without loss of generality, and x(0) = λ(0) = 0 due to the relaxed initial condition].For an illustration of A f we refer to Fig. 10 in the Appendix.Figure 2b shows the asymmetry parameter A x defined in (4) evaluated for f = x, versus ∆λ; which exhibits a minimum at the experimentally obtained ideal protocol at ∆λ * ≈ 0.5 µm (symbols).In agreement with the experimental findings, the theoretically predicted trajectories for the perfectly symmetric protocols (with instantaneous jumps) also lead to coinciding minima of ⟨A x ⟩ and ⟨W ⟩.

III. SYMMETRY PROOF
As will be demonstrated below, the occurrence of timereversal symmetry of both x * and λ * is a distinctive and universal property of a wide class of optimal processes.To prove this surprising observation, we start from a general generalized Langevin equation (GLE) [41][42][43][44][45][46] (5) with an arbitrary memory kernel Γ and zero-mean noise ν, and particle mass m.We further assume that the potential V is parabolic (as being the case for an optical trap), rendering the GLE to be linear in X and λ.Notably, no further restrictions are applied to Γ or ν.The latter may be a colored or a non-Gaussian noise, and we do not restrict to systems obeying the fluctuationdissipation relation Γ(|t − t ′ |) ∝ ⟨ν(t)ν(t ′ )⟩.Within such assumptions, Eq. ( 5) describes the dynamics of a broad class of systems, including granular media [33], glasses in their ergodic regime [47,48], linear viscoelastic fluids [44], polymer condensates [49], particles in bacterial baths [34], and even tracers in molecular fluids [50].The above GLE also applies to memory-free, viscous liquids by using delta-correlated kernels.Furthermore, the overdamped limit, which is the relevant regime in our experiments, is readily included by taking the limit m → 0.
Based on Eq. ( 5), we obtain general implications and non-implications between optimality and time-reversal symmetry of the corresponding protocol λ and the mean observable (trajectory) x = ⟨X⟩.The results are summarized in Fig. 3. Here, we outline the main idea of the proof, which is described in detail in Appendix D.
First, all non-implications can be proved by simple counterexamples (see Appendix D 1).For instance, the non-implication time-reversal symmetry of λ ⇏ timereversal symmetry of x becomes immediately obvious by considering an entirely linear protocol λ(t) = (λ f /t f )t which leads in a purely viscous, overdamped system to an exponentially relaxing trajectory which is clearly not symmetric under time reversal.
Next, by rewriting the work as a functional of either x or λ, only, one can show that optimality directly implies time-reversal symmetry.Because the confining potential is quadratic, both in λ and x, the functionals are also quadratic, from which the symmetry directly follows.Concretely, as we explicitly show in the Appendix D 2 based on Eqs. ( 2) and ( 5), the mean work can be expressed as the functional of x where C encapsulates terms that are independent of the process during t ∈ [0, t f ] and therefore irrelevant for the optimization or symmetry property.To derive Eq. ( 6) we have further made use of the fact that ⟨W ⟩ is independent of the noise level, which is a consequence of the linearity of the GLE.By applying appropriate coordinate transformations, one can show that the functional in Eq. ( 6) is invariant under time reversal of x, irrespective of the particular memory kernel Γ.Specifically, any trajectory x and its time-reversed image x(t Given the quadratic form of the work functional, we expect only a unique extreme, such that x * ≡ x * , implying that optimal trajectories are always time-reversal symmetric. Similarly, by explicitly making use of causality of the stochastic process, we can express the mean work as a quadratic functional of λ convoluted with the response function Φ [see Eq. (D20) in Appendix D 2].Analog arguments then also imply that optimal protocols λ * must be time-reversal symmetric.Finally, to show the reversed implication, we reexamine the work functional (6).Optimal trajectories x * are characterized by a vanishing variation of the work δ⟨W ⟩ with respect to all variations of x * that satisfy δx(0) = δx(t f ) ≡ 0. Using variational calculus and some integral manipulations, we find that δ⟨W ⟩ = 0, if and only if See Appendix D 4 for a derivation.In addition, for all time-symmetric protocols, one can show that any timesymmetric mean solution x(t) of Eq. ( 5) for t ∈ [0, t f ] fulfills the equality as given in Eq. (D25) in Appendix D 4. Realizing that the equality (8) readily implies the condition (7), it follows that ⟨W ⟩ is optimal whenever x and λ are both timereversal symmetric.Overall, we have thus shown that the simultaneous time-reversal symmetry of both x and λ is a necessary and sufficient condition for optimal control.Importantly, this holds for all linear GLE models.

IV. OPTIMAL CONTROL IN VISCOELASTIC FLUIDS
To experimentally test the generality of the predicted symmetry and to explore the generic features of optimal control in non-Markovian environments, we performed dragging experiments in a viscoelastic micellar fluid.To realize experimental variations around λ * , we first obtain a theoretical prediction regarding the optimal protocol.Our calculations are based on previous studies, demonstrating that the memory kernel of micellar viscoelastic solutions is well-described by a single exponential decaying with the bath stress-relaxation time τ b [28,44,49].We further treat the dynamics in the overdamped limit, because the inertial effects in our experimental system are negligible.As a consequence, the motion of a colloidal particle within such a Maxwell fluid is experimentally observed to be in agreement with two coupled overdamped Diagram showing implications (⇒) and nonimplications (⇏) between time-reversal symmetry [defined in Eq. ( 3)] of the protocol λ and mean particle trajectory ⟨X⟩ = x, and optimality with respect to the work required, for control processes in linear media.Optimal control is characterized by time-reversal symmetry of both λ and ⟨X⟩.
equations [51,52] Here, X and X b correspond to the positions of the colloid and a fictitious bath particle connected by a har-monic spring with stiffness κ b , and ξ p , ξ b are uncorrelated Gaussian white noises with variances 2k B T τ i /κ b , i = p, b, respectively, and τ p := γ/κ b .
Expressing the work as functional of ⟨X⟩ and ⟨X b ⟩ using Eqs.( 2) and ( 9), and incorporating Eq. ( 10) as dynamical constraint via a Lagrange multiplier, we construct an appropriate cost functional [15], for which the Euler-Lagrange equations yield x * , λ * (see Appendix E).
The theoretically predicted optimal protocol, as realized in our experiment in a viscoelastic micellar solution, is shown as green solid line in Fig. 4b.As expected, λ * and x * display time-reversal symmetry.Similar to the Markovian case (even though hardly visible here), the optimal protocol exhibits jumps at the beginning and end.However, in non-Markovian systems λ * contains no linear parts.Only in the quasi-static limit t f → ∞ where the memory kernel has decayed to zero, the protocol converges to the Markovian case and becomes linear.
To experimentally test the theoretically calculated λ * , we have varied the protocol around this prediction.Variations around λ * were achieved by a variation parameter α, with α = 0.5 corresponding to λ * (see Appendix B).Exemplarily, Fig. 4 shows experimental protocols for three different values of α, all of them exhibiting timereversal symmetry as suggested by our theoretical considerations.Because the friction in the viscoelastic fluid is larger than that in the viscous water-glycerol mixture, the mean optical trap velocity had to be reduced by setting λ f = 3 µm and t f = 10 s. Figure 4c shows the measured averaged work ⟨W ⟩ versus α, indicating a pronounced minimum at α = 0.5.In addition, the asymmetry of the mean trajectories ⟨A x ⟩ exhibits a minimum for the optimal protocol, which is in excellent agreement with the prediction of time-reversal symmetry of the optimal process independent of the solvent's memory effects.
The appearance of time-reversal symmetry of both λ and x for the optimal solution in non-Markovian systems (see Appendix B, Fig. 8) is particularly astonishing in view of the strongly time-asymmetric nature of the overall process, which starts in thermal equilibrium and ends in a state where the particle within the optical trap and the surrounding are anisotropic and out of equilibrium.This becomes visible in the time-resolved power ⟨dW/dt⟩, shown in Fig. 4c for different time-symmetric protocols, which is clearly not time-symmetric even for λ * (green curve).In fact, ⟨dW/dt⟩ is strongly time-asymmetric and non-monotonic; and the largest contribution to the applied work occurs towards the end of the optimal protocol.This modulated power input differs significantly from the Markovian case, where optimal control is characterized by constant power between the jumps (see Appendix B 2, Fig. 9).
The nonlinear behavior of λ * and asymmetry of ⟨dW ⟩ in a viscoelastic fluid can be rationalized by energetic considerations.At the beginning of the protocol, the fluid is isotropic and fully relaxed.In this regime, the particle can be initially dragged with relatively low energetic costs even at high trap velocities.With increas-ing particle displacement, however, the viscoelastic microstructure becomes increasingly distorted, thereby accumulating elastic energy and thus increasing the particle resistance against the trap motion.Therefore, to avoid an excessive increase of work, the trap velocity should be rather slow.However, since the protocol must be completed within t f , the trap velocity cannot be slow over the entire protocol.This conflict is resolved by slowing down the trap for t < t f /2 and accelerating it afterward.With this strategy, elastic energy stored in the fluid becomes largest towards the end of the protocol, when the trap has already stopped (at λ f ) and therefore exerts no more work on the particle.We remark that these arguments are in good agreement with the observation that molecular motors modulate their driving in accordance to their resistance [11].

V. APPLICATION IN MACHINE LEARNING
Finally, we aim to address an important practical implication of the uncovered symmetry in the context of computational optimization.In this field, recent progress has been made by incorporating machine learning techniques [53][54][55].To demonstrate the benefit of the symmetry property in this context, we trained a deep neural network to find the optimal control protocol in a viscous overdamped system, following an algorithm similar to [54].Instead of training the network with the objective of minimizing the work (Fig. 5, black line), we also trained with the objective of minimizing the asymmetries of protocol and mean trajectory A x + A λ (Fig. 5, orange line).In both cases, the learned protocol converges to the optimal one, demonstrating that the asymmetry parameter can be used as an alternative (or additional) cost functional for the optimization.Moreover, for control in more complex environments, for which generally no analytical solution is available, the asymmetry parameter offers the essential advantage that its value at the global optimum (A x + A λ ≡ 0) is always and a priori known.Therefore, unlike the work, the asymmetry reveals whether the true work optimum has been reached.

VI. CONCLUSION & OUTLOOK
With experiments and theoretical calculations, we have studied the optimal control of an optical trap dragging a colloidal particle through viscous (memory-free) and viscoelastic (non-Markovian) baths.Despite the very different response of colloidal particles in both systems, we find that the optimal protocols and the corresponding mean particle trajectories always exhibit time-reversal symmetry.Remarkably, such symmetry which is a hallmark of thermal equilibrium, reappears in these systems far away from equilibrium, but only when driven in the most energy-efficient way.The symmetry is rather universal, applying to all systems in the regime where the dynam- ical equations are approximately linear in the system's variable and protocol parameter.It is thus expected to be valid also in systems with long-ranged memory, such as active fluids [34,35] or fluids with hydrodynamic backflow [36].This symmetry property of optimal control is of immediate relevance for the efficient operation of nanomachines, low energy swimming mechanisms of micro-robotic systems but also energy-efficient information processing [14,56].In machine learning, numerical and exact optimization, the a priori knowledge of the uncovered time-reversal symmetry provides a strong constraint for the applicable function space and will, thus, significantly improve optimization algorithms.

Author contributions
CB, SM and FG designed the experiment.The experimental data were taken and analyzed by SM and discussed together with FG and CB who supervised the project.SL performed the analytical calculations, derived the theoretical proof and implemented the machine learning model.SL, SM, and CB wrote the manuscript.
Appendix A: Experimental Methods

Optical trap setup
The optical tweezers setup used consists of a 532 nm laser (Coherent Verdi V2) that is amplitude modulated with an acousto-optic deflector (AOD, AA optoelectronics DTSXY-400).The laser power in front of the AOD was adjusted to 250 mW using a λ/2-plate and a polarizing beam splitter.As a result, the laser power after the AOD remained below 100 mW.A 100x objective (Olympus Apochromat MPLAPON-Oil 100x NA=1.45) was used to focus the laser beam into the sample cell.To manipulate the sample position, a 3-axis piezo-driven stage (piezoconcept LT3) was used.Its position was controlled using the analog input with a signal supplied with a sampling rate of 5 kHz by a PCIe card (National Instruments PCIe-6351).At the same time, the actual position of the stage was measured from the analog output signal.Differences between the set and actual positions occur when the stage position is adjusted fast.The sample temperature was controlled by resistive heating of the sample stage and microscope objective (Okolab).The temperature was kept at 25 • C throughout all experiments.For video microscopy, the same microscope objective was used to give an image on a digital camera (Basler ace 2 a2A3840-45umPRO).Videos were acquired during the experiment at a frame rate of 100 frames per second.

Sample preparation
The viscoelastic solution was prepared by dissolving equimolar amounts of cetylpyridinium chloride monohydrate (CPyCl) and sodium salicylate (NaSal) in milipor water.The solution was stirred overnight to ensure equilibration of the micellar network.In this study, we used an 8 mM solution.Sample solutions were prepared by dispersing colloids (2.73 µm SiO 2 , microParticles GmbH) in either a water-glycerol mixture or the viscoelastic solution using an ultrasonic bath.Samples were prepared by filling glass capillaries with an inner diameter of 100 µm (CM Scientific) with the sample solution.The capillaries were closed with a combination of wax and epoxy resin.After filling the capillary, the samples were equilibrated in the measurement setup until the measured mean work shows no drift anymore.
the sample with a piezo-driven stage relative to the static trap.Even though this makes the temporal resolution of the optical trap position relative to the sample slower compared to e.g. an acoustic-optical deflector (AOD), our approach has several advantages: first, the optical path of the trap is not altered during translation which avoids spatial changes to its shape and stiffness.In addition, a resting optical trap in the reference frame of the camera makes it possible to considerably reduce the field of view of the camera and thus to achieve a high temporal resolution of the particle's motion.In a single measurement run, the protocol was executed in both the forward and backward directions consecutively, ultimately ending up in the same trap position.Before and after each individual protocol, the system was allowed to relax for a specified time interval t rel .

Variation of optimal protocols in experiments
To experimentally investigate the optimality of protocols predicted by the theory, the protocols were systematically varied as a function of one parameter.

a. Protocol variations for viscous samples
For the (Markovian) case of a particle in a viscous fluid, the optimal protocol for the shifting of a trap center in a finite time is given by Eq. (C2).The optimal protocol, which has symmetric jumps of height ∆λ * at the beginning and end, can be seen as a member of the family of functions described by To check the optimality of λ * , protocols defined by Eq. (B1) with varying jump height ∆λ were executed.
Examples comparing the theoretical given shape of the protocol and the realization in experiments together with resulting mean particle trajectories are shown in Fig. 6.In this figure the relaxation of the particle after the protocol is finished can be observed.
To calculate a prediction for the optimal jump height ∆λ * , it is necessary to know the relaxation time of the particle in the trap τ 0 .The latter is given as the quotient of particle friction γ 0 and trap stiffness κ, both of which can be determined from equilibrium measurements [57].The trap stiffness κ was extracted by fitting a parabolic function to the potential derived from the equilibrium distribution using the Boltzmann factor.Using the derived trap stiffness κ = 0.38 µN m , the friction coefficient γ 0 was subsequently calculated from the initial slope of the mean square displacement (see Fig. 7).This gave a result of 0.13 µN s m for γ 0 and therefore τ 0 = 0.35 s.
FIG. 6.(a) Protocols and (b) and mean particle trajectories from experimental data for the viscous system, for the same set of experiments as shown in Fig. 2. Different from Fig. 2, we here also show the relaxation period of the mean particle trajectory after t f .∆λ = 0.4 yields the optimal control.Only for this case, both λ and x exhibit time reversal symmetry on 0 < t < t f .The protocol duration and total trap displacement were t f = 1 s and λ f = 2 µm.

b. Protocol variations for viscoelastic samples
The optimal protocol for the viscoelastic solution, i.e., the non-Markovian case, is more complex.In Appendix E, we describe how we theoretically obtain the exact and general expression for it.The optimal protocol depends on the system parameters γ, γ b , κ b and κ, defined in Eqs. ( 9), (10), which first needed be determined experimentally before the optimal protocol can be executed in the experiment.To this end, we first conducted test experiments.These consisted of shifting the trap with constant velocity λ f /t f .The average work ⟨W exp ⟩ calculated from experimental data was compared to simulation data.The difference in average work between simulation and experiment was minimized using a gradient descent algorithm by adjusting γ, γ b and κ b in the simulation model.The resulting parameter set was used to calculate λ * .
To enable a protocol variation in dependence of a single parameter (like in the Markovian case), we constructed a superposition of three different protocols in dependence of one parameter α.For the three base functions we chose a tanh-function [λ T , given in Eq. (B3)], the opti-mal protocol [λ * , see Appendix E], and a step function featuring two symmetric jumps at the beginning and the end [λ S , given in Eq. (B4)].These are linearly combined [see Eq. (B2)], i.e., added up, each one multiplied with an individual weighting factor w i ≤ 1, with i=T,S,O, "O" for "optimal".The weighting factors can be expressed via single mixing parameter α according to Eqs. (B5)-(B7): )

Evaluation of experimental data
The particle position is tracked by analyzing video recordings captured at a frame rate of 100 fps using a custom tracking algorithm based on Ref. [58].The position of the piezo-stage and the exposure active signal of the camera are recorded at 5 kHz using a PCIe card.This allows to synchronize the stage and particle positions a posteriori.
The work done during an individual protocol is calculated in the framework of stochastic thermodynamics using Stratonovich integrals [see Eq. ( 2)].Since the trajectory is only sampled at finite intervals ∆t = 0.01 s, the integral transforms into a sum: The calculated work was then averaged over multiple tra- jectories.
Due to the inertia of the stage, it did not reach its final position λ f at t f = 1, 10 s but only about 0.1 s later.To account for this contribution to the work, the time frame of work calculation was extended until λ ≈ 0. Similar considerations must be done for the asymmetry parameter A x : The increased protocol time shifts the inflection point of the symmetry operation to slightly later times.To account for this, the time frame for calculating A x was extended to t ′ f so that the observed inflection point lies at t ′ f /2.For this adjusted integration window, the asymmetry parameter of the protocol A λ is minimal.

Appendix C: Model and theoretical prediction of optimal protocol in viscous fluid
The dynamics of the particle in the harmonic trap of stiffness κ in the viscous fluid is described very accurately by the Markovian overdamped Langevin equation with zero-mean, Gaussian white noise ξ with ⟨ξ(t)ξ(t , where τ 0 = γ 0 /κ denotes the relaxation time in the trap, and γ 0 is the friction constant.The seminal paper [12] showed that the optimal protocol in this case has at the beginning (t = 0) and end (t = t f ) two symmetric jumps of size ∆λ * = λ f /(2 + t f /τ 0 ), and in between increases linearly in time The corresponding optimal trajectories are fully linear: x * (t) = ∆λ * (t/τ 0 ), and the optimal mean work takes the value ⟨W * ⟩ = (∆λ * )γ 0 λ f /τ 0 .Thus, in the viscous fluid, optimal control is achieved, when particle and trap both exhibit a motion of the same constant speed ∆λ * /τ 0 for 0 < t < t f , akin a steady state.In order to initiate this joint constant-speed motion, the trap needs to abruptly jump at time t = 0, bringing the particle to the displacement from the trap center, where the relaxation force is constant and balanced with the trap's speed.
FIG. 10.Visualization of the symmetry property and the asymmetry parameter A f .Consider the difference between the two distances marked as red vertical lines [i.e., f (t), and For time-reversal symmetrical curves that are point-symmetrical around their center (black point), this operation results in zero, and f (t f ) = 2f (t f /2).Any deviation from this symmetry leads to a remainder after subtraction of f (t) and 2f (t f /2) − f (t f − t), which can be positive or negative.The absolute value increases with greater deviations.In order to always obtain a positive value, the result of the subtraction is therefore squared, giving rise to the definition of A f as given in Eq. ( 4).
the boundary conditions, which yields Next, substituting λ by which follows from solving the GLE (5) for λ, and taking the noise average, we find the functional We have used Note that the first two terms of (D3) is the increase of potential energy from time 0 to t f , and the third and fourth term is the increase of kinetic energy.To proceed further, we make use of the fact that the mean work is independent of the noise level.While this is directly not obvious from (D3), one can make it apparent as follows.Reconsidering Eq. ( 2) and directly performing a noise average over it, we obtain ⟨W ⟩ = κ t f 0 λ(λ − x)dt, and conclude that ⟨W ⟩ depends only on the mean trajectory x, not on the fluctuations of X.Then, due to the linearity of the GLE, the temporal evolution of x is fully independent of the noise, so that the same holds for ⟨W ⟩.To formally see the noiseindependence of x, we also take the noise average of the GLE (5), which together with the initial condition yields i.e., x follows a deterministic (integro-differential) equation.Taken together, ⟨W ⟩ itself is independent of the noise level.Hence, we are allowed to evaluate Eq. (D3) in the noise-free limit.For vanishing noise level, statistical dependencies between dynamical quantities disappear, so that ⟨ Ẋ(t) Ẋ(t ′ )⟩ → ⟨ Ẋ(t)⟩⟨ Ẋ(t ′ )⟩ = ẋ(t) ẋ(t ′ ) and ⟨ Ẋ(t)ν(t)⟩ → Ẋ(t) ⟨ν(t)⟩ → 0, simplifying (D3).Finally, we encapsulate in the constant C all terms of Eq. (D3) that are independent of the process during t ∈ [0, t f ] (and thus play no role in the optimization), allowing us to tighten the bounds of integration, and leading to as given in the main text in Eq. ( 6).This functional is invariant under time reversal.To show this, we first consider only the integral term of ⟨W ⟩ [x] and perform the coordinate transformations t ′ = t f − t ′′ , and t = t f − t, which leads to Now, interchanging the order of integration and accordingly adjusting the limits of the double-integral [59], and subsequentially renaming t ′′ → t and t → t ′ , we find Comparing this with the original integral in Eq. (D5), we notice that each path x and the paths defined by x(t) ≡ ±x(t f − t) + C s , with some arbitrary constant C s , give the same value of the integral term.However, among the possible paths x(t), only the one with C s = x(t f ) and negative sign of the x(t f − t) term, is compatible with the equilibrium initial condition and satisfies the constraint x(t f ) = x(t f ), such that the remaining contributions to ⟨W ⟩ [x] in Eq. (D5), in particular, the increase of potential and kinetic energy, is also identical for x and x.We conclude that any given trajectory x(t) and its timereversed image x(t) = −x(t f − t) + x(t f ) yield the same work.Since the work can be expressed as a quadratic functional of x alone [see Eq. (D5)], we expect only a unique optimum, such that optimal trajectories must satisfy x * ≡ x and, consequentially, must obey time-reversal symmetry.

Proof of: Optimality ⇒ Symmetry of λ
Here, we outline the proof of that optimal protocols λ * are time-symmetric.First, we show how one can generally express x as functional of λ.To this end, we take the noise average of the GLE (5), which, together with the equilibrium initial condition, yields (D4).To formally solve Eq. (D4) for x, we apply a Laplace transformation, f (s) = Noting that λ(0) = 0 and thus s λ(s) = [s λ(s) − λ(0)], we transform back to the time domain, and find Assuming causality of the stochastic process implies that any response function must satisfy Φ(t < 0) = 0, so that we can tighten the integration limits and finally find Now, this expression can be used to replace x in the noise-average of Eq. ( 2), directly leading to the following expression of the work as a functional of λ only, Starting from this functional, which is again quadratic in λ, and repeating the analogous steps as we have used before to prove time-reversal symmetry of x * , readily implies that λ * possesses time-reversal symmetry, too.
Consistent with our findings, it was shown in Ref. [60] using linear response theory that optimal protocols of generic Hamiltonian systems in the fast-but-weak driving regime are time-symmetric.

Proof of: Symmetry of x and λ ⇒ Optimality
Finally, we show that the combined symmetry of x and λ implies that the process is optimal.The main step of this proof is to derive a generic condition on x for optimality via variational calculus (leading to Eq. ( 7) given in the main text).
To this end, we start from the work functional given in Eq. ( 6).The variation of ⟨W ⟩[x] with respect to variations of x that satisfy δx(0) = δx(t f ) = 0 is generally given by The second term of this last expression can be rewritten, by interchanging the integrals, and renaming t → t ′ , t ′ → t, leading to Now, by using twice the identity: a = |a|, ∀a > 0, we can combine both integral terms of δ ⟨W ⟩ from Eq. (D15), and find Finally, integration by parts and using that, per definition, δx(0) = δx(t f ) = 0, we obtain Thus, trajectories that satisfy the condition d dt automatically fulfill δ ⟨W ⟩ [x(t), δx(t)] = 0 for all variations with δx(0) = δx(t f ) = 0, which is a characteristic property of optimal solutions.[The condition Eq. (D19) is identical to Eq. ( 7) given in the main text.]For sake of completeness, we note that, starting from Eq. (D14), analogous steps yield the analog condition d dt for optimal protocols.
The second step of this part of the proof is to show that symmetric control processes automatically satisfy the condition (D19).We start with assuming that a given protocol is time-symmetric, i.e., Substituting in this equation λ(t) and λ(t f − t) using the noise-averaged GLE (D4), yields Now, transforming the coordinates of the second integral (t ′ = t f − t ′′ ) and assuming that the trajectory x also obeys time-reversal symmetry, which implies x(t)+x(t f − t) = x(t f ) and ẍ(t) + ẍ(t f − t) = 0, we find Finally, using ẋ(t f − t) = ẋ(t) which is implied by the time-reversal symmetry of x, and again the identity: a = |a|, ∀a > 0, we find which readily implies as given in Eq. ( 8) in the main text.It is easy to see that this equality, which is as we have just shown fulfilled by all processes with time-symmetric x and λ, readily implies that condition (D19) is fulfilled.This further implies that time-symmetric processes are generally optimal.We note that this proof also holds in the overdamped limit.We note that the work required to translate the trap can be reduced if additional real-time information about the actual particle position is acquired, e.g., by performing a measurement at t = 0 and modifying the protocol at t > 0 according to the measurement outcome [19].In the presence of such measurements, the symmetry property discussed here is lost.

Appendix E: Model and theoretical prediction of optimal protocol in viscoelastic fluid
Here, we derive the optimal protocols for the particle in a Maxwell fluid described by the overdamped limit of the GLE (5) with Γ(t − t ′ ) = 2γδ(t − t ′ ) + κ b e −(t−t ′ )/τ b , and ⟨ν(t)ν(t ′ )⟩ = 2k B T [γδ(∆t) + γ b e −|∆t|/τ b ], with the bath stress-relaxation time τ b .Equivalently, the dynamics of X can be described by Eqs. ( 9) and ( 10), as given in the main text.As a first step, we express the work as a functional of x and x b := ⟨X b ⟩, only.To this end, we use the noise average of Eqs. ( 9) and (10), which is Solving Eq. (E1) for λ and substituting the result, we can rewrite the expression for the work W as This can be simplified by explicitly integrating all terms of the form , and rewriting by partial integration some of the other terms like

(E10)
The solution of this equation is z = z(0)e At .In combination with the initial conditions x(0) = 0, x b (0) = 0, this yields the optimal solution Note that in the last step we have used Eq.(E1) to obtain λ * from x * and x * b .Thus, although the equation of motion of the particle is linear in X, as it is for the Markovian case, the optimization now leads to fully nonlinear solutions.In particular, there is no "steady-statelike" regime anymore (where particle and trap move at a constant distance with constant speed).
The solutions obtained by this optimization procedure given in Eqs.(E11)-(E13) still depend on two unknown parameters C 1 and C 2 .We remark that the long-time limit of Eqs.(E11)-(E13) reveals that these unknowns encode the initial jump of ẋ and the initial value of the Lagrange-multiplier: C 1 = ẋ(0 + ), C 2 = Λ(0 + ), which depend on all parameters {λ f , t f , τ b , τ p , κ b , k}.
Usually, these unknowns must be determined by a secondary minimization.Concretely, by inserting x * and x * b , the work (E4) can be expressed as function of C 1 , C 2 .Then, minimizing ⟨W ⟩ (C 1 , C 2 ) with respect to C 1 yields the optimal value of C 1 (C 2 ) as a function of C 2 .Inserting this result, subsequently minimizing ⟨W ⟩ (C 2 ) with respect to C 2 , yields the optimal C 2 .For the Maxwell fluid, this involves very cumbersome and nested expressions.However, this secondary minimization can be entirely avoided by making use of the symmetry property of the optimal mean trajectory and protocol, which we have proven on general grounds.Postulating time-reversal symmetry of x * and λ * , immediately leads to analytical expressions for C 1,2 (λ f , t f , τ b , τ p , κ b , k); resulting in closedform solutions {x * , x * b , λ * }.As a consistency check, we have verified that the solutions obtained via the secondary minimization (without postulating the symmetry) match the analytical expressions found via the symmetry.

Appendix F: Machine learning algorithm
We chose an architecture and training procedure similar to Ref. [54].We used feed-forward fully connected Deep Neural Networks (DNN) that take a single scalar input, and return a single scalar output value, and have three hidden layers of 4,4,10 nodes, as illustrated in Fig. 5.The set θ of weights and biases of all nodes parameterizes the DNN.We apply a ReLU activation function to the input layer, and tanh activation function to all other layers.The series of time steps t i ∈ {∆t, 2∆t, ..., t f − ∆t} with ∆t > 0 and 0 < t i < t f , is sequentially given as input to the DNN, which returns as

FIG. 1 .
FIG. 1.(a) A colloidal particle is trapped in optical tweezers.Relative movement of the trap center λ is achieved by translating a piezo-actuated sample stage.(b) The protocol λ(t) describes the transfer of the trap center from its initial λ(0) = 0 to its final position λ(t f ) = λ f during the time t f .λ * corresponds to the protocol of minimal work.

FIG. 2 .
FIG. 2. (a) Experimental (solid lines) protocols for the motion of an optical trap which is displaced by λ f = 2 µm within the time t f =1 s.Different protocols are characterized by their jump height ∆λ.The dashed lines correspond to protocols with ideal infinitely fast jumps at start and end of the protocol.The optimal protocol (green) λ * corresponds to ∆λ * = 0.4 µm (see Eq. (C2) in the Appendix C).(b) Experimentally measured mean work ⟨W ⟩ (black) and asymmetry parameter ⟨Ax⟩ (orange) as function of ∆λ (symbols).The minima of ⟨W ⟩ and ⟨Ax⟩ are positioned at the optimal protocol λ * in agreement with theoretical predictions (solid lines).The fact that ⟨Ax⟩ ≈ 0 for λ * suggests that both λ and x are time symmetric for optimal control.Error bars correspond to the s.e.m.. (c) Average particle trajectories x = ⟨X⟩ normalized by the position at the end of the protocol x(t f ) corresponding to the protocols shown in (a).

FIG. 4 .
FIG. 4. (a) The sketch visualizes the used Maxwell model with fictitious bath particle with friction γ b , coupled to the tracer particle with friction γ with a linear spring with stiffness κ.Only the tracer feels forces from the optical potential.(b) Different time-reversal symmetric control protocols λ(t) were executed, which are a linear combination of a tanh-function (blue line), the predicted optimal protocol (green line) and a step-like function (purple line) weighed by a parameter α (for details see Appendix B).We depict the corresponding particle trajectories in Fig. 8 in the Appendix.(c) The experimentally measured mean work ⟨W ⟩ (black symbols) shows a distinct minimum close to α = 0.5 that is for the predicted optimal protocol.Theoretical predictions (black line) using the Maxwell model [Eqs.(9), (10)], which are offset by −290 k B T , are in good qualitative agreement with the experimental data.The asymmetric contribution Ax (orange) quantifies the deviation of the mean trajectory x from time-reversal symmetry and exhibits a minimum at the same position as ⟨W ⟩.Error bars again show the s.e.m..(d) Measured time resolved power ⟨dW/dt⟩ traces for the protocols shown in (b).Individual protocols are offset to negative values by 200 k B T for better readability, gray lines indicate the corresponding y-axis origin.Protocols including a jump show strong peaks at beginning and end.The work trace for the optimal protocol (green line) shows a complex non-linear and non-monotonic shape.The matching curve from numerically solving the equation of motion (black line) is in good agreement with the experiment.

FIG. 5 .
FIG. 5. We train a deep neural network (DNN) with the objective of minimizing the work ⟨W ⟩ (black lines), or the overall asymmetry Ax + A λ (orange lines).(b) Shows the work, (c) shows the total asymmetry during training.The lines depict the averages of 100 independent training runs, the shaded regions indicate standard derivations.Both objectives lead to successful learning.Training on Ax + A λ has the crucial advantage that the globally optimal value Ax + A λ → 0 is a priori known.As illustrated in (a) the network has 5 layers of {1,4,4,10,1} nodes and training is done by a Monte Carlo algorithm, similar to Ref. [54], see Appendix F for details.

FIG. 7 .
FIG.7.Mean-squared displacement (MSD) of the particle in the stationary trap to experimentally determine the friction coefficient γ0.Symbols show the ensemble averaged data from experiments, errorbars correspond to the SEM.In full lines, the analytical expression for the MSD of a 2.73 µm colloid in a harmonic trap is plotted using the fitted parameters.The trap stiffness κ is fitted from the positional distribution in equilibrium and γ0 is derived afterward from the initial slop of the MSD[57].

FIG. 8 .
FIG. 8. (a) Protocols and (b) mean particle trajectories from experimental data for the viscoelastic system, for the same set of experiments as shown in Fig.4.For the optical protocol (α = 0.5), both λ and x exhibit time reversal symmetry on 0 < t < t f .Protocol duration and total trap displacement were t f = 10 s and λ f = 3 µm.