*Article* **Optimal Control of Hydrogen Atom-Like Systems as Thermodynamic Engines in Finite Time**

## **Johann Christian Schön**

Max Planck Institute for Solid State Research, Heisenbergstr. 1, D-70569 Stuttgart, Germany; C.Schoen@fkf.mpg.de

Received: 27 August 2020; Accepted: 19 September 2020; Published: 23 September 2020

**Abstract:** Nano-size machines are moving from only being topics of basic research to becoming elements in the toolbox of engineers, and thus the issue of optimally controlling their work cycles becomes important. Here, we investigate hydrogen atom-like systems as working fluids in thermodynamic engines and their optimal control in minimizing entropy or excess heat production in finite-time processes. The electronic properties of the hydrogen atom-like system are controlled by a parameter κ reflecting changes in, e.g., the effective dielectric constant of the medium where the system is embedded. Several thermodynamic cycles consisting of combinations of iso-κ, isothermal, and adiabatic branches are studied, and a possible a-thermal cycle is discussed. Solving the optimal control problem, we show that the minimal thermodynamic length criterion of optimality for finite-time processes also applies to these cycles for general statistical mechanical systems that can be controlled by a parameter κ, and we derive an appropriate metric in probability distribution space. We show how the general formulas we have obtained for the thermodynamic length are simplified for the case of the hydrogen atom-like system, and compute the optimal distribution of process times for a two-state approximation of the hydrogen atom-like system.

**Keywords:** optimal control; thermodynamic cycles; finite-time thermodynamics; thermodynamic length; hydrogen atom; nano-size engines; a-thermal cycle

## **1. Introduction**

Optimal control of physical and chemical systems, and of the processes taking place in such systems, has been a major goal since the beginning of scientific investigations [1,2]. Essentially any application of scientific insights to practical problems has constituted such an effort in optimal control of some kind—even if not formulated as a mathematical control problem—, with the objective ranging from minimizing the difference of the values of characteristic parameters and quantities between the ideal theory and the real experiment [3,4], to maximizing the amount or quality of the desired output for given material and technical constraints. One can distinguish between those controls that are based on practical limitations due to the availability of tools and materials or lack thereof, and those based on the laws of physics.

Perhaps the classical examples of optimal control based on laws of physics have been the analyses of thermodynamic cycles [5–7], where the famous formulas for maximal efficiencies of hypothetical engines are sometimes given a status nearly equal to the fundamental laws of thermodynamics [6]. Such formulas have typically been derived under the assumption of infinite time available for each step of the cycles, allowing us to move from equilibrium state to equilibrium state. About fifty years ago, engineers and scientists began to question this assumption and re-formulated the optimal control problem by demanding that the cycle should be performed in a given finite amount of time, leading to the development of the field of finite-time thermodynamics [8–11].

A second aspect of optimal control based on the laws of physics is to reduce the engine under consideration to the most elementary physical systems that are stripped of all weaknesses and complications which are associated with the macroscopic aspects of the experimental apparatus employed in their realization, resulting in the creation and investigation of molecular machines [12]. Typically, this involves reducing the size of the system in the sense that we are dealing with a macroscopic system as a (non-interacting) ensemble of elementary but microscopic systems. Of course, in practice, isolating the individual elementary system often requires a very large experimental apparatus, but for the purpose of the analysis of the physics and the optimal control of the system, this counts as "environment" and "control tools", whose optimality in themselves are usually irrelevant to the issue of optimally controlling the (ensemble of) elementary system(s) as such. Many experiments have been performed where single atoms or ions in vacuum [13–15] or single defects in solids [16,17] have been studied and controlled in some fashion.

A third feature of achieving optimal control of systems on the level of physical laws is dealing with the quantum nature of these elementary systems, which is forced upon us when reducing the elementary systems to atomic dimensions. While the quantum aspects are unavoidable, one can nevertheless often separate them from the issue of optimal control one investigates, especially if the time resolution of the control is so large that many quantum aspects can be captured by, e.g., effective decay rates.

From the point of view of a theorist, such a reduction to elementary physical systems is often a desirable feature because it allows us to focus on the elementary system itself—which can, in many cases, be analyzed analytically to a certain point—while assigning all other aspects to a generic environment. Examples are the optimal control of harmonic oscillator systems, which have been studied both on the classical and on the quantum mechanical level [18–26], spin systems [26–28], particles in a box [26], and generic two-level systems [29].

In this study, we are going to analyze the basic concepts of optimal control at the example of a hydrogen atom-like system, which we employ as an engine, or more specifically, the working fluid of such an engine, to perform a thermodynamic cycle within finite time. On the technical mathematical level, the electronic Hamiltonian possesses a very high degree of symmetry allowing at least some analytical treatment. On the level of possible applications, there exist systems equivalent to hydrogen-like atoms, e.g., excitons inside a solid [30], that can be controlled by modifying the environment while the hydrogen atom-like system remains in its state. Controlling such a system might allow us to construct nano-size engines inside solids. Alternatively, we can consider isolated hydrogen atoms inside a cavity [31], where also the conditions can be controlled such that the hydrogen atom becomes a modified hydrogen atom.

We will analyze the stages of the thermodynamic control cycle on the general level of probability distributions, both for the ideal (infinite-time) cycle and the cycle at finite time, derive an optimality criterion for minimal waste of work/minimal excess production of heat (dissipation)/minimal production of entropy during finite-time processes for general statistical mechanical systems, and apply these formulas to the example of the hydrogen atom-like system. Note that we are dealing with an "electronic" states-based engine, not with a standard thermal atom movement-based engine as studied, e.g., in [13].

## **2. Background**

#### *2.1. Aspects of the Hydrogen Atom-Like System*

Due to the high symmetry of the Coulomb potential, the electronic Schrödinger equation for the hydrogen atom can be solved analytically, and we get for the energy eigenvalues

$$E\_{\text{ll}} = -\frac{\alpha}{n^2} \tag{1}$$

where α = *me*<sup>4</sup> 2-<sup>2</sup> . The degeneracy of the *n*'th energy level is *g*(*n*) = *n*2. In principle, we need to add a factor 2 for the spin degeneracy of the electron, but this factor is not relevant for this study and will be dropped.

If we consider hydrogen atom-like systems, the formula for the energy is modified by, e.g., changing the mass of the electron or quasi-particle *m* → *m*<sup>∗</sup> , i.e., <sup>α</sup> <sup>→</sup> <sup>α</sup><sup>∗</sup> = *<sup>m</sup>*<sup>∗</sup> *<sup>m</sup>* α, by changing the effective charge that generates the Coulomb field *e* → *q*<sup>1</sup> <sup>∗</sup> and/or the effective charge of the quasi-particle *e* → *q*<sup>2</sup> ∗ , i.e., <sup>α</sup> <sup>→</sup> <sup>α</sup><sup>∗</sup> = *<sup>m</sup>*(*q*<sup>2</sup> ∗) 2 (*q*<sup>1</sup> ∗) 2 2-<sup>2</sup> or by introducing a shielding dielectric constant ε - 1, such that *En* = − <sup>α</sup> *<sup>n</sup>*<sup>2</sup> , or combinations thereof. Quite generally, we note that these modifications can be incorporated in a straightforward fashion by introducing a modification factor

$$\kappa = \frac{m^\*(q\_2^\*)^2(q\_1^\*)^2}{m^{4}\varepsilon^2},\tag{2}$$

such that

$$E\_n(\kappa) = -\kappa \frac{\alpha}{n^2} = \kappa E\_n(\kappa = 1). \tag{3}$$

If we can apply external forces or fields to the system such that κ (i.e., *m*<sup>∗</sup> , *q*1,2<sup>∗</sup> and/or ε) can be smoothly varied, then we can modify the energy levels in a controlled fashion. In that case, the hydrogen atom-like system is used as the working fluid of an engine, where the changing of the energy levels leads to a change in energy that may be extracted as work. A change of the statistical occupation of the various energy levels at given temperature *T* is associated with the entropy content and the heat exchanges of the system, and we can define work cycles in, e.g., (κ, *T*)-space. Examples for individual legs (or branches) of such a cycle would be adiabatic or isothermal changes in κ from some initial value κ*in* to a final value κ*<sup>f</sup>* , and iso-κ changes in temperature where we keep κ constant (see Figures 1–3 below).

**Figure 1.** Sketch of an iso-κ-isothermal cycle for a hydrogen atom-like system. Branches [1] → [2] and [3] → [4] are iso-κ-legs and branches [2] → [3] and [4] → [1] are isothermal legs, respectively. The four corners of the cycle are the points [1] = - κ[1] , *T*[1] = (κ*in*, *T*1), [2] = - κ[2] , *T*[2] = (κ*in*, *T*2), [3] = - κ[3] , *T*[3] = - κ*<sup>f</sup>* , *T*<sup>2</sup> and [4] = - κ[4] , *T*[4] = - κ*<sup>f</sup>* , *T*<sup>1</sup> in the (κ, *T*) plane. Note that for given κ*in*, κ*<sup>f</sup>* > κ*in* and *T*[1] = *T*1, there remains only one variable, e.g., *T*[2] = *T*2, we are free to choose; all other variables are fixed by the choice of path types. All cycles for which *T*<sup>2</sup> > *T*<sup>1</sup> are feasible iso-κ-isothermal cycles.

**Figure 2.** Sketch of an iso-κ-adiabatic cycle for a hydrogen atom-like system. Branches [1] → [2] and [3] → [4] are iso-κ-legs and branches [2] → [3] and [4] → [1] are (special) adiabatic legs, respectively. Note that the adiabatic legs run along straight lines through the origin. The four corners of the cycle are the points [1] = - κ[1] , *T*[1] = (κ*in*, *T*1), [2] = - κ[2] , *T*[2] = (κ*in*, *T*2), [3] = - κ[3] , *T*[3] = - κ*<sup>f</sup>* , *T*<sup>3</sup> , and [4] = - κ[4] , *T*[4] = - κ*<sup>f</sup>* , *T*<sup>4</sup> in the (κ, *T*) plane. Note that for given κ*in*, κ*<sup>f</sup>* > κ*in*, and *T*[1] = *T*<sup>1</sup> there remains only one variable, e.g., *T*[2] = *T*2, we are free to choose; all other variables are fixed by the choice of path types. All cycles for which *T*<sup>2</sup> > *T*<sup>1</sup> are feasible iso-κ-adiabatic cycles.

**Figure 3.** Sketch of an adiabatic-isothermal cycle for a hydrogen atom-like system. Branches [1] → [2] and [3] → [4] are (special) adiabatic legs and branches [2] → [3] and [4] → [1] are isothermal legs, respectively. Note that the adiabatic legs run along straight lines through the origin. The four corners of the cycle are the points [1] = - κ[1] , *T*[1] = (κ*in*, *T*1), [2] = - κ[2] , *T*[2] = (κ2, *T*2), [3] = - κ[3] , *T*[3] = - κ*<sup>f</sup>* , *T*<sup>2</sup> , and [4] = - κ[4] , *T*[4] = (κ4, *T*1) in the (κ, *T*) plane. Note that for given κ*in*, κ*<sup>f</sup>* > κ*in* and *T*[1] = *T*1, there remains only one variable, e.g., *T*[2] = *T*2, we are free to choose; all other variables are fixed by the choice of path types. However, only cycles for which *Tmax* <sup>2</sup> > *T*<sup>2</sup> > *T*1, with *Tmax* <sup>2</sup> <sup>=</sup> <sup>κ</sup>*<sup>f</sup>* <sup>κ</sup>*in T*1, are feasible adiabatic-isothermal cycles for the hydrogen atom-like system.

In this context, one should note that, e.g., the dielectric constant ε = ε(*p*, *T*) depends on both temperature and pressure, complicating the issue considerably; for small ranges of temperature and pressure, ε(*p*, *T*) commonly changes with temperature and pressure in an approximately linear fashion in a solid [32,33], i.e., ε(*p*, *T*) ≈ ε - *pre f* , *Tre f* + γ*<sup>T</sup>* - *pre f* , *Tre f*-*T* − *Tre f* + γ*<sup>p</sup>* - *pre f* , *Tre fp* − *pre f* Depending on the type of system, we may have γ*<sup>T</sup>* - *pre f* , *Tre f* > 0 and γ*<sup>p</sup>* - *pre f* , *Tre f* < 0, respectively [32], or the opposite [33], or other combinations. Thus, e.g., we find that κ ∼ <sup>1</sup> <sup>ε</sup><sup>2</sup> increases with pressure and decreases with temperature for CdF2 [32], and we could translate our analysis from using (κ, *T*) to (*p*, *T*) as control variables, in principle.

.

