Charging a quantum battery in a non-Markovian environment: a collisional model approach

We study the effect of non-Markovianity in the charging process of an open-system quantum battery. We employ a collisional model framework, where the environment is described by a discrete set of ancillary systems and memory effects in the dynamics can be introduced by allowing these ancillas to interact. We study in detail the behaviour of the steady-state ergotropy and the impact of the information backflow to the system on the different features characterizing the charging process. Remarkably, we find that there is a maximum value of the ergotropy achievable: this value can be obtained either in the presence of memoryless environment, but only in the large-loss limit, as derived in [D. Farina et al., Phys. Rev. B 99, 035421 (2019)], or in the presence of an environment with memory also beyond the large-loss limit. In general, we show that the presence of an environment with memory allows us to generate steady-state ergotropy near to its maximum value for a much larger region in the parameter space and thus potentially in a shorter time. Relying on the geometrical measure of non-Markovianity, we show that in both the cases of an environment with and without memory the ergotropy maximum is obtained when the non-Markovianity of the dynamics of the battery is zero, possibly as the result of a non-trivial interplay between the memory effects induced by, respectively, the environment and the charger connected to the battery.


I. INTRODUCTION
A battery is a device meant to act as an energy (work) reservoir, where energy is injected during the charging process and later discharged into a consumption hub. The study of the performances of quantum batteries (QB), that is batteries whose energy charging and discharging processes are based on the laws of quantum mechanics, has both fundamental and technological motivations.
Since the seminal work of Alicki and Fannes [1], where the concept of quantum battery has first been introduced, various scholars explored this increasingly vast field, investigating the role of quantum resources in the charging of this kind of devices, their charging power bounds and the development of optimal charging protocols [2][3][4][5][6]. Theoretical frameworks applied to the study of QBs are numerous, including collections of qubits, spin chains and harmonic oscillators [5,[7][8][9], covering for an equally large amount of experimental platforms available to implement QBs. As of recently, a Dicke-model QB has been realized through a cavity [10] and another has been implemented through superconducting qubits [11].
To guarantee that a real-life implementation of QBs actually works despite the unavoidable interaction with the environment, it is important to include this interaction, * daniele.morrone@unimi.it † marco.genoni@fisica.unimi.it and any dissipative effect it might entail, in the theoretical description. Moreover, the dissipation and decoherence brought by the interaction lead quantum batteries to a stationary state and, as a consequence, the stored energy to a stationary value, at variance with unitary charging protocols, where the energy has an oscillatory behaviour. For these reasons, much attention has been given to the study of QBs in an open-system setting, sometimes being referred to as open quantum batteries (OQBs). Within this framework, there is interest not only in studying the effect of the environment on QBs [12][13][14][15], but also in developing open-system protocols to stabilize the extractable work of a charged battery through quantum control techniques [16][17][18][19][20][21].
In most of the studies mentioned above, the dynamics induced by the environment is Markovian, that is, the memory effects are negligible [22,23]. This is indeed a useful assumption that simplifies considerably the characterization of the dynamics, but in many circumstances one does need to go beyond it. When the interaction of the system of interest with any further degree of freedom affecting its evolution is not weak or whenever the evolution of the environment takes place on a similar time scale as the one of the system, one should take memory effects into account, thus entering into the realm of non-Markovian quantum dynamics [24][25][26].
As regards OQBs, memory effects have been considered only in very few cases. In [14] the authors study the behaviour in time of the energy stored in a qubit coherently driven and whose dissipative dynamics is described arXiv:2212.13488v2 [quant-ph] 12 May 2023 1. A collisional model of an OQB interacting with a non-Markovian environment: (left) two qubit systems representing a battery B (red qubit) and a charger C (blue qubit) interact between themselves for a discrete time δt via a energy-exchange Hamiltonian, with coupling constant g. At the same time, C is driven by an external laser (with frequency α) and interacts with the i-th environmental ancilla Ai, with coupling strength κ; (middle) before the next interaction between system and environment, the i-th and the (i + 1)-th ancillas interact with each other via an incoherent partial-SWAP operation with probability p; (right) the interaction Hamiltonian is turned on for another time step δt and the charger is put in contact with the next ancillary system. via specific non-Markovian master equations, without however discussing the effect on the ergotropy, that is on the maximum amount of actual work extractable from the battery qubit. In [15] the dynamics of a system composed of a qubit-battery and a qubit-charger, with the second initially prepared in an excited state, is considered; there, both systems are interacting with two specific non-Markovian environments, where the initial excitation is eventually lost, and the analysis is focused on the time evolution of the ergotropy characterizing the battery. Finally, in [27] the charging and discharging of a qubit-battery is studied, and either a Markovian or non-Markovian environment plays the role of the charger.
In this work we rather consider the following model of an OQB, that has already been put forward in [12] and that is pictured in Fig. I: two qubits, corresponding respectively to battery and charger, interact via an energy exchange Hamiltonian. The energy is injected into the system via a driving Hamiltonian applied to the charger. The charger qubit is also coupled to an environment that will cause decoherence and dissipation for the battery, leading eventually to the steady-state of the dynamics. At variance with [12], where the interaction with a memoryless environment was considered, we will here study the impact of an environment that can induce memory effects on the dynamics of the system.
For this purpose, we exploit a useful framework to study non-Markovianity in the quantum setting: collisional models (CMs) [28] (see Refs. [29][30][31] for more details on these models and their connection with quantum thermodynamics and multipartite quantum dynamics). In these models both the environment and time are discretized: the environment is indeed represented by a discrete set of ancillas that interact with the systems sequentially at discrete times. We remark that CMs have already been employed as a tool for studying the behaviour of OQBs [32][33][34][35][36][37]. However in most of these works the stream of ancillas that constitutes the CM plays the role of the charger, except in [34] where it plays the role of the battery itself. In our model, as represented in Fig. I, we instead exploit CMs in order to describe the dissipative environment interacting with the charger qubit.
The structure of this work as follows: in Sec. II, we recall the notion of quantum batteries and the figures of merit we use to assess them. In Sec. III, we describe the non-Markovian CM that we exploit to characterize the environment for our model of dissipative quantum battery. In Sec. IV, we fix the microscopic details of the model we study. In Sec. V, we present the results in the case of both a discrete-time and a continuous-time evolution, while in Sec. VI the precise connection between non-Markovianity and ergotropy is investigated. Sec. VII concludes the paper with a final discussion and some outlooks of our work.

II. QUANTUM BATTERIES
A quantum battery can be described by a ddimensional system with Hamiltonian: with non-degenerate energy levels such that ε n < ε n+1 . The charging and extraction of work can be modeled trough a time-dependent control parameter regulating the interaction that describes the process, giving a timedependent Hamiltonian that readsĤ(t) =Ĥ 0 + V (t). To evaluate the maximum energy that can be extracted from a given state of the system one considers a discharging process that starts at the time t = 0 and finishes after a time t = τ when the battery is fully empty [38].
The system is driven from the unitary operator generated by the full Hamiltonian and the average extracted work is given by where ρ 0 indicates the initial state of the system. The maximum amount of work that on average can be ex-tracted from the system, a quantity called ergotropy, is then given by To rewrite it in a more operational form, we can consider the spectral decomposition of ρ 0 , written as with r j ≥ r j+1 , and referring to Eq. (1), it becomes evident that the state minimizing the system energy, that is, the equilibrium state once all the work has been extracted, is given by As work can no longer be extracted from this state, one usually refers to it as passive state. The ergotropy can simply be evaluated as the energy lost by the system during a discharging process that drives the system to its passive state: We remark that for a qubit state, and assuming the HamiltonianĤ 0 = (ω 0 /2)σ z , one can easily evaluate evaluate average energy and ergotropy in terms of the average values of the corresponding Pauli matrices, as where we have introduced the notation Ô = Tr[Ôρ] and we have defined the quantity | σ | = σ x 2 + σ y 2 + σ z 2 . By observing the formula for the qubit ergotropy, and by recalling that the purity of a qubit state is equal to we find that ergotropy can be expressed as a function of energy and purity as It is thus clear that for qubits larger values of ergotropy can be obtained by maximizing not only the energy but also the purity of the state.

III. COLLISIONAL MODELS
In this section we provide the basic notions on CMs, describing the differences between Markovian and non-Markovian scenarios, and discussing the continuous-time limits of such models.
A. Discrete-time collisional models In a collisional model, a quantum system S described by an HamiltonianĤ s , is coupled to an environment E, made up from an infinite, but discrete, collection of subsystems, called ancillas, each with its own free Hamiltonian, such that the environment Hamiltonian readŝ H E = iĤ ai , withĤ ai denoting the free Hamiltonian of each ancilla. Time is also discretized, as the system interacts subsequently with each ancilla for a time interval δt, and one can thus introduce a collision rate γ = 1/δt. By denoting withV s,ai the interaction Hamiltonian between the system and the i-th ancilla, the unitary operator describing the evolution at the i-th step reads (we assume = 1 throughout the manuscript): A Markovian collisional model is realized when all these conditions are satisfied: i) there are no initial correlations between the system and the ancillae; ii) the initial state of the ancillae is factorized:σ e = i η i (for simplicity we also assume that they are prepared in the same initial state η i = η); iii) there are no ancilla-ancilla collisions; iv) each ancilla collides only once with the system. Under these assumptions, the evolution of the state of the system can be described through a discrete map so that the state after n steps is related to the initial state ρ 0 by This corresponds, in the context of discrete evolutions, to the semigroup property, which defines Markovian dynamics that are also homogeneous in time [22].
To introduce non-Markovianity in the model, one has to relax at least one of the conditions listed above; here we introduce ancilla-ancilla collisions as shown in Fig. I, in the form of a (incoherent) partial-swap quantum map W n,n−1 = (1 − p)I + pS n,n−1 (14) where I represents the identity map, and p represents the probability of applying the SWAP operation S n,n−1 between the (n − 1)-th and the n-th ancilla (as expected one has 0 ≤ p ≤ 1). In practice, before colliding with the system S, each ancilla with probability p swaps its quantum state with the state of the previous ancilla that has just interacted with S. Clearly for p = 0 one obtains the Markovian case previously discussed, while for p > 0 one introduces memory effects in the environment. In particular, in the opposite limit of p = 1 the system effectively interacts continuously with the same ancilla, and it is easy to show that its dynamics is described by the map Through the maps F j one can thus express the state of the system at the n-th step for arbitrary values of p as [29]

