Optimal Quantum Control of Charging Quantum Batteries

Quantum control allows us to address the problem of engineering quantum dynamics for special purposes. While recently the field of quantum batteries has attracted much attention, optimization of their charging has not benefited from the quantum control methods. Here we fill this gap by using an optimization method. We apply for the first time this convergent iterative method for the control of the population of a bipartite quantum system in two cases, starting with a qubit-qubit case. The quantum charger-battery system is considered here, where the energy is pumped into the charger by an external classical electromagnetic field. Secondly, we systematically develop the original formulation of the method for two harmonic oscillators in the Gaussian regime. In both cases, the charger is considered to be an open dissipative system. Our optimization takes into account experimentally viable problem of turning-on and off of the charging external field. Optimising the shape of the pulse significantly boosts both the power and efficiency of the charging process in comparison to the sinusoidal drive. The harmonic oscillator setting of quantum batteries is of a particular interest, as the optimal driving pulse remains so independently of the temperature of environment.

Quantum battery [14] is a system which stores useful energy (work), and as such may be integrated into a thermal machine, which operates with the aim of charging the battery.Alternatively, quantum batteries are of independent interest as reservoirs of energy which can be stored and released on demand.Possible application of these systems is to provide energy for operations on low temperature quantum systems from within, as an alternative to energy transfer from exterior sources, leading to noise.Quantum effects in operating quantum batteries have been identified in many body systems, where collective effects enable advantage in charging power [26][27][28][29], similarly to metrological settings.Spin chains [30], superconducting qubits and quantum dots [31], disordered chains [32,33], and qubits in an optical cavity [34] were all investigated from the perspective of their use as quantum batteries.
In this paper, we tackle a problem of identifying the optimal classical drive which charges quantum battery in a typical charging setting.Namely, we intend to maximize useful energy stored in the battery, while at the same time reducing energy spent during the charging.We will verify the performance of the method both for qubits and harmonic oscillators, as both are common models of quantum batteries [34,35].The proposed method for drive optimization will take into account noise present in the realistic charging scenarios, described within the open system approach.
We will address a charging scenario in which the battery is coupled to an additional quantum system, called charger (see Fig. (1)).It is the charger which interacts with external laser field, as well as with environment.On one hand, this arrangement allows for the flow of energy from the field to the battery, while on the other partially isolates it from the effects of noise, improving quality of stored energy.While quantifiers of this quality may vary for particular physical applications, here we are going to use ergotropy [36].The general setup for battery charging is described in more detail in Sec.II.
Different methods may be used to improve power and quality of charging.An example of a passive method is to exploit qutrit batteries with energy landscape favouring charging through the so-called dark states [37,38], while measurements [39], empowered by linear feedback protocols [40,41] have been shown to exhibit improvement with respect to charging which do not take noise into account.Recently, considering noisless battery charging, [42] proposed a method based on Pontryagin's minimum principle to design optimal modulations of the Hamiltonians.
Here, we develop a passive optimized method for charging quantum batteries of an arbitrary dimension through chargers coupled to classical electromagnetic field and memory-less environment.The method relies on an iter-FIG.1: Battery charging: a quantum system, battery, is coupled to another quantum system, charger.The charger is pumped by classical electromagnetic field while interacting with environment.Goal: taking into account all the couplings, optimize over pulse shape such that the battery achieves high energy and ergotropy at a given time.
ative numerical technique [43][44][45] for optimizing a functional, which in our case encodes the goal state of the battery and the dynamics of the open system, including noise and external driving.We choose the goal state of the battery to be maximally excited (in case of a qubit) or a specific pure state (in case of a harmonic oscillator battery).The result is a time profile of the electromagnetic field which drives the battery state close to the goal state in a desired time.By a design of the functional, we enforce shape pulses of the field to increase smoothly from zero values at the beginning of the protocol (and vanish in the same manner at the end), which addresses the problem of switching on and off of the laser field, and ensures practicality of obtained solutions.Our method works not only for pure, but also mixed states, which enables us to analyze charging for non-zero temperatures of the environment.The method is presented in Sec.III.When applied to qubit atomic batteries inside an optical cavity (Sec.IV), the method leads to battery states of higher energy and ergotropy than the ones previously reported in Ref. [46] for experimentally viable parameters.Remarkably, while our method is not fully optimized for minimizing the energy cost of charging, it leads to protocols with lesser energy consumption than the ones reported for qubit batteries.Moreover, in Sec.V we show that the same applies to charging of harmonic oscillator batteries with linear coupling, while in this case optimization over temperature is not needed, provided charger and battery are prepared in the vacuum state.