Of course, all energy levels of the hydrogen atom-like system will exhibit nonzero occupancy in thermodynamic equilibrium in general—in principle, even including the continuous distribution of energy levels associated with modified plane–wave states beyond the ionization energy (although these will most likely be irrelevant due to the assumed localization or confinement of the electron). However, for practical calculations, one can often simplify the system by considering, e.g., only the two lowest energy levels *E*<sup>1</sup> and *E*2. Frequently, such simplified models can yield some quantitative results and help to better understand the qualitative behavior of the full system [34]. Finally, we note that there are other ways to modify the electronic states of the hydrogen atom-like system, e.g., by breaking the spherical symmetry of the Hamiltonian, such that Equations (1)–(3) no longer apply. Since the corresponding changes in the eigenvalue spectrum of such a modified Hamiltonian are very specific to the way we break the symmetry and need to be treated on a case-by-case basis, we are not going to discuss such systems and only allow modifications of the hydrogen atom-like system that preserve the spherical symmetry and the 1/*r* dependence of the Coulomb potential.

## *2.2. Thermodynamic Cycles for the Hydrogen Atom-Like System*

In general, we can distinguish two ways to change the occupation of the energy levels: directly via radiation with suitable frequencies corresponding to energy differences between specific energy levels, and stochastically by contact to heat baths at various temperatures. However, in the case of a radiation driven a-thermal cycle, we are not dealing with a system close to thermodynamic equilibrium, and the classical thermodynamic optimal control might not be suitable. Thus, in this study, we focus on the more familiar cycles involving interactions with heat reservoirs.

Regarding the notation, we write *X*(*j*) or *Xj*<sup>→</sup>*j*+<sup>1</sup> to indicate that the variable, parameter, or quantity *X* belongs to leg (*j*) which runs from corner [*j*] to corner [*j* + 1] of the four-leg cycle (corner [5] = corner [1], of course). Furthermore, quantities associated with corner [*j*] are referred to as *X*[*j*] . This notation is introduced to keep the labeling of legs and corners distinct from the one for quantities such as the probability distribution <sup>→</sup> *p <sup>i</sup>* at step *i* along each branch when analyzing the effect of finite-time processes. Finally, the subscripts {κ; *T*}, {κ; *S*}, and {*S*; *T*} indicate that the quantity is associated with an iso-κ-isothermal, iso-κ-adiabatic, or adiabatic-isothermal cycle, respectively.

If we allow interaction with a heat bath, we need to consider an ensemble of identical isolated localized hydrogen atom-like systems such that we can apply statistical mechanics to evaluate the (equilibrium) probabilities of occupation of the individual energy levels. From a statistical point of view, the microstates correspond to the eigenstates of the hydrogen-like atom. For concreteness, we always define (without loss of generality) κ*in* and κ*<sup>f</sup>* > κ*in* to denote the smallest and largest value of κ on the cycle, and *T*[1] = *T*<sup>1</sup> as the lowest temperature in the cycle. Starting point of the cycle is always - κ[1] , *T*[1] = (κ*in*, *T*1). Together with the assignment of path types to the legs (adiabatic, isothermal, iso-κ), there is only one additional temperature, which we can choose, e.g., *T*[2] = *T*<sup>2</sup> or *T*[4] = *T*4; all other temperatures and κ values of the cycle are then fixed. We always assume smooth changes in both κ and *T* along the legs of the cycle, i.e., for example, the system is exposed to an infinite number of heat baths with intermediary temperatures when changing *T*.

Note that we use the terms adiabatic and isentropic essentially interchangeably for thermodynamic equilibrium paths, since we assume that the system is in thermodynamic equilibrium both at the starting and at the end point of a leg. In the general case of such an adiabatic path, only the entropy remains constant along the path. However, for some physical systems, such as the hydrogen atom-like ones we are going to discuss, not only the entropy but also the equilibrium Boltzmann distribution remains unchanged along an adiabatic path, and we call such paths "special adiabatic".

For such a macroscopic system, Figures 1 and 2 show cycles combining two iso-κ legs with two isothermal or adiabatic legs, respectively. We excite the ensemble of atoms via change in temperature *T*[1] → *T*[2] = *T*<sup>2</sup> > *T*1, while we keep κ at the value κ*in*: κ[2] = κ[1] = κ*in*. Next, we perform/extract work while we increase κ from κ[2] = κ*in* to κ[3] = κ*<sup>f</sup>* > κ*in*. This can be done adiabatically, thus involving a concomitant change in temperature during the process (*T*[2] → *T*[3] = *T*<sup>3</sup> > *T*2), or isothermally keeping the temperature constant at *T*[2] → *T*[3] = *T*<sup>3</sup> = *T*2. In leg 3, we de-excite the atom ensemble via change in temperature *T*[3] → *T*[4] = *T*<sup>4</sup> < *T*3, while we keep κ at the value κ[3] = κ[4] = κ*<sup>f</sup>* , and finally, we decrease κ from κ[4] = κ*<sup>f</sup>* back to κ[1] = κ*in*; again, this can be done either adiabatically (*T*[4] → *T*[1] = *T*<sup>1</sup> < *T*4) or isothermally at *T*[4] → *T*[1] = *T*<sup>1</sup> = *T*4. Note that for cycles containing two iso-κ branches, the only condition on *T*<sup>2</sup> is *T*<sup>2</sup> > *T*1. In the literature, one sometimes calls the iso-κ-adiabatic cycle an Otto cycle, in analogy to the isochore-adiabatic cycle, which is the underlying cycle of an Otto engine [7], and similarly, we could call the iso-κ-isothermal cycle a Stirling cycle in analogy to the isochore-isothermal cycle belonging to the Stirling engine [7].

An alternative type of cycle shown in Figure 3 would include no legs with constant κ; instead, we combine two adiabatic and two isothermal legs to the analogue of a Carnot cycle [7]. We adiabatically increase κ from κ[1] = κ*in* to κ[2] = κ2, κ*in* < κ<sup>2</sup> < κ*<sup>f</sup>* , appropriately changing the temperature during the process (*T*[1] → *T*[2] = *T*<sup>2</sup> > *T*1), followed by an isothermal leg where we increase κ from κ[2] = κ<sup>2</sup> to κ[3] = κ<sup>3</sup> = κ*<sup>f</sup>* while keeping the temperature constant at *T*[2] → *T*[3] = *T*<sup>3</sup> = *T*2. Next, we adiabatically decrease κ from κ[3] = κ<sup>3</sup> to κ[4] = κ4, κ*in* < κ<sup>4</sup> < κ*<sup>f</sup>* , while appropriately changing the temperature (*T*[3] → *T*[4] = *T*<sup>4</sup> < *T*3), and finally, we decrease κ from κ[4] = κ<sup>4</sup> back to κ[1] = κ*in* while keeping the temperature constant *T*[4] → *T*[1] = *T*<sup>1</sup> = *T*4.

Note that a feasible isothermal-adiabatic cycle usually will have an additional condition on *T*[2] . For the special adiabatic legs of a hydrogen atom-like system, feasibility requires that the temperature at the second corner fulfills the condition

$$T\_1 < T\_2 < T\_2^{\text{max}} \,\tag{4}$$

where

$$T\_2^{\text{max}} = \frac{\kappa\_f}{\kappa\_{\text{in}}} T\_1;\tag{5}$$

otherwise, leg 3 would have a larger slope than leg 1, violating the condition that κ*in* < κ2, κ<sup>4</sup> < κ*<sup>f</sup>* .

When analyzing the work performed and the heat exchanged along the legs of the cycles, we do not include the work done on the environment of the hydrogen atom-like system (e.g., the solid or the cavity), which is needed to vary κ. Of course, we can take that into account, e.g., via replacing κ by the pressure *p* as control variable if κ = κ(*p*) depends on pressure in a monotonic fashion, and then compute the work needed to establish such a pressure inside the solid. However, the focus is on the hydrogen-atom like system, and not on the whole solid or cavity where the system might be realized in the experiment. Thus, we will stay with using κ as the control variable, and only consider the change in the hydrogen atom-like system itself.

There are several general aspects that need to be considered regarding the equilibrium distributions, relaxation, and entropy/excess heat production along the cycles. How close are the instantaneous probability distributions over the states of the system to the (equilibrium) Boltzmann distributions at the various temperatures along its iso-κ legs? Similarly, for branches where κ is changed, how does the finite time available to vary κ affect our ability to keep the probability distribution close to the appropriate Boltzmann distribution for isothermal processes, and how close can the adiabatic path in (κ, *T*)-space which is realized in experiment, be to the ideal adiabatic path? All these questions directly lead to the issue of relaxation to the appropriate Boltzmann distributions in finite time, for which we can hope to derive general formulas as long as we can assume that the processes are slow enough for the system to always remain close to thermodynamic equilibrium throughout the cycle.

## *2.3. Statistical Mechanics and Thermodynamics of Cycles*

Regarding the statistical mechanics and thermodynamics of cycles, the starting point of our analysis will be the first law of thermodynamics,

$$dE = \delta Q - \delta W\tag{6}$$

along a piece of path in thermodynamic space, which is equivalent to δ*W* = δ*Q* − *dE*. Here, *dE* > 0 means that the internal energy of the system is increased along the leg, and δ*Q* > 0 means that heat is added to the atom from the reservoir(s) the atom is in contact with along the path, thus increasing the system's internal energy. δ*W* > 0 means that the system does work on the apparatus, radiation field or the environment in general, along the leg, and reduces the system's internal energy in the process. To avoid confusion, we note that in the literature δ*W*(> 0) is frequently defined in an alternative fashion to refer to the amount of work done by the apparatus on the system increasing its internal energy; as a consequence, one then would write the first law as *dE* = δ*Q* + δ*W* and δ*W* = *dE* − δ*Q*.

The connection to statistical mechanics appears via the information theoretic definition of the entropy

$$S\_{\perp} = -k\_B \sum\_{j=-1}^{N\_S} p\_j \ln(p\_j),\tag{7}$$

where *pj* is the probability for the microstate *j* to be occupied, and the sum is over all *NS* microstates [5]. In equilibrium at given temperature *T*, these probabilities π*<sup>j</sup>* correspond to the equilibrium Boltzmann probability distribution,

$$\pi\_j(T) = \frac{\exp\left(-\frac{E\_j}{k\_B T}\right)}{Z(T)}\tag{8}$$

for the case of the canonical ensemble, where the sum over states *Z*(*T*) = *NS <sup>k</sup>* <sup>=</sup> <sup>1</sup> *exp*- − *Ek kBT* serves as the normalization of the probability distribution, and *Ej* is the energy of microstate *j*. Keep in mind that the equilibrium distribution maximizes the entropy, for a given set of boundary conditions that are, e.g., defining the ensemble.

If we consider the energy levels *En*(= *E n*) of the states instead of the microstates themselves in the formula of the entropy, then we need to include the degeneracies *gn* of the energies *E n*. As far as the equilibrium probabilities are concerned, we can assume that the probabilities of occupying two states *i* and *j* with the same energy *Ei* = *Ej* = *E <sup>n</sup>* are equal; for convenience, we define <sup>ρ</sup>*<sup>n</sup>* <sup>=</sup> <sup>π</sup>*<sup>i</sup>* <sup>=</sup> <sup>π</sup>*j*, and thus

$$
\overline{\pi}\_{\mathfrak{n}} = \mathcal{g}\_{\mathfrak{n}} \rho\_{\mathfrak{n}\_{\mathfrak{n}}} \tag{9}
$$

is the equilibrium probability to find the system with energy *E n*. In general, we can write the equilibrium entropy as

$$\begin{array}{rcl} S = & -k\_{\text{B}} \sum\_{n=1}^{N\_{\text{E}}} g\_{n} \rho\_{n} \ln(\rho\_{n}) \\ & & -k\_{\text{B}} \sum\_{n=1}^{N\_{\text{E}}} \widetilde{\pi}\_{n} \ln(\rho\_{n}) \\ & & -k\_{\text{B}} \sum\_{n=1}^{N\_{\text{E}}} \widetilde{\pi}\_{n} [\ln(\widetilde{\pi}\_{n}) - \ln(\underline{g}\_{n})] \end{array} \tag{10}$$

where now the summation goes over the *NE* energy levels and π*<sup>n</sup>* are the equilibrium probabilities to find the system in a state with energy *E n*. Note that for non-degenerate states, i.e., *gn* <sup>=</sup> 1, this expression reverts to the original microstate-based formula, and for the special case π*<sup>n</sup>* <sup>=</sup> 1 for *<sup>n</sup>* <sup>=</sup> *<sup>m</sup>* while π*<sup>n</sup>* <sup>=</sup> 0 for *<sup>n</sup> m*, we obtain the formula for the entropy in the microcanonical ensemble, *S* = *kBln*(*gm*).

Finally, for those probability distributions where we deviate from the equilibrium distribution but nevertheless can assume that the probabilities of being in a state with energy *Ei* = *Ej* = *E n* are the same, we can define *rn* <sup>=</sup> *pi* <sup>=</sup> *pj*, and thus *pn* <sup>=</sup> *gnrn*. Then, we get for the entropy the expression *S* = −*kB NE <sup>n</sup>* <sup>=</sup> <sup>1</sup> *gnrnln*(*rn*) = <sup>−</sup>*kB NE <sup>n</sup>* <sup>=</sup> <sup>1</sup> *pnln pn gn* and the normalization *NE <sup>n</sup>* <sup>=</sup> <sup>1</sup> *gnrn* <sup>=</sup> *NE <sup>n</sup>* <sup>=</sup> <sup>1</sup> *pn* <sup>=</sup> *NS <sup>j</sup>* <sup>=</sup> <sup>1</sup> *pj* = 1. Note that this is a substantial restriction in the set of allowed probability distributions; thus, unless this assumption is valid, we need to employ the microstate formulation of the problem.

As a shorthand notation, we can represent the probability distributions by vectors <sup>→</sup> *p* = - *p*1, ... , *pNS* , and expressions like *NS <sup>j</sup>* <sup>=</sup> <sup>1</sup> *pjln*- *pj* can be written as

$$\sum\_{j=-1}^{N\_S} p\_j \ln(p\_j) \, \, = \, \overrightarrow{p} \cdot \ln(\overrightarrow{p}) \, \, \, \tag{11}$$

where *ln*-→ *p* = - *ln*(*p*1), ... , *ln*- *pNS* . Similarly, <sup>→</sup> *E* = - *E*1, ... , *ENS* , and we can relate the equilibrium probabilities of the Boltzmann distribution to the energies via

$$
\overrightarrow{E} = -k\_B T \ln \left( \overrightarrow{\pi} \right) + \mathbf{C} \left( \overrightarrow{\pi} \right)
\overrightarrow{1} = -k\_B T \ln \left( \overrightarrow{\pi} \right) - k\_B T \ln \left( \mathbf{g} \left( \overrightarrow{\pi} \right) \right)
\overrightarrow{1},
\tag{12}
$$

where *g* -→ π is a constant that can be related to an overall shift of the energy scale, and <sup>→</sup> 1 = (1, ... , 1)[35]. The expectation value of the energy is then given by

$$\sum\_{j=-1}^{N\_S} p\_j E\_j = \overrightarrow{E} \cdot \overrightarrow{p}\_\* \tag{13}$$

or, for the case of the expectation value in equilibrium, *NS <sup>j</sup>* <sup>=</sup> <sup>1</sup> <sup>π</sup>*jEj* <sup>=</sup> <sup>→</sup> *E*· → π. Note that some of these energies will appear many times in this vector if the energy level is degenerate. Another example is the expectation value of the square of the energy, *NS <sup>j</sup>* <sup>=</sup> <sup>1</sup> π*<sup>j</sup>* - *Ej* <sup>2</sup> <sup>=</sup> → *E*2· → π, where → *E*<sup>2</sup> = (*E*1) 2 , ... , - *ENS* 2 . If appropriate, we can replace the sums over the *NS* microstates by sums over the *NE* energies, i.e., *NS <sup>j</sup>* <sup>=</sup> <sup>1</sup> <sup>π</sup>*jEj* <sup>=</sup> *NE <sup>j</sup>* <sup>=</sup> <sup>1</sup> π*jE <sup>j</sup>* <sup>=</sup> → *E* · → π, where <sup>→</sup> <sup>π</sup> <sup>=</sup> - π1, ... , π*NE* and → *E* <sup>=</sup> - *E* 1, ... , *<sup>E</sup> NE* , or for the entropy *S* = −*kB NE <sup>n</sup>* <sup>=</sup> <sup>1</sup> π*nln*(ρ*n*) <sup>=</sup> <sup>−</sup>*kB* → π·*ln*-→ ρ where *ln*-→ ρ = - *ln*(ρ1), ... , *ln*- ρ*NE* = *ln*π1 *g*1 , ... , *ln* π*NE gNE* . In the case of the single atom-like system, the microstates correspond to the eigenfunctions of the Hamiltonian of an electron (or a quasi-particle) in a (shielded) Coulomb potential. Note that we are not considering the degeneracy due to the multiple copies of the atom-like system in the ensemble—the ensemble is only introduced to allow us to visualize the occupation probabilities of the single atom-like system with which we are dealing.

Since the energy is a state function, the change of its equilibrium expectation value

$$<\langle E \rangle = \sum\_{j=1}^{N\_S} E\_j \pi\_j = \stackrel{\rightarrow}{E} \stackrel{\rightarrow}{\cdot \pi} \tag{14}$$

along a leg (*j*) of the path does not depend on the choice of path, i.e., the total change in energy can be computed directly from taking the difference between the two states,

$$
\langle \Delta E \rangle\_{j \to j+1} = \langle E \rangle^{[j+1]} - \langle E \rangle^{[j]}.\tag{15}
$$

For the heat delivered/absorbed by the atom along a leg (*j*) (parametrized by λ ∈ λ[*j*] , λ[*j*+1] ), we can use the formula

$$\begin{split} Q^{(j)}\_{\overrightarrow{\pi}} &= \prescript{}{\text{Sil}}{\text{Sil}}^{[j+1]} T \text{d}\mathbf{S} = -\text{k} \oint\_{\text{l}}^{[j+1]} T(\lambda) \frac{d}{d\lambda} [\overrightarrow{\pi} \cdot \ln(\overrightarrow{\pi})] d\lambda \\ &\qquad \qquad \qquad \qquad \frac{d\overrightarrow{\pi}}{d\lambda} d\lambda = -\text{k}\_{B} \oint\_{\overleftarrow{\pi}^{[j+1]}}^{\overrightarrow{\pi}^{[j+1]}} T(\overrightarrow{\pi}) [\ln(\overleftarrow{\pi}) + \overrightarrow{1}] \cdot d\overrightarrow{\pi}, \end{split} \tag{16}$$

if we stay at the equilibrium distribution along the path, and an analogous expression in <sup>→</sup> *p* if we deviate from the equilibrium distribution because of, e.g., finite-time effects:

$$Q\_{\overrightarrow{p}}^{(j)} = \int\_{S^{[j]}}^{S^{[j+1]}} TdS = -k\_B \int\_{\lambda^{[j]}}^{\lambda^{[j+1]}} T(\lambda) \left[ \ln \left( \overrightarrow{p} \left( \lambda \right) \right) + \overrightarrow{1} \right] \cdot \frac{d\overrightarrow{p}}{d\lambda} d\lambda. \tag{17}$$

Finally, the work performed by the atom can be computed via the first law by taking the difference between δ*Q* and *dE* along the path. Along the legs where κ is constant, both *Q* and Δ*E* will vary as they are both functions of the probability distribution, which in turn evolves as the temperature changes. To compute Δ*E* is no problem, but the expression for *Q* is nontrivial. We can switch coordinates to follow the change in temperature instead of the change in entropy,

$$Q\_{\overrightarrow{j}\rightarrow\overrightarrow{j}+1} = \prescript{}{S^{[j+1]}}{\int\_{S^{[j]}} TdS} = \left[ T^{[j+1]}S^{[j+1]} - T^{[j]}S^{[j]} \right] - \int\_{T^{[j]}}^{T^{[j+1]}} S dT = \left[ T^{[j+1]}S^{[j+1]} - T^{[j]}S^{[j]} \right] + \\ \tag{18}$$

$$k\_B \int\_{T^{[j]}}^{T^{[j+1]}} \overrightarrow{\pi}(T) \cdot \ln\Big(\overrightarrow{\pi}(T)\Big) dT,$$

However, we note that this way of writing *Q*(*j*) does not necessarily make the integral easier to perform in general either, even though κ, and thus all the energy levels *En*(κ), are constant along these legs of the cycle. However, since the work δ*W* would usually be associated with changes in κ, we expect that *W* = 0 along thermodynamic equilibrium paths with fixed κ, and therefore, *Q* = Δ*E*. Using Equations (16) and (12), we find:

*W*(*j*) = *Q*(*j*) − (Δ*E*) (*j*) <sup>=</sup> *<sup>S</sup>*[*j*+1] *<sup>S</sup>*[*j*] *TdS* <sup>−</sup> [*E* [*j*+1] − *E* [*j*] ] = − → π(*T*[*j*+1] ) → π(*T*[*j*] ) *kBT*[*ln*( → <sup>π</sup>) + <sup>→</sup> 1 ]·*d* → π − → *E*(κ*in*)·( → π(κ*in*, *T*[*j*+1] ) <sup>−</sup> <sup>→</sup> π(κ*in*, *T*[*j*] )) = − → π(*T*[*j*+1] ) → π(*T*[*j*] ) *kBT*[*ln*( → <sup>π</sup>) + <sup>→</sup> 1 ]·*d* → π − → π(*T*[*j*+1] ) → π(*T*[*j*] ) → *E*(κ*in*)·*d* → π = − → π(*T*[*j*+1] ) → π(*T*[*j*] ) {*kBT*[*ln*( → <sup>π</sup>) + <sup>→</sup> <sup>1</sup> ] + <sup>→</sup> *E*(κ*in*)}·*d* → π = − → π(*T*[*j*+1] ) → π(*T*[*j*] ) {*kBT*[*ln*( → <sup>π</sup>) + <sup>→</sup> 1 ] − *kBT ln*( → π) + *ln*(*g*( → π)) → 1 }·*d* → π = − → π(*T*[*j*+1] ) → π(*T*[*j*] ) {*kBT*[*ln*( → <sup>π</sup>) + <sup>→</sup> 1 − *ln*( → π) − *ln*(*g*( → π)) → 1 ]}·*d* → π = − → π(*T*[*j*+1] ) → π(*T*[*j*] ) {*kBT*[<sup>1</sup> <sup>−</sup> *ln*(*g*( → π))]} → 1 ·*d* → π = 0 , (19)

since <sup>→</sup> 1 ·*d* → π = 0 along a thermodynamic equilibrium path because of probability conservation. Note that we have not exploited the fact that we are dealing with a hydrogen atom-like system, and thus this result is general for any statistical mechanical system along legs with κ = constant, even for the most general case of many control parameters κ=ˆ → κ = (κ*a*, κ*b*, ...).

If we consider the complete cycle, the changes in energy will sum to zero, and thus *W* = *Q* over the whole cycle, i.e., the net heat added to the atom over the cycle must be converted into net work done by the atom on the apparatus. The discussion in this subsection is standard procedure from equilibrium thermodynamics [5,6], but has been included to establish the concepts and notation needed for analyzing the thermodynamics of the cycles of statistical mechanical systems in finite time in the next sections.

## **3. Optimal Control Criterion for Finite-Time Thermodynamic Cycles of General Statistical Mechanical Systems**

## *3.1. Finite-Time Optimal Control along a General Path in* (κ, *T*) *Space*

If thermodynamic processes are performed in finite time, one usually encounters deviations in the heat exchanged and work performed along the path from those values that one finds for the ideal quasi-static processes for which infinite times are available, because the system cannot maintain thermodynamic equilibrium over the whole cycle when the total time τ is finite. As a consequence, a net amount of entropy is produced over the whole cycle or excess heat/work is found while the system tries to move towards or stay close to the elusive thermal equilibrium along the path. Typically, one would attempt to minimize this entropy or excess heat production, leading to the formulation of the minimum excess heat/work production optimal control problems discussed in finite-time thermodynamics. In this study, we will focus on minimum entropy production and minimum excess heat production; other possible optimal control objectives such as maximum power or maximum efficiency are not considered. In the following, the subscript *Q* will indicate minimization of excess heat, while the subscript *S* indicates minimization of entropy production.

In general, one would need to analyze each process in depth, in order to compute the excess heat or excess work associated with the given physical situation. However, we can perform an approximate analysis of the difference *IQ* = *Q*<sup>→</sup> <sup>π</sup> <sup>−</sup> *<sup>Q</sup>*<sup>→</sup> *p* between the heat *Q*<sup>→</sup> <sup>π</sup> we would obtain under the assumption that along the path the system is everywhere in thermodynamic equilibrium, i.e., → *p i* (*Ti*) <sup>=</sup> <sup>→</sup> π*i*(*Ti*), and the corresponding expression *Q*<sup>→</sup> *<sup>p</sup>* along the path for the real probability distribution where <sup>→</sup> *p i* (*Ti*) - <sup>→</sup> <sup>π</sup>*i*(*Ti*), yet <sup>→</sup> *p i* (*Ti*) is nevertheless close to <sup>→</sup> π*i*(*Ti*) and just a bit "behind", i.e., we can approximate <sup>→</sup> *p i* (*Ti*) as <sup>→</sup>

$$
\overrightarrow{p}\_i(T\_i) = \overrightarrow{\pi}\_{i-1}(T\_{i-1}) \,\tag{20}
$$

For the remainder of this study, we will assume that Equation (20) is a suitable approximation; the issue of incomplete relaxation to equilibrium of <sup>→</sup> *p i* (*Ti*) to <sup>→</sup> π*i*−1(*Ti*<sup>−</sup>1) is discussed in Refs. [35,36].

Using Equations (16) and (17) where λ now corresponds to time, we get

$$\begin{split} I\_{Q} &= Q\_{\overrightarrow{\pi}} - Q\_{\overrightarrow{p}} = -k\_{\text{B}} \int\_{0}^{\pi} T(t) \Big\{ \overset{\cdot}{\pi} \Big[ \ln \left( \overrightarrow{\pi} \left( t \right) \right) + \overset{\cdot}{1} \Big] - \overset{\cdot}{p} \Big[ \ln \left( \overrightarrow{p} \left( t \right) \right) + \overset{\cdot}{1} \Big] \Big\} dt \approx -k\_{\text{B}} \int\_{0}^{\pi} T(t) \overset{\cdot}{\pi} \cdot dt \\ & \Big\{ \ln \left( \overrightarrow{\pi} \left( t \right) \right) - \ln \left( \overrightarrow{p} \left( t \right) \right) \Big\} dt \approx k\_{\text{B}} \int\_{0}^{\pi} T(t) \overset{\cdot}{\pi} \cdot \Big[ \frac{d}{d\pi} \ln \left( \overrightarrow{\pi} \left( t \right) \right) \left( \overrightarrow{\pi} \left( t \right) - \overrightarrow{p} \left( t \right) \right) \Big] dt \approx \\ & \sum\_{i=1}^{N\_{el}} \binom{\overline{\gamma}\_{i} - \overline{\pi}\_{i-1}}{\pi\_{i}} \Big[ \binom{\overline{k}\_{\text{B}} \overline{T}\_{i}}{\overline{\pi}\_{i}} \Big] \Big( \overline{\pi}\_{i} - \overline{p} \Big) \approx \sum\_{i=1}^{N\_{el}} \binom{\overline{\gamma}\_{i} - \overline{\pi}\_{i-1}}{\pi\_{i}} \Big[ \frac{k\_{\text{B}} T\_{i}}{\overline{\pi}\_{i}} \Big] \Big( \overline{\pi}\_{i} - \overline{\pi}\_{i-1} \Big) . \end{split} \tag{21}$$

Here, *Nst* is the number of possible steps in (κ, *T*) space during the finite time τ assuming that each temperature-plus-κ change requires a "relaxation-to-equilibrium" time of (Δ*t*)*st*, i.e., τ = *Nst*(Δ*t*)*st*. In the above derivation, several approximations were applied. First, we have employed the fact that → *<sup>p</sup>* (*t*) essentially follows <sup>→</sup> π(*t*), and thus . → π = . → *p* to first order in -→ <sup>π</sup>(*t*) <sup>−</sup> <sup>→</sup> *p* (*t*) . Furthermore, we assumed that -→ <sup>π</sup>(*t*) <sup>−</sup> <sup>→</sup> *p* (*t*) is very small, and thus we can make a Taylor expansion of *ln*-→ *p* (*t*) about <sup>→</sup> π(*t*). Next, we assumed that we can make a large number of changes in (κ, *T*) along the path, such that we can replace the integral by a sum over such discrete changes, resulting in . → π*dt* ≈ . → π(Δ*t*)*st* ≈ -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> , and finally we assumed that Equation (20) holds, i.e., <sup>→</sup> *<sup>p</sup> <sup>i</sup>* <sup>≈</sup> <sup>→</sup> π*i*<sup>−</sup>1.

Analogously, we can derive an expression for the entropy production over the path as

$$\begin{split} I\_S &= -k\_B \int\_0^t \left\{ \stackrel{\cdot}{\pi} \cdot \left[ \ln \left( \stackrel{\cdot}{\pi} (t) \right) + \stackrel{\cdot}{1} \right] - \stackrel{\cdot}{p} \cdot \left[ \ln \left( \stackrel{\cdot}{p} (t) \right) + \stackrel{\cdot}{1} \right] \right\} dt \\ &\approx \sum\_{i=1}^{N\_{\text{st}}} \binom{\stackrel{\cdot}{\pi} \, \_i - \stackrel{\cdot}{\pi}\_{i-1}}{\left( \stackrel{\cdot}{\pi}\_i - \stackrel{\cdot}{\pi}\_{i-1} \right)} \cdot \left\{ \frac{k\_B}{\pi\_i} \right\} \Big( \stackrel{\cdot}{\pi}\_i - \stackrel{\cdot}{\pi}\_{i-1} \Big). \end{split} \tag{22}$$

Looking at the expressions for the excess heat and the entropy production that are to be minimized, we see that <sup>↔</sup> *MQ* = *kBTi* <sup>↔</sup> π*i* and <sup>↔</sup> *MS* = *kB* ↔ π*i* , repectively, are positive definite diagonal matrices that can serve as metrics in the space of probability distributions with components

$$(\stackrel{\leftrightarrow}{\dot{M}}\_Q)\_{kl} = \left\{ \frac{k\_B T\_{\dot{i}}}{\stackrel{\leftrightarrow}{\pi\_i}} \right\}\_{kl} = \frac{k\_B T\_{\dot{i}}}{\pi\_k (\kappa\_{i\dot{\nu}} T\_{\dot{i}})} \delta\_{kl} \text{ and } (\stackrel{\leftrightarrow}{\dot{M}}\_S)\_{kl} = \left\{ \frac{k\_B}{\stackrel{\leftrightarrow}{\pi\_i}} \right\}\_{kl} = \frac{k\_B}{\pi\_k (\kappa\_{i\dot{\nu}} T\_{\dot{i}})} \delta\_{kl\prime} \tag{23}$$

which allows us to define distances in thermodynamic space, and thus yield the corresponding thermodynamic lengths of the path. Note that both the temperature *Ti* and <sup>→</sup> π*<sup>i</sup>* (which is a function of (κ*i*, *Ti*)) depend on *<sup>i</sup>*, and thus the metrics <sup>↔</sup> *MQ*/*<sup>S</sup>* vary along the path. *IQ*/*<sup>S</sup>* is now minimized by picking the stopping points along the path such that the thermodynamic lengths

$$\begin{aligned} \left(\Delta L\_{Q}\right)\_{i} &= \left[ \left(\overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i-1}}\right) \left(\frac{k\_{B}T\_{i}}{\overrightarrow{\pi\_{i}}}\right) \left(\overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i-1}}\right) \right]^{1/2} \text{ or } (\Delta L\_{S})\_{i} = \left[ \left(\overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i-1}}\right) \left(\frac{k\_{B}}{\overrightarrow{\pi\_{i}}}\right) \left(\overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i-1}}\right) \right]^{1/2}, \end{aligned} \tag{24}$$

respectively, of all *Nst* pieces of the path are equal. This follows from the Cauchy–Schwarz inequality

$$I\_{Q/S} = \sum\_{i=-1}^{N\_{st}} \left[ \left( \Delta L\_{Q/S} \right)\_i \right]^2 \ge \frac{1}{N\_{st}} \left[ \sum\_{i=-1}^{N\_{st}} \left( \Delta L\_{Q/S} \right)\_i \right]^2 = \frac{\left[ \left( \Delta L\_{Q/S} \right)\_{\text{total}} \right]^2}{N\_{st}},\tag{25}$$

implying that equality holds only if the lengths of all individual pieces -Δ*LQ*/*<sup>S</sup> i* are equal,