B. Continuous-time limit
We now describe two examples where one can derive a continuous-time limit for the Markovian and non-Markovian collisional models we have just described. Deriving the continuous-time limit corresponds to taking the limit for the ancilla-system interaction time δt → 0. For simplicity and as it will correspond to the case we consider in the next sections, we assume that both the system and all the ancillas are qubits and we focus on a particular interaction Hamiltonian between system and ancillas.
The continuous-time limit of the non-Markovian collisional model introduced above is not as straightforward. In fact it is possible to numerically check that, by introducing the partial-swap quantum map defined in Eq. (14) with a fixed value of p, and by decreasing the timestep interval δt, the dynamics does not converge to a well-defined continuous-time dynamics.
One can however show that a continuous time limit can be taken by introducing a memory rate Γ, and by making the partial-swap parameter p time-dependent as p = exp{−Γδt} [29]. In particular, in the limit for Γδt 1, such that p ≈ 1−Γδt, a memory-kernel non-Markovian integro-differential ME can be found in the forṁ where F(t) is the continuous-time version of the map (15).

IV. A MARKOVIAN OPEN QUANTUM BATTERY
In the following, we use as benchmark of our investigation the qubit model of OQB in a Markovian environment studied in [12], which thus fixes the microscopic details of the quantum battery under study. The qubit B represents the quantum battery itself, with free Hamiltonian z , and it interacts with another qubit C that corresponds to the charger, via an energy-exchange interactionĤ The Hamiltonian for the charger is the sum of two terms, is the free Hamiltonian of the charger, whilê represents the driving of the charger qubit, injecting energy in the system via a laser driving at frequency ω 0 . In [12], the charger is subjected to an amplitude damping due to the interaction with a memoryless environment. By going to the interaction picture with respect to the HamiltonianĤ 0 =Ĥ B,0 +Ĥ C,0 , the dynamics of the battery and charge state is described by the Lindblad equation wherê The global maximum of the ergotropy is reached in the large-loss limit (i.e. for κ α), and by tuning driving and coupling such that α ≈ 1.09g, yielding [12] The dynamics described by the master equation (22) corresponds to the continuous-time limit of a particular Markovian collision-based model, as follows from what shown in Sec. III B. Here, we explore what happens beyond this regime by taking into account memory effects induced by the environment, first via a discrete-time collisional model, and then looking at the continuous-time limit. As in [12] we focus on the steady-state properties of the battery ρ (B) ss , evaluating via Eqs. (7) and (8) the corresponding average energy E ss and ergotropy E ss .