II. GENERAL SETUP
We start by arguing for the relevance of the applied model of quantum control.

A. Battery charging recast as a quantum control problem
A desired transformation of a quantum system can be performed in two paradigms: non-autonomous and autonomous.The latter case can be achieved either in continuous dynamical models, as used in the description of thermal machines, or through the application of quantum clocks [47,48].In the latter case, additional quantum systems are prepared and coupled to the main system through time-independent coupling, with the aim of performing a desired operation on the system.This operation may result in activating interactions between parts of the system, and associated energy costs can be calculated by investigating preparation and dynamics of the clock.
Contrary to this, in the non-autonomous approach, the control on the system is active, with extra care needed when accounting for the energy costs of the desired transformations.This applies both for driving the system through some time-dependent parameter, or in feedback schemes, as they rely on measurements and/or operations performed 'on demand' (feedback schemes can be based both on processing of classical and quantum information, in the spirit of [49]).
Thinking about battery charging as a process in which a system (composed of the battery and the charger) is driven to a desired state, we choose the simplest nonautonomous model of external, classical (laser) drive, with no feedback mechanism present in the protocol.Avoiding autonomous settings is motivated by the simplicity of experimental implementation of a laser drive, while its classical nature is justified for the weak backreaction imposed on the field by the interaction with the system.Finally, keeping in mind that the goal is to charge the battery with a form of ordered energy (quantified below through its ergotropy), we do not expect the interaction with the environment to leave room for any improvements, which could be achieved through feedback mechanisms (at least for the case of dissipative coupling to thermal baths).Therefore, the classical drive is treated in the open-loop approach, and no information about the state of the system is gathered during the protocol.
As mentioned above, to describe the preferred experimental setting, the laser is not to directly interact with the system, and instead a charger is mediating the interaction between the drive and a system on which the transformation needs to be performed.Again, this setting is minimal, and does not allow for investigation of effects which arose though synchronized charging through many chargers.Similar scenarios were recently studied in [50], where, in the absence of classical drive, coherence shared between the oscillator chargers increased the final energy and ergotropy of the battery.
On the other hand, investigation of systems of multiple batteries driven through a single charger can be in general treated as a direct extension of the single charger/single battery model.
As we will see in Sec.V, the method remains efficient in designing charging pulses for the setting in which both charger and battery are modelled by harmonic oscillators.This is because, for the assumed linear coupling between the charger and the battery, the dimensionality of the optimization problem can be reduced, as the evolution preserves Gaussianity of the states, which results in good performance of the method.On the other hand, while the method can be applied to a multi-battery case, it requires more computational resources to find the solution which renders advantage both in terms of ergotropy of the battery and energy spent.

B. The model
We move to the detailed description of the single charger/single battery model, driven by a classical laser pulse.We investigate two cases: when both of these systems can be modelled simultaneously as qubits or harmonic oscillators.
The charger is assumed to dissipate energy into the environment during the charging process.The local GKSL master equation [51] will be used to describe the dissipative evolution of the whole system.The process starts from the charger in the ground state driven by a classical laser field.The goal is to design an optimized laser pulse such that the final state is achieved at a given time.With the aim to demonstrate efficient charging of qubit and oscillator quantum batteries, we select their final states to be excited and some coherent states, respectively.
Quality of the final state of the battery is going to be assessed by its ergotropy.Ergotropy is defined as the maximum amount of work that can be extracted from a state ρ in a cyclic unitary process such that the initial Hamiltonian of the system H(t 0 ) is equal to the final Hamiltonian of the system H(t f ) [36].Defining E(ρ) := tr{ρH} as the internal energy of the system, ergotropy of a state ρ is calculated as where ρ p is the passive state associated with ρ by ρ p = min U U ρU † , with the minimization over all unitaries.Since the ground state is a passive state only for pure states, in the optimization process we choose the target state of the battery to be an excited pure state to maximize the ergotropy.On the other hand, the energy cost of the drive is calculated as where τ is the final time of the evolution, end ϵ(t) is the time-dependent amplitude of the drive.
Consequently, to describe efficiency of the control procedure, we will compare the values of extractable ergotropies E osc , E opt and energy spent W osc , W opt for the simple, oscillatory drive, and the solution found by the optimization method, respectively.As figures of merit we introduce quality factors for the battery at the final time τ , quantifying how much the optimization improves the charging process in terms of ergotropy extracted and energy spent, respectively, evaluating method's efficiency and efficacy.In Refs.[34,46,[52][53][54] quantum correlations and quantum coherence contained in the initial state of the charger were investigated for possible benefits in transferring energy from quantum chargers to quantum batteries.As specific preparations of the initial state of the charger may cost significant input energy, to have a proper energy accounting we restrict ourselves to product ground states.Note however that the optimized charging method can be applied for an arbitrary initial state of a battery-charger system.