$$\left(\Delta I\_{Q/S}\right)\_i = \frac{\left(\Delta L\_{Q/S}\right)\_{\text{total}}}{N\_{st}}.\tag{26}$$

Note that this criterion of equal thermodynamic lengths of sub-pieces is equivalent to the constant thermodynamic speed criterion [37] employed, e.g., in the context of optimization of global optimization algorithms [38], where thermodynamic speed corresponds to thermodynamic distance per relaxation, i.e., time is measured in units of relaxation-to-equilibrium times.

Since <sup>↔</sup> *MQ* = *kBTi* <sup>↔</sup> π*i* is a diagonal matrix, we can rewrite each term in the sum as

$$\left(\overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i-1}}\right) \cdot \begin{Bmatrix} k\_{B}T\_{i} \\ \frac{\overrightarrow{\pi\_{i}}}{\overrightarrow{\pi\_{i}}} \end{Bmatrix} \begin{pmatrix} \overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i-1}} \end{pmatrix} \\ = \, ^{k}\_{B}T\_{i} \sum\_{k\_{B}=1}^{N\_{S}} \frac{(d\pi\_{i})\_{k}(d\pi\_{i})\_{k}}{(\pi\_{i})\_{k}},\tag{27}$$

where *d* → π*<sup>i</sup>* = -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> = ((*d*π*i*)1, ...(*d*π*i*)*NS* )is the infinitesimal difference between the equilibrium probability distributions at steps *i* − 1 and *i*. For the total length of the path along, e.g., leg (*j*) with *N*(*j*) steps, we thus get the expression

$$\begin{split} \boldsymbol{L}\_{Q}^{(j)} &= \begin{aligned} &\boldsymbol{L}\_{Q}^{(j)} = \begin{bmatrix} \overleftarrow{\boldsymbol{\pi}}\_{i}^{N(j)} & \overleftarrow{\boldsymbol{\pi}}\_{i}^{\*} - \overleftarrow{\boldsymbol{\pi}}\_{i-1} \end{bmatrix} \begin{Bmatrix} \overleftarrow{k\_{B}T\_{i}} \begin{pmatrix} \overleftarrow{\boldsymbol{\pi}}\_{i} - \overleftarrow{\boldsymbol{\pi}}\_{i-1} \end{pmatrix} & \boldsymbol{\pi}\_{i} \end{bmatrix} = \boldsymbol{\Sigma}\_{i-1}^{N(j)} \sqrt{\begin{vmatrix} \boldsymbol{k}\_{B}T\_{i} \ \boldsymbol{\sum}\_{k=1}^{N\_{S}} \frac{(d\boldsymbol{\pi}\_{i})\_{k}(d\boldsymbol{\pi}\_{i})\_{k}}{(\boldsymbol{\pi}\_{i})\_{k}} \end{vmatrix}} \\ & \left| \int\_{\mathbf{k}\mathbf{y}} \sqrt{\begin{vmatrix} \boldsymbol{k}\_{B}T(\boldsymbol{\lambda}) \ \sum\_{k=1}^{N\_{S}} \frac{(d\boldsymbol{\pi}(\boldsymbol{\lambda}))\_{k}(d\boldsymbol{\pi}(\boldsymbol{\lambda}))\_{k}}{(d\boldsymbol{\lambda})^{2}\_{k}(\boldsymbol{\pi}(\boldsymbol{\lambda}))\_{k}} \end{vmatrix}} d\boldsymbol{\lambda} \right| \end{split} \tag{28}$$

where λ is the variable of integration along the branch (*j*). Note that we have taken the absolute value of the integral, since *<sup>L</sup>*(*j*) *<sup>Q</sup>* <sup>≥</sup> 0 by definition, independent of whether <sup>λ</sup> increases or decreases along the path. Analogously, we obtain for *<sup>L</sup>*(*j*) *<sup>S</sup>* the expression

$$L\_S^{(j)} = \left| \int\_{\log\_{\hat{\mathbb{S}}}(j)} \sqrt{k\_B} \sqrt{\left| \sum\_{k=1}^{N\_S} \frac{1}{(\pi(\lambda))\_k} \left( \frac{(d\pi(\lambda))\_k}{d\lambda} \right)^2 \right|} d\lambda \right|. \tag{29}$$

Of course, we must first choose the path in (κ, *T*)-space between the starting and end point of the leg in such a way that its total length is minimal. For general statistical mechanical systems, where the Hamiltonian is controlled not only by one single parameter <sup>κ</sup> but by a whole set of such parameters <sup>→</sup> κ = (κ*a*, κ*b*, ...), this task is usually very complex. However, for the individual legs of the cycles for the hydrogen atom-like system, this is trivial, as we have only one parameter which can be varied (either just κ with fixed *T* for the isothermal leg, or both κ and *T* but in a synchronized fashion along the adiabatic leg, or finally only *T* with fixed κ along the iso-κ leg), and thus the path itself is given, and we can only vary the location of the steps *i* along the path. One additional aspect needs to be addressed: the optimization encompasses the whole cycle, and thus the available time τ needs to be distributed over the four legs, i.e., we have τ = τ(1) + τ(2) + τ(3) + τ(4). In principle, this poses no difficulty as long as the relaxation times per step are the same for all legs, Δ*t* (*j*) = (Δ*t*)*<sup>T</sup>* = (Δ*t*)<sup>κ</sup> = (Δ*t*)*a*, regardless of whether we are dealing with an isothermal, iso-κ, or adiabatic leg: knowing the thermodynamic lengths for the four legs *L*(1), *L*(2), *L*(3), and *L*(4), we use *Lcycle* = *L*(1) + *L*(2) + *L*(3) + *L*(4) and the principle of constant thermodynamic speed [37] to assign the times as

$$
\pi^{(j)} = \frac{L^{(j)}}{L\_{\text{cycle}}} \tau. \tag{30}
$$

Once τ(*i*) is known, then the number of available steps along the leg is given by

$$N^{(j)} = \frac{\mathfrak{r}^{(j)}}{\Delta t^{(j)}}.\tag{31}$$

However, if the relaxation times vary between the legs—or more generally, vary along the legs as function of κ and *T*, i.e., (Δ*t*)*st* = (Δ*t*)*st*(κ, *T*)—, we need to be more circumspect. Assuming that (Δ*t*)*st*(κ, *T*) is known, in a first step, we would evaluate the average relaxation time along the path, (Δ*t*)*av*, which allows us to compute an estimate of the number of discrete steps along the path *Nst* = τ/(Δ*t*)*av*. With this information, we can use Equation (25) to compute the optimal length of each sub-piece *<sup>i</sup>*, (Δ*L*)*<sup>i</sup>* <sup>=</sup> (Δ*L*)*opt* <sup>=</sup> *Lcycle Nst* <sup>=</sup> *Lcycle* <sup>τ</sup> (Δ*t*)*av*. By construction, the value of (Δ*L*)*opt* is independent of the position (κ*i*, *Ti*) of sub-piece *i* along the path. Since the relaxation time varies with position *i*, we now need to assign each sub-piece *i* its own time τ(κ*i*, *Ti*) = τ*<sup>i</sup>* = (Δ*t*)*st*(κ*i*, *Ti*). As long as the relaxation times do not vary much along the path, the sum of the assigned times *Nst <sup>i</sup>* <sup>=</sup> <sup>1</sup> <sup>τ</sup>*<sup>i</sup>* = <sup>τ</sup>*cycle* will nearly equal the total available time <sup>τ</sup>*cycle* <sup>≈</sup> <sup>τ</sup>, and the result is self-consistent. Otherwise, we need to set up a feedback loop and re-compute *Nst*, via, e.g., *<sup>N</sup>*(*k*+1) *st* <sup>=</sup> *<sup>N</sup>*(*k*) *st* τ τ (*k*) *cycle* , and

then assign <sup>τ</sup>*i*, until self-consistency has been reached, i.e., *N*(*k*) *st <sup>i</sup>* <sup>=</sup> <sup>1</sup> τ (*k*) *<sup>i</sup>* = τ (*k*) *cycle* = <sup>τ</sup>. For further discussions concerning the influence of varying relaxation times in step optimal control processes, we refer to the literature [35,36].

Note that this derivation did not depend on the specific features of the hydrogen atom-like system. Thus, the minimal thermodynamic length criterion of optimality we have derived is valid for general statistical mechanical systems, whose Hamiltonian is controlled by a set of parameters <sup>→</sup> κ = (κ*a*, κ*b*, ...). In this context, we note that the metric <sup>↔</sup> *MQ* at each point *i* along the path is proportional to *Ti*, and thus we expect that the branches (*j*) (or parts thereof) that lie in a high temperature region, should exhibit larger thermodynamic lengths *<sup>L</sup>*(*j*) *<sup>Q</sup>* than those at lower temperatures since the formulas for those lengths contain <sup>√</sup> *Ti* as factors in each term or integral.

We now turn to the three special cases of iso-κ, isothermal, and isentropic (adiabatic and special adiabatic) paths.

## *3.2. Finite-Time Optimal Control along Isothermal Legs*

For the legs with isothermal change in the parameter κ, Equation (21) yields for the excess heat *IQ*;*iso*−*<sup>T</sup>* ≈ *kBT N*<sup>κ</sup> *i* = 1 -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> · 1 ↔ π*i* -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> and similarly, Equation (22) for the entropy production *IS*;*iso*−*<sup>T</sup>* ≈ *kB N*<sup>κ</sup> *i* = 1 -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> · 1 ↔ π*i* -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> = *IQ*;*iso*−*T*/*T*, where *N*<sup>κ</sup> is the number of changes in the value of κ along the branch, which are feasible during the finite time τ assuming that each κ change takes at least a time of (Δ*t*)κ, i.e., τ = *N*κ(Δ*t*)κ. Again, *IQ*/*<sup>S</sup>* is minimized by picking the stopping points along the path such that the thermodynamic lengths

$$\left(\Delta L\_Q\right)\_i = \sqrt{\text{kg}} \overline{T} \Big[ \left(\overrightarrow{\pi}\_i - \overrightarrow{\pi}\_{i-1}\right) \Big| \left(\frac{1}{\overline{\pi}\_i}\right) \left(\overrightarrow{\pi}\_i - \overrightarrow{\pi}\_{i-1}\right) \Big]^{1/2} \text{ or } \left(\Delta L\_S\right)\_i = \sqrt{\text{kg}} \Big[ \left(\overrightarrow{\pi}\_i - \overrightarrow{\pi}\_{i-1}\right) \Big| \left(\frac{1}{\overline{\pi}\_i}\right) \left(\overrightarrow{\pi}\_i - \overrightarrow{\pi}\_{i-1}\right) \Big|^{1/2}, \tag{32}$$

respectively, of all *N*κ pieces of the path are equal,

$$\left(\Delta I\_{Q/S}\right)\_{\dot{i}} = \frac{\left(\Delta L\_{Q/S}\right)\_{\text{total}}}{N\_{\text{k}}}.\tag{33}$$

We realize that the change in κ can be interpreted as the change in the Hamiltonian of the system. Thus, the isothermal branch of the cycle for a system with only one control parameter κ represents a special case of the general estimates of the difference between computational work and the free energy (at constant temperature)—which is computed via various thermodynamic integration methods [39–41] between two different Hamiltonians in finite time—, for which the optimal control problem has been analyzed in earlier work [35]. In this earlier study, it had been found that as long as we can stay close to the equilibrium distribution such that we can assume that the actual probability distribution <sup>→</sup> *p <sup>i</sup>* at step *<sup>i</sup>* equals the equilibrium probability distribution <sup>→</sup> π*i*−<sup>1</sup> at the previous step *i* − 1, the amount of excess work along an isothermal leg is given by

$$\begin{split} I\_{\text{iso}-T} &= \; \mathcal{W}\_{\text{iso}-T} - \Delta F\_{\text{iso}-T} = \int\_{0}^{\tau} \overset{\cdot}{E} \Big( \overrightarrow{p} - \overrightarrow{\pi} \Big) dt = k\_{B} T \int\_{0}^{\tau} \overset{\cdot}{\overline{\pi}} \cdot \Big\{ \frac{1}{\pi} \Big\} \cdot \left( \overrightarrow{\pi} - \overrightarrow{p} \right) dt \approx \\ & \sum\_{i=1}^{N\_{\text{x}}} \underline{\pi}\_{i}^{\text{N}} \Big( \overrightarrow{\pi}\_{i} - \overrightarrow{\pi}\_{i-1} \Big) \cdot \Big\{ \frac{k\_{B}T}{\overline{\pi}\_{i}} \Big\} \Big( \overrightarrow{\pi}\_{i} - \overrightarrow{p}\_{i} \Big) \approx k\_{B} T \sum\_{i=1}^{N\_{\text{x}}} \Big( \overrightarrow{\pi}\_{i} - \overrightarrow{\pi}\_{i-1} \Big) \cdot \Big\{ \frac{1}{\pi} \Big\} \Big( \overrightarrow{\pi}\_{i} - \overrightarrow{\pi}\_{i-1} \Big). \end{split} \tag{34}$$

However, this is just the same expression as *IQ*;*iso*−*T*, which we have obtained for the excess heat along an isothermal leg in (κ, *T*)-space, as one would have already expected from energy conservation. Since the temperature is constant along the path, we can pull *T* as a factor in front of the summation when computing the excess heat, and thus the thermodynamic length *LQ* of an isothermal leg (*j*) is proportional to <sup>√</sup> *<sup>T</sup>*(*j*). Nevertheless, since the matrix 1 ↔ π*i* varies along the path, the computation of the thermodynamic length is not trivial in general.

Equations (28) and (29) can be specialized to an isothermal path by replacing λ by κ, and explicitly computing

$$\frac{\partial \pi\_k}{\partial \kappa} = -\frac{1}{k\_B T} \pi\_k \left[ \frac{\partial E\_k}{\partial \kappa} - \sum\_j \frac{\partial E\_j}{\partial \kappa} \pi\_j \right] = -\frac{1}{k\_B T} \pi\_k \left[ \frac{\partial E\_k}{\partial \kappa} - \left( \frac{\overleftarrow{\partial E}}{\partial \kappa} \right) \overrightarrow{\pi} \right] \tag{35}$$

and

$$\begin{split} &\sum\_{k=1}^{N\_{\mathcal{S}}} \frac{1}{(\pi(\boldsymbol{\lambda}))\_{k}} \Big( \frac{(d\boldsymbol{\pi}(\boldsymbol{\lambda}))\_{k}}{d\boldsymbol{\lambda}} \Big)^{2} = \quad \sum\_{k=1}^{N\_{\mathcal{S}}} \frac{1}{\pi\_{k}} \Big( -\frac{1}{k\_{B}T} \pi\_{k} \Big[ \frac{\partial E\_{k}}{\partial \boldsymbol{\kappa}} - \left( \frac{\partial}{\partial \boldsymbol{\kappa}} \right) \overline{\boldsymbol{\pi}} \Big]^{2} \\ &= \frac{1}{(k\_{B}T)^{2}} \sum\_{k=1}^{N\_{\mathcal{S}}} \Big[ \pi\_{k} \Big[ \frac{\partial E\_{k}}{\partial \boldsymbol{\kappa}} - \left( \frac{\partial E\_{j}}{\partial \boldsymbol{\kappa}} \right) \overline{\boldsymbol{\pi}} \Big]^{2} \Big] \\ &= \frac{1}{(k\_{B}T)^{2}} \Big( \overline{\boldsymbol{\pi}} \Big( \frac{\partial E}{\partial \boldsymbol{\kappa}} \Big)^{2} - \Big( \left( \frac{\partial E}{\partial \boldsymbol{\kappa}} \right) \overline{\boldsymbol{\pi}} \Big)^{2} \Big) = \quad \frac{1}{(k\_{B}T)^{2}} Var\_{\overline{\boldsymbol{\pi}}} \Big( \frac{\partial E}{\partial \boldsymbol{\kappa}} \Big). \end{split} \tag{36}$$

Plugging this into Equations (28) and (29), we obtain

$$L\_{Q\text{iso}-T}^{(j)} = \left| \frac{1}{\sqrt{\mathbf{k}\_B T}} \int\_{\mathbf{x}\mathbb{i}\mathbb{I}}^{\mathbf{x}^{[j+1]}} \sqrt{\text{Var}\_{\pi}\left(\frac{\partial E}{\partial \mathbf{x}}\right)} d\mathbf{x} \right| \text{ and } L\_{S\text{iso}-T}^{(j)} = \left| \frac{1}{\sqrt{\mathbf{k}\_B T^2}} \int\_{\mathbf{x}\mathbb{i}\mathbb{I}}^{\mathbf{x}^{[j+1]}} \sqrt{\text{Var}\_{\pi}\left(\frac{\partial E}{\partial \mathbf{x}}\right)} d\mathbf{x} \right|. \tag{37}$$

respectively. Note that the term under the square root is the variance of <sup>∂</sup>*<sup>E</sup>* ∂κ with respect to the equilibrium probability distribution <sup>→</sup> π(κ, *T*), *Var*<sup>→</sup> π - ∂*E* ∂κ , as function of *T* and κ.

## *3.3. Finite-Time Optimal Control along Iso-*κ *Legs*

Next, we turn to the case of changing temperature while keeping κ constant. Along those branches, only the temperature varies, but we cannot directly profit from the fact that κ is constant when computing the excess heat. Equations (21) and (22) yield *IQ*;*iso*−<sup>κ</sup> <sup>≈</sup> *NT i* = 1 -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> · *kBTi* <sup>↔</sup> π*i* -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> and *IS*;*iso*−<sup>κ</sup> <sup>≈</sup> *NT i* = 1 -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> · *kB* ↔ π*i* -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> , respectively, where *NT* is the number of changes in the value of the temperature *T* along the branch, which are feasible during the finite time τ, assuming that each temperature change takes at least a time of (Δ*t*)*T*, i.e., τ = *NT*(Δ*t*)*T*.

Again, we see that finding the optimal solution of distributing *NT* temperature changes over the path corresponds to minimizing *IQ*/*S*, where the thermodynamic length of each piece *i* of the path is

$$\left(\Delta L\_Q\right)\_i = \left[ \left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_{i-1}}\right) \left(\frac{k\_B T\_i}{\overrightarrow{\pi\_i}}\right) \left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_{i-1}}\right) \right]^{1/2} \text{ or } \left(\Delta L\_S\right)\_i = \left[ \left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_{i-1}}\right) \left(\frac{k\_B}{\overrightarrow{\pi\_i}}\right) \left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_{i-1}}\right) \right]^{1/2},\tag{38}$$

respectively. To do so, we first minimize the thermodynamic length of the complete path, - Δ*LQ*/*<sup>S</sup> total* <sup>=</sup> *NT i* = 1 - Δ*LQ*/*<sup>S</sup> i* , and then pick the size of each step such that they all have the same thermodynamic length

$$\left(\Delta I\_{Q/S}\right)\_i = \frac{\left(\Delta L\_{Q/S}\right)\_{\text{total}}}{N\_T}.\tag{39}$$

Equations (28) and (29) can be specialized to an iso-κ path by replacing λ by *T*, switching variables to β = <sup>1</sup> *kBT* and explicitly computing

$$\frac{\partial \pi\_k}{\partial T} = \frac{\partial \beta}{\partial T} \frac{\partial \pi\_k}{\partial \beta} = -\frac{1}{k\_B T^2} \Big( -\pi\_k \Big[ E\_k - \sum\_j E\_j \pi\_j \Big] \Big) = \frac{1}{k\_B T^2} \pi\_k \Big[ E\_k - \stackrel{\rightharpoonup}{E} \stackrel{\rightharpoonup}{\pi} \Big] \tag{40}$$

and

$$\sum\_{k=-1}^{N\_S} \frac{1}{\left(\pi(\lambda)\right)\_k} \left(\frac{(d\pi(\lambda))\_k}{d\lambda}\right)^2 = \frac{1}{\left(k\_B T^2\right)^2} \left(\overrightarrow{\pi} \cdot \overrightarrow{\left(E\right)}^2 - \left(\overrightarrow{E} \cdot \overrightarrow{\pi}\right)^2\right) = \frac{1}{\left(k\_B T^2\right)^2} Var\_{\overrightarrow{\pi}}(E),\tag{41}$$

where *Var*<sup>→</sup> <sup>π</sup>(*E*) is the variance in energy *<sup>E</sup>*(κ) with respect to the probability distribution <sup>→</sup> π. Plugging this into Equation (28), we obtain

$$\begin{split} L\_{Q\text{iso}-\text{x}}^{(j)} &= \left| \int\_{T^{[j]}}^{T^{[j+1]}} \frac{\sqrt{k\_{\text{B}}T}}{\sqrt{k\_{\text{B}}T^{2}}} \sqrt{\frac{V^{\text{arc}}(\text{E})}{k\_{\text{B}}T^{2}}} dT \right| = \left| \int\_{T^{[j]}}^{T^{[j+1]}} \sqrt{\frac{\text{C}(\text{x},T)}{T}} dT \right| \text{ or } L\_{S\text{iso}-\text{x}}^{(j)} \\ &= \left| \int\_{T^{[j]}}^{T^{[j+1]}} \sqrt{\frac{\text{C}(\text{x},T)}{T^{2}}} dT \right| \end{split} \tag{42}$$

respectively, where *C*(κ, *T*) = <sup>1</sup> *kBT*<sup>2</sup> *Var*<sup>→</sup> <sup>π</sup>(*E*) is the specific heat at *<sup>T</sup>* and <sup>κ</sup>. Note that these expressions are reminiscent of optimal control results for the minimal entropy/excess heat production for paths where we change the temperature of a thermodynamic system in finite time [36,42]. Furthermore, for iso-<sup>κ</sup> legs along which the specific heat is approximately constant, we find *<sup>L</sup>*(*j*) *<sup>Q</sup>*;*iso*−<sup>κ</sup> <sup>∼</sup> - √ *<sup>T</sup>*[*j*+1] <sup>−</sup> <sup>√</sup> *T*[*j*] .

## *3.4. Finite-Time Optimal Control for Adiabatic Legs*

## 3.4.1. General Adiabatic Paths

Clearly, minimizing the excess heat along a general isentropic adiabatic path is just another special case of the finite-time optimal control along general paths in (κ, *T*)-space. Thus, we find for the excess heat the expression *IQ*;*iso*−*<sup>S</sup>* ≈ *Na i* = 1 -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> · *kBTi* <sup>↔</sup> π*i* -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> and for the entropy production *IS*;*iso*−*<sup>S</sup>* ≈ *Na i* = 1 -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> · *kB* ↔ π*i* -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> , where *Na* is the number of changes in the values of (κ, *T*(κ)), or equivalently (κ(*T*), *T*) along the branch, which are feasible during the finite time τ assuming that each change in (κ, *T*) requires at least a time of (Δ*t*)*a*, i.e., τ = *Na*(Δ*t*)*a*. We keep in mind that any change in κ automatically determines a corresponding change in *T* such that the thermodynamic equilibrium entropy after the move has not changed, or conversely, changing the temperature enforces an appropriate change in κ.

Again, *IQ*/*<sup>S</sup>* is minimized by picking the stopping points along the path such that the thermodynamic lengths

$$\left(\Delta L\_Q\right)\_i = \left[ \left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_{i-1}}\right) \left(\frac{k\_B T\_i}{\overrightarrow{\pi\_i}}\right) \left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_{i-1}}\right) \right]^{1/2} \text{ or } \left(\Delta L\_S\right)\_i = \left[ \left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_{i-1}}\right) \left(\frac{k\_B}{\overrightarrow{\pi\_i}}\right) \left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_{i-1}}\right) \right]^{1/2}, \tag{43}$$

