Free energy amplification by magnetic flux for driven quantum systems

Exploring the source of free energy is of practical use for thermodynamical systems. In the classical regime, the free energy change is independent of magnetism, as the Lorentz force is conservative. In contrast, here we find that the free energy change can be amplified by adding a magnetic field to driven quantum systems. Taking a recent experimental system as an example, the predicted amplification becomes 3-fold when adding a 10-tesla magnetic field under temperature 316 nanoKelvin. We further uncover the mechanism by examining the driving process. Through extending the path integral approach for quantum thermodynamics, we obtain a generalized free energy equality for both closed and open quantum systems. The equality reveals a decomposition on the source of the free energy change: one is the quantum work functional, and the other emerges from the magnetic flux passing through a closed loop of propagators. The result suggests a distinct quantum effect of magnetic flux and supports to extract additional free energy from the magnetic field. It is known that the magnetic field does not affect the free energy change for a driven classical system. Here, the author investigates the influence of the magnetic field on a driven quantum system, finding that the free energy change is amplified and that this quantum effect is reflected in an extended free energy equality.

E valuating free energy is a central endeavor of thermodynamics [1][2][3][4] . Continuous efforts have been made to harvest more free energy, such as from work fluctuations 5 , coherences 6 , and correlations 7 . In the classical regime, the magnetic field does not affect the free energy change 8 , as the Lorentz force is conservative. Different from the classical regime, a magnetic field can modify equilibrium free energy in the quantum regime 9 , and makes charged particles occupy orbits with quantized energy values known as Landau level 10 . These quantum phenomena for undriven systems motivate us to explore whether magnetism can alter free energy change for driven quantum systems, even though the Lorentz force does not induce work in the classical regime. If the effect existed, it would suggest a new strategy to extract additional free energy by adding a magnetic field to driven quantum thermodynamical systems [11][12][13][14] .
As a theoretical foundation to explore such effect in the driving process, the Jarzynski equality 1,15 enables us to quantify free energy changes from nonequilibrium work measurements 2,3 : ΔF ¼ Àβ À1 ln hexpðÀβWÞi clpath , where 〈⋯〉 clpath denotes an average over the classical path ensemble. The parameter β equals the inverse of the Boltzmann constant multiplying temperature: β = 1/(k B T). In the classical regime, it was found that the magnetic field does not modify the Jarzynski equality [16][17][18][19][20] . The quantum Jarzynski equality and quantum fluctuation theorems 21-30 also do not have an explicit modification by magnetic flux, including the results applicable to the case with a magnetic field 22,23,25 . Thus, whether the free energy change of a driven quantum system can be modified by magnetism, and the free energy amplification mechanisms itself remain elusive.
Explicitly studying the effect of magnetism in the quantum dynamical process is challenging due to the following reasons. First, work is no longer an observable 24 . A conventional way to calculate the free energy change via work measurements utilized the two-point measurement scheme 24 , and the quantum Jarzynski equality was reached mainly by operator formulation 12,[21][22][23] . On the other hand, the interaction between a charged system and a magnetic field, such as the Lorentz force, depends on the dynamical trajectory in state space. Thus, a path-based framework is required. To this end, a recent path integral approach 31 allows the investigation of the driving process in a path-dependent manner, however, the case with a magnetic field was not considered. Second, a magnetic field breaks the time-reversal symmetry. Special care is required if using the time-reversal operation to derive the free energy equality, because the operation may need a change in the Hamiltonian 12,25 with multiple choices proposed before 32,33 . Third, both closed and open quantum systems beyond the weak-coupling limit should be covered, as dissipation typically exists in experiments.
In this paper, we explore the effect of applying a magnetic field to a driven quantum system on its free energy. As a working example, we focus on a trapped ion system in the experiment 34 and theoretically consider the scenario by adding a magnetic field (Fig. 1). By analytically calculating the free energy from the canonical partition function, we find that the free energy difference can be amplified by adding the magnetic field (Fig. 2a). For example, after adding a 10-T magnetic field, the predicted free energy difference has a threefold amplification under temperature 316 nK as tuned in the experiment (Fig. 2b). The amplification diminishes when temperature increases or magnetic intensity decreases. In order to further dissect the amplification mechanism, we investigate the driving process and study how magnetism cooperates with work to alter the free energy change. In particular, by extending the path integral approach 31 to the case with magnetism, we find that the magnetic field does play a role in the extended free energy equality Eq. (4), for both closed and open quantum systems. A magnetic flux emerges in the free energy equality as a natural consequence of using the quantum work functional 31 , thus uncovering the source of the amplification. For the open quantum system, the amplification can be suppressed by dissipation. We further analytically evaluate the free energy change for a dragged quantum harmonic oscillator under a magnetic field and provide detailed experimental designs to observe the effect.