III. CONVERGENT ITERATIVE METHOD FOR CONTROL OF THE POPULATION OF A QUANTUM SYSTEM
The charging process can be described as a transition from the initial state ρ0 of the system (discharged battery and charger) to a target state ρtgt (representing battery charged, and an arbitrary state of the charger).The transition results from a dynamical process taking time τ (we take the initial time to be 0), which, for noisy dynamics, is modelled by the equation of motion: with the initial state ρ0 setting a boundary condition.The Liouvillian operator L takes into account local Hamiltonians, dissipation terms and the classical drive.Under this evolution constraint, driving the system to the desired final state while limiting the energy spent on the drive can be understood through the problem of minimization of the general functional where ρ(i) (τ ) denotes the state at the final time τ evolved by the field of iteration i, ϵ (i) (t).J τ is the main part of the functional J and throughout the paper it corresponds to J τ = 1 − F i (τ ), where F i (τ ) = tr ρtgt † ρi (τ ) is the fidelity between the pure states ρi (τ ) and ρtgt .
The remaining part of the functional attests for the energy cost of the drive: where λ > 0 is a numerical parameter for the optimization and S(t) ∈ [0, 1] allows for the control of the shape of the pulse.Throughout this work S(t) has the form where t on = t off = 0.005τ .We take the initial guess for the field in the form For a specific case, we choose κ large enough to achieve fast convergence.The term (7) quantifies the divergence of the pulse shape at iteration i from the shape in the previous iteration.We select pulse shapes with small energies in the initial iterations, in order to obtain a final pulse shape solutions which is not energetically costly.
The reasoning for the choices of S(t) and ϵ (i=0) (t) is the following: we start with the field guess S(t)κ which has small values at initial and final stages of the evolution.Minimization of the functional with S(t) going to 0 in these limits suppresses substantial modification of values of the field in the initial and final time regimes, compared to modification of the values of the field in intermediate times.The result is that the optimized pulse smoothly achieves small values at initial and final times.Essentially, the optimization strategy is finding a way to ensure that at each iteration the value of the functional diminishes, i.e.
Following the original proof of convergence [43] for closedsystem dynamics we see that Eq. ( 10) is satisfied when the update of the field is where ρ and σ represent the density matrix of the forward and backward states respectively.Above, we used a shorthand for ∂L ∂ϵ(t While in general this derivative has to be numerically calculated, this is not the case for charging protocols investigated in this work, where the corresponding Liouvillians are linear in the control field.σ(i−1) are the so-called backward states and they evolve according to [55] where the time goes backwards.Having said that, we can proceed to sketch the algorithm.To simplify the explanation, we will consider that ∂L ∂ϵ(t) does not depend on time.We consider a time grid made of N + 1 time points with the step between them equal to dt.The grid starts at t = 0 and ends at t = τ and the states are only defined at those points.We use the notation ϵ (i=0) (t) for the initial guess of the field.First of all, for the iteration i we generate σ(i−1) (t) by propagating the backward states σ using Eq. ( 13) with field ϵ (i) (t) from t = τ to t = 0 along the N + 1 time points.Then, we calculate the update of the field with our initial state ρ0 using the discretized version of Eq. (11) as where instead of computing the update for time t we will do so for time t = t + dt/2.Doing so, we can solve the apparent contradiction of Eq. (11) where the update of the field is calculated at time t whereas the states used for the computation are also at time t and to get those, we will need to propagate them under the field we are calculating now.Therefore, calculating it at t, the update only depends on the past information.Actually, Eq. ( 11) is the continuous limit of Eq. ( 14) when dt → 0.
With this update, we can propagate our states ρ under the new field while at the same time we keep updating the field sequentially for all time grid, obtaining ρ(i) (t) and ϵ (i) (t).In doing this, we extend the field values calculated at points t + dt/2 to points t + dt, tacitly assuming that discretization of the evolution equations does not lead to rapidly oscillating field (this can always be obtained by decreasing dt).After that, we move to the next step, i+1, where the guess field will correspond to the updated field of the iteration from before.This procedure keeps repeating until the convergence of the functional from Eq. (6).
It is worth to emphasize that the convergence is guaranteed only in the case the field is continuous in time.
Nevertheless, we observed convergence in all discretizations of the investigated processes.
In cases considered below, we implemented the optimization method in Python.

IV. OPTIMIZED CHARGING: A QUBIT-QUBIT MODEL
We start by considering a system composed of a quantum charger charging a quantum battery made of l cells (l qubits), while a classical laser field ϵ(t) is shining on the charger.The Hamiltonian of the whole system reads (ℏ = 1) where are the free Hamiltonians of the charger and the battery, respectively, and ) the interaction Hamiltonian in which g is the interaction strength.Above, we σ x,y,z are Pauli matrices with eigenstates σ z |0⟩ = |0⟩, σ z |1⟩ = −|1⟩, and we used the notation σ ± = σ x ± σ y .As we are considering real quantum systems, dissipation is inevitable to occur due to the interaction with the environment.The master equation where D T [•] the Lindblad super-operator which accounts for the dissipation and is represented by where T is the temperature of the bath, γ fixes the time scale of the dissipation and •} for any operator b.Ground state is taken as the initial state of the charger and the battery: ρ0 AB = |00⟩⟨00| AB .The goal is to design a pulse for the laser field such that the final battery state has maximum ergotropy.To do so, the target state is set to ρtgt AB = I A ⊗ |1⟩⟨1| B .We will compare our results obtained when optimizing the field appearing in Eq. ( 15) with the case of using an oscillatory field interacting with the charger, modelled by the following Hamiltonian [46] ) where H A , H B and H AB are the same as in Eq. ( 15), and rotating-wave approximation to the interaction between the classical field and the battery was applied.In doing so, we assumed ω a ≈ ω, such that ω a + ω ≫ ω a − ω.Based on (2), the cost of using the oscillatory drive can be calculated (see Appendix A) as FIG. 2: Optimized single qubit battery charging (in green), compared with a non-optimized charging (in black).In the optimized case, the target state is selected to be the excited state for the battery.The final time is chosen such that the energy and ergotropy extraction achieve their maximum value for the oscillatory field.Parameters used: N b (T ) = 0, g = 0.2ω, γ = 0.05ω, F = µ = 0.5ω. A. Efficiency and efficacy boost.
In Fig. 2, we compare the energy and ergotropy of the battery in both settings.We identify a substantial improvement in terms of energy efficiency, offered by the optimization of the pulse: the energy spent by the optimized field is W τ,opt ≈ 6.38, while the oscillatory drive leads to W τ,osc ≈ 31.42, with quality factors α W = 392% and α E = 9.7%.We notice that reduced energy expenditure not only is not reflected by the final state of worse quality, but, on the contrary, the state produced is closer to the target in terms of ergotropy, attesting for ability of the optimization method to improve both efficacy and efficiency of the charging process.Moreover, for the qubit-qubit model of the battery charging setup, the optimization method can take advantage of the presence of the above-zero temperature environment to design a pulse which yields improved efficiency over the oscillatory drive.At the same time, not only it consumes significantly less energy than the nonoptimized drive, but also less than the optimal pulse for charging in zero-temperature environment.
To show this, in Fig. 3 we present ergotropy E B of the battery resulting from the charging, and energy W used by the optimized field at time τ = π g for different temperatures of the environment (energy cost of the oscillatory drive remained 31.42).In order to set comparable energetic constraints for charging in all temperatures, we keep the same choice of λ and ϵ (i=0) (t), given by ( 7), the same as in Fig. 2.
As expected, presence of the constraints results in the inability of the method to compensate for the effect of high temperature noise.Consequently, the value of optimized ergotropy converges to zero, in parallel with the non-optimized behavior.
Nevertheless, temperature dependence of energy spent enables to distinguish three different regimes, as depicted in Fig. 3b.First of all, energy consumed by the laser decreases from temperature 0 to some non-zero value (N b (T ) ≈ 1), which can be explained by feeding energy to the system from the environment, due to the terms of the dissipator which scale with N b (T ).The second trend corresponds to the increasing of energy spent when increasing the average number of photons of the bath N b (T ).This can be explained by the fact that when increasing the temperature, the bath injects more noise into the system, which makes it more difficult for the optimization to get good ratios between ergotropy and energy.Finally, while increasing the temperature further, it becomes impossible for the optimized external field, within the set constraints, to make the system evolve to the target state since, as the system quickly thermalizes to the Gibbs state with zero ergotropy.As a result, the optimization does not ask for energy from the optimized field.
A detailed analysis of the method application to the problem of charging qubit quantum batteries, in particular the role of chosing the optimization parameters in obtaining fast convergence and efficient pulses, is presented in Appendix D. On the other hand, Appendix E presents limitations the method faces when applied to charging settings with multiple batteries.It is observed that, within the available computational resources, the method stops offering efficiency and efficacy advantages in charging for settings of 4 and more batteries, connected to a single charger.A further work should be conducted in employing optimization protocols for these settings, for the case they also become accessible in the experiment.FIG.3: Optimized single qubit battery charging (in green), compared with a non-optimized charging (in black) at time t = π g for different temperatures of the environment.Parameters used g = 0.2ω, γ = 0.05ω, F = µ = 0.5ω, while the non-optimized pulse and initial guess in the optimized scenario are chosen as in Fig 2 .(a) Energy (green) and ergotropy (black) for different temperatures of the environment.Due to the increase of noise, the ergotropy extracted within the optimized approach tends to that provided by the oscillatory field.
(b) Energy consumed by the optimized field for different temperatures of the environment.Energy spent by the oscillatory field is 31.42 for all temperatures.Energy cost of the optimal pulse grows non-monotonically with small temperatures.