respectively, of all *Na* pieces of the path are equal:

$$\left(\Delta I\_{Q/S}\right)\_i = \frac{\left(\Delta L\_{Q/S}\right)\_{\text{total}}}{N\_d}.\tag{44}$$

However, for a general adiabatic path, no system independent simplification of Equations (28) and (29) is possible, since both κ and *T* change along such a path and their relationship *T*(κ) varies from system to system.

## 3.4.2. Special Adiabatic Paths

As mentioned above, there are physical systems where not only the equilibrium entropy but also the equilibrium probability distribution of the occupancy of the microstates does not change along an adiabatic isentropic path. For such special adiabatic paths, adiabaticity is equivalent to a constant equilibrium probability distribution along the path, i.e., <sup>→</sup> π*<sup>i</sup>* = constant. On the other hand, our assumption that <sup>→</sup> *<sup>p</sup> <sup>i</sup>* is close to <sup>→</sup> <sup>π</sup>*<sup>i</sup>* implied that <sup>→</sup> *<sup>p</sup> <sup>i</sup>* can be approximated by <sup>→</sup> *<sup>p</sup> <sup>i</sup>* <sup>≈</sup> <sup>→</sup> π*i*<sup>−</sup>1, and thus, to first order in -→ <sup>π</sup>(*t*) <sup>−</sup> <sup>→</sup> *p* (*t*) , we find for a special adiabatic path,

$$I\_{\text{Q;iso}-S} = Q\_{\text{iso}-S; \overrightarrow{n}} - Q\_{\text{iso}-S; \overrightarrow{p}} = \text{ 0}, \tag{45}$$

i.e., along such a leg there is no excess heat being produced due to finite time effects. We can see this also directly from the general expression for the thermodynamic length of the general adiabatic path:

$$\begin{aligned} \left(\Delta L\_Q\right)\_{\text{total}} &= \begin{array}{c} \sum\_{i=1}^{N\_a} (\Delta L)\_i = \sum\_{i=1}^{N\_a} \sqrt{\left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_{i-1}}\right) \cdot \left(\frac{k\_B T\_i}{\overrightarrow{\pi\_i}}\right) \left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_{i-1}}\right)} = \\ \sum\_{i=1}^{N\_a} \sqrt{\left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_i}\right) \cdot \left(\frac{k\_B T\_i}{\overrightarrow{\pi\_i}}\right) \left(\overrightarrow{\pi\_i} - \overrightarrow{\pi\_i}\right)} = 0 \end{aligned} \tag{46}$$

since <sup>→</sup> <sup>π</sup>*<sup>i</sup>* <sup>=</sup> <sup>→</sup> π*i*−<sup>1</sup> along a special adiabatic path, and analogously (Δ*LS*)*total* = 0. Here, *Na* is the number of steps along the special adiabatic path. As a consequence, the work performed by the system on the apparatus equals the negative of the energy difference between the two end points of leg (*j*), *Wj*<sup>→</sup>*j*+<sup>1</sup> = −(Δ*E*)*j*→*j*+<sup>1</sup> = − - *E* [*j*+1] − *E* [*j*] , regardless of whether we were restricted to finite time or not, and thus no excess work or heat is present, at least to first order under the assumptions we have made. Even when including higher orders, the fact that <sup>→</sup> π*<sup>i</sup>* is constant along the whole path together with <sup>→</sup> *<sup>p</sup> <sup>i</sup>* <sup>=</sup> <sup>0</sup> <sup>=</sup> <sup>→</sup> <sup>π</sup>*<sup>i</sup>* <sup>=</sup> <sup>0</sup> ensures that all higher order terms vanish because no relaxation of <sup>→</sup> *<sup>p</sup> <sup>i</sup>* to <sup>→</sup> π*<sup>i</sup>* is ever needed, thus also eliminating the issue of incomplete relaxation to equilibrium discussed in refs. [35,36].

The way finite-time considerations can enter the estimates along a special adiabatic branch must therefore involve deviations of the control itself from the true adiabatic path. Note that we did not consider such deviations from the target curve of the control parameters for the isothermal or the iso-κ branches. Since, in general, any motion of the system along these two types of branches already involves substantial changes in the equilibrium probability distribution, <sup>→</sup> π*<sup>i</sup>* - <sup>→</sup> π*i*<sup>−</sup>1, one usually assumes that the additional effects related to being "off-target" can be ignored in the analysis, although the issue of keeping the control parameters "on target" might be quite relevant in practical applications!

However, since <sup>→</sup> <sup>π</sup>*<sup>i</sup>* <sup>≡</sup> <sup>→</sup> π*i*−<sup>1</sup> along the ideal special adiabatic path, deviations in the control parameters now become the primary source of entropy or excess heat production; other possible sources such as equilibrium fluctuations in the probability distribution <sup>→</sup> *<sup>p</sup> <sup>i</sup>* about <sup>→</sup> π*<sup>i</sup>* will not be considered here. As we have no knowledge about the way the control would be established in practice (i.e., in the experiment), we make the reasonable assumption that trying to stay as close as possible to the ideal adiabatic values of the control requires us again to maximize the number of change steps. This is analogous to how we proceeded earlier, where we assumed that the optimal solution of minimizing excess heat or entropy production for the general adiabatic, the isothermal, and the iso-κ branches would be found using the maximal number of steps feasible between the two endpoints of the leg: if the optimal solution requires fewer than the maximally possible number of steps, then we can just "throw away" the superfluous steps by assigning zero time to them and/or placing them at one of the endpoints of the branch.

The maximal-number-of-steps assumption implies that we cannot perform an optimal control on the sub-step level, i.e., the deviation associated with the movement from one point *i* − 1 with values (κ*i*<sup>−</sup>1, *Ti*<sup>−</sup>1) along the ideal adiabatic curve to the next point *i* with values (κ*i*, *Ti*) can only involve one "virtual stopping point" away from the curve "halfway" between the two curve points. In general, there exist an infinite number of choices for such "halfway points", but from the basic modeling point of view, only two of them make sense, i.e., are consistent with our deviation analysis: (κ*i*, *Ti*<sup>−</sup>1) "below" the adiabatic curve or (κ*i*<sup>−</sup>1, *Ti*) "above" the adiabatic curve for paths moving from low to high temperatures; conversely, if we move from high to low temperatures, the (κ*i*, *Ti*<sup>−</sup>1) points are "above" and the (κ*i*<sup>−</sup>1, *Ti*) "below" the adiabatic curve (see Figure 4 below). If we could be closer to the curve than these points, then we would appear to have the ability to access temperatures and κ values in-between those of the two consecutive points along the adiabatic curve, suggesting that we have not yet maxed out the number of steps. Of course, this is only a plausibility argument and not a proof that such closer points would not be possible, but for this analysis we will employ the two virtual points given above since no further information about the actual functioning of the experimental apparatus is available. In fact, we can interpret our choice of virtual points as providing a heuristic upper bound on the entropy/excess heat production along the special adiabatic path; we essentially assume that we are able to be perfectly on target in either κ or *T*, and the excess production is due to the adjustment in the lagging parameter *<sup>T</sup>* or <sup>κ</sup>, respectively. In the following discussion, we only employ the metric <sup>↔</sup> *MQ*; completely analogous results are obtained when using the metric <sup>↔</sup> *MS*.

**Figure 4.** Sketch of an optimal setting of step points along a (special) adiabatic leg moving from corner [3] to corner [4], where the excess heat associated with being "off-target" with respect to the ideal adiabatic path is minimized. Note that the density of step points (κ*i*, *Ti*) along the leg increases with temperature, approximately in a square-root fashion. Red lines are the isothermal and blue lines the iso-κ sub-pieces, respectively, which connect two points (κ*i*<sup>−</sup>1, *Ti*<sup>−</sup>1) and (κ*i*, *Ti*) along the perfect adiabatic path via the virtual intermediary off-target points (κ*i*<sup>−</sup>1, *Ti*).

We note that reaching the point *i* via either of the virtual points requires an isothermal step and an iso-κ step. Since no sub-optimization along these steps is possible, we can directly write down the excess heat associated with each half-step and sum them. For the virtual point (κ*i*, *Ti*<sup>−</sup>1), we have for the thermodynamic length to go from *i* − 1 to *i*:


where <sup>→</sup> <sup>π</sup>*i*−<sup>1</sup> <sup>=</sup> <sup>→</sup> <sup>π</sup> (κ*i*<sup>−</sup>1, *Ti*<sup>−</sup>1) and <sup>→</sup> <sup>π</sup>*<sup>i</sup>* <sup>=</sup> <sup>→</sup> π (κ*i*, *Ti*) are the two consecutive points on the adiabatic curve, and we have used the fact that <sup>→</sup> <sup>π</sup>*<sup>i</sup>* <sup>=</sup> <sup>→</sup> π*i*<sup>−</sup>1.

Similarly, for the virtual point (κ*i*<sup>−</sup>1, *Ti*), we have

$$
\Delta \begin{pmatrix} \Delta L\_Q \end{pmatrix}\_i = \sqrt{\begin{pmatrix} \overleftarrow{\pi}\_i - \overrightarrow{\pi} \left( \kappa\_{i-1}, T\_i \right) \end{pmatrix} \begin{bmatrix} \left\{ k\_B T\_i \right\} \\ \left\{ \overleftrightarrow{\pi}\_i \end{bmatrix} + \begin{Bmatrix} \overleftarrow{k\_B T\_i} \\ \overleftrightarrow{\pi} \left( \kappa\_{i-1}, T\_i \right) \end{Bmatrix} \begin{bmatrix} \left\{ \overleftarrow{\pi}\_i - \overrightarrow{\pi} \left( \kappa\_{i-1}, T\_i \right) \right\} \end{bmatrix}} \tag{48}
$$

Since it is not clear which of the two virtual points would be more suitable, one might suggest that a decent approximation for - Δ*LQ i* would be the average of the two thermodynamic lengths for the two points:

$$\begin{split} \mathbb{E}\left(\Delta L\_{Q}\right)\_{i} & \triangleq \frac{1}{2} \Big( \sqrt{\left(\overleftarrow{\pi}\_{i} - \overrightarrow{\pi}\left(\kappa\_{i}, T\_{i-1}\right)\right)} \Big| \Big\{ \begin{matrix} \frac{k\_{B}T\_{i}}{\widehat{\pi}\_{i}} \end{matrix} \Big\} + \begin{Bmatrix} \frac{k\_{B}T\_{i-1}}{\widehat{\pi}\left(\kappa\_{i}, T\_{i-1}\right)} \end{pmatrix} \Big| \Big(\overleftarrow{\pi}\_{i} - \overrightarrow{\pi}\left(\kappa\_{i}, T\_{i-1}\right) \Big) \\ & + \sqrt{\left(\overleftarrow{\pi}\_{i} - \overrightarrow{\pi}\left(\kappa\_{i-1}, T\_{i}\right)\right)} \Big| \Big\{ \begin{matrix} \frac{k\_{B}T\_{i}}{\widehat{\pi}\_{i}} \end{matrix} \Big\} + \begin{Bmatrix} \frac{k\_{B}T\_{i}}{\widehat{\pi}\left(\kappa\_{i-1}, T\_{i}\right)} \end{matrix} \Big\} \Big| \Big(\overleftarrow{\pi}\_{i} - \overrightarrow{\pi}\left(\kappa\_{i-1}, T\_{i}\right) \Big) \Big\}. \end{split} \tag{49}$$

However, from the point of view of optimal control, this average is not very helpful; in particular, the thermodynamic metric becomes a very complicated expression.

Instead it is more effective to systematically pick one of the two virtual points, e.g., (κ*i*, *Ti*<sup>−</sup>1), because this allows us to write the excess heat production due to deviations in the control from the special adiabatic path as

$$I\_{Q\text{iso}-S} = \begin{array}{c} \Sigma\_{i}^{\text{N}\_{a}} \left( \overrightarrow{\pi}\_{i} - \overrightarrow{\pi} \left( \kappa\_{i}, T\_{i-1} \right) \right) \cdot \left[ \begin{pmatrix} \frac{k\_{\text{D}}T\_{i}}{\pi\_{i}} \end{pmatrix} + \begin{pmatrix} \frac{k\_{\text{D}}T\_{i-1}}{\pi \left( \kappa\_{i}, T\_{i-1} \right)} \end{pmatrix} \right] \overrightarrow{\left(\pi\_{i} - \overrightarrow{\pi} \left( \kappa\_{i}, T\_{i-1} \right) \right)} \\ = \begin{array}{c} \Sigma\_{i}^{\text{N}\_{a}} \left[ \left( \Delta L\_{\text{Q}} \right) \right]^{2}, \end{array} \tag{50}$$

where each - Δ*LQ i* is the thermodynamic distance between the points *i* − 1 and *i* computed with the metric  *kBTi* <sup>↔</sup> π*i* + *kBTi*<sup>−</sup><sup>1</sup> <sup>↔</sup> π(κ*i*,*Ti*<sup>−</sup>1) , with the virtual intermediary point fixed as (κ*i*, *Ti*<sup>−</sup>1).

We note that the probability distribution <sup>→</sup> π(κ*i*, *Ti*<sup>−</sup>1) at the virtual point, which enters the expression for - Δ*LQ i* , is completely determined from our information about the temperatures and κ-values of the two consecutive points along the ideal special adiabatic path which are "connected" via the virtual point. Thus, there is no internal degree of freedom left for the piece of path between the points *i* − 1 and *i*, which could be adjusted as part of the optimal control analysis. As a consequence, the choice of the locations of the consecutive points along the special adiabatic path completely determines - Δ*LQ i* , although in a slightly more involved fashion than for the isothermal and the iso-κ legs. This allows us to conclude that choosing the step points (κ*i*, *Ti*) such that the lengths of all the - Δ*LQ i* have the same value, again yields the optimal solution for minimizing the excess heat.

While the general formula for the metric and thus the thermodynamic length of the path is more complicated than for the isothermal or iso-κ legs, we note that the metric is still essentially proportional to *kBTi* at step *<sup>i</sup>*. Furthermore, due to the leg being special adiabatic, the term  *kBTi* <sup>↔</sup> π*i* + *kBTi*<sup>−</sup><sup>1</sup> <sup>↔</sup> π(κ*i*,*Ti*<sup>−</sup>1) does only weakly vary as function of the probability distribution <sup>→</sup> π*<sup>i</sup>* since the distribution is constant on the path, and should only differ slightly from <sup>→</sup> π*<sup>i</sup>* along the virtual points. Thus, we can conclude that the thermodynamic length of the virtual-point pieces between two points along the special adiabatic path mostly depends on the temperature, with

$$\left(\Delta L\_Q\right)\_i \sim \sqrt{T\_i}.\tag{51}$$

As a consequence, the optimal distribution of points will be related to the square root of the temperature in the sense that the distance of step points along the leg (as function of temperature) will monotonically decrease as 1/ √ *Ti*, leading to a higher density of step points at higher temperatures (c.f. Figure 4).

## **4. Application to the Hydrogen Atom-Like System**

Regarding the hydrogen atom-like system, we first note that κ and *T* enter the formulas for the equilibrium probability distribution everywhere in the combination