A. Discrete-time collisions
We first study the discrete-time collisional model where the open system consists of the two qubits representing the battery and the charger, with HamiltonianĤ S = H BC as in Eq. (23), and the charger interacts with the ancillas describing the environment, via a Hamiltonian of the form (17), which in our case readŝ Each system-ancilla collision lasts for a time δt = 1/γ, leading to a unitary evolution as in Eq. (11), and we introduce ancilla-ancilla interactions via the partial-swap map defined in Eqs. (14). We now present our results for the steady state of the battery, focusing on the role of the parameter controlling the information backflow to the battery and the charger, that is the swap-probability p, as well as on the batterycharger coupling g and the driving constant α. We have considered collision rates γ much larger than the other frequencies characterizing the dynamics, so that by setting the swap probability p = 0 we (numerically) recover the continuous-time limit dynamics described by Eq. (22).
To characterize the battery charging properties in an environment with memory and beyond the large-loss limit, in Fig. 2 we plot the steady-state ergotropy and energy as a function of both p and g, by fixing the value of α = 0.9κ. We immediately notice a different behaviour between energy and ergotropy: in particular, while the former shows a generally decreasing behaviour with p, the ergotropy shows a non-monotonous behaviour as a function of both p and g. However, a noticeable optimal region of parameters can be identified, corresponding to p ≈ 0.9 and g ≈ α, where the maximum amount of ergotropy is observed. This different behaviour emphasizes the necessity to use a measure of extractable work like the ergotropy as figure of merit for a quantum battery instead of simply evaluating its energy. Indeed, for fixed values of α/κ and g/κ, increasing p can lead to an increase in the portion of the system maximum extractable energy, its ergotropy, while decreasing the maximum amount of average energy itself. As we remarked in Eq. (10), the ergotropy of a qubit can be expressed as a function of the energy and of the purity of the state. The previous observations clearly hint to the fact that the ergotropy enhancement due to the backflow of information from the environment corresponds to the generation of less mixed steady-states.
To further understand this improvement of the ergotropy due to memory effects, we compare the maximum of ergotropy in the region with p > 0 with the maximum achieved in the large-loss limit at p = 0. In Fig. 3 we therefore show the behaviour of the steadystate ergotropy as a function of the memory parameter p, for different values of the coupling g, and by fixing the driving parameter α such that the optimal condition α = 1.09g, identified for the large loss memoryless scenario [12], is satisfied. We remark that in general, at each value of p, a different optimal tuning condition between α/κ and g/κ can be found. This tuning condition, as we will later describe, is generally close to the value at p = 0, and also the difference in the corresponding values of the ergotropy is negligible, as we have numerically verified for all the parameter regimes considered in our plots.
We observe that for small values of α and g, that is towards the large-loss limit, the behaviour of the ergotropy as a function of p is almost flat. Only for larger values of g and α we observe a more evident non-monotonous behaviour of the ergotropy as a function of p, and that an enhancement is observed with respect to the Markovian case p = 0, reaching a maximum for a certain, relatively large, value of p.
The most remarkable result we observe in Fig. 3 is that the maximum amount of ergotropy E max derived in the memoryless case in the large-loss regime (see Eq. (24)) maximizes the ergotropy also in our collisional model with memory, but E max can be achieved also beyond the large-loss regime in the presence of large enough values of p. As we numerically checked, the maximum value of ergotropy is indeed reached in all the considered regimes via the same steady state, described by Bloch vector components σ x = − √ 2 − 1, σ y = 0, σ z = 1 √ 2 − 1. Importantly, for any value of g/κ 1, and for the right tuning condition between g and α, there is always a value of p for which the ergotropy approximates its maximum value, while this is no longer the case for larger values of g/κ.
We also observe that in our model only coherence contributes to ergotropy, and as a consequence its maximum possible value a priori could be ω 0 /2 [42]. However, we find E max < ω 0 /2 irrespectively of the values of the parameters considered and of the memory properties of the environment, hinting to the fact that the optimal performance of the battery depends on the sole operatorial form of the interaction between battery and charger and between charger and environment.
We then further investigate the optimal tuning condi- The value for the steadystate ergotropy is upper bounded by the maximum found in the memoryless case in the large-loss limit [12]. Indeed, for p = 0, the ergotropy is the higher the lower is g/κ, but when p increases, the ergotropy also starts to increase for all curves at different speed, with the curves further from the large-loss limit exhibiting the largest increment, all plateauing under the boundary condition. Therefore systems that are already in the optimal region of parameters display a mostly flat behaviour, while systems out of that region can achieve the maximum gain from a backflow of information due to the environment.
tion between α and g to achieve maximum ergotropy. In Fig. 4 we plot the steady-state ergotropy as a function of α and g, respectively, in the model without swap, p = 0, and for a large swap probability p = 0.95. In the former case, we observe as expected that the maximum of the ergotropy is obtained in the large-loss limit α κ and for α = 1.09g, as analytically demonstrated in [12]. On the other hand, in the case of a collisional model with memory, we now observe an extended region of parameters where one can find large values of the ergotropy, and in particular there exist a linear boundary between the parameters g/κ and α/κ along which the maximum value of the ergotropy can be found for a limited region of the plot, approximately identified by the condition g/κ 1. We can thus conclude that the presence of memory effects allows us to obtain the maximum value of ergotropy E max for a larger region in the parameters space.
Besides the steady-state properties of the ergotropy of the battery, also its transient evolution can be indeed of interest, for example because the maximum value can be obtained on different timescales depending on the parameters fixing the dynamics. In Fig. 5, we plot the ergotropy as a function of time for both the memoryless model in the large loss limit (g/κ = 0.01) and various combinations of the values for the swap probability p and for g/κ; in all these cases α/κ is determined by the optimal tuning condition that maximizes the steady state ergotropy. What is shown is that the various curves reach approximately the same asymptotic value E max , but this happens the sooner the larger g/κ. This shows that, if larger values of the coupling g are possible, an accurate choice of p can be done in order to speed up the dynamics and obtain the maximum amount of the ergotropy in a shorter time. Indeed, one should keep in mind that too large values of p will eventually slow down the stabilization process, as in the limit p → 1 one obtains a unitary dynamics. However a large enough value can still be chosen to approximate the maximum ergotropy at steady state and still speed up the dynamics. On the left, the steady-state ergotropy shows the same result obtained in [12], i.e., the ideal tuning condition to maximize the ergotropy exists in the large-loss limit, α κ, for a fixed ratio of α and g. On the right, the same plot realized for a higher value of p, shows how a backflow of information from the environment can extend the optimal tuning region also outside the large-loss limit.
of p leading to the curves in Fig. 5 correspond to the minimum value needed, at fixed g/κ, to approximate the maximum state ergotropy. In the inset we plot the time t c that is required for these curves to reach their steadystate value as a function of g: we indeed observe how larger values of g monotonously lead to a faster charging time.