V. OPTIMIZED CHARGING: OSCILLATOR-OSCILLATOR MODEL
Growing dimensionality of the system subject to optimization can be efficiently tackled in case of linear couplings between harmonic oscillator batteries.In this section, we extend the optimization method to this scenario, taking both the charger and the battery as harmonic oscillators, and subjecting the charger to dissipation.
Our extension avoids truncating Hilbert space of the systems.The truncation, if employed for optimization of the charging scenario, would produce applicability time limits which become more stringent with increasing cou-pling to the environment.In contrast, our approach is not susceptible to values of noise, and in principle can always be applied for arbitrary times of the evolution.It is also worth mentioning that from a practical point of view truncating dimension can become inefficient as one would end up with a large Hilbert space for optimization ( H oscillator1 ⊗ H oscillator2 ) which will suffer from the curse of dimensionality, specially if one wants to store more energy on the battery as it would require higher levels to be populated.Additionally, not having to decide on a dimension size for truncation makes simulation more straightforward and unambiguous.
The Hamiltonian of our model reads where H A = ωa † a ⊗ I B and H B = I A ⊗ ωb † b are the free Hamiltonians of the charger and the battery, respectively, and the interaction Hamiltonian reads H AB = g(ab † + a † b).In addition, the charger interacts weakly with the bath.Consequently, the dynamics is described by the Lindblad master Eq. ( 16), with the Lindblad super-operator accounting for dissipation expressed by where The total Hamiltonian H is quadratic, and consequently the evolution preserves the Gaussian character of the initial state.For the initial Gaussian state taken to be the ground state of harmonic oscillator, we can fully describe the state of the total system at any time t [56] using the first and second momenta of the field modes which means that our problem is reduced to optimization over low dimensional space.We define the following vector of operators where xj = 1 2ω (â j + â † j ) and pj = i ω 2 (â † j − âj ) with j = 1, 2. The operators of the vector fulfill the commutation relations [r, rT ] = iJ, with J = 0 2 I 2 −I 2 0 2 , where I 2 and 0 2 are the identity matrix and the null matrix respectively.For the indices k ∈ S = {1, 2, 3, 4} labelling vector elements rk , the state of the system is fully described by its statistical moments defined through subsets S ′ ⊂ S: where Π k stands for multiplication over k.First moments (for |S ′ | = 1) and second moments (for |S ′ | = 2) fully describe a Gaussian state.We construct the vector |r⟩ of the first moments as well as the matrix made of the second moments of x and p: The relationship between matrix V and the covariance matrix V c is given by V c = V − |r⟩⟨r|.Therefore, in order to apply the optimization method, we will use an object made of the elements of the vector of moments, the elements of the second moment matrix [57] and an independent parameter, which encodes all the information from the vector living in the infinite dimension Hilbert space.We will arrange it as follows where c is an arbitrary constant to linearize the set of equations; we set it to 1 for simplicity.The evolution of our state ρ is given by However, as we are interested in the evolution of the expectation values of the operators, we will resort to the Heisenberg equation.For any operator O, the evolution of its expectation value reads where D † T (O) is the adjoint dissipator and is given by Computing Eq. ( 29) for all the elements of Eq. ( 27) we can write the evolution as which will be our Schrodinger-like equation of motion with the condition that ψ(t = 0) = ϕ i , where ϕ i is the initial state of the system rewritten in terms of first and second moments.Consequently, the backwards evolution of the co-states will be given by the adjoint Liouvillian dynamics where and this will be translated to our Gaussian framework as where it should be noted that the time runs backwards.The boundary condition in this case is χ(τ ) = ϕ t , where ϕ t is the target state and τ the final time of our evolution.The explicit forms of A f and A b are deferred to Appendix B.
Finally, the update of the field will be given by the derivative of the Liouvillian (multiplied by the imaginary unit) with respect to the field only.So, for the iteration i and for the control ϵ we have where ρ and σ represent the density matrix of the forward and backward state respectively.This update can be calculated explicitly for any given pair of states and the result is a function of the elements of r and V (we refer the Reader to Appendix C for the details).This makes Eq. ( 35) well defined for any pair of ψ and χ.Numerical results of our optimization and the nonoptimized case are both plotted in Fig. 4a and it is seen that for the optimized pulse the energy and ergotropy are higher.The energy spent by the optimized laser pulse is 30.73 while by the oscillatory pulse 31.41,resulting in α W = 2.2%.On the other hand, we observe α E = 25%, which attests for significant advantage over non-optimized fields in terms of ergotropy extraction.In Fig. 4b it is seen that for longer times more energy can be transferred to the battery in both optimized and nonoptimized process.As longer time offers bigger opportunities for optimization of the field pulse, the energy cost increase is modest (36.7), compared to 94.25 with the fixed sinusoidal pulse (α W = 157%) while there is a sizeable gain in ergotropy extracted α E = 28%.
One should note that, for initial state of the chargerbattery system being |0⟩ C ⊗ |0⟩ B , the equation of motion (31) implies that, for a fixed driving ϵ(t) at temperature  T , the ergotropy of the final state does not depend on temperature, following the separation of energy of the target state into parts which depend separately on driving and temperature: The proof of Eq. ( 36) runs analogously to the one in [46] for a fixed, sinusoidal driving.It relies on the fact that for quadratic Hamiltonians and a loss channel at temperature T = 0, the initial vacuum state evolves into a product of coherent states.
From there, it is easy to see how our algorithm could be used in finding optimal driving of a harmonic oscillator battery.Namely, we run the algorithm for target states which have the desired ergotropy, and select the pulse which has the lowest energy cost.Eq. (36) guarantees that this pulse will lead to a state with the same ergotropy when applied at an arbitrary temperature T .Simultaneously, a pulse found in this way would also maximize the ratio E E for every temperature.This properties stand in a striking contrast to the qubit-qubit charging schemes (Section IV B), where increasing temperature was connected with diminishing values of extractable ergotropy.As such, it singles out the harmonic oscillator battery architecture as a preferred one when it comes to high tolerance to external noise.
As a closing remark, we note that the method introduced here can be specially useful in fully realistic settings, such as when the initial state cannot be taken as vacuum, or for quadratic interaction with the field.