$$A = \frac{\text{\tiny K}}{T'} \tag{52}$$

such that

$$\pi\_k(\mathbf{x}, T) \;= \pi\_k \binom{\mathbf{x}}{T} = e^{-(\frac{\mathbf{x}}{T})\frac{\mathbf{E}\_\mathbf{g}(1)}{\mathbf{k}\_\mathbf{B}}} / \sum\_{j=-1}^{N\_\mathbf{S}} e^{-(\frac{\mathbf{x}}{T})\frac{\mathbf{E}\_\mathbf{j}(1)}{\mathbf{k}\_\mathbf{B}}} \\ \;= e^{-A\frac{\mathbf{E}\_\mathbf{g}(1)}{k\_\mathbf{B}}} / \sum\_{j=-1}^{N\_\mathbf{S}} e^{-A\frac{\mathbf{E}\_\mathbf{j}(1)}{k\_\mathbf{B}}}. \tag{53}$$

In particular, this means that the ratio <sup>κ</sup> *<sup>T</sup>* remains constant along the adiabatic legs of the cycle, ensuring that <sup>→</sup> π does not change along this branch. Thus, the adiabatic branches for cycles involving the hydrogen atom-like system belong into the special category where not only the entropy but the whole equilibrium probability distribution is constant along the path. Note that in the cycle diagram

(Figures 2 and 3), an adiabatic branch (*j*) for the hydrogen atom-like system is always a straight line (that can be continued through the origin) with slope <sup>1</sup> *<sup>A</sup>*(*j*) . Of course, the actual value of the ratio *<sup>A</sup>* will be different for each adiabatic leg. For an adiabatic leg (*j*), it follows that κ[*j*+1] *T*[*j*] = κ[*j*] *T*[*j*+1] . For the combination of iso-κ and adiabatic legs, we have κ[1] = κ[2] = κ*in* and κ[3] = κ[4] = κ*<sup>f</sup>* ; therefore, we get

$$\frac{\kappa\_{\rm in}}{\kappa\_f} = \frac{T^{[1]}}{T^{[4]}} = \frac{T^{[2]}}{T^{[3]}}.\tag{54}$$

Analogously, for the combination of adiabatic and isothermal legs, we have the two adiabatic branches (legs 1 and 3) with *A*1→<sup>2</sup> - *A*3<sup>→</sup>4, for which κ[1] *T*[2] = κ[2] *T*[1] and κ[4] *T*[3] = κ[3] *T*[4] , and the isothermal legs yield the conditions *T*[3] = *T*[2] and *T*[1] = *T*[4] . Thus, we have the relations

$$\frac{T^{[1]}}{T^{[2]}} = \frac{\kappa^{[1]}}{\kappa^{[2]}} = \frac{\kappa^{[4]}}{\kappa^{[3]}} = \frac{\kappa\_{in}}{\kappa^{[2]}} = \frac{\kappa^{[4]}}{\kappa\_f}.\tag{55}$$

Regarding the expressions for the thermodynamic lengths of the various legs in this section, we remark that the main effect of dealing with the hydrogen atom-like system is the special adiabaticity of the isentropic paths, such that the contribution of the adiabatic paths to the excess heat or entropy production can be set equal to zero unless we include the "off-target" contributions discussed in Section 3.4.2. In addition, we can exploit Equation (3) to rewrite the specific heat as

$$\mathcal{L}(\mathbf{x},T) = \frac{\overrightarrow{\pi}\cdot(\overrightarrow{\mathbf{E}})^2 - \left(\overrightarrow{\overline{\mathbf{E}}\cdot\overline{\pi}\right)^2}}{k\_B T^2} = \kappa^2 \frac{\overrightarrow{\pi}\cdot(\overrightarrow{E(1)})^2 - \left(\overrightarrow{E(1)}\cdot\overrightarrow{\pi}\right)^2}{\frac{k\_B T^2}{k\_B T^2}} = \kappa^2 \mathcal{C}^\kappa(\mathbf{x},T) = \frac{\kappa^2}{k\_B T^2} V \text{arc}\_{\overrightarrow{\pi}}(\mathcal{E}(1)) = \tag{56}$$

where both the variance *Var*<sup>→</sup> <sup>π</sup>(*E*(1)) <sup>=</sup> <sup>→</sup> π· → (*E*(1))<sup>2</sup> − <sup>→</sup> *E*(1)· → π 2 = <sup>1</sup> <sup>κ</sup><sup>2</sup> *Var*<sup>→</sup> <sup>π</sup>(*E*) and the specific heat *C*(κ, *T*) are functions of *A* = - κ *T* . Furthermore, we can rewrite Equation (35) as

$$\frac{\partial \pi\_k}{\partial \mathbf{x}} = -\frac{1}{k\_B T} \pi\_k \left[ E\_k(1) - \sum\_j E\_j(1) \pi\_j \right] = -\frac{1}{k\_B T} \pi\_k \left[ E\_k(1) - E(1) \cdot \stackrel{\rightarrow}{\pi} \right].\tag{57}$$

where π*<sup>k</sup>* is a function of - κ *T* , and thus Equation (36) becomes

$$\frac{1}{\left(k\_B T\right)^2} \left(\overrightarrow{\pi} \cdot \overrightarrow{E(1)}^2 - \left(\overrightarrow{E(1)} \cdot \overrightarrow{\pi}\right)^2\right) = \frac{1}{k\_B} \mathbf{C^\times}(\mathbf{x}, T) = \frac{1}{\mathbf{x}^2 k\_B} \mathbf{C(x, T)} = \frac{Var\_{\overrightarrow{\pi}}(E(1))}{\left(k\_B T\right)^2}.\tag{58}$$

Note that the variance of <sup>∂</sup>*<sup>E</sup>* ∂κ in Equation (36) is now transformed into a variance of the energy *E*(1) of the unmodified hydrogen atom.

For each cycle discussed below, we first write down a formula for the total work done by the atom and the heat absorbed by the atom in the quasi-static approximation, where <sup>→</sup> *<sup>p</sup> <sup>i</sup>* <sup>=</sup> <sup>→</sup> π*<sup>i</sup>* everywhere along the cycle, and subsequently, we provide formulas for the efficiency, and the optimality criterion for the minimal excess heat production.

## *4.1. Iso-*κ*-Adiabatic Cycle*

In the case of the iso-κ-adiabatic cycle where the legs 2 and 4 are adiabatic and do not contribute to the heat production, we can focus on legs 1 and 3 when computing the heat exchange with the environment. Using Equations (18) and (19), we obtain therefore for the total heat exchange over the full cycle:

$$\begin{split} Q\_{\text{cycle}} &= \prescript{\text{S}^{[2]}}{\mathbb{S}^{[1]}} TdS + \prescript{\text{S}^{[4]}}{\mathbb{S}^{[3]}} TdS = \left[ T^{[2]}S^{[2]} - T^{[1]}S^{[1]} \right] + k\_{\text{B}} \int\_{T^{[1]}}^{T^{[2]}} \overrightarrow{\pi}(T, \kappa\_{\text{in}}) \cdot \ln\left( \overrightarrow{\pi}(T, \kappa\_{\text{in}}) \right) dT + \\ & \left[ T^{[4]}S^{[4]} - T^{[3]}S^{[3]} \right] + k\_{\text{B}} \int\_{T^{[3]}}^{T^{[4]}} \overrightarrow{\pi}(T, \kappa\_{f}) \cdot \ln\left( \overrightarrow{\pi}(T, \kappa\_{f}) \right) dT = \overrightarrow{\pi}\left(\kappa\_{\text{in}}\right) \cdot \left( \overrightarrow{\pi}\left(\kappa\_{\text{in}}T^{[2]} \right) - \overrightarrow{\pi}\left(\kappa\_{\text{in}}T^{[1]} \right) \right) \\ & + \overrightarrow{\pi}\left(\kappa\_{f}\right) \cdot \left( \overrightarrow{\pi}\left(\kappa\_{f}T^{[4]} \right) - \overrightarrow{\pi}\left(\kappa\_{\text{in}}T^{[3]} \right) \right) = W\_{\text{cycle}} \cdot \text{d} . \end{split} \tag{59}$$

Since *T*[2] > *T*[1] , *T*[4] < *T*[3] , and furthermore, the equilibrium entropy at higher temperatures is always larger than the one at lower temperatures, the term belonging to leg 1 transfers heat into the system, while along leg 3, the system gives off heat.

Since the legs 2 and 4 represent adiabatic processes, we have, furthermore, *S*[2] = *S*[3] and *S*[1] = *S*[4] , and also *<sup>T</sup>*[3] <sup>=</sup> <sup>κ</sup>*<sup>f</sup>* <sup>κ</sup>*in <sup>T</sup>*[2] and *<sup>T</sup>*[4] <sup>=</sup> <sup>κ</sup>*<sup>f</sup>* <sup>κ</sup>*in <sup>T</sup>*[1] . Using Equation (18) and shifting variables back and forth from *T* to *T*/κ*in* and *T*/κ*<sup>f</sup>* , this implies that

$$\begin{cases} Q\_{\text{cycle}} = \int\_{S^{[1]} \cup\_{\mathbb{R}} \mathbb{S}^{1}}^{[2]} TdS + \int\_{S^{[1]} \cup\_{\mathbb{R}} \mathbb{S}^{1}}^{[4]} TdS = \left(1 - \frac{\kappa\_{f}}{\kappa\_{in}}\right) [T^{[2]}S^{[2]} - T^{[1]}S^{[1]}] + k\_{B} \kappa\_{in} \int\_{T^{[1]} \cup\_{\mathbb{R}} \mathbb{S}^{1}}^{[2]} \overline{\pi}(y) \cdot h(\overline{\pi}(y)) dy\\\ \quad + k\_{B} \kappa\_{f} \int\_{T^{[2]} \cup\_{\mathbb{R}} \mathbb{S}^{1}}^{[1]} \overline{\pi}(y) \cdot h(\overline{\pi}(y)) dy = \left(1 - \frac{\kappa\_{f}}{\kappa\_{in}}\right) [T^{[2]}S^{[2]} - T^{[1]}S^{[1]}] - \left(\kappa\_{in} - \kappa\_{f}\right) \frac{1}{\kappa\_{in}} \int\_{T^{[1]}}^{T^{[2]}} S(T) dT = \left(1 - \frac{\kappa\_{f}}{\kappa\_{in}}\right) \int\_{S^{[1]}}^{S^{[2]}} T^{[1]}S(T) dT\\\ \quad + \left(1 - \frac{\kappa\_{f}}{\kappa\_{in}}\right) \int\_{S^{[1]} \cup\_{\mathbb{R}} \mathbb{S}^{1}}^{S^{[2]}} TdS < 0,\end{cases} \tag{60}$$

since κ*<sup>f</sup>* > κ*in*. This shows that the hydrogen atom-like system gives off heat to the environment, when the cycle is run as described.

Of course, this equals the total work around the cycle, which needs to balance the total heat by energy conservation. If we want to compute the expressions for the work along each of the four legs—e.g., in order to talk about the efficiency of the hydrogen atom-like system as working fluid in an engine, we need to add the contribution for the energy change. We then find: *W*1→<sup>2</sup> = *W*3→<sup>4</sup> = 0, *W*2→<sup>3</sup> = − → *E* - κ*f* · → π - κ*<sup>f</sup>* , *T*[3] + → *E*(κ*in*)· → π - κ*in*, *T*[2] = → *E*(κ*in*) − → *E* - κ*f* · → π(*A*2→3), and *W*4→<sup>1</sup> = − → *E*(κ*in*)· → π - κ*in*, *T*[1] <sup>+</sup> <sup>→</sup> *E* - κ*f* · → π - κ*<sup>f</sup>* , *T*[4] = → *E* - κ*f* − → *E*(κ*in*) · → π(*A*4→1). This shows that we reduce the internal energy of the hydrogen atom-like system by a certain amount along leg 2 and raise it along leg 4 but by a much larger amount. Taking the sum, we obtain

$$\begin{array}{c} W\_{4\to 1} + W\_{2\to 3} = \left( \overrightarrow{E} \left( \mathbf{x}\_f \right) - \overrightarrow{E} \left( \mathbf{x}\_{\text{in}} \right) \right) \overrightarrow{\pi} \left( A\_{4\to 1} \right) + \left( \overrightarrow{E} \left( \mathbf{x}\_{\text{in}} \right) - \overrightarrow{E} \left( \mathbf{x}\_f \right) \right) \overrightarrow{\pi} \left( A\_{2\to 3} \right) \\ \left( \overrightarrow{E} \left( \mathbf{x}\_f \right) - \overrightarrow{E} \left( \mathbf{x}\_{\text{in}} \right) \right) \left( \overrightarrow{\pi} \left( A\_{4\to 1} \right) - \overrightarrow{\pi} \left( A\_{2\to 3} \right) \right) = \\ \left( \mathbf{x}\_f - \mathbf{x}\_{\text{in}} \right) \overrightarrow{E} \left( \mathbf{x} = 1 \right) \cdot \left( \overrightarrow{\pi} \left( A\_{4\to 1} \right) - \overrightarrow{\pi} \left( A\_{2\to 3} \right) \right) < 0, \end{array} \tag{61}$$

since <sup>κ</sup>*<sup>f</sup>* > κ*in* and <sup>→</sup> *E*(κ = 1)· → <sup>π</sup>(*A*4→1) <sup>&</sup>lt; <sup>→</sup> *E*(κ = 1)· → <sup>π</sup>(*A*2→3) <sup>&</sup>lt; 0 because *<sup>A</sup>*4→<sup>1</sup> = <sup>κ</sup>*in <sup>T</sup>*[1] <sup>&</sup>gt; *<sup>A</sup>*2→<sup>3</sup> <sup>=</sup> <sup>κ</sup>*in <sup>T</sup>*[2] . Thus, during this cycle, the apparatus performs net work on the system over the legs 2 and 4.

For the efficiency, a possible definition is to take the ratio between the net work along the legs where κ is varied, and total heat added to/extracted from the system. With this definition, we find

$$\eta\_{\text{[k:S]}} = \frac{W\_{4\to 1} + W\_{2\to 3}}{Q\_{\text{cycle}}} = \frac{W\_{\text{cycle}}}{Q\_{\text{cycle}}} = 1. \tag{62}$$

Of course, one can define many other efficiencies, depending on the quantities and processes of interest.

Regarding the excess heat, we note that due to Equation (52), the adiabatic legs are special. We do not include the effect of being "off-target" during the adiabatic legs, and thus we only consider the two terms from the iso-κ legs 1 and 3:

$$\begin{split} I\_{\text{Qtotal}} = \, ^{I\_{\text{Q;1}\to2}} \, + \, ^{I\_{\text{Q;3}\to4}} \, = \, \left. \begin{split} \left. \begin{pmatrix} \sum\_{i=1}^{N\_{\text{T}}} \left( \overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i}} \, - \right) \cdot \begin{Bmatrix} \frac{k\_{\text{B}} \text{T} i}{\overleftarrow{\pi\_{i}}} \end{Bmatrix} \right| \left( \overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i}} \, - \right) \right\vert\_{\text{kg}^{\text{q}}} \, + \\ \left\{ \sum\_{i=1}^{N\_{\text{T}}} \left( \overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i}} \, - \right) \cdot \begin{Bmatrix} \frac{k\_{\text{B}} \text{T} i}{\overleftarrow{\pi\_{i}}} \end{Bmatrix} \begin{pmatrix} \overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i}} \, - \end{Bmatrix} \right\vert\_{\text{kg}^{\text{q}}} \, \end{split} \end{split} \tag{63}$$

Using Equations (42) and (56), we get for the whole cycle

$$\begin{split} L\_{\text{Qxyz}\!dv} &= L\_Q^{(1)} + L\_Q^{(3)} = \left| \kappa\_{\text{in}} \int\_{T^{[1]}}^{T^{[2]}} \sqrt{\frac{\mathbb{C^{\times}(\frac{1}{T})}}{T}} dT \right| + \left| \kappa\_f \int\_{T^{[3]}}^{T^{[4]}} \sqrt{\frac{\mathbb{C^{\times}(\frac{1}{T})}}{T}} dT \right| \\ &= \left| \kappa\_{\text{in}} \int\_{T^{[1]}}^{T^{[2]}} \sqrt{\frac{\text{Var}\_{\text{-}}(E(1))}{k\_B T^3}} dT \right| + \left| \kappa\_f \int\_{T^{[3]}}^{T^{[4]}} \sqrt{\frac{\text{Var}\_{\text{-}}(E(1))}{k\_B T^3}} dT \right|. \end{split} \tag{64}$$

Switching variables to *A* = <sup>κ</sup> *<sup>T</sup>* for the integration, keeping in mind that *Var*<sup>→</sup> <sup>π</sup>(*E*(1)) is a function of *A* = <sup>κ</sup> *<sup>T</sup>* , and using *<sup>A</sup>*[2] <sup>=</sup> *<sup>A</sup>*[3] and *<sup>A</sup>*[4] <sup>=</sup> *<sup>A</sup>*[1] since legs (4) and (2) are adiabatic, we find

$$L\_Q^{(1)} = \left| \sqrt{\kappa\_{\text{in}}} \int\_{A^{[1]}}^{A^{[2]}} \sqrt{\frac{Var\_{\overline{\pi}}(E(1))}{\sqrt{k\_B A}}} dA \right| < L\_Q^{(3)} = \left| \sqrt{\kappa\_f} \int\_{A^{[1]}}^{A^{[2]}} \sqrt{\frac{Var\_{\overline{\pi}}(E(1))}{\sqrt{k\_B A}}} dA \right|. \tag{65}$$

since κ*<sup>f</sup>* > κ*in*.

In the case of the adiabatic legs considered here, we do have the problem that, to first order, the thermodynamic length vanishes as long as we are perfectly on target with the thermodynamic controls. Thus, the formula for τ(*j*) yields zero time for the adiabatic legs of the path, which essentially means we could jump directly from the end of the first leg (= beginning of the second leg) to the beginning of the third leg (= end of the second leg), and analogously for the fourth branch. In practice, this does not make too much sense, and we would want to employ the off-target formula derived above, even though this requires additional information from experiment, or make assumptions about the location of the virtual intermediary points discussed above. Alternatively, we can make heuristic assumptions about the (hopefully short, i.e., τ*<sup>a</sup>* τ) minimal time τ*<sup>a</sup>* = τ (2) *<sup>Q</sup>* = τ (4) *<sup>Q</sup>* needed to move along the adiabatic leg without noticeable deviations from the ideal adiabatic curve in (κ, *T*) space and subtract these times from the total available time τ, τ*iso*−<sup>κ</sup> = τ − 2τ*a*, before assigning τ (1) *<sup>Q</sup>* and τ (3) *Q* according the principle of constant thermodynamic speed.

$$\text{Since } \frac{L\_Q^{(3)}}{L\_Q^{(1)}} = \frac{\sqrt{\kappa\_f}}{\sqrt{\kappa\_m}} \text{, the optimal time allocation for the two legs must be } \frac{\kappa\_p}{\kappa\_m}$$

$$\frac{\pi\_Q^{(3)}}{\pi\_Q^{(1)}} = \frac{L\_Q^{(3)}}{L\_Q^{(1)}} = \frac{\sqrt{\mathbb{K}\_f}}{\sqrt{\mathbb{K}\_{\rm in}}},\tag{66}$$

and thus we obtain τ (1) *<sup>Q</sup>* = τ*iso*−<sup>κ</sup> <sup>√</sup>κ*in* <sup>√</sup>κ*<sup>f</sup>* <sup>+</sup> <sup>√</sup>κ*in* and <sup>τ</sup> (3) *<sup>Q</sup>* = τ*iso*−<sup>κ</sup> √κ*f* <sup>√</sup>κ*<sup>f</sup>* <sup>+</sup> <sup>√</sup>κ*in* . We remark that when we minimize the entropy production and thus use the metric <sup>↔</sup> *MS*, we find *<sup>L</sup>*(3) *<sup>S</sup>* <sup>=</sup> *<sup>L</sup>*(1) *<sup>S</sup>* and, after subtracting τ*<sup>a</sup>* = τ (2) *<sup>S</sup>* = τ (4) *<sup>S</sup>* from τ, we obtain τ (1) *<sup>S</sup>* = τ (3) *<sup>S</sup>* <sup>=</sup> <sup>τ</sup>*iso*−<sup>κ</sup> <sup>2</sup> .

Due to the sum over microstates for the heat capacity with nontrivial energy eigenvalues under the square root and the nontrivial temperature dependence of <sup>→</sup> π(*T*, κ), no further analytical simplifications appear to be possible. Thus, the allocation along the individual legs is an open question, but should depend on the variance *Var*<sup>→</sup> <sup>π</sup>(*E*(1)) as function of - κ *T* .

## *4.2. Iso-*κ*-Isothermal Cycle*

For the iso-κ-isothermal cycle (*T*[3] = *T*[2] and *T*[4] = *T*[1] ), we have a non-vanishing heat term along all legs, where the integrals over temperature along the isothermal branches vanish, of course,

$$k\_B \int\_{T^{[2]}}^{T^{[3]}} \overrightarrow{\pi}\nolimits(\kappa, T) \cdot \ln\Big(\overrightarrow{\pi}\nolimits(\kappa, T)\Big) dT = k\_B \int\_{T^{[4]}}^{T^{[1]}} \overrightarrow{\pi}(\kappa, T) \cdot \ln\Big(\overrightarrow{\pi}(\kappa, T)\Big) dT = 0. \tag{67}$$

Using the fact that along the iso-κ branches *Q*(*j*) = (Δ*E*) (*j*) , we get for the total heat produced on the cycle,

$$\begin{split} Q\_{\text{cycle}} &= \overrightarrow{E}\left(\kappa\_{\text{in}}\right) \cdot \left[ \overrightarrow{\pi}\left(\kappa\_{\text{in}}, T^{[2]}\right) - \overrightarrow{\pi}\left(\kappa\_{\text{in}}, T^{[1]}\right) \right] + \left[ T^{[2]}S^{[3]}\left(\kappa\_{f'}, T^{[2]}\right) - T^{[2]}S^{[2]}\left(\kappa\_{\text{in}}, T^{[2]}\right) \right] + \\ & \overset{\rightarrow}{E}\left(\kappa\_{f}\right) \cdot \left[ \overrightarrow{\pi}\left(\kappa\_{f'}, T^{[1]}\right) - \overrightarrow{\pi}\left(\kappa\_{f'}, T^{[2]}\right) \right] + \left[ T^{[1]}S^{[1]}\left(\kappa\_{\text{in}}, T^{[1]}\right) - T^{[1]}S^{[4]}\left(\kappa\_{f'}, T^{[1]}\right) \right]. \end{split} \tag{68}$$

For the work along the legs, we find *W*1→<sup>2</sup> = *W*3→<sup>4</sup> = 0, *W*2→<sup>3</sup> = *T*[2] *S*[3] - κ*<sup>f</sup>* , *T*[2] − *T*[2] *S*[2] - κ*in*, *T*[2] <sup>−</sup> <sup>→</sup> *E* - κ*f* · → π - κ*<sup>f</sup>* , *T*[2] <sup>+</sup> <sup>→</sup> *E*(κ*in*)· → π - κ*in*, *T*[2] and *W*4→<sup>1</sup> = *T*[1] *S*[1] - κ*in*, *T*[1] − *T*[1] *S*[4] - κ*<sup>f</sup>* , *T*[1] − → *E*(κ*in*)· → π - κ*in*, *T*[1] <sup>+</sup> <sup>→</sup> *E* - κ*f* · → π - κ*<sup>f</sup>* , *T*[1] . The possible net extracted work from the isothermal legs 2 and 4 is now:

$$\begin{split} \mathcal{W}\_{4\rightarrow 1} + \mathcal{W}\_{2\rightarrow 3} &= \left[ T^{[2]} S^{[3]} \Big( \mathbf{x}\_{f'} T^{[2]} \Big) - T^{[2]} S^{[2]} \Big( \mathbf{x}\_{\scriptscriptstyle{in}}, T^{[2]} \Big) + T^{[1]} S^{[1]} \Big( \mathbf{x}\_{\scriptscriptstyle{in}\nu} T^{[1]} \Big) - T^{[1]} S^{[4]} \Big( \mathbf{x}\_{f'}, T^{[1]} \Big) \right] \\ &+ \overrightarrow{E} \big( 1 \big) \cdot \Big[ \mathbf{x}\_{f}' \Big[ \overrightarrow{\pi} \big( \mathbf{x}\_{f'} T^{[1]} \Big) - \overrightarrow{\pi} \big( \mathbf{x}\_{f'}, T^{[2]} \Big) \Big] - \kappa\_{\acute{m}} \Big[ \overrightarrow{\pi} \big( \mathbf{x}\_{\acute{m}\nu} T^{[1]} \Big) - \overrightarrow{\pi} \big( \mathbf{x}\_{\acute{m}\nu} T^{[2]} \Big) \Big]. \end{split} \tag{69}$$

Now, <sup>κ</sup>*<sup>f</sup> <sup>T</sup>*[2] <sup>&</sup>gt; <sup>κ</sup>*in <sup>T</sup>*[2] and similarly <sup>κ</sup>*<sup>f</sup> <sup>T</sup>*[1] <sup>&</sup>gt; <sup>κ</sup>*in <sup>T</sup>*[1] , and thus the probability distribution <sup>→</sup> π - κ*<sup>f</sup>* , *T*[2] is more concentrated at low energies than <sup>→</sup> π - κ*in*, *T*[2] , leading to the conclusion that *S* - κ*<sup>f</sup>* , *T*[2] < *S* - κ*in*, *T*[2] , and analogously *S* - κ*<sup>f</sup>* , *T*[1] < *S* - κ*in*, *T*[1] . Similarly, <sup>→</sup> *E*(1)· → π - κ*<sup>f</sup>* , *T*[1] <sup>&</sup>lt; <sup>→</sup> *E*(1)· → π - κ*<sup>f</sup>* , *T*[2] and → *E*(1)· → π - κ*in*, *T*[1] <sup>&</sup>lt; <sup>→</sup> *E*(1)· → π - κ*in*, *T*[2] . Since κ*<sup>f</sup>* > κ*in*, the energy contribution to the work along these legs should be negative, resulting in an overall negative work, i.e., the environment performs net work on the hydrogen atom-like system.

Again, we compute the efficiency as

$$\eta\_{\text{(k;T)}} = \frac{W^{(2)} + W^{(4)}}{Q\_{\text{cycle}}} = \frac{W\_{\text{cycle}}}{Q\_{\text{cycle}}} = 1. \tag{70}$$

Regarding the excess heat production, all four legs contribute in this case. Thus, we have

*IQ*;*total* = *IQ*;1→<sup>2</sup> + *IQ*;2→<sup>3</sup> + *IQ*;3→<sup>4</sup> + *IQ*;4→<sup>1</sup> = *NT i* = 1 -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> · *kBTi* <sup>↔</sup> π*i* -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> *leg*1 + *kBT*<sup>2</sup> *N*<sup>κ</sup> *i* = 1 -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> · 1 ↔ π*i* -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> *leg*2 + *NT i* = 1 -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> · *kBTi* <sup>↔</sup> π*i* -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> *leg*3 + *kBT*<sup>1</sup> *N*<sup>κ</sup> *i* = 1 -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> · 1 ↔ π*i* -→ <sup>π</sup>*<sup>i</sup>* <sup>−</sup> <sup>→</sup> π*i*−<sup>1</sup> *leg*4 . (71)

Note that *NT* and *NK* of the individual legs will be determined from the ratios <sup>τ</sup>(*j*) (Δ*t*)*T*,<sup>κ</sup> , where we again will assume that the relaxation times are constant. Employing Equations (37), (42) and (56)–(58), the total thermodynamic length of the cycle is then

$$\begin{split} \left| L\_{Q;\text{cycle}} = L\_{Q}^{(1)} + L\_{Q}^{(2)} + L\_{Q}^{(3)} + L\_{Q}^{(4)} = \begin{vmatrix} \kappa\_{\text{in}} \int\_{T^{[1]}}^{T^{[2]}} \sqrt{\frac{\text{C}^{\kappa}\left(\frac{\mathbf{x}}{T^{\kappa}}\right)}{T}} dT \end{vmatrix} + \left| \sqrt{T^{[2]}} \int\_{\kappa\_{\text{in}}}^{\kappa\_{f}} \sqrt{\text{C}^{\kappa}\left(\frac{\mathbf{x}}{T^{[2]}}\right)} d\mathbf{x} \right| + \left| \sqrt{T^{[2]}} \int\_{T^{[1]}}^{\kappa\_{f}} \sqrt{\text{C}^{\kappa}\left(\frac{\mathbf{x}}{T^{[2]}}\right)} d\mathbf{x} \right| + \left| \sqrt{T^{[2]}} \int\_{T^{[1]}}^{T^{[2]}} \sqrt{\text{C}^{\kappa}\left(\frac{\mathbf{x}}{T^{[2]}}\right)} d\mathbf{x} \right| \\ \left| \sqrt{T^{[2]}} \int\_{\kappa\_{\text{in}}}^{\kappa\_{f}} \sqrt{\frac{\text{Var}\_{\pi}(E(1))}{k\_{B}T^{[2]}}} d\mathbf{x} \right| + \left| \kappa\_{f} \int\_{T^{[1]}}^{T^{[2]}} \sqrt{\frac{\text{Var}\_{\pi}(E(1))}{k\_{B}T^{[2]}}} d\mathbf{x} \right| + \left| \sqrt{T^{[1]}} \int\_{\kappa\_{\text{in}}}^{\kappa\_{f}} \sqrt{\frac{\text{Var}\_{\pi}(E(1))}{k\_{B}T^{[2]}}} d\mathbf{x} \right|. \end{split} \tag{72}$$

Keeping in mind that *Var*<sup>→</sup> <sup>π</sup>(*E*(1)) depends only on *<sup>A</sup>*, we switch variables in all integrals from *<sup>T</sup>* and κ to *A* = <sup>κ</sup> *<sup>T</sup>* , to obtain

$$\begin{vmatrix} L\_Q^{(1)} + L\_Q^{(2)} + L\_Q^{(3)} + L\_Q^{(4)} & \cdots \\ \vdots & \vdots \\ \sqrt{\kappa\_f} \int\_{A^{[\mathfrak{N}]}}^{A^{[\mathfrak{A}]}} \sqrt{\frac{\operatorname{Var}\_{\pi}(E(1))}{k\_B A}} dA \end{vmatrix} + \left| \sqrt{T^{[2]}} \int\_{A^{[\mathfrak{N}]}}^{A^{[\mathfrak{N}]}} \sqrt{\frac{\operatorname{Var}\_{\pi}(E(1))}{k\_B}} dA \right| + \dots \tag{73}$$

Note that since all legs contribute already to first order to the total thermodynamic length, the times spent in each leg in the optimal case are proportional to the thermodynamic lengths of each leg, τ (*j*) *<sup>Q</sup>* <sup>=</sup> *<sup>L</sup>* (*j*) *Q Lcycle* τ. Since the values of *A* at the corners are all different, no simple general estimate of assigning times to the various legs appears possible. However, for the special case of (approximately) constant variance *Var*<sup>→</sup> <sup>π</sup>(*E*(1)), we find *<sup>L</sup>*(1) *<sup>Q</sup>* <sup>=</sup> <sup>κ</sup>*in* <sup>1</sup><sup>√</sup> *T*1 − <sup>1</sup><sup>√</sup> *T*2 "*Var*→<sup>π</sup> (*E*(1)) *kB* , *<sup>L</sup>*(2) *<sup>Q</sup>* = κ*<sup>f</sup>* √ *T*2 − √ κ*in T*2 "*Var*→<sup>π</sup> (*E*(1)) *kB* , *L*(3) = κ*<sup>f</sup>* <sup>1</sup><sup>√</sup> *T*1 − <sup>1</sup><sup>√</sup> *T*2 "*Var*→<sup>π</sup> (*E*(1)) *kB* and *<sup>L</sup>*(4) *<sup>Q</sup>* = κ*<sup>f</sup>* √ *T*1 − √ κ*in T*1 "*Var*→<sup>π</sup> (*E*(1)) *kB* . From this follows *LQ*;*cycle* = 2 % *Var*<sup>→</sup> <sup>π</sup>(*E*(1)) *kB* ( κ*<sup>f</sup>* √ *T*1 <sup>−</sup> <sup>κ</sup>*in* <sup>√</sup> *T*2 ) = 2 % *Var*<sup>→</sup> <sup>π</sup>(*E*(1)) *kB* - √ *<sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup> <sup>√</sup> *T*1κ*in* √ *T*1*T*<sup>2</sup> , (74)

and thus the optimal times for the four legs we obtain τ (1) *<sup>Q</sup>* <sup>=</sup> <sup>τ</sup> 2  √ *<sup>T</sup>*2κ*in*<sup>−</sup> <sup>√</sup> <sup>√</sup> *<sup>T</sup>*1κ*in <sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup> <sup>√</sup> *<sup>T</sup>*1κ*in* , τ (2) *<sup>Q</sup>* <sup>=</sup> <sup>τ</sup> 2  √ *<sup>T</sup>*1κ*<sup>f</sup>* <sup>−</sup> <sup>√</sup> *<sup>T</sup>*1κ*in* <sup>√</sup> *<sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup> <sup>√</sup> *<sup>T</sup>*1κ*in* , τ (3) *<sup>Q</sup>* <sup>=</sup> <sup>τ</sup> 2  √ *<sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup> <sup>√</sup> *T*1κ*<sup>f</sup>* √ *<sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup> <sup>√</sup> *<sup>T</sup>*1κ*in* and τ (4) *<sup>Q</sup>* <sup>=</sup> <sup>τ</sup> 2  √ *<sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup> <sup>√</sup> *<sup>T</sup>*2κ*in* <sup>√</sup> *<sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup> <sup>√</sup> *<sup>T</sup>*1κ*in* . Analogous results are obtained using the metric ↔ *MS* for the case of minimum entropy production. In particular, if we again assume an approximately constant variance *Var*<sup>→</sup> <sup>π</sup>(*E*(1)), we obtain *<sup>L</sup>*(1) *<sup>S</sup>* <sup>=</sup> κ*in <sup>T</sup>*<sup>1</sup> <sup>−</sup> <sup>κ</sup>*in T*2 "*Var*→<sup>π</sup> (*E*(1)) *kB* , *<sup>L</sup>*(2) *<sup>Q</sup>* <sup>=</sup> κ*<sup>f</sup> <sup>T</sup>*<sup>2</sup> <sup>−</sup> <sup>κ</sup>*in T*2 "*Var*→<sup>π</sup> (*E*(1)) *kB* , *L*(3) = κ*<sup>f</sup> <sup>T</sup>*<sup>1</sup> <sup>−</sup> <sup>κ</sup>*<sup>f</sup> T*2 "*Var*→<sup>π</sup> (*E*(1)) *kB* and *<sup>L</sup>*(4) *<sup>Q</sup>* <sup>=</sup> κ*<sup>f</sup> <sup>T</sup>*<sup>1</sup> <sup>−</sup> <sup>κ</sup>*in T*1 "*Var*→<sup>π</sup> (*E*(1)) *kB* . From this follows for the total thermodynamic length of the path *LS*;*cycle* = 2 "*Var*→<sup>π</sup> (*E*(1)) *kB* (*T*2κ*<sup>f</sup>* −*T*1κ*in*) *<sup>T</sup>*1*T*<sup>2</sup> , yielding the optimal time assignments to the legs as τ (1) *<sup>S</sup>* <sup>=</sup> <sup>τ</sup> 2 *T*2κ*in*−*T*1κ*in <sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup>*T*1κ*in* , τ (2) *<sup>S</sup>* <sup>=</sup> <sup>τ</sup> 2 *T*1κ*<sup>f</sup>* −*T*1κ*in <sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup>*T*1κ*in* , τ (3) *<sup>S</sup>* <sup>=</sup> <sup>τ</sup> 2 *<sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup>*T*1κ*<sup>f</sup> <sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup>*T*1κ*in* and τ (4) *<sup>S</sup>* <sup>=</sup> <sup>τ</sup> 2 *T*2κ*<sup>f</sup>* −*T*2κ*in <sup>T</sup>*2κ*<sup>f</sup>* <sup>−</sup>*T*1κ*in* .

## *4.3. Isothermal-Adiabatic Cycle*

In the case of the isothermal-adiabatic cycle where the legs 1 and 3 are adiabatic and do not contribute to the heat exchange, we have from legs 2 and 4:

$$\begin{cases} Q\_{\text{cycle}} = \int\_{S^{[2]}}^{S^{[3]}} TdS + \int\_{S^{[4]}}^{S^{[1]}} TdS = \left[ T^{[3]}S^{[3]} - T^{[2]}S^{[2]} \right] + k\_{\text{B}} \int\_{T^{[2]}}^{T^{[3]}} \overleftarrow{\pi}(T, \kappa\_{\text{in}}) \cdot \ln\left( \overleftarrow{\pi}(T, \kappa\_{\text{in}}) \right) dT + \\ \left[ T^{[1]}S^{[1]} - T^{[4]}S^{[4]} \right] + k\_{\text{B}} \int\_{T^{[4]}}^{T^{[1]}} \overleftarrow{\pi}(T, \kappa\_{\text{f}}) \cdot \ln\left( \overleftarrow{\pi}(T, \kappa\_{\text{f}}) \right) dT = \left. T^{[2]} \right[S^{[3]} - S^{[1]}] + T^{[1]}[S^{[1]} - S^{[3]}] = \\ \left[ T^{[2]} - T^{[1]} \right] \left[ S^{[3]} - S^{[1]} \right] = \left. W\_{\text{cycle}} \text{-} \right. \end{cases} \tag{75}$$

Here, we have used the fact that the temperature does not change along legs 2 and 4, *T*[2] = *T*[3] and *T*[1] = *T*[4] , and that the entropy does not change along the adiabatic legs, i.e., *S*[1] = *S*[2] and *S*[3] = *S*[4] .

Since *T*[2] > *T*[1] , and furthermore, for equal temperatures, the equilibrium entropy decreases with κ, i.e., *S*[3] < *S*[2] = *S*[1] , we have a rejection of heat over the cycle, i.e., the hydrogen atom-like system converts work performed on it into heat transferred to the environment. Furthermore, the term belonging to leg 2 absorbs heat in the system, while along leg 3, we are removing heat from the system.

For the work performed by the system along the four legs, we find *W*1→<sup>2</sup> = − → *E*(κ2)· → π - κ2, *T*[2] − → *E*(κ*in*) → π - κ*in*, *T*[1] , *W*2→<sup>3</sup> = *T*[2] *S*[3] - κ*<sup>f</sup>* , *T*[2] − *S*[2] - κ2, *T*[2] − → *E* - κ*f* · → π - κ*<sup>f</sup>* , *T*[2] − → *E*(κ2)· → π - κ2, *T*[2] , *W*3→<sup>4</sup> = − → *E*(κ4)· → π - κ4, *T*[1] − → *E* - κ*f* → π - κ*<sup>f</sup>* , *T*[2] , and *W*4→<sup>1</sup> = *T*[1] *S*[1] - κ*in*, *T*[1] − *S*[4] - κ4, *T*[1] − → *E*(κ*in*)· → π - κ*in*, *T*[1] − → *E*(κ4)· → π - κ4, *T*[1] . Taking the sum along the two isothermal legs, we obtain

$$\begin{split} \mathcal{W}\_{4\to 1} + \mathcal{W}\_{2\to 3} &= \; T^{[1]} \Big[ \mathcal{S}^{[1]} \{ \mathbf{x}\_{\text{in}}, T^{[1]} \} - \mathcal{S}^{[4]} \{ \mathbf{x}\_{4\text{-}}, T^{[1]} \} \Big] - \left[ \overrightarrow{E} \{ \mathbf{x}\_{\text{in}} \} \cdot \overrightarrow{\pi} \{ \mathbf{x}\_{\text{in}}, T^{[1]} \} - \overrightarrow{E} \{ \mathbf{x}\_{4\text{-}} \} \cdot \overrightarrow{\pi} \{ \mathbf{x}\_{4\text{-}}, T^{[1]} \} \right] \\ &+ \mathcal{T}^{[2]} \Big[ \mathcal{S}^{[3]} \{ \mathbf{x}\_{f}, T^{[2]} \} - \mathcal{S}^{[2]} \{ \mathbf{x}\_{2\text{-}}, T^{[2]} \} \Big] - \left[ \overrightarrow{E} \{ \mathbf{x}\_{f} \} \cdot \overrightarrow{\pi} \{ \mathbf{x}\_{f\_{f}}, T^{[2]} \} - \overrightarrow{E} \{ \mathbf{x}\_{2\text{-}} \} \overrightarrow{\pi} \{ \mathbf{x}\_{2\text{-}}, T^{[2]} \} \right] \\ &= \left[ T^{[2]} - T^{[1]} \right] \Big[ \mathcal{S}^{[3]} - \mathcal{S}^{[1]} \Big] - \left( 1 - \frac{T\_{1}}{T\_{2}} \right) \mathbf{x}\_{f} \overset{\rightarrow}{E} (\mathbf{x}\_{1} = 1) \cdot \Big[ \widetilde{\pi} (A\_{3\to 4}) - \frac{\kappa\_{\text{m}}}{\kappa\_{f\_{1}}} \Big( \widetilde{T}\_{1} \right) \widetilde{\pi} (A\_{1\to 2}) \Big], \end{split} \tag{76}$$

where we have used *S*[1] = *S*[2] , *S*[3] = *S*[4] , *<sup>A</sup>*1→<sup>2</sup> = <sup>κ</sup>*in <sup>T</sup>*[1] <sup>=</sup> <sup>κ</sup><sup>2</sup> *<sup>T</sup>*[2] , and *<sup>A</sup>*3→<sup>4</sup> <sup>=</sup> <sup>κ</sup>*<sup>f</sup> <sup>T</sup>*[2] <sup>=</sup> <sup>κ</sup><sup>4</sup> *<sup>T</sup>*[1] . We note that <sup>→</sup> *E*(1)· → <sup>π</sup>(*A*3→4) <sup>&</sup>lt; <sup>→</sup> *E*(1)· → π(*A*1→2) < 0 and thus

$$-\kappa\_f \left( 1 - \frac{T\_1}{T\_2} \right) \overrightarrow{\mathcal{E}} \left( \kappa \;=\; 1 \right) \cdot \left\{ \overrightarrow{\pi} \left( A\_{3 \to 4} \right) - \frac{\kappa\_{in}}{\kappa\_f} \left( \frac{T\_2}{T\_1} \right) \overrightarrow{\pi} \left( A\_{1 \to 2} \right) \right\} > 0 \tag{77}$$

as long as <sup>κ</sup>*in* κ*f* - *T*2 *T*1 < 1; note that this is exactly the feasibility condition for the special adiabatic-isothermal cycle, Equation (5). Furthermore, *S*[3] < *S*[1] and thus *T*[2] − *T*[1] *S*[3] − *S*[1] < 0, suggesting that the net work for these two legs is likely to be negative, i.e., the apparatus does work on the atom and increases its internal energy in the process.

For the "efficiency", we again compute the ratio between the net work along the isothermal legs and the total heat exchanged

$$\eta\_{[S,T]}^{\text{isothermal}} = \frac{\mathcal{W}\_{4\to1} + \mathcal{W}\_{2\to3}}{Q\_{cycle}} = 1 - \frac{-\mathbf{x}\_f \Big(1 - \frac{T\_1}{T\_2}\big) \stackrel{\rightarrow}{\mathcal{E}}(\mathbf{x} = 1) \cdot \Big\{ \stackrel{\rightarrow}{\pi}(A\_{3\to4}) - \frac{\mathbf{x}\_{\text{int}}}{\mathbf{x}\_f} \Big(\frac{T\_2}{T\_1}\big) \stackrel{\rightarrow}{\pi}(A\_{1\to2})}{\Big[T^{[2]} - T^{[1]}\big] \Big[S^{[1]} - S^{[3]}\big]} < 1. \tag{78}$$

Alternatively, we could use the two adiabatic legs to extract/perform work, i.e.,

$$\begin{split} \mathcal{W}\_{1\to 2} + \mathcal{W}\_{3\to 4} &= -\Big( \overrightarrow{E}\left(\kappa\_{4}\right) \overrightarrow{\pi}\Big(\kappa\_{4}, T^{[1]}\big) - \overrightarrow{E}\left(\kappa\_{f}\right) \overrightarrow{\pi}\Big(\kappa\_{f'}, T^{[2]}\big) \Big) \\ &- \Big( \overrightarrow{E}\left(\kappa\_{2}\right) \cdot \overrightarrow{\pi}\Big(\kappa\_{2}, T^{[2]}\big) - \overrightarrow{E}\left(\kappa\_{\text{in}}\right) \overrightarrow{\pi}\Big(\kappa\_{\text{in}}, T^{[1]}\big) \Big) \\ &= \Big(1 - \frac{T\_{1}}{T\_{2}}\big) \kappa\_{f} \overset{\rightarrow}{E}\left(\kappa\_{1} = 1\right) \cdot \Big( \overset{\rightarrow}{\pi}\big(A\_{3\to 4}\big) - \frac{\kappa\_{\text{in}}}{\kappa\_{f}} \Big(\frac{T\_{2}}{T\_{1}}\big) \overset{\rightarrow}{\pi}\big(A\_{1\to 2}\big) \Big); \end{split} \tag{79}$$

in that case, we get for the efficiency

$$\eta\_{\{S,T\}}^{\text{adiabatic}} = \frac{W\_{1\to 2} + W\_{3\to 4}}{Q\_{cycle}} = \frac{\left(1 - \frac{T\_1}{T\_2}\right) \kappa\_f \overrightarrow{E}(\kappa = 1) \cdot \left\{\overrightarrow{\pi}(A\_{3\to 4}) - \frac{\kappa\_{\text{in}}}{\kappa\_f} \binom{T\_2}{T\_1} \overrightarrow{\pi}(A\_{1\to 2})\right\}}{\left(T^{[2]} - T^{[1]}\right) \left[S^{[3]} - S^{[1]}\right]}.\tag{80}$$

Clearly, η*isothermal* {*ad*;*T*} <sup>+</sup> <sup>η</sup>*adiabatic* {*ad*;*T*} = 1, since *Wcycle* = *Qcycle*.

Regarding minimizing the excess heat, we do not include the effect of being "off-target" during the adiabatic legs, and thus we only have the two terms from the isothermal legs 2 and 4:

$$\begin{split} I\_{\text{Qtotal}} = \; I\_{\text{Q2}\to\text{3}} + I\_{\text{Q3}\to\text{1}} &= \; \left\{ \Sigma\_{i}^{N\_{\text{T}}} \; \middle| \begin{matrix} \overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i}} - 1 \end{matrix} \middle| \begin{matrix} \overrightarrow{k\_{B}T\_{i}} \\ \overrightarrow{\pi\_{i}} \end{matrix} \middle| \begin{matrix} \overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i}} - 1 \end{matrix} \right\}\_{\text{kg}\mathbb{Z}} \\ &+ \left\{ \Sigma\_{i}^{N\_{\text{T}}} \; \middle| \begin{matrix} \overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i}} - 1 \end{matrix} \middle| \begin{matrix} \overrightarrow{k\_{B}T\_{i}} \\ \overrightarrow{\pi\_{i}} - \overrightarrow{\pi\_{i}} - 1 \end{matrix} \right\}\_{\text{kg}\mathbb{Z}}. \end{split} \tag{81}$$

We can use Equations (37) and (58) to write an expression for the thermodynamic length of the cycle:

$$L\_{Q\text{xyz}} = L\_Q^{(2)} + L\_Q^{(4)} = \begin{vmatrix} \sqrt{T^{[2]}} \int\_{\mathbf{x}^{[2]}}^{\mathbf{x}\_f} \frac{1}{\mathbf{x}} \sqrt{\mathbb{C}\left(\frac{\mathbf{x}}{T^{[2]}}\right)} d\mathbf{x} \end{vmatrix} + \left| \sqrt{T^{[1]}} \int\_{\mathbf{x}^{[4]}}^{\mathbf{x}\_{in}} \frac{1}{\mathbf{x}} \sqrt{\mathbb{C}\left(\frac{\mathbf{x}}{T^{[1]}}\right)} d\mathbf{x} \right| = \sqrt{T^{[1]}} \int\_{\mathbf{x}^{[4]}} \sqrt{T^{[1]}} \int\_{\mathbf{x}^{[4]}}^{\mathbf{x}\_{in}} \sqrt{\frac{V\mathbf{r}\mathbf{r} \cdot (E(1))}{T^{[1]}}} d\mathbf{x} \right|. \tag{82}$$

We note that for the hydrogen atom-like system, the integrand in the thermodynamic length integrals of the isothermal legs is the square root of the heat capacity, just as in the case of the iso-κ legs. We again switch to integration over *A* = <sup>κ</sup> *<sup>T</sup>* , and find for the thermodynamic lengths

$$L\_Q^{(2)} = \left| \sqrt{T^{[2]}} \int\_{A^{[2]}}^{A^{[3]}} \sqrt{\frac{Var\_{\overrightarrow{\pi}}(E(1))}{k\_B}} dA \right| > L\_Q^{(4)} = \left| \sqrt{T^{[1]}} \int\_{A^{[4]}}^{A^{[1]}} \sqrt{\frac{Var\_{\overrightarrow{\pi}}(E(1))}{k\_B}} dA \right| \tag{83}$$

since <sup>√</sup> *<sup>T</sup>*[2] <sup>&</sup>gt; <sup>√</sup> *T*[1] , *A*[2] = *A*[1] , and *A*[4] = *A*[3] along the special adiabatic legs, and *Var*<sup>→</sup> <sup>π</sup>(*E*(1)) depends only on *A*.

As far as distributing the available time over the four legs, we again have to face the problem of the adiabatic legs being of zero thermodynamic length as long as we can keep the controls on target along these legs. We assume a short (i.e., τ*<sup>a</sup>* τ) time τ*<sup>a</sup>* = τ (1) *<sup>Q</sup>* = τ (3) *<sup>Q</sup>* needed to move along the adiabatic leg without noticeable deviations from the ideal adiabatic curve in (κ, *T*) space and subtract these times from the total available time τ, τ*iso*−*<sup>T</sup>* = τ − 2τ*a*, before assigning τ (2) *<sup>Q</sup>* and τ (4) *<sup>Q</sup>* according the principle of constant thermodynamic speed. Assuming constant relaxation times, we determine the optimal times using the ratio of the thermodynamic lengths,