B. Continuous-time limit dynamics
As we described in Sec. III B, the considered collisionbased model with memory leads to a well defined continuous-time limit if we introduce a memory rate Γ, allow the partial-swap probability to be dependent on the collision rate as p = e −Γ/γ , and consider the regime Γ γ. In fact under these conditions, the limit 1/γ = δt → 0 of the collision-based model is well described by the integro-differential ME (19), where the map F(t) also includes the effect of the driving Hamiltonian acting on the charger qubit and the charger-battery coupling Hamiltonian.
We have thus exploited our collisional model to simulate such integro-differential master equation, by considering the regime Γ γ and by fixing γ/κ = 10 3 (we have checked numerically that equivalent results are obtained by considering larger values of γ and thus approaching the continuous-time limit δt → 0). The results in terms of energy and ergotropy for the steady state of the dynamics are reported in Fig. 6. In particular, when compared to the discrete-time model where the energy decreases when increasing p, we observe that the energy has a minimum as a function of the memory rate Γ. On the other hand the ergotropy, which is our main figure of merit, monotonically increases with Γ. This result may seem in contradiction with what we have observed in the previous section for the discrete-time model, as it hints that ergotropy increases when one moves towards the Markovian regime, that is by increasing Γ. However we have to remind ourselves that in order to obtain a well-defined continuous limit, we are restricting to values of p very close to one; consequently, even if a one-to-one correspon-dence between the discrete-and continuous-time models cannot be properly defined due to the dependence between p, Γ and γ, what we observe in Fig. 6 approximately corresponds to the region in Fig. 2 where the ergotropy, after having reached its maximum, decreases when p takes large values and approaches one. Until now, we have studied the steady state ergotropy for different values of the parameter p, which quantifies the probability of having collisions among the environmental ancillas, in turn inducing memory effects in the evolution of the battery and the charger as discussed in Sec. III A. On the other hand, to fully understand the role of non-Markovianity in the properties of the battery we need to quantify in an explicit way the amount of memory effects in the dynamics, i.e., to introduce a measure of non-Markovianity. This is what we are going to do in the next section.