VI. REALIZATION
We conclude with the description of the perspective of experimental realisation of the qubit-qubit and oscillatoroscillator models with the current superconducting quantum technology [58].
The architecture is easily scalable to multiple qubit and/or resonator configurations.The chip integration allows coupled multiple transmon qubits or resonatorresonator designs with ultimately stable operations [59].The in-situ tunable couplings can be realized using modular capacitive [60] or inductive [61][62][63] coupling with a large on to off coupling ratio reaching up to GHz ranges.Each qubit or resonator in the chain can also be individually controlled by coupling them to a 1D transmission line or waveguide.Note that, the coupling can be short (capactive) or long (inductive) range, allowing multiple quantum units (resonators or qubits) to efficiently interact; necessary condition to implement the current quantum control proposal.
Additionally, the microwave control electronics and control methods of these quantum circuits haven been extensively improved and developed over the last few years [64][65][66].Proper pulse shaping allows faster operations, reducing the gate errors, or improving the gate fidelity.
For instance, open or close-loop optimal control methods [67] allow stable gate operations by optimizing several parameters related to the shape, amplitude, phase, and other properties of the control field acting on the quantum units.

VII. CONCLUSIONS AND DISCUSSION
In this paper, we investigated optimization of quantum battery charging, motivated by the fact that, as far as we know, the current literature focuses on simple sinusoidal charging field.Apart from maximising the fidelity with respect to a desired target state and minimising the energy spent, we also took into the account the turning on and off of the field, to make the resulting pulses experimentally feasible.
Firstly, we studied the case in which both the charger and the battery are two-level systems.In this regime, the optimization procedure returns charging laser pulses which more effectively extract ergotropy on the battery, with a 4-fold increased energetic efficiency.Moreover, the optimization procedure takes properly into account the presence of environment, offering a prospect of further cost reductions of the charging pulses.We also proposed an operational protocol for optimizing the charging process, which should enable determination of an optimal pulse within limited computational resources.
Significant improvements in terms of extracted ergotropy and energy cost were also observed for the case in which harmonic oscillators model both the charger and the battery.Crucially, if product initial conditions are met, in these settings ergotropy extraction does not face challenges linked to finite-temperature effects in charging of qubit-qubit systems, and optimal pulses found for zero temperature are universal.In order to apply the optimization method, it was recast within the Gaussian formalism, making it effective for systems of infinite dimension.
We advocate that further work in optimizing methods is needed, anticipating the development of experimental techniques enabling fabrication and handling of batteries composed of multiple qubits or harmonic oscillator cells.Namely, for a multi-battery composed of 4 qubit cells, while the application of the current optimization procedure still offers an improved final state energy and ergotropy, the optimized pulse requires more energy, compared with the sinusoidal drive.This is because performing the optimization and at the same time minimizing the energy used by the field is not numerically stable.We conjecture that with higher computational power the optimization could be carried more efficiently, resulting in pulses with lower energy costs.Moreover, optimization of systems with multiple batteries may benefit from using gradient-based methods, like Gradient Ascent Pulse Engineering (GRAPE) algorithm [68].Note however that these methods are not guaranteed to converge monotonically.Moreover, as suggested in [45], implementation of the Krotov algorithm in languages other than Python may lead to performance boost of 2-3 orders of magnitude, which could translate into more efficient optimization of the functional.Furthermore, multi-cell battery systems bring new questions about the role which geometry of inter-cell couplings may play in effective charging.Therefore, effective optimization method for these scenarios would be of immediate application.The introduced method efficiently explores possible optimizations for the current state-ofthe-art technology, which allows handling of few qubits and harmonic oscillators, working as quantum batteries.