$$\frac{\tau\_Q^{(2)}}{\tau\_Q^{(4)}} = \frac{L\_Q^{(2)}}{L\_Q^{(4)}} = \frac{\sqrt{T^{[2]}}}{\sqrt{T^{[1]}}} \,\tag{84}$$

to be τ (2) *<sup>Q</sup>* = τ*iso*−*<sup>T</sup>* √ *T*[2] √ *T*[2]+ √ *T*[1] and τ (4) *<sup>Q</sup>* = τ*iso*−*<sup>T</sup>* √ *T*[1] √ *T*[2]+ √ *T*[1] . Analogously, when minimizing the entropy production instead of the excess heat, we obtain *<sup>L</sup>*(2) *<sup>S</sup>* <sup>=</sup> *<sup>L</sup>*(4) *<sup>S</sup>* , and thus with τ*<sup>a</sup>* = τ (1) *<sup>S</sup>* = τ (3) *S* , the optimal time assignment to the two legs is τ (2) *<sup>S</sup>* = τ (4) *<sup>S</sup>* <sup>=</sup> <sup>τ</sup>*iso*−*<sup>T</sup>* <sup>2</sup> .

Again, due to the sum over microstates with nontrivial energy eigenvalues under the square root, further analytical calculations require additional simplifications; in particular, the optimal placement of the steps along each of the isothermal paths remains open but is expected to vary according to the specific heat.

## **5. Approximation of the Hydrogen Atom-Like System as a Two-Level System**

## *5.1. Preliminaries*

In many cases of statistical mechanical systems, one can find analytical solutions for a problem, if we can restrict ourselves to a two-state model; perhaps the most straightforward example for our purposes is the spin 1/2 system [27,28]. This is also the case here, since we can employ the probability π<sup>1</sup> of one of the two states as the integration variable, π = π1. Probability conservation then determines the occupation probability of the second state as π<sup>2</sup> = 1−π<sup>1</sup> = 1−π, thus eliminating the complicated sum over the microstates. This was demonstrated in [35], where the thermodynamic length was computed for a paramagnet in a magnetic field for an isothermal path along which the energy of the paramagnet was changed by varying the magnetic field in finite time. In this fashion, one could compute the thermodynamic length and subsequently assign the steps by the equal thermodynamic length criterion, thus solving the optimal control problem.

However, the situation is more complex in the case of the cycle of the hydrogen atom-like system, because along the iso-κ legs the temperature varies, adding a nontrivial function *T*(π) to the integrand for the case of minimizing the excess heat. On the other hand, the approximation of any statistical mechanical system by a two-state system actually leads to many generic properties associated with the thermodynamic cycles of the two-state system, i.e., many of the results obtained below do not depend on the specific property in Equation (3), *E n*(κ) <sup>=</sup> <sup>κ</sup>*<sup>E</sup> n*(1), of the hydrogen atom-like system.

If we take two energy levels, *n*<sup>1</sup> and *n*<sup>2</sup> with *n*<sup>1</sup> < *n*<sup>2</sup> and thus *En*<sup>1</sup> (κ) = *E n*<sup>1</sup> (κ) <sup>=</sup> <sup>κ</sup>*<sup>E</sup> n*<sup>1</sup> (1) <sup>&</sup>lt; *En*<sup>2</sup> (κ) <sup>=</sup> *<sup>E</sup> n*<sup>2</sup> (κ) <sup>=</sup> <sup>κ</sup>*<sup>E</sup> n*<sup>2</sup> (1), with degeneracies *<sup>g</sup>*(*n*1) <sup>=</sup> (*n*1) <sup>2</sup> and *g*(*n*2) = (*n*2) 2 , respectively—recall: we ignore the spin degeneracy of the electron in this study—, then we obtain the following expressions, for given (κ, *T*): For the probabilities, we have

$$\widetilde{\pi}(n\_1) = \operatorname{g}(n\_1)\rho(n\_1) = \pi = \frac{\operatorname{g}(n\_1)\exp\left(\frac{-\widetilde{E}\_{n\_1}(\kappa)}{k\_B T}\right)}{\operatorname{g}(n\_1)\exp\left(\frac{-\widetilde{E}\_{n\_1}(\kappa)}{k\_B T}\right) + \operatorname{g}(n\_2)\exp\left(\frac{-\widetilde{E}\_{n\_2}(\kappa)}{k\_B T}\right)}\tag{85}$$

and

$$\widetilde{\pi}(n\_2) = g(n\_2)\rho(n\_2) = 1 - \pi = \frac{g(n\_2)\exp\left(\frac{-\widetilde{E}\_{\text{tr}\_2}(\mathbf{x})}{k\_B T}\right)}{g(n\_1)\exp\left(\frac{-\widetilde{E}\_{\text{tr}\_1}(\mathbf{x})}{k\_B T}\right) + g(n\_2)\exp\left(\frac{-\widetilde{E}\_{\text{tr}\_2}(\mathbf{x})}{k\_B T}\right)}.\tag{86}$$

For the equilibrium entropy, we have the expression

$$\begin{array}{c} S(\pi) = -k\_{\mathrm{B}} \Big[ \pi \ln \Big( \frac{\pi}{\mathcal{g}(n\_1)} \Big) + (1 - \pi) \ln \Big( \frac{1 - \pi}{\mathcal{g}(n\_2)} \Big) \Big] = \\ -k\_{\mathrm{B}} [\pi (\ln(\pi) - \ln(\mathcal{g}(n\_1))) + (1 - \pi)(\ln(1 - \pi) - \ln(\mathcal{g}(n\_2)))] & \\ \qquad \qquad \qquad \qquad k\_{\mathrm{B}} \ln(Z(\kappa, T)) - \pi(\kappa, T) \frac{\mathrm{B}k\_{\mathrm{B}}}{T}; \end{array} \tag{87}$$

and for the temperature,

$$T(\pi) = \frac{B}{\ln\left[\left(\frac{\xi\left(n\_2\right)}{\xi\left(n\_1\right)}\right)\left(\frac{\pi}{1-\pi}\right)\right]}.\tag{88}$$

Here, *B* = − -*E n*<sup>1</sup> (κ) <sup>−</sup> *<sup>E</sup> n*<sup>2</sup> (κ) /*kB* > 0, for a generic two-state system; specifically for the hydrogen atom-like system, we have *B* = κ*B*0/*kB* with *B*<sup>0</sup> = − - *E n*<sup>1</sup> (1) <sup>−</sup> *<sup>E</sup> n*<sup>2</sup> (1) = α 1 (*n*1) <sup>2</sup> − <sup>1</sup> (*n*2) 2 > 0. Note that *g*(*n*2) *g*(*n*1) - π 1−π <sup>≥</sup> 1, with equality only possible in the infinite temperature limit when <sup>π</sup> = *<sup>g</sup>*(*n*1) *<sup>g</sup>*(*n*1)+*g*(*n*2). With this, we get for the expectation value of the energy

$$
\pi\_1(E)(\mathbf{x}, T) = \widetilde{E}\_{\mathfrak{m}\_2}(\mathbf{x}) + \pi(\mathbf{x}, T) \big( \widetilde{E}\_{\mathfrak{m}\_1}(\mathbf{x}) - \widetilde{E}\_{\mathfrak{m}\_2}(\mathbf{x}) \big) \\
= \kappa \Big[ \widetilde{E}\_{\mathfrak{m}\_2}(1) - \pi(\frac{\kappa}{T}) \mathcal{B}\_0 \big],
\tag{89}
$$

where the second equality holds for the hydrogen atom-like system. For the derivative of the entropy with respect to π, we find

$$\frac{dS}{d\pi} = -k\_{\mathbb{B}}[\ln(\pi) - \ln(g(n\_1)) - \ln(1-\pi) + \ln(g(n\_2)) + 1 - 1] \\ = -k\_{\mathbb{B}}\ln\left(\left(\frac{g(n\_2)}{g(n\_1)}\right)\left(\frac{\pi}{1-\pi}\right)\right) \\ = -k\_{\mathbb{B}}\frac{\pi}{1} < 0 \quad \text{(90)}$$

for all temperatures. From this follows that for all valid values of <sup>π</sup>, *<sup>g</sup>*(*n*1) *<sup>g</sup>*(*n*1)+*g*(*n*2) <sup>≤</sup> <sup>π</sup> <sup>≤</sup> 1, we have a one-to-one correspondence between the entropy *S* and the occupation probability of the low energy state π. As a consequence, every adiabatic path for any two-state system is automatically special adiabatic, because *S* = constant along the path implies π = constant, too.

## *5.2. Thermodynamic Cycles*

With the formulas derived above, we can compute some of the expressions given in the previous section for the work and heat transfer along the legs of the cycles explicitly, such as, e.g.,

$$Q^{(j)} = \int\_{S^{[j]}}^{S^{[j+1]}} TdS = \int\_{\pi\_{\text{in}}}^{\pi\_f} T(\pi) \frac{dS}{d\pi} d\pi = \int\_{\pi\_{\text{in}}}^{\pi\_f} T(\pi) \Big( -\frac{B(\pi)k\_B}{T(\pi)} \Big) d\pi \tag{91} = -B\_0 \int\_{\pi\_{\text{in}}}^{\pi\_f} \kappa(\pi) d\pi,\tag{91}$$

where the last equality only holds for the hydrogen atom-like system. Here, π*in* = π[*j*] and π*<sup>f</sup>* = π[*j*+1] are the values of π at the beginning and at the end of the leg (*j*). If we are considering an iso-κ branch, then we have κ(π) = κ(*j*) = constant, and thus *B*(π) = *B*(*j*) = constant, from which follows *Q*(*j*) = −*kBB*(*j*) - π*<sup>f</sup>* − π*in* . Furthermore, if in addition the temperature increases along the leg, then π(*T*) will decrease, *E* - κ(*j*), *T* will increase, and thus *Q*(*j*) > 0. We note that along such a branch, we also have (Δ*E*) (*j*) = *E* - κ(*j*), *T*[*j*+1] − *E* - κ(*j*), *T*[*j*] = −*kBB*(*j*) - π*<sup>f</sup>* − π*in* , and thus for any two-state system, we have *Q*(*j*) = (Δ*E*) (*j*) and *W*(*j*) = 0 along the iso-κ branches. This is a special case of the earlier general result, Equation (19).

For the adiabatic path (*j*), we recall that these paths are special for any two-state system, i.e., π = constant, and thus the heat term yields *Q*(*j*) = − <sup>π</sup>*<sup>f</sup>* <sup>π</sup>*in kBB*(π)*d*<sup>π</sup> <sup>=</sup> 0 since <sup>π</sup>*<sup>f</sup>* <sup>=</sup> <sup>π</sup>*in*. Finally, for an isothermal leg, we have

$$\begin{split} Q^{(j)} &= -k\_B T^{(j)} \Big[ \Big( \pi\_f \ln \Big( \frac{\pi\_f}{\xi(n\_1)} \Big) + \Big( 1 - \pi\_f \Big) \ln \Big( \frac{1 - \pi\_f}{\xi(n\_2)} \Big) \Big) - \Big( \pi\_{\text{in}} \ln \Big( \frac{\pi\_{\text{in}}}{\xi(n\_1)} \Big) + (1 - \pi\_{\text{in}}) \ln \Big( \frac{1 - \pi\_{\text{in}}}{\xi(n\_2)} \Big) \Big) \Big] \\ &= k\_B T^{(j)} \ln \Big[ \frac{Z\_{\text{\{k $\cdot$ ^{\{j+1\}} $/T^{\text{(j)}}\}}}{Z\{\text{\{k$ \cdot $^{\text{(j)}}$ /T^{\text{(j)}}\}}} \Big)} + B\_0 \Big[ \pi\_{\text{in}} \mathbf{x}^{\text{[.j]}} - \pi\_f \mathbf{x}^{\text{[.j]}+1} \Big] \Big] \end{split} \tag{92}$$

where the last equality holds for the hydrogen atom-like system.

In the following, we are not going to re-compute for the two-state hydrogen atom-like system all the general work and heat-related expressions derived in Section 4. We only note that for the cycles with iso-κ legs, we find again that η{κ;*T*} = 1 and η{κ;*S*} = 1, which are the same results as we had obtained for the complete hydrogen atom-like system, Equations (62) and (70). Thus, for the two-state system, the net work performed by the "atom" along the isothermal or adiabatic legs equals the net heat added to the system over the whole cycle because *Q*(*j*) = (Δ*E*) (*j*) along the iso-κ legs. Finally, for the adiabatic-isothermal path, we find η*adiabatic* {*S*;*T*} = {<sup>1</sup> + *<sup>Y</sup>*} <sup>−</sup><sup>1</sup> and η*isothermal* {*S*;*T*} <sup>=</sup> 1 + <sup>1</sup> *Y* −1 ,

$$\text{where } Y = \frac{k\_{\text{B}}(T\_1 - T\_2) \ln \left| \frac{Z(\kappa\_{\text{iv}}/T\_1)}{Z(\kappa\_f/T\_2)} \right|}{\kappa\_f \left(1 - \frac{T\_1}{T\_2}\right) \left| \tilde{E}\_{\text{v}\_2}(1) \left[1 - \left(\frac{\kappa\_{\text{iv}}/T\_1}{\kappa\_f/T\_2}\right)\right] - B\_0 \left[\pi \left(\kappa\_f/T\_2\right) - \left(\frac{\kappa\_{\text{iv}}/T\_1}{\kappa\_f/T\_2}\right) \pi \left(\kappa\_{\text{iv}}/T\_1\right)\right] \right|}.$$

Instead, we will focus on the optimal control problem of minimizing the excess heat production instead. Applying the general formulas in Equations (23) and (24), we observe that the expression for the square length of an infinitesimal distance in probability space yields in terms of π:

$$\left(d\mathcal{L}\_{\mathcal{Q}}\right)^{2} = \,^{k}\_{B}T(\pi)\begin{pmatrix} d\pi\\ -d\pi \end{pmatrix} \begin{pmatrix} \left(\frac{\mathcal{S}(n\_{1})}{\pi}\right)\frac{\mathcal{S}(n\_{1})}{\left(\mathcal{S}(n\_{1})\right)^{2}} & 0\\ 0 & \left(\frac{\mathcal{S}(n\_{2})}{1-\pi}\right)\frac{\mathcal{S}(n\_{2})}{\left(\mathcal{S}(n\_{2})\right)^{2}} \end{pmatrix} \begin{pmatrix} d\pi\\ -d\pi \end{pmatrix} = k\_{B}T(\pi)\Big[\left(d\pi\right)^{2}\Big] \left(\frac{1}{\pi} + \frac{1}{1-\pi}\right). \tag{93}$$

The metric for the energy levels is a compactified (2 × 2) version of the true (*g*(*n*1) + *g*(*n*2)) × (*g*(*n*1) <sup>+</sup> *<sup>g</sup>*(*n*2)) microstate metric 1 ↔ π *kl* = δ*kl* <sup>1</sup> *<sup>r</sup>*<sup>1</sup> = <sup>δ</sup>*kl g*(*n*1) <sup>π</sup> for *k* = 1, ... , *g*(*n*1) and 1 ↔ π *kl* = δ*kl* <sup>1</sup> *<sup>r</sup>*<sup>2</sup> = <sup>δ</sup>*kl g*(*n*2) <sup>1</sup>−<sup>π</sup> for *<sup>k</sup>* <sup>=</sup> *<sup>g</sup>*(*n*1) <sup>+</sup> 1, ... , *<sup>g</sup>*(*n*1) <sup>+</sup> *<sup>g</sup>*(*n*2). Similarly, ( *<sup>d</sup>*<sup>π</sup> −*d*π ) is a compactified version of the (*g*(*n*1) + *g*(*n*2))-dimensional microstate probability difference vector (*d*ρ1, ... , *d*ρ1,−*d*ρ2, ... ,−*d*ρ2) = *d*π *<sup>g</sup>*(*n*1), ... , *<sup>d</sup>*<sup>π</sup> *<sup>g</sup>*(*n*1), <sup>−</sup>*d*<sup>π</sup> *<sup>g</sup>*(*n*2), ... , <sup>−</sup>*d*<sup>π</sup> *g*(*n*2) . As mentioned earlier, we assume that the microstates with the same energy exhibit the same occupation probability, and that we do not have "mixing" among the states for the same energy, i.e., all *g*(*n*1) states with energy "gain" the same amount of probability *d*ρ<sup>1</sup> = *<sup>d</sup>*<sup>π</sup> *<sup>g</sup>*(*n*1), and similarly, all states with energy "lose" the same amount of probability.

Taking this into account, we find for the infinitesimal element of thermodynamic length:

$$d\mathcal{L}\_{\mathbb{Q}} = \sqrt{k\_B T(\pi)} \sqrt{\frac{1}{\pi} + \frac{1}{1 - \pi}} |d\pi| = \pm \sqrt{\frac{k \mathcal{F}(\pi)}{\pi (1 - \pi)}} d\pi \tag{94}$$

where the (+)-sign is employed if π increases along the path (*d*π > 0) and the (−)-sign is employed if π decreases along the path (*d*π < 0). We note that Equations (93) and (94) apply to any two-state system and are not restricted to hydrogen atom-like systems. As mentioned above, the adiabatic pieces of the cycle are special for a two-state system, and thus there is no excess heat production to first order since π is constant along these legs, and thus |*d*π| = 0; alternatively, we can note that the initial and final values of π, π*in*, and π*<sup>f</sup>* , respectively, for an adiabatic path are the same, π*<sup>f</sup>* = π*in*, and thus ± <sup>π</sup>*<sup>f</sup>* π*in* √*kBT*(π) √π(1−π) *d*π = ± <sup>π</sup>*in* π*in* √*kBT*(π) √π(1−π) *d*π = 0. However, we should introduce a phenomenological time τ*<sup>a</sup>* required for the external controls to follow the ideal path along an adiabatic leg.

For the isothermal pieces of the cycle, we can compute the corresponding thermodynamic lengths *LQ* analytically, since

$$\pm \int\_{\pi\_{\rm in}}^{\pi\_f} \frac{d\pi}{\sqrt{\pi(1-\pi)}} = \pm \left( \arcsin(1-2\pi\_{\rm in}) - \arcsin(1-2\pi\_f) \right). \tag{95}$$

Assuming constant relaxation times (Δ*t*)*<sup>T</sup>* along the path, the optimal assignment of time follows automatically; along the optimal path with optimal times τ(2) and τ(4), and thus *N*(2) = <sup>τ</sup>(2) (Δ*t*)*<sup>T</sup>* and *N*(4) = <sup>τ</sup>(4) (Δ*t*)*<sup>T</sup>* given, we find

$$\pi\_i^{(2)} = \frac{1}{2} \left[ 1 - \sin \left( \arcsin \left( 1 - 2 \pi\_{\text{in}}^{(2)} \right) - \left[ \arcsin \left( 1 - 2 \pi\_{\text{in}}^{(2)} \right) - \arcsin \left( 1 - 2 \pi\_f^{(2)} \right) \right] \frac{i}{N^{(2)}} \right) \right] \tag{96}$$

along leg 2, and

$$\begin{array}{ll} \pi\_{i}^{(4)} & = \frac{1}{2} \Big[ 1 - \sin \left( \arcsin \left( 1 - 2 \pi\_{f}^{(4)} \right) - \left[ \arcsin \left( 1 - 2 \pi\_{f}^{(4)} \right) - \arcsin \left( 1 - 2 \pi\_{\text{in}}^{(4)} \right) \right] \Big| \frac{N^{(4)} - i}{N^{(4)}} \right) \Big] \\ & = \frac{1}{2} \Big[ 1 - \sin \left( \arcsin \left( 1 - 2 \pi\_{\text{in}}^{(4)} \right) + \left[ \arcsin \left( 1 - 2 \pi\_{f}^{(4)} \right) - \arcsin \left( 1 - 2 \pi\_{\text{in}}^{(4)} \right) \right] \Big| \frac{i}{N^{(4)}} \right] \end{array} \tag{97}$$

along leg 4. Note that we have employed the (+)-sign in the integral for leg 2 since <sup>π</sup>(2) *<sup>f</sup>* > π(2) *in* , and similarly the (−)-sign for leg 4 since <sup>π</sup>(4) *in* > π(4) *f* .

However, for the iso-κ leg, we need to compute the integral

$$\ln(\pm) \int\_{\pi\_{in}}^{\pi\_{f}} \frac{\sqrt{\text{Bk}\_{\text{B}}} d\pi}{\sqrt{(\pi(1-\pi)) \ln \left[ \left( \frac{\xi(n\_{2})}{\xi(n\_{1})} \right) \left( \frac{\pi}{1-\pi} \right)}} = (\pm) \sqrt{\text{v}} \int\_{\pi\_{in}}^{\pi\_{f}} \frac{\sqrt{\text{B}\_{0}} d\pi}{\sqrt{(\pi(1-\pi)) \ln \left[ \left( \frac{\xi(n\_{2})}{\xi(n\_{1})} \right) \left( \frac{\pi}{1-\pi} \right)}}} \text{ (98) $$

which is not straightforward even for constant *B*. Here, the (+)-sign refers to legs with increasing π (i.e., leg 3) and the (−)-sign to legs with decreasing π (i.e., leg 1), and we have used Equation (88) to replace *T*(π). Thus, any cycle containing an iso-κ leg does not allow us to compute the actual distribution of steps along the leg once the optimal time assignment to the legs has been performed. Note that the √ κ dependence of the thermodynamic length of an iso-κ branch is specific to the hydrogen atom-like system and is not a property of a general two-state system.

Nevertheless, we note that for an iso-κ-adiabatic cycle, π[2] = π[3] and π[1] = π[4] because of the special adiabaticity of legs (2) and (4), where we assume as usual that we need the time τ*<sup>a</sup>* to proceed along an adiabatic leg without generating excess heat such that the available time is τ*iso*−<sup>κ</sup> = τ − 2τ*a*. Then we determine the optimal assignment of times as τ (1) *<sup>Q</sup>* = τ*iso*−<sup>κ</sup> <sup>√</sup>κ*in* <sup>√</sup>κ*in*<sup>+</sup> <sup>√</sup>κ*<sup>f</sup>* and τ (3) *<sup>Q</sup>* = τ*iso*−<sup>κ</sup> √κ*f* <sup>√</sup>κ*in*<sup>+</sup> <sup>√</sup>κ*<sup>f</sup>* , according to the ratio of the optimal times, <sup>τ</sup> (3) *Q* τ (1) *Q* <sup>=</sup> *<sup>L</sup>*(3) *Q <sup>L</sup>*(1) *Q* = √κ*f* <sup>√</sup>κ*in* ; we had found the same result for the general hydrogen atom-like system in Equation (66). In contrast to this result, for the iso-κ-isothermal cycle, the relative sizes of the four legs are unknown, and thus we cannot assign optimal times to the four legs of this cycle, even though we have an analytical expression for the thermodynamic lengths of the two isothermal legs.

Among the three cycles we have considered, only the isothermal-adiabatic one can be completely solved analytically when minimizing excess heat, yielding *<sup>L</sup>*(1) *<sup>Q</sup>* <sup>=</sup> *<sup>L</sup>*(3) *<sup>Q</sup>* = 0 and

$$L\_Q^{(2)} = \sqrt{k\_B T^{[2]}} \left( \arcsin\left(1 - 2\pi^{[2]}\right) - \arcsin\left(1 - 2\pi^{[3]}\right) \right) \tag{99}$$

and

$$L\_Q^{(4)} = \sqrt{k\_B T^{[1]}} \Big( \arcsin(1 - 2\pi^{[1]}) - \arcsin(1 - 2\pi^{[4]}) \Big). \tag{100}$$

Due to the special adiabaticity of legs 1 and 3, we have π[1] = π[2] and π[3] = π[4] , and thus

$$L\_Q^{(4)} = \sqrt{k\_B T^{[1]}} \left( \arcsin\left(1 - 2\pi^{[2]}\right) - \arcsin\left(1 - 2\pi^{[3]}\right) \right) \\ = \sqrt{\frac{T^{[1]}}{T^{[2]}}} L\_Q^{(2)}.\tag{101}$$

Subtracting the time needed for the adiabatic legs, we can split the remaining time τ*iso*−*<sup>T</sup>* = τ−2τ*<sup>a</sup>* over the legs 2 and 4, i.e.,

$$
\pi\_Q^{(2)} = \pi\_{\text{iso}-T} \frac{L\_Q^{(2)}}{L\_{\text{cycle}}} = \pi\_{\text{iso}-T} \frac{\sqrt{T^{[2]}}}{\sqrt{T^{[1]}} + \sqrt{T^{[2]}}} \tag{102}
$$

and

$$
\pi\_Q^{(4)} = \pi\_{iso-T} \frac{L\_Q^{(4)}}{L\_{cycle}} = \pi\_{iso-T} \frac{\sqrt{T^{[1]}}}{\sqrt{T^{[1]}} + \sqrt{T^{[2]}}}.\tag{103}
$$

The ratio of the two assigned times is the same as that which we had found in Equation (84),

$$\frac{\tau\_Q^{(2)}}{\tau\_Q^{(4)}} = \frac{L\_Q^{(2)}}{L\_Q^{(4)}} = \sqrt{\frac{T^{[2]}}{T^{[1]}}} ,\tag{104}$$

i.e., we need to spend more time in the high-temperature leg than in the low-temperature leg when minimizing the excess heat of the system. The assignment of the step points along each leg now follows directly from Equations (96) and (97).

We note that we did not need to employ the special properties of the hydrogen atom-like system to derive the finite-time thermodynamics results in Equations (95)–(97) and (99)–(104). Thus, the optimal ratio of assigned times \$ *T*[2] /*T*[1] is the optimality criterion for the adiabatic-isothermal cycle of any two-state system. This agrees with the analysis of a spin 1/2 two-state system in finite time where the power along the cycle was maximized [28], and is reminiscent of similar general results obtained in the analysis of Carnot cycles in finite time [10].

The above analysis was performed using the metric <sup>↔</sup> *MQ* in the optimality criterion for minimizing excess heat/work. If we employ the metric <sup>↔</sup> *MS* appropriate for minimizing entropy production, we note that we now have *dLS* <sup>=</sup> <sup>√</sup> *kB* 0 1 <sup>π</sup> + <sup>1</sup> <sup>1</sup>−π|*d*π| = ± 0 *kB* <sup>π</sup>(1−π) *d*π. Thus, for every leg (*j*), we can use Equation (95) to compute the thermodynamic length *<sup>L</sup>*(*j*) *<sup>S</sup>* , regardless of whether we are dealing with an adiabatic, isothermal, or iso-κ leg. As a consequence, all three cycles considered can be solved analytically. For the Carnot-like cycle, we obtain an assignment of equal times to the isothermal legs, τ (2) *<sup>S</sup>* = τ (4) *<sup>S</sup>* , like we had obtained for the full hydrogen atom; this assignment is again analogous to results obtained for minimal entropy production in the spin 1/2 two-state model [28], as one would have expected from the universal aspects of two-level systems. For the Otto-like cycle, we also find equal time assignments for the iso-κ legs, τ (1) *<sup>S</sup>* = τ (3) *<sup>S</sup>* , as we did already for the full hydrogen atom. Finally, for the Stirling-like cycle, the total thermodynamic length is *LS*;*cycle* = 2 *arcsin*- 1 − 2π[2] − *arcsin*- 1 − 2π[4] , and thus the optimal time assignment to the four legs is τ (1) *<sup>S</sup>* <sup>=</sup> <sup>τ</sup> 2 [*arcsin*(1−2π[2] )−*arcsin*(1−2π[1] )] [*arcsin*(1−2π[2] )−*arcsin*(1−2π[4] )], <sup>τ</sup> (2) *<sup>S</sup>* <sup>=</sup> <sup>τ</sup> 2 [*arcsin*(1−2π[2] )−*arcsin*(1−2π[3] )] [*arcsin*(1−2π[2] )−*arcsin*(1−2π[4] )], τ (3) *<sup>S</sup>* <sup>=</sup> <sup>τ</sup> 2 [*arcsin*(1−2π[3] )−*arcsin*(1−2π[4] )] [*arcsin*(1−2π[2] )−*arcsin*(1−2π[4] )] and <sup>τ</sup> (4) *<sup>S</sup>* <sup>=</sup> <sup>τ</sup> 2 [*arcsin*(1−2π[1] )−*arcsin*(1−2π[4] )] [*arcsin*(1−2π[2] )−*arcsin*(1−2π[4] )]. Since we have analytical expressions for the thermodynamic length for every leg, it is straightforward to also assign the times along the legs for all three cycles, analogous to Equations (96) and (97).

## **6. Summary and Discussion**

In the previous sections, we have presented three thermodynamic cycles for a hydrogen atom-like system in (κ, *T*) space, where κ allows us to control the electronic energy levels of the system: iso-κ-isothermal, iso-κ-adiabatic, and adiabatic-isothermal. We have written down expressions for heat and work along the legs of these cycles and derived conditions that yield optimal ways to run through the cycles in finite time such that the entropy production or the excess heat production is minimal. In particular, we found that the optimal allocation of time—in units of relaxation-to-equilibrium times—including the allocation of discrete steps along the cycle, should take place in such a way that a) the path in (κ, *T*) space, for given corners ([1], [2], [3], [4]) and prescribed types of branches, should be chosen such that the total thermodynamic length of the cycle is a minimum, b) the time allocated to each leg of the cycle should be proportional to the thermodynamic length of each leg separately, and c) the discrete steps along each leg should be spaced in such a way that the thermodynamic lengths between all pairs of consecutive points along the branch are identical. We showed that the thermodynamic length could be evaluated using an appropriate metric, <sup>↔</sup> *MQ* = *kBTi* <sup>↔</sup> π*i* or <sup>↔</sup> *MS* = *kB* ↔ π*i* , in probability distribution space, which was obtained as part of the optimal control analysis.

We note that condition a) is trivial for the cycles chosen in the present study, since each leg is completely determined by the assignment of its end points and the type of path, i.e., whether it is iso-κ, isothermal, or adiabatic. If there were several control parameters κ*a*,*b*,... that influence the change in the energy levels of the system, then step a) would be a major part of the optimal control problem of minimizing entropy or excess heat production, of course.

Furthermore, we discussed the minimization of excess heat along special adiabatic branches, which by construction equals zero due to the condition that the equilibrium probability distribution is constant along such a special adiabatic path, and thus never an imbalance between actual and equilibrium distribution can build up; for example, by construction, all two-state statistical mechanical systems constitute examples where adiabatic paths are special. Thus, only our inability in practice to keep the control parameters on-target while moving along a special adiabatic path generates deviations from the equilibrium occupation of the microstates of the system, which are the main source of excess heat or entropy production. We derived approximate expressions for the thermodynamic length of generic off-target paths that still remain close to the ideal adiabatic path.

We note that the issue of on-target path control arises for every leg of any cycle, but that one usually ignores these contributions to the entropy or excess heat production. The reason for discounting them is twofold; for one, they tend to be overwhelmed by the effects of having only finite time available to run through the legs of the cycle. Perhaps more important is the fact that an analysis would require information about the apparatus employed to move the system in the (κ, *T*) space, which is specific to each experiment, and thus usually not within the purview of the theoretical study.

Related finite-time analyses have been performed for thermodynamic engines in the past by assuming, e.g., a generic heat leakage or (inefficient) heat conduction during the processes of the cycle, which are described by phenomenological laws [43–45]. However, this leakage was not connected to the issue of being "on-target" vs. "off-target"; instead, the thermodynamic controls were assumed to be perfect, and the inefficiencies associated with, e.g., friction or heat conduction were considered part of the working of the engine.

These optimality criteria and the associated thermodynamic metrics are very general and apply to essentially all statistical mechanical systems, as long as the energy levels can be controlled by a generic parameter <sup>κ</sup> or set of parameters <sup>→</sup> κ = (κ*a*, κ*b*, ...). Thus, there are connections to other general results [35,46–50]. For example, the excess heat we consider corresponds to the excess work investigated by Sivak and Crooks [47], and thus Equations (28) and (29) for the thermodynamic lengths *LQ*/*<sup>S</sup>* correspond to the generalized thermodynamic length they define via the time-integrated force covariance matrix [47]. Furthermore, the relationship <sup>↔</sup> *MQ* = *T* ↔ *MS* for statistical mechanical systems observed in this study corresponds to the conformal equivalence of the energy and entropy metric demonstrated by Salamon and co-workers for thermodynamic equilibrium systems [50]. This also shows that the excess heat metric <sup>↔</sup> *MQ* measures the dissipation or loss of availability when proceeding along the path in finite time, as had been shown earlier in the context of optimally measuring free energy differences in statistical mechanical systems [35] and computing thermodynamic lengths within computer simulations [46].