VI. THE ROLE OF NON-MARKOVIANITY
Among the different quantifiers of non-Markovianity [24,25], we exploit the so-called geometrical measure of non-Markovianity, defined in [43]. The amount of non-Markovianity in a given dynamics is here quantified by integrating the expansions of the volume of possible states accessible by the system throughout the evolution. Compared to other measures of non-Markovianity -such as those based on non-monotonic behaviors of the trace distance [22] or on the breaking of divisibility [44] -the geometrical measure is weaker, i.e., it might be equal to zero also for dynamics where other measures are not. On the other hand, besides its clear geometrical meaning that will be recalled below, it has the advantage of being manageable also for high-dimensional systems: in fact, it provides us with a clear computational convenience already for the two-qubit system formed by the battery and the charger.

A. Geometrical measure of non-Markovianity
Every state ρ of a finite n-dimensional system, i.e., positive trace-one linear operator on C n , can be written as [45] where 1 is the identity map on C n , r α ∈ R and thê G α are the hermitian traceless generators of SU (n). For n = 2, the latter identify with the Pauli matrices and Eq. (26) corresponds to the well-known Bloch-vector representation of the qubit states [46]; we then call the vector r with components {r α } α=1,...,n 2 −1 generalized Bloch vector. Now, the map Λ(t) describing the state evolution, corresponds to an affine transformation of the generalized Bloch vector where A(t) is a n 2 − 1 × n 2 − 1 real matrix with elements and q(t) is a n 2 − 1 real vector. The matrix A(t) describes rotations (possibly composed with inversions) and contractions of the generalized Bloch vectors, so that its determinant ||A(t)|| accounts for the contraction factor of the volume of accessible states, i.e., the volume V (t) of the image of the set of generalized Bloch vectors under the action of the affine transformation defined in Eq. (28). The geometrical measure of non-Markovianity defined in [43] is given in terms of the variations of the volume of the set of accessible states as that is, as the integral of the derivative of the volume of accessible states over all the time intervals where such volume increases, divided by the overall volume of the set of states. The basic idea is that in Markovian evolutions, such as semigroup dynamics, there is a monotonic decay of the volume of accessible states corresponding to an irreversible loss of information from the open system [47], while the revivals in time of the volume of accessible states can be read as memory effects leading to a (partial) recovery of previously lost information.