RRR and GS acknowledge Michael Goerz and Daniel
Reich for fruitful discussions.BA would like to akcnowledge Tomasz Linowski for his useful arguments.We acknowledge support from the Foundation for Polish Science through IRAP project co-financed by EU within the Smart Growth Operational Programme (contract no.2018/MAB/5).S.B. acknowledges funding by the Natural Sciences and Engineering Research Council of Canada (NSERC) through its Discovery Grant, funding and advisory support provided by Alberta Innovates through the Accelerating Innovations into CarE (AICE) -Concepts Program, and support from Alberta Innovates and NSERC through Advance Grant.
The dissipator for the backward equation is and for the forward Since there is a minus sign in the backwards evolution the difference in the dynamics is given by the sum of these generators: We may rewrite Eq. (B12) by using the equality: Similarly one may obtain: One may write: This expression helps to construct the backward equation from the forward one.In the X, P basis, this can be written as: which allows to compute the backwards evolution from the forward straight-forwardly.For instance let us consider X 1 and X substituting those relations in Eq. (B16) one obtains: where we exploited a This integral can be solved analytically in terms of first moments and the elements of the covariance matrix V c of the two states.Below we investigate the relation between parameter λ in Eq. ( 7) and convergence of the algorithm, and suggest a protocol for effective use of the optimization method.
For the single qubit battery charging, we investigate Pareto fronts on Fidelity vs. Work Cost diagrams, associated with running the algorithm with different λ parameters (Fig. 5).No strong correlation between fidelity of the required transformation and energy of the pulse is observed.Nevertheless, the algorithm performance depends strongly on λ.Setting it to higher values forces the algorithm to run for more number of steps before converging, while in the convergence limit it produces a pulse which may be significantly less energetic.From the above observations we infer a recommendation about how the method should be used in practise.Namely, 1.Running the cost-effective protocol in small λ regime to establish the achievable saturation level of fidelity, should be followed by 2. Running the cost-demanding protocol in high λ regime for number of steps needed to achieve or approach the saturation level from step 1.
In this way, the pulse of low energy and leading to high fidelity can be determined even without the need of observing convergence of the method in the cost-demanding regime.The suggested method remains in line with the limit which the optimization problem takes when λ → 0, when energy cost of the pulse is entirely disregarded.Therefore, we expect the proposed approach to be valid for all implementations, though precise values of λ must depend on a problem in hand.We also note here that very small values of λ which may be chosen in step 1 typically result in strong fluctuations of the pulse in time domain.However, this pulse serves only as a benchmark, and therefore we do not require it to be experimentally feasible.For the case of 3 cells, more energy is used by the optimized field compared to the 1 qubit cell, yet it remains below the energy used by the non-optimized field.The quality factors read α W = 13.8% and α E = 8.4%, calculated for fixed time τ = π g .The time of achieving maximal ergotropy by a sinusoidal drive decreases when more cells are added.For a 3 qubit cell, it shifts to approximately τ = 0.92 π g .With the optimization algorithm ran and compared with the sinusoidal drive for this updated time, it brings a slightly modified improvement factors α W = 15.93% and α E = 7.75%.Search over different initial gueses of the field profile given by Eq. ( 9) and over the parameter λ did not allow us to further improve these factors within the available computational resources.We observed that the method ceases to bring substantial improvements for 4 qubit cell systems, suggesting a need for further improvements in the optimization.FIG.6: Optimized three qubit battery charging (in green), compared with a non-optimized charging (in black).In the optimized case, the target state is selected to be the excited state for the battery.The final time is chosen such that the energy and ergotropy extraction achieve their maximum value for the oscillatory field.Parameters used: N b (T ) = 0, g = 0.2ω, γ = 0.05ω, F = µ = 0.5ω.
B. Role of environment in improving efficiency.
(a) N b (T ) = 1.Final time chosen such that first maximums in energy and ergotropy for the non-optimized setting appear.(b) N b (T ) = 1.Final time chosen such that second maximums in energy and ergotropy for the non-optimized setting appear.(c) N b (T ) = 0, and final time as in (a).The state remains pure, with ergotropy and energy taking the values of ergotropy from a).
Appendix D: Single qubit battery charging: finding the optimal pulse

FIG. 5 :
FIG. 5: Performance of the algorithm in terms of number of steps, fidelity F of the final state and energy cost W of the laser pulse used to charge a single qubit battery to an excited state.Numbers at points indicate number of steps in which the pulse was obtained.Different lines correspond to different values of λ parameter taken.