Specific to the hydrogen atom-like system is the observation that *En*(κ) = κ*En*(κ = 1) for all energy levels *n*. From this follow certain simplifications, such as the fact that κ and *T* appear only in the combination *A* = <sup>κ</sup> *<sup>T</sup>* in the equilibrium probability distribution <sup>→</sup> π, and therefore all adiabatic paths in (κ, *T*) space are special and lie on straight lines that contain the origin (κ = 0, *T* = 0). In particular, we observed that for the isothermal-adiabatic cycle the time allocation to the two isothermal branches should be proportional to the square roots of the temperatures associated with these branches when minimizing the excess heat production. Similarly, for the iso-κ-adiabatic cycle, the time allocation for the two iso-κ branches should be proportional to the square roots of the κ values associated with these branches. In contrast, when minimizing the entropy production of the cycles that contain two adiabatic branches, the optimal times assigned to the two isothermal or iso-κ-legs should be equal. Here, we note that the results obtained in Section 4 would be applicable to any system whose energy spectrum scales with the control parameter κ according to Equation (3), such as, e.g., a quantum harmonic oscillator if one modifies only the basic frequency, ω<sup>0</sup> → κω0, or a spin system with *NL* energy levels in a magnetic field as long as we only change the strength of the applied magnetic field, *B*<sup>0</sup> → κ*B*0. For an analysis of the influence of the eigenvalue spectrum of a system on the finite-time performance, we refer to [51].

For the case of the hydrogen atom-like system, we have also considered a two-state approximation, which allows us to perform further analytical evaluations of the optimal control conditions. When minimizing excess heat, we can analytically solve the isothermal-adiabatic cycle, while for minimal entropy production, all three cycles can now be solved analytically. These results are quite general and hold for any two-state system, as can be seen from the agreement with results obtained from, e.g., a spin-1/2 system [28]. Furthermore, the result for the Carnot cycle is reminiscent to the outcome of some finite time optimal control calculations for heat engines, working between two reservoirs [10], and agrees with corresponding results for the spin 1/2 system [28].

However, thermal interactions with the environment affect all energy levels, making the two-state approximation of the hydrogen atom somewhat artificial. On the other hand, enforcing transitions via narrow band radiation allows us to focus on single pairs of energy levels, thus providing a more realistic example of a two-state system at the price of dealing with an a-thermal cycle.

A possible four-leg cycle for the two-state version of a single hydrogen atom-like system (i.e., only two of the electronic energy levels *n*<sup>1</sup> and *n*<sup>2</sup> > *n*<sup>1</sup> participate in the process) without contact to a heat bath is shown in Figure 5 for the case *n*<sup>1</sup> = 1 and *n*<sup>2</sup> = 2. No temperature is involved, and the cycle runs as follows, where we take as starting point the atom in the state *n*<sup>1</sup> with energy *<sup>E</sup>*[1] = *En*<sup>1</sup> (κ*in*) for <sup>κ</sup>[1] = <sup>κ</sup>*in*. In leg 1, we excite the atom from *<sup>n</sup>* = *<sup>n</sup>*<sup>1</sup> to *<sup>n</sup>* = *<sup>n</sup>*<sup>2</sup> via irradiation at frequency <sup>ν</sup>*in* (*h*ν*in* = *<sup>E</sup>*[2] <sup>−</sup> *<sup>E</sup>*[1] = *En*<sup>2</sup> (κ*in*) <sup>−</sup> *En*<sup>1</sup> (κ*in*)), while we keep <sup>κ</sup> at the value <sup>κ</sup>*in*, <sup>κ</sup>[2] = <sup>κ</sup>*in*. Next, we increase κ to κ[3] = κ*<sup>f</sup>* , while keeping the atom in the excited state *n* = *n*2, i.e., *E*[3] = *En*<sup>2</sup> - κ*f* . This is followed by the reverse operations, i.e., we de-excite the atom back to *n* = *n*<sup>1</sup> via irradiation at frequency ν*<sup>f</sup>* (*h*ν*<sup>f</sup>* = *E*[3] − *E*[4] = *En*<sup>2</sup> - κ*f* − *En*<sup>1</sup> - κ*f* ), while keeping κ at the value κ*<sup>f</sup>* , κ[4] = κ*<sup>f</sup>* , followed by the decrease of κ to κ = κ*in*, while keeping the atom in the state *n* = *n*1, thus closing the cycle.

Note that legs 2 and 4 would be the analogues to adiabatic branches in the thermal cycle. There, we perform or extract work on the system by changing the energy content of the hydrogen atom-like system from *En*<sup>2</sup> (κ*in*) to *En*<sup>2</sup> - κ*f* and from *En*<sup>1</sup> - κ*f* to *En*<sup>1</sup> (κ*in*), respectively. The total amount of work (done by the atom) associated with these two legs would be

$$\begin{array}{lclclcl}\mathcal{W} &=& -\Delta E &=& -\left[E\_{\text{n}\_{2}}(\mathbf{x}\_{f}) - E\_{\text{n}\_{2}}(\mathbf{x}\_{in})\right] - \left[E\_{\text{n}\_{1}}(\mathbf{x}\_{in}) - E\_{\text{n}\_{1}}(\mathbf{x}\_{f})\right] \\ & \left(\mathbf{x}\_{\text{in}} - \mathbf{x}\_{f}\right)\left[E\_{\text{n}\_{2}}(\mathbf{x}=1) - E\_{\text{n}\_{1}}(\mathbf{x}=1)\right] & =& a\middle|\frac{1}{\left(n\_{1}\right)^{2}} - \frac{1}{\left(n\_{2}\right)^{2}}\Big)\left(\mathbf{x}\_{\text{in}} - \mathbf{x}\_{f}\right) < 0,\end{array} \tag{105}$$

since κ*<sup>f</sup>* > κ*in* and *n*<sup>2</sup> > *n*1. Thus, our external apparatus, which changes κ, performs a net amount of work on the atom along these two legs.

**Figure 5.** Sketch of an a-thermal iso-κ-"adiabatic" cycle for a two-state system comprising the ground state and the first excited state of the hydrogen-like atom. Branches [1] → [2] and [3] → [4] are iso-κ-legs and branches [2] → [3] and [4] → [1] are "adiabatic" legs, respectively. Note that the adiabatic legs run along straight lines that pass through the origin and through the point (κ, *E*) = (1,−α) for the adiabatic leg in the ground state, and through the origin and through the point (κ, *E*) = (1,−α/4) for the adiabatic leg in the first excited state, respectively. The four corners of the cycle are the points [1] = - κ[1] , *E*[1] = (κ*in*, *E*1), [2] = - κ[2] , *E*[2] = (κ*in*, *E*2), [3] = - κ[3] , *E*[3] = - κ*<sup>f</sup>* , *E*<sup>3</sup> , and [4] = - κ[4] , *E*[4] = - κ*<sup>f</sup>* , *E*<sup>4</sup> in the (κ, *E*) plane. Note that *E*[1] = κ*inE*1(κ = 1), *E*[2] = κ*inE*2(κ = 1), *E*[3] = κ*<sup>f</sup> E*2(κ = 1), and *E*[4] = κ*<sup>f</sup> E*1(κ = 1).

Concerning legs 1 and 3, which would be the analogues to the heating and cooling branches of a typical thermodynamic cycle, it is not obvious how to account for the equivalent of heat transferred from and to the heat reservoir at different temperatures, and thus make a connection to thermodynamic cycles. If the radiation fields had a black-body frequency distribution, the formulas of radiation thermodynamics would apply [52–54], but this would weaken the desired approximation of the system through only two energy levels. What we can consider is a "reservoir" of photons with frequencies ν*in* and ν*<sup>f</sup>* , which the hydrogen atom-like system is in contact with during the excitation and de-excitation processes in legs 1 and 3, respectively. However, such a radiation field that consists of narrow frequency bands does not act as a standard thermal heat source as far as the hydrogen atom-like system is concerned. Instead, we treat the radiation field as part of the external apparatus for the purpose of this discussion, analogous to the pressure we might apply to the material to change the properties of the excitons representing the hydrogen atom-like system. As a consequence, the net work done by the radiation field on the atom equals

$$\ln \mathbf{v}\_{\text{in}} - \ln \mathbf{v}\_{f} = \left[ E\_{n2}(\mathbf{x}\_{\text{in}}) - E\_{n\_1}(\mathbf{x}\_{\text{in}}) \right] - \left[ E\_{n2}(\mathbf{x}\_f) - E\_{n\_1}(\mathbf{x}\_f) \right] \\ = \left( \mathbf{x}\_{\text{in}} - \mathbf{x}\_f \right) \left[ E\_{n\_2}(1) - E\_{n\_1}(1) \right] < 0,\tag{106}$$

i.e., the energy of the radiation field shows a net increase along legs 1 and 3 by the same amount as the atom gained in energy when we applied work along legs 2 and 4.

We can thus visualize the two-state approximation of our hydrogen atom-like system as an "engine" that acts as a "frequency conversion pump" while keeping the number of photons conserved. A possible co-efficient of performance would be

$$
\eta^{\rm conv} = \frac{W^{(1)} + W^{(3)}}{W^{(2)} + W^{(4)}} = 1,\tag{107}
$$

i.e., the a-thermal cycle of the single controllable hydrogen atom-like system represents a perfect energy conversion apparatus from photons with one frequency to photons with another frequency. We note that this perfect restriction of the hydrogen atom-like system to a two-state system would also work if

the modification of the Hamiltonian breaks the symmetry of the Coulomb field, as might be the case by exposing the hydrogen atom to an anisotropic external electric field inside a cavity.

Of course, in practice, this a-thermal cycle will encounter finite-time losses, too. The sources of possible finite-time losses have to be identified in an analysis of the quantum processes involved when changing the Hamiltonian and exciting/de-exciting the electrons between the two levels, including the degree of coherence maintained in the system along each leg. An analysis of these issues would go beyond the purview of this study, however. Possible approaches on how to analyze these issues can be found in some of the cited references dealing explicitly with the quantum aspects of heat engines [18–29,48,49,51].

A final question is whether there are experimental systems where the thermodynamic or a-thermal cycles discussed in this study might be realized. The most straightforward suggestion would be to take an individual hydrogen atom inside a cavity whose shape can be changed, such that the energy levels can be modified in some way [31]. This system should allow an a-thermal cycle, but the momentum transfer during absorption would start injecting kinetic energy, which would re-appear as a source of heat to the system. In the case of a thermodynamic cycle, where we were to expose the atom to a heat reservoir over a sufficiently large temperature range for exciting the hydrogen atom(s) to a noticeable degree, the system's translational degrees of freedom would quickly establish thermal movement with all that implies, possibly overwhelming the thermodynamic quantities of interest in the electronic two-state system. However, since the experimental control of the hydrogen atom as a thermal engine based on the translational degrees of freedom has been quite successful already [13], a quasi-a-thermal or a thermodynamic engine based on the occupation of the electronic states and on the modification of their energy levels should be feasible.

An alternative would be an excitonic defect in a solid, since this is usually more localized (but still mobile, in principle) and thus probably less susceptible to the kinetic thermal contributions. Furthermore, the reference value of κ, κ*in*, should be rather small, and thus small changes in temperature would already lead to noticeable changes in the occupation probabilities of the excitonic states. On the other hand, as mentioned earlier, varying κ in a solid can be nontrivial, since the quantities entering κ will depend on both pressure—which would be a suitable control variable—and temperature. As a consequence, in a (*p*, *T*) space representation, the iso-κ branches would involve closely coordinated changes both in pressure and temperature. Additionally, an a-thermal cycle might be difficult to achieve, due to the strong thermal coupling of the exciton to the rest of the solid. Nevertheless, it appears that a variety of systems exist which might serve as substrates for the realization of an electronic states-based engine with a single hydrogen atom-like system as the working fluid.

**Funding:** This research received no external funding.

**Acknowledgments:** I would like to thank the participants of the 2017 workshop on "Optimizing Thermodynamics" at the Telluride Science Research Center in Telluride, CO, USA, for valuable discussions, and Karl Heinz Hoffmann for a careful reading of the manuscript.

**Conflicts of Interest:** The author declares no conflict of interest.

## **References**


© 2020 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