B. Memory effects and ergotropy
In the following we study the behaviour of the geometric non-Markovianity measure N b , by focusing on the discrete-time scenario. In particular, we evaluate the measure for both the composite system (battery plus charger) N The non-Markovianity of the composite system, plotted in Fig. 7, follows the expected behaviour as it is monotonically increasing with the swap probability p, which in fact quantifies the memory of the environment affecting the composite system. We also observe that N (BC) b is equal to zero in a large region of values of p, the extension of which depends on the the different parameters involved in the dynamics.
If we rather focus on the battery subsystem only, the behaviour of the non-Markovianity measure N Other parameters are fixed as α = 0.9κ and γ = 10 3 κ (equivalent results are obtained as expected for larger values of γ, that is towards the continuous-time limit). As functions of the memory rate Γ, energy and ergotropy show opposite behaviours, with the energy decreasing to a minimum as Γ increases, while the ergotropy monotonously increases. In general, for higher values of Γ, more energy passed onto the system can no longer be recovered. This means, in this regime of parameters, that the backflow of information from the environment has a negative impact on the properties of the battery. for the composite system (charger + battery) as a function of p for different values of g. The other parameters are α = 1.09g, γ = 10 2 κ. As expected, the geometrical measure grows monotonously with p in the area shown. We remark that for smaller values of p, the measure of non-Markovianity is zero. memoryless environment, that is for p = 0. A Markovian dynamics of the joint system consisting of the battery and the charger, as fixed by the semigroup map in Eq. (13) (or the Lindblad equation (18) in the continuous case), can well induce a non-Markovian evolution of the battery only: the two-fold exchange of information between the battery and the charger qubits due to their coherent interaction will generally result in a repeated backflow of information to the battery, with large values of non-Markovianity. Increasing the value of p the non-Markovianity of the battery has a non-monotonic behavior, which strongly depends on the ratio g/κ. An intuitive interpretation of this behaviour traces back to the fact that for values of p larger than zero the battery dynamics has two sources of memory. Besides the one already mentioned above originating directly in the coherent interaction with the charger, now there is also an information backflow from the environment, due to the ancilla-ancilla collisions. As follows from the discussion in Sec. III A, the latter will store and give back memory about previous stages of the evolution, affecting in the first instance the charger, with which the ancillas directly interact, and then also the battery due to its interaction with the charger. The overall behaviour of the battery dynamics depends on the interplay between these two sources of memory, so that the presence of a second source can reduce the impact of the memory effects induced by the charger observed in the case p = 0. This effect strongly depends on the ratio of the two couplings g and κ, connecting respectively the charger with the battery, and the environment with the charger. For small values of this ratio, the environment is capable of affecting the battery dynamics enough to cancel out the information backflow from the charger, while for higher values of the ratio the impact of the memory from the environment on the non-Markovianity of the battery is weaker. has a non-zero value for p = 0, due to the memory effects caused by the battery-charger coherent interaction, but as the backflow of information from the environment to the charger increases, the measure itself decreases. For values of the ratio g/κ small enough, N Note that there are values of p such that the joint battery-plus-charger dynamics is non-Markovian, while the reduced battery dynamics is Markovian, see Figs. 7 and 8; this is indeed in contrast with what happens commonly, that is, by enlarging the set of degrees of freedom one moves from non-Markovian to Markovian evolutions. On the other hand, a similar phenomenon has been observed in [48] and exploited for quantum teleportation in [49], where non-local memory effects in the dephasing dynamics of two qubits -originating from the presence of initial correlations within the environment -affect the joint systen made by the two qubits, but neither of the two individually.
By comparing Fig. 3 and Fig. 8, we notice some significant correlations between N (B) b and E ss . The two have in general opposite behaviour, with one increasing while the other decreases. Even more, every time the steady state ergotropy approximate its absolute maximum E ss , the battery non-Markovianity N  as a function of g/κ in the presence of a memoryless environment as discussed in [12]. For each value of g/κ, the driving α has been chosen in order to optimize the steady-state ergotropy.
We also notice how, differently, the curve with g/κ = 2 does not reach E ss even though its value of N (B) b reaches zero for certain values of p.
We conclude that the absence of memory effects for the battery dynamics seems to be necessary, although not sufficient, to reach the maximum of steady state ergotropy in our model. This is confirmed by the behaviour of N as a function of the ratio g/κ for the scenario described by the Lindblad master equation considered in [12] and that corresponds to our collisional model with no swap between ancillas (p = 0). As shown in Fig. 9, the non-Markovianity measure is a monotonously increasing function of g/κ and it is equal to zero under a certain threshold; we thus observe that, also in this case, in the regime where one obtains the maximum ergotropy (the large loss limit, g/κ → 0), the effective dynamics of the battery subsystem is in fact Markovian.