Results
Free energy amplification by the magnetic field. We consider a closed quantum system of a particle with mass m and charge q. The notations p, x are the momentum and position operator separately, with the bold font denoting the vector form. The magnetic field is given by a vector potential: B(x) = ∇ × A(x). For clarity, we focus on a constant magnetic field, B(x) = B. A timedependent force f t performs work. The Hamiltonian is: where the subscript S denotes the subject "system", and V[x, f t ] is the potential. By Legendre transform, the Lagrangian is: At each time point, after equilibration, the instantaneous Helmholtz free energy can be evaluated through the partition function: F ½f t ¼ : À β À1 ln Z½f t 19,35 . For two steady states with a constant external force f τ at time t = τ and f 0 = 0 at time t = 0, their Helmholtz free energy difference is: The partition function is the canonical distribution of the instantaneous steady state. For the quantum system Eq. (1), the canonical distribution can be obtained from the propagator 36,37 : ρðx t ;x t Þ ¼ Kðx t ; Àiβ_;x t ; 0Þj f t , with the subscript denoting the force. The propagator is analytically solvable for specific examples 36 . We next study such a case, i.e., a dragged harmonic oscillator under a magnetic field. The system consists of a particle moving on a two dimensional plane with x = (x, y), as illustrated in Fig. 1. The potential is: V[x,f t ] = mω 2 x 2 /2 − x ⊤ f t , and the Hamiltonian is: This potential corresponds to the experiment where the minimum position of the Fig. 1 Schematic of a driven quantum particle under a magnetic field. A charged particle is dragged by a harmonic potential, whose minimum position follows an external force. The gray arrow illustrates a moving trajectory of the potential well on a two-dimensional plane. A uniform magnetic field (green arrow) applies to the positive-z direction, which alters the free energy change in the quantum regime.
potential well follows the force f t 34 . Before moving forward, we clarify the terminology to be used. First, the "equilibrium free energy" or "steady-state free energy" term those calculated from the partition function. Second, we use "equilibrium" to denote the stable state with zero magnetic fields and the force is constant. The term "steady-state" refers to the stable state with a magnetic field, as a magnetic field can induce non-detailed balance 19,33 leading to a nonequilibrium steady state 17,32,38 . Third, the "nonequilibrium" induced by a magnetic field is distinct from the "nonequilibrium" caused by the external force in the driving process. Fourth, the "free energy difference (change)" represents the energy difference between two states, which is evaluated from either the partition function or the free energy equality with the forced protocol. We remark that the free energy change between steady states and the temperature with the presence of the external field can be defined 19,22,23,25,33,38 . Specifically, the temperature was defined for the nonequilibrium steady state with magnetic field 18,19 . The temperature for the quantum system under an external field can also be defined similarly for the steady state 23,25 . For example, the trapped ion system in the experiment 34 is under controllable temperature even with the external force field. When the external driving and magnetic field are absent, the system can reduce to a one-dimensional quantum harmonic oscillator with the equilibrium Helmholtz free energy 37 : The last term β À1 ln ð1 À e Àβ_ω Þ ! 0 in the zero-temperature limit β → ∞, leading to the zero-point energy ℏω/2. When a constant external force f τ is present, the free energy difference between the two equilibriums with and without the force is 12 : This free energy variation corresponds to the "inclusive work" 12,35 , as the difference between the total Hamiltonians of the two states. The "inclusive work" leads to a negative free energy change.
When a magnetic field is present, the propagator for the case without external force 36 gives the free energy at steady-state (Supplementary Note 2B): p , ω c = qB/m. The free energy corresponds to a sum of harmonic oscillations with the frequencies ω 1 and ω 2 , and is consistent with the two-dimensional version of Eq. (5.7) in 9 .
When both a magnetic field and an external force are present, the propagator has not been obtained before. We calculate the propagator and use it to evaluate the free energy difference (Supplementary Note 2B): as the main result I of the manuscript. The first term is the twodimensional version of free energy difference without a magnetic field. The second term corresponds to the modification by the magnetic field, which tends to vanish when B → 0. Under the limit, Eq. (3) agrees with the experimental data in Table 1 of ref. 34 (Fig. 2b). When the magnetic field is present, the free energy difference can be enhanced at low temperatures ( Fig. 2). All the free energy formulas calculated from the partition function are listed in Supplementary Table I.
Extended free energy equality with magnetic flux. The amplification is a joint effect of the driving force and the magnetic field.
To uncover the mechanism of the amplification, we need to investigate the driving process and evaluate the free energy change.
Through using the two-point work measurement scheme 24 and extending the path integral approach 31 to the system with a magnetic field, we evaluate the work characteristic function without specifying a time-reversal operation in prior (see "Methods"). We then obtain an extended quantum free energy equality for Eq. (1), with a modification by a magnetic flux (main result II): where Φ iβ = ∬dS ⋅ B is the magnetic flux (Fig. 3), and 〈⋯〉 qpath denotes an average over the quantum path ensemble. The work functional W ν ½x¼ : To dissect the effect of the magnetic field, we used a path-based framework, making the continuous-time work functional 31 as a natural choice. Consequently, the magnetic flux is explicitly decomposed out, serving as another contribution to the free Free energy difference by external force Amplification by magnetic field a b Fig. 2 Free energy amplification for a driven quantum system under a magnetic field. a Free energy difference between two steady states of the closed quantum system in the experiment 34 : one state is undriven and the other is subject to a constant force. The force causes a free energy change, which can be amplified by adding a magnetic field at low temperatures. The magnetic intensity is denoted by the color code. The horizontal axis is the effective temperature T eff implemented in the experiment and k B is the Boltzmann constant. b Free energy differences under a set of temperatures T eff and magnetic intensities B. The first column for B = 0 T agrees with the measurement in Table 1 by An et al. 34 . The results with finite magnetic field predict that the amplification becomes threefold (≈8.94/2.62) under B = 10 T and temperature 316 nK. The analytical formula in Eq. (3), and the parameter values can be found in "Experimental designs". energy change. This reformulation of free energy equality reveals the origin of the free energy amplification. Instead, the previous proof on the quantum Jarzynski equality 22,23 used the type of work definition with discrete-time, such that the magnetic flux term was not decomposed out in the historical developments on the free energy equalities summarized in Fig. 4.
We have chosen to calculate the work characteristic function for the forward process, instead of specifying a time-reversal operation in prior. A time-reversal component is inherently contained in the conjugate propagator 39 , where the magnetic field is not reserved. Differently, the time-reversal operation in ref. 12,25 has reversed the magnetic field to preserve the microreversibility, which is regarded as equivalent to the detailed balance condition 40 . For nonequilibrium systems without detailed balance, such as induced by a magnetic field 19 , both the timereversal operations with and without reversing the magnetic field are plausible 32,33 . The previous fluctuation theorem 12,25 and the present free energy equality separately use these two types of time-reversal operations. In addition, we have employed the present time-reversal operation without reversing the magnetic field to derive the fluctuation theorem (Supplementary Note 1G), and the result is the same as in ref. 25 . Thus, the emergence of magnetic flux in Eq. (4) is a consequence of using the continuoustime quantum work functional 31 .
The case of an open quantum system. We next demonstrate that free energy equality can also be achieved for open quantum systems. An open system is modeled by Eq. (1) coupled to a bath of harmonic oscillators. The total Hamiltonian contains the subject system, heat bath, and coupling: It describes the quantum Brownian motion known as the Caldeira-Leggett model 39 . The heat bath has a set of harmonic oscillators with mass m k , oscillation frequency ω k , momentum P k , and position coordinate Q k . All bath oscillators are assumed to have the same mass: m k ¼ m. The interaction between the system and bath is given by the bilinear coupling between their position coordinates, with coupling constant C k . The last term in H SB cancels the frequency shift on the potential function 41 .
From influence functional approach 36,39 with the dissipation strength γ ≐ η/(2m) and the damping constant η. The action functions S S ½x andS S ½x are the same as those of the closed system. The real exponent ϕðx;xÞ ¼ ð2mγ=πÞ R t 0 ds ½xðtÞ ÀxðtÞ > cosνðt À sÞ½xðsÞ ÀxðsÞ.
With a similar derivation for the closed system, the full propagator can be rewritten as: Dx expfði=_ÞðS 0 ½x ÀS 0 ½xÞ þ iνW ν ½x þ ði=_ÞqΦ ν gI ½x;x: Putting it into χ(ν), we get the same equalities in Eqs. (4) and (7), with the average taking into account the influence of the heat bath. Thus, the present free energy equality is valid in the open Free energy equality is independent of magnetic field Free energy equality is dependent of magnetic field Present result, equation (4) Fig. 4 A brief summary of historical developments of the free energy equalities. They include the cases without (classical regime: 1,2,15 , quantum regime: [21][22][23][24] ) and with a magnetic field [17][18][19] . The free energy equality is independent of magnetism in the classical regime but becomes dependent on the quantum regime.
quantum system. We have focused on a specific case of open systems by Eq. (5) with the Ohmic dissipation. Further extensions are required for general dissipation 42 and coupling modes 43 .
The example of a dragged harmonic oscillator. We analytically calculate the work characteristic function and free energy change for four cases of a dragged harmonic oscillator: without and with a magnetic field, as closed and open systems separately. For closed systems, the first case without magnetic field (Supplementary Note 2A) demonstrates that a careful treatment is needed to apply the forced protocol Eq. (6). We provide a detailed analysis of the process-independence of free energy change, as a property of the Jarzynski equality 1 . The second case (Supplementary Note 2B) is a dragged harmonic oscillator with a magnetic field as a closed quantum system. The result shows the analytical dependence of the free energy change on magnetism, as given by Eq. (2).
For the case of the open system without a magnetic field (Supplementary Note 2C), the free energy varies with the dissipation strength ( Supplementary Fig. 2), indicating that the dissipation diminishes the free energy change. For the case with a magnetic field, the roles of both dissipation and magnetism are analyzed (Supplementary Note 2D), where the amplification can be suppressed by dissipation (Supplementary Fig. 3).
This example indicates that the magnetic flux in Eq. (4) is necessary to capture the total free energy change. We further propose two experimental designs to measure the free energy amplification by magnetic flux below. The amplification is induced by implementing large magnetic intensity and lowtemperature conditions, for which additional energy is consumed 34 .
Experimental designs. We provide two possible experimental designs to detect the effect of a magnetic field on the free energy change. The first is a single ion trapped in a harmonic potential well 34 , which was used to illustrate the free energy amplification above. The other is a charged particle, for which both the case of the closed system and open system are discussed. In practice, careful treatments are required to implement the experiment (Supplementary Note 1F). For example, the thermalization procedure needs a coupling to a high-temperature reservoir 44,45 , by which the dissipation may reduce the free energy amplification. In addition, the measurement of the magnetic flux term in the free energy equality demands careful designs, as the propagation of quantum particles needs to be mapped out. The experimental setup to test the work functional in 31 also requires to measure such propagated trajectories, which would be useful to the case with a magnetic field.
As the first example of the closed system, we consider a system of a single ion, which was used to test the quantum Jarzynski equality 34 . The magnetic field was not implemented in their experiment. Here, we consider the case with the addition of a magnetic field. Due to the close connection to the experiment, this example was used to demonstrate the major result. We focus on discussing this example as a closed system, and the open system will be studied for the next example. Specifically, the 171 Yb + ion is trapped in a harmonic potential. By using the notations and values of the parameters in ref. 34  Inserting these parameters into Eq. (3), we get the free energy change as plotted in Fig. 2, Supplementary Fig. 1.
Second, we consider a system of a charged particle. As the particle is more macroscopic, it is more convenient to demonstrate the implementation of dissipation to the system, such that the case of both closed and open quantum are studied for this example. Specifically, the particle has mass density ρ = 1.5 kg m −3 and radius R = 10 −6 m. Then, the particle's mass is m = (4π/3)ρR 3 ≈ 6.3 * 10 −18 kg. If the surface charge density is σ = 0.5 Cm −246 , the total charge is e = 4πR 2 σ ≈ 6.3 * 10 −12 C. The typical range of the force from an optical tweezer is [0.1, 300]pN, and thus we take the intensity of the external force f τ to be 10 −12 N. The particle is trapped by a harmonic potential with frequency ω = 10 6 s −1 , leading to mω 2 = 6.3 * 10 −6 kgs −2 . If adding a magnetic field B ∈ [0, 10]T, then ω c = eB/m ∈ [0, 10 7 ]s −1 . We approximately haveω 2 ½0; 10 7 =2s −1 and ω 1 ∈ [0, 10 7 ]s −1 with the magnetic field varying within the given range. When the magnitude of ω c is comparable to ω, the effect of the magnetic field on the dynamics is not negligible. With ℏ ≈ 6.6 * 10 −34 m 2 kgs −1 , ℏω 1 ≈ 6.6 * [10 −28 ,10 −27 ]m 2 kgs −2 . We consider the temperature range T ∈ [10 −4 , 298]K. The Boltzmann energy is k B T ≈ 4.1 * 10 −21 N m at room temperature T = 298 K, and k B T ≈ 4.1 * 10 −27 N m when T ≈ 3 * 10 −4 K. At low temperature, an increase in the magnetic field leads to an observable quantum effect as βℏω 1~1 .
For the open systems of this setup, we consider a phenomenological way to implement dissipation. For example, dissipation can be caused by a friction force from the surrounding environment. The viscosity of air at room temperature is f vis ≈ 1.81 * 10 −5 Pa s, and thus the damping constant η ≈ 6πf vis R = 2.8 * 10 −10 kgs −1 . This value may become lower when the temperature decreases. We take the damping constant η = 1.3 * 10 −12 kgs −1 at low temperature and the dissipation strength γ = η/(2m) ≈ 10 5 s −1 . To observe the effect of dissipation, we consider a range of γ ∈ [0, 6 * 10 5 ]s −1 . The sampling time in the experiment can be t s ≤ 10 ms as in ref. 47 , which gives 1=t s ( γ;ω. Given these parameters, Supplementary Figs. 2 and 3 illustrate the free energy change for the second experimental setup.

Discussion
By applying Jensen's inequality to Eq. (4), we obtain ΔF ≤ hW iβ ½x À ði=_βÞqΦ iβ i qpath . It can serve as a generalized second law of thermodynamics (Supplementary Note 1H). Besides, there is gauge freedom on choosing the vector potential: A 0 ðxÞ ¼ AðxÞ þ ∇ΛðxÞ gives the same magnetic field. As ∮dx ⋅ ∇ Λ(x) = 0, Eq. (4) is gauge invariant, which is different from the Aharonov-Bohm effect 48,49 . The present effect is induced by the closed-loop of the magnetic flux, which does not depend on the magnetic vector potential.
Besides, the topological effect may lead to interesting phenomena in the free energy change, as the magnetic flux is quantized: qΦ ν = 2πnℏ. In the classical regime, the special topology was found to cause an anomalous free energy change 50 . In the quantum regime, the work statistics using an Aharonov-Bohm flux has been investigated for charged particles moving along a one-dimensional ring 49 . In addition, the quantum-classical correspondence for work statistics has been investigated 51 . Along with this direction, we have explicitly taken the semi-classical limit of the magnetic flux term and the free energy change (Supplementary Notes 1C and 2). When the paths with maintaining suitable phases are allowed to interfere, the semiclassical work distribution obtained from classical paths can be further compared with the present work distribution.
Though the non-Markovian dynamics is relevant in various fields and applications, such as optomechanical control 52 , the system considered here is mainly Markovian. It was reported that the lowtemperature regime may be affected by non-Markovian effects [52][53][54] .
However, the effect is not dramatic in the current setup. For example, the experiment 34 has reached the low-temperature condition of 316 nK, where the dynamics of the dragged ion is still Markovian and not yet affected by the non-Markovian effect. Besides, the current free energy amplification appears already for the closed quantum system, where the non-Markovian effect caused by the coupling to the environment 53 does not happen.
The steady-state free energy for the quantum Brownian motion under a magnetic field was studied 9 . Differently, we calculated the free energy change driven by an external force, which is also absent in the quantum Langevin formalism of charged magneto-oscillator coupled to heat bath [55][56][57] . For the case with an external force, another study evaluates the free energy change 58 . However, they used a different definition of the work from the typical two-point measurement scheme and did not obtain the new effect of magnetic flux. A similar system has been adopted to study Landau diamagnetism 59 . They considered a finite boundary condition, and thus the solution to the equation of motion is distinct. Its further generalizations include 60,61 , where the free energy amplification by adding both a magnetic field and an external time-dependent driving was not found. Besides, when the charged particle moves in a confined area, the states should have discrete energies of Landau levels 10 . The free energy change for such systems remains to be explored. In addition, we have not considered the time-dependent magnetic field 62 , but the present free energy amplification can appear even for a constant magnetic field. Under a time-dependent electromagnetic field, the definition of the thermodynamic work on a charged particle needs a special care 63 . The generalization of the present free energy equal to the case with the time-dependent magnetic field is an intriguing direction. Finally, in the emerging area of quantum information thermodynamics, it is attractive to study whether a magnetic field can increase the information gain such as in the quantum Maxwell demon 64 .
In summary, by adding a magnetic field to driven quantum systems, we found that the free energy change can be amplified by calculating the steady-state free energy. We further uncovered the mechanism of the free energy amplification through deriving extended free energy equality for the driving process. An emergent magnetic flux was obtained in free energy equality, revealing the source of the free energy amplification. The present result suggests a distinct quantum effect of magnetic flux on the free energy change, which would motivate a class of new explorations for driven quantum systems.

Methods
Two-point measurement scheme. For a quantum system, the work can be defined through the two-point measurement scheme [21][22][23][24] : W j,l ≐ E j (τ) − E l (0). The probability of observing this energy difference is p(j, l) ≐ p l |〈j(τ)|U S (τ)|l(0)〉| 2 , where p l ≐ 〈l(0)|ρ S (0)|l(0)〉. Here, lðtÞ j iis the nth energy eigenstate of the system at time t, and U S ðτÞ¼ : expfÀi=_ R τ 0 dtH S ½f t g is the unitary operator governing the time evolution. Corresponding to the Helmholtz free energy, the initial density matrix is chosen as the canonical form, ρ S ð0Þ ¼ e ÀβH S ½f 0 =Z S ½f 0 , with the partition function Z S ½f 0 ¼ R dxe ÀβH S ½f 0 . The work probability distribution is P(W) = ∑ j,l δ (W − W j,l )p(j,l), where δ(W − W j,l ) is the Dirac delta function. By taking the Fourier transform, the work characteristic function is: χðνÞ¼ : R dWe iνW PðWÞ ¼ P j;l e iν½E j ðτÞÀE l ð0Þ pðj; lÞ. With inserting p(j, l), χðνÞ ¼ Tr½U s ðτÞe ÀiνH S ½f 0 ρ S ð0ÞU y s ðτÞ e iνH S ½f τ . The operators e ÀiνH S ½f 0 and e iνH S ½f τ correspond to the two measurements.
The force protocol. A path integral approach was recently developed for quantum thermodynamics without magnetism 31 . To apply path integral, we use the coordinate representation and interpolate a middle coordinate x m : χ W ðνÞ ¼ hx τ jU s ðτÞjx m ihx m je Àði=_Þ_νH S ½f 0 jx 0 ihx 0 jρ S ð0Þjx 0 ihx 0 jU y s ðτÞjx m ihx m je ði=_Þ_νH S ½f τ jx τ i. The propagators are recognized as 36,39 : hx τ jU s ðτÞjx m i¼ : Kðx τ ; τ þ _ν; x m ; _νÞj f tÀ_ν , hx m je Àði=_Þ_νH S ½f 0 jx 0 i¼ : Kðx m ; _ν; x 0 ; 0Þj f 0 , hx 0 jU y s ðτÞjx m i¼ :K ðx m ; τ;x 0 ; 0Þj f t , hx m je ði=_Þ_νH S ½f τ jx τ i¼ :K ðx τ ; τ þ _ν;x m ; τÞj f τ . The tilde symbol specifies the variables for the conjugate propagators, which can be regarded as evolving backward in time. The subscripts of K,K assign distinct force protocols for the forward and conjugate propagators: The force protocol is illustrated in Fig. 3a. It can be implemented by the Ramsey interferometry scheme 65 . For the initial steady-state, we set f 0 = 0.
Work characteristic function. The propagators are given by the action functions: Dx and R Dx denote path integration. The action functions are 31 : S S ½x¼ : Dx expði=_ÞfS S ½x ÀS S ½xg. In the case with A = 0 31 , the subtraction of the action functions is: S 0 ½x ÀS 0 ½x 1 S 0 ½x ÀS 0 ½x þ _νW ν ½x, where S 0 ½x ¼ R τþ_ν When magnetic field is present with A ≠ 0, given the Lagrangian, we can separate out the terms with A (Supplementary Note 1A): come from the forward and conjugate propagators separately. Besides, the initial distribution ρðx 0 ;x 0 Þ can be obtained from the propagator 39,66 : ρðx 0 ;x 0 Þ ¼ Kðx 0 ; Àiβ_;x 0 ; 0Þj 0 , contributing a term q R x 0 x 0 dx Á A on the exponent. In addition, the endpoints x τ ,x τ are identical due to the function δðx τ Àx τ Þ. Together, the paths of all the propagators form a closed loop, as shown in Fig. 3b. The magnetic field leads to an integral term along the closed-loop (Supplementary Note 1B): S S ½x ÀS S ½x þ q R x 0 x 0 dx Á A ¼S 0 ½x ÀS 0 ½x þ _νW ν ½x þ qΦ ν . Based on the forced protocol Eq. (6), the paths of the forward and conjugate propagators are generally different, giving a nonzero magnetic flux Φ ν = ∮dx ⋅ A = ∬dS ⋅ B by Stokes' theorem. Then Dx expfði=_ÞðS 0 ½x ÀS 0 ½xÞ þ iνW ν ½x þ ði=_ÞqΦ ν g. It gives: With Eq. (7), the moments can be extracted, showing a modification by the magnetic flux in the first order (Supplementary Note 1C,D).
To obtain the left-hand side in Eq. (4), we used the property of the trace on the operators. For attaining the right-hand side, we adopted the path integral formulation. These two views are essentially equivalent. The conventional way to reach the right-hand side mainly utilizes the operator formulation 12,21,22,24 . Only until recently, the path integral formulation for quantum thermodynamics was proposed 31 , which is a necessary ingredient to generate the magnetic flux term. This might explain why historically the magnetic flux term has not been found in the free energy equality (Supplementary Note 1E).

Data availability
The material that supports the findings of this study is available from the corresponding author upon request.