VII. CONCLUSIONS
In this work, we studied the discrete-time and continuous-time dynamics of a quantum battery interacting with a collisional model that acts as the environment. Specifically, we described how a discrete-time collisional model is able to mimic an environment with memory by introducing an ancilla-ancilla partial swap interaction with a certain probability p. It was therefore possible to explore the transition between a memoryless environment (obtained for p = 0) and an environment able to induce strong memory effects on the battery and the charger (for values of p approaching 1), while observing the proper-ties of the corresponding steady states of the dynamics. In particular, we observed a non-monotonic behaviour of the ergotropy as a function of the swap probability p, and the presence of a maximum for a large value of p, smaller than the limiting value p = 1. As we also observed that energy decreases monotonically with p, we came to the conclusion that the ergotropy behaviour is mainly driven by the change in the steady-state purity.
We have also found that the maximum ergotropy achievable at steady state in all the different parameter regimes corresponds to the same value that was obtained with a Markovian environment in the strong dissipative regime, which suggests that the maximum ergotropy is fixed by the operatorial properties of the interaction, regardless of the features of the environment. On the other hand, the presence of memory effects induced by the environment allows us to approach the maximum value of ergotropy in a broader region of the parameter space, and in a shorter amount of time, thus boosting the charging speed of the battery.
The behaviour observed in the discrete-time model is consistent with what we observe in the regime of parameters where the continuous-time limit exists, that is, for p ≈ 1. Specifically, we observe that the ergotropy increases by increasing the memory rate Γ characterizing this dynamics, and thus by decreasing the capability of the environment to store information about the evolution of the system. By using a definite measure of non-Markovianity, the geometrical measure, we investigated the amount of memory effects affecting the battery and the charge seen as a joint system, as well as the battery only. While the non-Markovianity of the joint system shows the expected monotonically increasing behavior as a function of the ancilla-ancilla collision parameter p, the non-Markovianity of the battery has a non-monotonic behavior as a function of p, possibly including regions where there are actually no memory effects, as quantified by the geometrical measure of non-Markovianity. Remarkably, the maximum of the steady state ergotropy lies in regions of parameters where the battery dynamics is Markovian, as the combined effects of the memory due to, respectively, the direct coherent interaction with the charger and the backflow of information mediated by the ancillaancilla collisions cancel each other.
Our work is one of the first attempts in understanding the role of memory effects in quantum battery charging and is particularly suitable for a direct experimental implementation in the next future on actual quantum devices, as quantum collisional models have recently been demonstrated on different quantum simulation platforms [50][51][52]. We believe that our study paves the way to further research in this direction: it will be interesting and necessary to understand if the behaviour we have observed will be confirmed when considering quantum batteries with larger dimensionality, that is, going beyond the qubit case, and/or for other noisemodels characterized by different forms of the coupling or by different sources of non-Markovianity. In the first instance, one could for example look at dephasing, where non-trivial thermodynamic behaviour has recently been found [53]. Concerning non-Markovianity, one could consider collisional models exhibiting information backflow with or without system-environment correlations [54]: it has been indeed shown how the two scenarios have an impact on thermodynamic properties, such as the entropy production rate [55]. These results suggest that it may be interesting to exploit these models in order to further study the actual relationship between ergotropy, decoherence, information backflow and system-environment correlations.

ACKNOWLEDGMENTS
DM acknowledges financial support from MUR under the "PON Ricerca e Innovazione 2014-2020". MACR acknowledges financial support from the Academy of Finland via the Centre of Excellence program (Project No. 336810). MGG and AS acknowledge support from UniMi via PSR-2 2020 and PSR-2 2021. The computer resources of the Finnish IT Center for Science (CSC) and the FGCI project (Finland) are acknowledged.