Elucidating the Structure of the Magnesium Aluminum Chloride Complex electrolyte for Magnesium-ion batteries

We present a rigorous analysis of the Magnesium Aluminum Chloro Complex (MACC) in tetrahydrofuran (THF), one of the few electrolytes that can reversibly plate and strip Mg. We use \emph{ab initio} calculations and classical molecular dynamics simulations to interrogate the MACC electrolyte composition with the goal of addressing two urgent questions that have puzzled battery researchers: \emph{i}) the functional species of the electrolyte, and \emph{ii}) the complex equilibria regulating the MACC speciation after prolonged electrochemical cycling, a process termed as conditioning, and after prolonged inactivity, a process called aging. A general computational strategy to untangle the complex structure of electrolytes, ionic liquids and other liquid media is presented. The analysis of formation energies and grand-potential phase diagrams of Mg-Al-Cl-THF suggests that the MACC electrolyte bears a simple chemical structure with few simple constituents, namely the electro-active species MgCl$^+$ and AlCl$_4^-$ in equilibrium with MgCl$_2$ and AlCl$_3$. Knowledge of the stable species of the MACC electrolyte allows us to determine the most important equilibria occurring during electrochemical cycling. We observe that Al deposition is always preferred to Mg deposition, explaining why freshly synthesized MACC cannot operate and needs to undergo preparatory conditioning. Similarly, we suggest that aluminum displacement and depletion from the solution upon electrolyte resting (along with continuous MgCl$_2$ regeneration) represents one of the causes of electrolyte aging. Finally, we compute the NMR shifts from shielding tensors of selected molecules and ions providing fingerprints to guide future experimental investigations.


I. INTRODUCTION
The success of clean energy sources is predicated on improvements in energy storage technologies. State-ofthe-art Li-ion batteries, although instrumental in considerable advances in portable electronics, cannot cope with the minimum storage 1-4 and safety 5 requirements dictated by grid and transport applications.
A viable strategy for post-Li-ion technology is to replace Li with safer and earth-abundant Mg. Magnesium has the advantage of doubling the total charge per ion, which results in larger theoretical volumetric capacity compared to typical Li-ion batteries. [1][2][3][4]6,7 Most importantly, in Mg-ion batteries the intercalation architecture of the graphitic-anode for Li-ions is replaced by a highenergy density metal anode (∼ 700 Ah l −1 and ∼ 3830 Ah l −1 , respectively). 1,3,4,[6][7][8] Notwithstanding the tantalizing advantages of Mg-ion technology, its distinct electrochemistry imposes serious limitations on the kind of electrolyte that can reversibly plate and strip Mg, and at the same time sustain high-voltage cathode materials. For example, Mgion electrolytes that are analogous to their Li-ion counterparts (e.g. PF − 6 Li + ) and solvents (e.g. propylene carbonate/dimethyl carbonate) irreversibly decompose at the Mg anode, producing passivating layers that are impermeable to Mg-ions, and inhibit further electrochemical activity. 9,10 To circumvent this issue, efforts by Gregory et al. 3,11 demonstrated quasi -reversible Mg-plating from Grignard's reagents. Greater coulombic efficiencies and anodic stabilities were achieved by Aurbach and collab-orators after many years of meticulous tuning of the organic magnesium aluminum chloride salts (organomagnesium-chloride complexes) dissolved in ethereal solutions, namely the dichloro complex (DCC) and the "all phenyl complex" (APC). 2,10,[12][13][14][15][16][17][18][19][20] Similarly, Shao et al. 21 achieved Mg deposition by combining Mg(BH 4 ) 2 and LiBH 4 in diglyme. The air-sensitivity and low anodic stability of previous Mg-ion electrolytes led Kim et al. 22 to propose a non-nucleophilic salt comprising AlCl 3 and hexamethyldisilazide magnesium chloride (HMDSMgCl). Recently, Mohtadi, Arthur and co-workers at Toyota developed a series of halogen-free electrolyte based on Mg borohydride, boron-clusters and carboranes, which are not corrosive and with relatively high anodic-stability ∼ 3.8-4.0 V. [23][24][25] Subsequently, Doe et al. 17,18 developed an inexpensive electrolyte termed Magnesium Aluminum Chloride Complex (MACC) which is formed by mixing two common inorganic salts, namely AlCl 3 with MgCl 2 in ethereal solutions. MACC possesses a relatively large anodic stability (∼ 3.1 V) and good reversible Mg deposition/stripping. The MACC electrolyte is the focus of the current paper.
The good performance of an electrolyte is dictated by few but important parameters such as high coulombic efficiency, high anodic and cathodic stabilities, and high diffusivity of the ion carriers, which depend ultimately on the structural composition of the electrolyte at rest and during electrochemical cycling. In the present study we interrogate the MACC electrolyte composition with the goal of elucidating: i ) the functional species of the electrolyte, and ii ) the complex equilibria regulating the MACC speciation after prolonged electrochemical cycling, a process termed as conditioning 4 , and after inactivity, termed as aging 20 . Aiming to describe important macroscopic effects observed in electrochemical experiments from the ground-up, and provide an atomistic picture of the processes regulating the speciation in the MACC electrolyte at different electrochemical conditions, we explore the complex chemical space of Mg-Cl-Al-THF (with THF as tetrahydrofuran) combining Density Functional Theory (DFT) with Classical Molecular Dynamics (CMD) simulations. The computational strategy is general and suitable to other electrolytes, ionic liquids and a variety of liquid media.
On the basis of previous experimental XRD, Raman and NMR observations 16 on the APC electrolyte, similar to MACC but with organic moieties on the Al 3+ ion, it is speculated that Mg m Al n Cl [(2m)+(3n)] comprises the magnesium chloride monomer, [µ−MgCl·5THF] + , the dimer [µ−Mg 2 Cl 3 ·6THF] + and AlCl − 4 as counterion. While monomer and dimer ions are yet to be observed during electrochemical cycling in both MACC and APC, they are thought to be the active Mg 2+ carriers during electrochemical cycling. Barile et al. 20 also speculated that higher order magnesium-chloro structures such as trimer and multimeric units may exist, and they are included in this study.
With the aid of density functional theory calculations and molecular dynamics we are able to show that the MACC electrolyte bears a simple chemical structure with very few species present. By knowing the stable species of the electrolyte, we elucidate the equilibria taking place in the electrolyte, showing that the Mg 2+ carriers, MgCl + are continuously exchanged with MgCl 2 (and AlCl − 4 with AlCl 3 ), and changes of these equilibria alter the observed electrochemical performance of the electrolyte. Finally, our results suggest some explanation for the phenomena of electrolyte aging and conditioning.
These findings are instrumental for progressing the development of the next generation of Mg-ion batteries. Particularly, we demonstrate the working of the MACC electrolyte, and also provide clear directions for the improvement of the electrolyte performance.

A. Ab initio molecular solvation and periodic bulk calculations
Due to the importance of strong interactions between solvent molecules and the species in the MACC electrolyte, we model, using Density Functional Theory (DFT), each magnesium-aluminum-chloride complex with an explicit solvent of THF molecules in the first solvation shell and an implicit model in the outer shells to describe long-range solvent-solvent interactions. The methodology is shown in Fig. 1 According to Figure 1 G PCM , the Gibbs free energy of the fully solvated Mg-Cl-Al-THF clusters are set by Equation 1.
where G PCM and E PCM represent the Gibbs free energy and total energy of the fully solvated complex (explicit solvent and implicit solvent, see Figure 1), while ZPE expl , q expl , and T S expl are the zero point energy correction, the thermal contribution, and the entropic term respectively, approximated by the MACC clusters comprising only the explicit solvent. To obtain the explicit part of E PCM (see Fig. 1), we first relax the geometries of the magnesium-aluminum-chloro clusters (comprising an explicit 1 st solvation shell of THFs) within the DFT approximation with B3LYP and a 6-31+G(d) basis-set implemented in Gaussian09. 27 Previous battery studies have demonstrated that B3LYP can accurately reproduce experimental results. [28][29][30][31] More details on the methodology are provided in the Supplementary information. Finally, E PCM of Eq. 1 is obtained from a single point energy calculation on the relaxed structures using the PCM model. 26 Frequency analysis is performed to ensure that the relaxed structures are real minima as well as to compute the free energy corrections (i.e. ZPE expl , q expl , and T S expl ).
To evaluate some important reactions involving solid phases, we employ the B3LYP functional available in VASP. 32,33 The total energy is sampled on a wellconverged 4×4×4 k -point grid (and a 16×16×16 k -point grid for Al and Mg metals) together with projector augmented-wave theory 34 and a 520 eV plane-wave cutoff. Forces on atoms are converged to less than 1×10 −2 eV/Å. In order to compare the liquid species participating to chemical reactions containing solid phases (see Table II) we simulated the relaxed structures obtained from molecular PCM calculations with periodic boundary conditions employing a box of size 20×20×20Å 3 and the VASP setup indicated above. Thus, the chemical potential of molecules and ions coordinated by THF (see Table II) are referenced to the liquid THF via the experimental enthalpy of vaporization ∆H ∼ 0.331 eV. 35 For relevant clusters, 35 Cl and 25 Mg NMR shielding tensors (only the isotropic shielding part is discussed) are provided as useful fingerprints to guide experiments. NMR parameters are obtained with Gauge-Independent Atomic Orbital theory 36 on the relaxed structures at the 6-31+G(d) level of accuracy, but increasing the basis-set quality to 6-311+G(d,p). Basis-set convergence on the NMR isotropic shielding for these molecules are discussed in the Supplementary Information.

B. Debye-Hückel correction
To account for the electrostatic interactions of ions in the electrolytic solution, we apply a potential energy correction to the reactions energies (see Table II) based on Debye-Hückel theory. 37,38 Therefore the ∆E corrected by the Debye-Hückel model ∆E D−H becomes: where ∆E obtained from DFT calculations at infinite dilution, m is the total number of ion i, and u i the electrostatic potential energy given by Equation 3, where z i is the charge number and c 0 i the number concentration of ion i, r the relative dielectric constant (∼7.5 for THF), 0 the vacuum permittivity, k B the Boltzmann constant, T the temperature, e the electron charge, a 0 the minimum separation of ions, and κ −1 the Debye screening length. We set a 0 to be ∼ 7.1Å that is the minimum separation of the van der Waals spheres of MgCl + (3THF) and AlCl − 4 . Since the ∆E D−H of Equation 3 depends on the ionic activity c 0 i , which in turn depends on the magnitude of the Debye-Hückel correction, the ∆E D−H has to be evaluated numerically through an iterative self-consistent procedure. Self-consistency of u i is achieved when the concentration (of the charged species, i.e. MgCl + ) equals the input concentration. In general, the Debye-Hückel theory is not appropriate for the description of concentrated solutions; for this reason we use the extended Debye-Hückel approximation (which holds for concentrations < 10 −1 M), see Eq. 3 which is compatible with the concentrations of the charged species in solution (∼ 92 mM for MgCl + and AlCl − 4 ).

C. Classical molecular dynamics simulations of bulk electrolytes
All classical molecular dynamics (CMD) simulations to study the dynamic structure of the MACC electrolyte are computed using LAMMPS 39 and treat the effect of the THF solvent explicitly. The THF-THF, and THFion interactions are modeled using the Generalized Amber Force Field 40,41 (GAFF), whereas Mg and Cl partial charges presented in Table I are computed with the RESP procedure by fitting the electrostatic potential surface of the optimized geometries using Antechamber. [40][41][42] The GAFF force field parameters for THF were benchmarked against the experimental properties and found to reproduce the experimental values adequately; for example the experimental density of THF (∼ 0.889 g/cm 3 ) is well reproduced by CMD simulations (∼ 0.882 g/cm 3 ), 28 similarly the experimental diffusion coefficient (∼ 300.00×10 −11 m 2 /s) is in good agreement with the calculated value (∼ 211.34×10 −11 m 2 /s). 28 The MACC electrolyte structures initially optimized with Gaussian09 (see above) are inserted into a periodic box of size 48×48×48Å 3 containing 800 THF molecules at the experimental THF density (0.889 g/cm 3 ). The infinite dilution limit is simulated for each complex, i.e. only one molecule was inserted in the CMD box. Then, each configuration is equilibrated for 1 ns in the isothermal-isobaric ensemble (NPT) which is sufficient to converge the density, with minimal variation (∼ 1% ) from the THF experimental value. Subsequently, a 1 ns simulation is performed in the canonical ensemble (NVT) at 300 K, of which the first 200 ps is utilized for equilibration, within which convergence of each simulation is achieved, followed by a production time of 800 ps. A time step of 1 fs is used.
To identify how THF coordinates to the Mg x Cl y (i.e. monomer, dimer and trimer) ionic species, it is not necessary to consider changes of the ion structures during coordination by THF. Therefore, in the CMD simulations the ions are held rigid (in the electrolyte solvent) at the fully relaxed geometries as obtained by Gaussian09, thus removing the necessity of parameterizing bonded interactions of each ion.

III. RESULTS
To isolate the electro-active species comprising the MACC electrolyte, we first study the structures and composition of various magnesium chloride complexes hypothesized to be present in the electrolyte. The Mg-Al-Cl-THF chemical space is further enlarged by additional structures that are guessed by chemical intuition or results of CMD simulations. Consequently, we study the salt solvation by altering the first solvation shell of the magnesium-chloro complexes considered. The Supplementary Information reports the atomic positions of the thermodynamic stable structures.

A. Magnesium-chloride complexes
Previous experimental efforts have attempted to understand the complex structure of the magnesiumchloride complexes of the MACC electrolyte. The combined X-ray diffraction, Raman, and NMR spectroscopies by Aurbach and co-workers established that Mg 2+ in THF exists always as a six coordinated ion in the form of monomer MgCl + (5THF) or dimer Mg 2 Cl + 3 (6THF). 14,16 In contrast to these results, a more recent theoretical investigation 43 elucidated the first solvation shell of the MgCl + and Mg 2 Cl + 3 magnesium organo-chloro species in the bulk electrolyte using ab inito molecular dynamics calculations, and suggested that the MgCl + monomer is always coordinated by three THFs, leading to a total Mg coordination of four. Similar findings were supported by the experimental NMR and XANES work of Nakayama et al. 44 We benchmark our modelling strategy on previous experimental and theoretical results by simulating several magnesium-chloride complexes in different THF environments combining DFT and CMD calculations, as outlined above.
To measure the stability of magnesium-chloride clusters in THF we compute (with DFT) the formation free energy ∆F at fixed THF chemical potential µ THF : where G(n Mg , n Cl ) and G(n Mg , n Cl , n THF ) of Eq. 5 are the Gibbs free energy of each Mg x Cl y cluster isolated and coordinated by n T HF molecules. Throughout the paper all references to "formation energy" refer to the formation free energy ∆F . Figure 2 depicts the free energies of formation ∆F for the magnesium-chloride complexes as a function of THF coordination (bottom x-axis) and total Mg coordination (top x-axis) obtained from B3LYP calculations.
Each minimum in Fig. 2 represents the most stable structure for a particular Mg-Cl complex, hence its most stable Mg coordination. Figure 2 shows that the preferred magnesium coordination is 4-fold for both MgCl + (3THF) and MgCl 2 (2THF), 5-fold for the dimer Mg 2 Cl + 3 (4THF), and 6-fold for the trimer Mg 3 Cl + 5 (6THF). Interestingly, the total Mg coordination number increases with the size of the magnesium-chloride cluster. The stable structures show a coordination of 3 THFs for the monomer MgCl + and 2 THFs for each Mg atom in dimer Mg 2 Cl + 3 (4THFs in total). These results are consistent with theoretical findings by Wan et al. 43 and XANES spectroscopy data. 44 Classical molecular dynamic simulations are used to clarify the dynamics of the ion complexes in MACC in THF solvent. Figure 3 plots the radial distribution functions (RDF, black lines), and the corresponding coordination numbers for the 4 complexes (red and blue dashed and dotted lines, respectively) obtained from CMD calculations. More RDF plots of different atom pairs are  The peaks located between 2.0-2.5Å in each RDF indicate the first coordination shell of Mg experienced by THF, and its integration (see blue dotted lines) the number of THF molecules coordinated by Mg atoms. For dimer and trimer of Fig. 3 c) and d) the peaks from 4.5 to 5.0Å are the oxygen atoms of the THFs coordinating the nearest neighbors Mg atoms. Figure 3 obtained from classical molecular dynamic simulations, shows that the overall Mg coordination number for each Mg-Cl complex is consistent with the prediction from the DFT formation energies (see above). Our preliminary CMD simulations demonstrated that the coordination of MgCl + is wrongly predicted to be 6, if Mg 2+ and Cl − ionic charges are assigned to +2 and -1 for Mg and Cl ions, respectively. 43,44 This is because charge transfer processes occurring within each complex reduce the nominal charges on both Cl and Mg (as seen in Table I), hence lowering the overall Mg coordination number to 4. Moreover, we find two kinds of Mg-THF coordinations observed for the charged ions-THF molecules are either strongly coordinated to the complex, or weakly coordinated, thereby setting up a free exchange of THF molecules with the bulk solution and the first solvation shell. For Mg 2 Cl + 3 , two THF molecules are strongly coordinated to each Mg atom, while a third THF molecule is constantly exchanged between the bulk region and the Mg atoms in an alternating manner, leading to an effective coordination number of 2.5 THFs per Mg atom. For instance, this exchange occurs after 900 ps for Mg 2 Cl + 3 . For the MgCl + monomer, the coordination number is predicted to be 3.7 THFs, and slightly larger than in previous ab initio MD simulations (3 THFs for MgCl + ). 43 Overall, the coordination numbers computed from both DFT and CMD are consistent with previous XANES, 44 with sub-ambient pressure ionization with nano-electrospray mass spectroscopy, 45 and accurate ab initio MD studies consolidating the idea that THF steric hindrances and Mg-Cl charge transfer lead to THF not being able to fulfill the typical sixfold coordination of Mg in solids. 43 To conclude, DFT coupled with computationally inexpensive CMD simulations provides a robust strategy to interrogate the structural characteristic of the species in the MACC electrolyte.
To study the effect of electrolyte composition on the stability of the MACC complexes, we analyze the stable phases of the Mg-Cl-Al-THF chemical space using the the total energies of more than hundred Mg x Cl y and Al x Cl y molecules with variable THF coordination numbers. Figure 4 shows the grand-potential phase diagram 46 for the Mg-Cl-THF system at the bulk THF chemical potential, where black lines set the boundaries of the stable regions, and red-dots indicate the stable phases. To the best of our knowledge this is the first instance of grand-potential phase diagrams together with DFT calculations being used to analyze the structure of a liquid electrolyte.
The THF chemical potential is calculated using the same procedure exposed in Sec. III A from a cluster of 7 THF molecules extracted from an well equilibrated ab initio MD, see more details in Ref. 47 The grand potential formation free energy of each complex is calculated with respect to Mg 2+ in THF and Cl − in THF as these are the relevant reference states for the complexes in THF. At Cl compositions of 0.0 (equivalent to 0 % Cl and 100 % Mg, or Mg 2+ ) and 1.0 (equivalent to 100 % Cl and 0 % Mg, or Cl − ), Mg 2+ and Cl − species are coordinated by 6 and 0 THFs, respectively. The formation free energies of Fig. 4 and successive grand-potential phase diagrams contain the vibrational entropy as indicated by Eq. 1 and Eq. 5. Our calculations do not capture the configurational entropy that would tend to stabilize low coordination number. At first glance Fig. 4a and b show that solutions containing Mg and Cl in THF form stable magnesium-chloride complexes, and only MgCl + (3T) (with T for THF) and MgCl 2 (2T) are observed to be the stable phases (see red dots) through the entire Cl composition. We find that neither the dimer, nor the trimer are stable in bulk THF (see yellow squares marked as Mg 2 Cl + 3 (4T) and Mg 3 Cl + 5 (6T) for the dimer, trimer, respectively in Fig. 4b). Notably, the stable phases identified by the grand-potential phase diagram of Fig. 4 correspond to the lowest formation energies of the magnesiumchloride complexes as presented in Fig. 2. As already mentioned, the dimer Mg 2 Cl + 3 was isolated with X-ray on mono-crystals as one of the products of crystallization of the APC electrolyte, 16 while trimer and higher order structures were speculated to exist by Barile et al. 20 as a byproduct of polymerization of the principal MACC components MgCl 2 , monomer and dimer. By isolating the most stable Mg x Cl y components from the grand-potential phase diagram of Fig. 4 we can estimate the reaction energies to form dimer and trimer complexes from the MgCl + as seen in Fig. 5. Figure 5  clearly shows that both dimer and trimer are not accessible in normal thermodynamic conditions (with almost 1 eV to create the trimer from the monomer). Hence our results argue against the existence of such magnesiumchloride agglomerates in the actual solution. 16,18,20,48 To explore the morphology of the MACC electrolyte further and analyze possible changes that might occur to its structure, we investigate the stability of the electrolyte with varying THF chemical potential, and therefore look for possible conditions under which unstable structures from Fig. 4 can be stabilized (e.g. dimer and trimer). Figure 6 shows the grand-potential phase diagram 46 for the Mg-Cl-THF system at the chemical potential corresponding to a THF activity of 10 −6 (which means lowering the THF chemical potential by ∼ -34.25 kJ mol −1 ). Changing the THF chemical potential affects directly the relative stability of the THF coordination environment experienced by the MACC complexes, and lowcoordination situations are preferred at low THF chemical potentials. For example, the THF coordination of MgCl 2 decreases from 2THF to 1THF, but the relative stability order between MgCl 2 and MgCl + is maintained. Lowering the chemical potential of THF in the bulk solution emulates the process of drying, where the solvent evaporates, and thereby only the strongly-bound THF molecules remain coordinated to the complexes.
Interestingly, from Fig. 6 we notice that the free energy of the dimer complex now approaches the ground state line (see black line), meaning that this structure might become accessible under conditions of evaporating/drying solvent. The dimer is only ∼ 0.02 eV above the stability line that is enough to be accessible by thermal fluctuations, and may explain why the dimer was successfully crystallized. 16 In summary our results show that in pure Mg-Cl-Al-THF solutions neither the dimer nor the trimer exist at equilibrium, but a reduction of the THF chemical potential, as experienced in drying, may lead to the formation of dimers.

B. Aluminum complexes in THF and Al-Cl-Mg Phase Diagram
To complete the thermodynamic analysis of the possible species in the MACC electrolyte we perform a similar study of Al-Cl in THF. Figure 7 shows the Al-Cl-THF grand-potential phase-diagram, where at Cl compositions of 0.0 and 1.0 are located the isolated species of Al 3+ and Cl − coordinated by 5 and by 0 THFs, respectively. Figure 7 suggests that the stable species in the electrolyte are: AlCl 2+ 2 (2THF), AlCl + 2 (2THF), AlCl 3 (THF) and AlCl − 4 , with no Al x Cl y polymeric species found to be stable in THF. fourfold coordinated does not have strongly bonded THF molecules. Figure 8 shows the ternary Al-Cl-Mg grand-potential phase-diagram at the THF chemical potential and black lines indicate tie-lines (more detail in the Supplementary  Information). Although the ternary Al-Cl-Mg grandpotential phase-diagram shows tie-lines such as Mg 2+ -AlCl + 2 (2THF), MgCl + (3THF) -AlCl + 2 (2THF), and MgCl + (3THF) -AlCl 2+ (2THF) these species cannot coexist as they do not respect the charge neutrality of the MACC electrolyte. The orange part of the PD in Fig. 8 represents the zone where ionic species can coexist and respect charge neutrality. Therefore, from the Al-Cl-THF grand-potential PD we deduce that the important equlibria will only occur among MgCl + , AlCl − 4 and MgCl 2 and AlCl 3 species and the dashed tie-line indicate their interaction. In the orange area, the only plausible equilibria that respect charge neutrality are either MgCl + (3THF) with AlCl − 4 or MgCl 2 (2THF) with AlCl 3 (THF). We use a dashed line for the interaction between MgCl + (3THF) and AlCl − 4 to indicate the small driving force of this reaction (see ∆E D−H of reaction (c) in Table II), which will be discussed in more detail later. The stable composition of the MACC electrolyte is the MgCl + (3THF) and AlCl − 4 tie-line. Despite the small dielectric constant of THF (∼ 7.58 at 298 K), from the phase diagram of Figure 8 we do not find stable ionic couples (e.g. MgCl + AlCl − 4 ) that would hinder the electrochemical function of the electrolyte.  Table II and text for more details). Tie-lines do not necessary respect charge neutrality (see text and Supplementary Information).

C. MACC under equilibrium and conditioning
We use the knowledge of the stable species gained from grand-potential phase diagrams to explain the phenomenological effects observed in the MACC electrolyte under electrochemical cycling.
MACC electrolytes exhibit high coulombic efficiency, but only after extensive electrochemical cycling, a process termed conditioning. 4 Barile et al. 20 demonstrated that when a conditioned MACC electrolyte is left to rest for a prolonged period of time it shows lower coulombic efficiencies than when conditioned, and referred as "aging" of the electrolyte. The changes in the electrolyte species caused by aging and conditioning can be rationalized by evaluating possible reaction equilibria occurring in bulk and at the electrodes summarized in Table II. The grand-potential phase diagrams in Fig. 4, Fig. 6, Fig. 7 and Fig. 8 attest to the presence of only four stable magnesium/aluminum chloride species, MgCl 2 , MgCl + , AlCl 3 and AlCl − 4 limiting the total number of species in the reactions of Table II. Here, we do not consider the ionic dissociation of MgCl 2 (ALCl 3 ) in Mg 2+ (Al 3+ ) and Cl − because of their high-energy in our simulations. In addition, DFT calculations and ab initio MD dynamics confirm that Cl − is poorly coordinated by THF.
The reaction energy (∆E) at the dilute limit, and with the Debye-Hückel correction (∆E D−H ) are included in Table II. The Debye-Hückel correction captures the electrostatic interaction of charged species in solution at dilute activities, and stabilizes the ions in the electrolyte, thus affecting some reaction energies of Table II Reaction (a) of Table II dictates the equilibrium of MgCl 2 between its liquid and solid state, a reaction which is predicted as endothermic. The magnitude of the ∆E shows that MgCl 2 is sparingly "dissolved" in ethereal organic solvents such as THF or glymes and is supported by previous experimental evidences. 18,49 Reaction (b) that sets the "dissolution" of AlCl 3 in THF, is highly exothermic suggesting that AlCl 3 occurs in liquid THF.
In order to maintain charge neutrality, the activities of the charged species in solution, namely MgCl + (3THF)(l) and AlCl − 4 (l), must remain equal, and this condition is regulated by reaction (c) of Table II. Reaction (c) is slightly exothermic, favoring the formation of neutral molecules (MgCl 2 and AlCl 3 ) in the electrolyte. Nevertheless, when the Debye-Hückel correction is applied to reaction (c), the formation of ions is favored guaranteeing the operability of the MACC electrolyte. This stresses the importance to include the effect of the ion activities to compute properly reaction energies in liquids. Moreover, for the ionic strengths in the MACC electrolyte, the Debye-Hückel correction is sufficient, and no higher order corrections are necessary. The conductivity of the MACC electrolyte is related directly to the concentration of the charged ionic species MgCl + , and AlCl − 4 . The slightly endothermic nature of reactions (c) ∆E D−H shows that under thermodynamic equilibrium the charged species MgCl + and AlCl − 4 are present in the electrolyte. At the solubility limit of MgCl 2 ∼ 7.8 × 10 −4 M in THF (set by reaction (a)) and for a 0.5 M of AlCl 3 in THF, the MgCl + activity is approximately 92 mM, which is high enough to guarantee good ionic conductivity (see discussion later). Note that the Debye-Hückel correction on the ∆E of reaction (c) is concentration dependent (see Eq. 4) and is calculated for a 0.5 M solution of MACC electrolyte.
The processes of non-electrochemical Mg and Al deposition are regulated by reactions (d) and (e) in Table II. Reaction (d) depicts the equilibrium between magnesium aluminum chloride neutral species and Mg and Al metals. The highly exothermic character of reaction (d) explains that Al deposition is preferred at the cost of Mg dissolution. A similar trend is observed for reaction (e) that establishes the equilibrium of charged and neutral magnesium aluminum chloride species and the respective metals. The reduction potential of Al (∼ -1.67 V vs. NHE) is more positive than for Mg (∼ -2.35 V vs. NHE) and ensures immediate Al deposition during initial electrochemical cycles. Spontaneous Al deposition sets a thermodynamic driving force for the process of aging, in absence of an applied potential at the electrode.
According to reactions (d) and (e) of Table II when a conditioned electrolyte is allowed to rest (i.e. not undergoing electrochemical cycling) the concentration of the electroactive species available in solution, MgCl + and AlCl  Table II, we suggest that during the first few electrochemical cycles of Mg deposition of a freshly prepared MACC electrolyte, Al ions in solution (AlCl − 4 ) are easily displaced, thereby decreasing the initial coulombic efficiency of the electrolyte as observed by Barile et al 20 -this process is called conditioning of the electrolyte (see discussion later). However, during conditioning the presence of a chemical or electrical potential promotes reaction (c) furhter towards the formation of MgCl + (AlCl − 4 ) species, hence favoring Mg deposition over Al. The concepts of electrolyte aging and conditioning will be clarified further in the discussion section. To aid the interpretation of future NMR experiments on the MACC electrolyte we computed the NMR isotropic shielding fingerprints of 25 Mg and 35 Cl of selected MACC complexes. In general, changes in charge density localization on different MACC complexes directly alter the screening effects experienced by each NMR nucleus giving rise to different NMR responses.
While Mg posses an NMR active nucleus, due to its low abundance 25 Mg requires expensive high field NMR instruments. Therefore, in this analysis 25 Mg data will be complemented by data on the more abundant 35 Cl nucleus. Figure 9 shows the 25 Mg and 35 Cl NMR isotropic shifts in THF for some relevant Mg x Cl y clusters isolated from the grand-potential phase diagrams of Figs. 4 and 6.
The 35 Mg and 35 Cl isotropic shielding (of Fig. 4) fall at very different absolute values. Note that NMR data of Fig. 9a and Fig. 9b are not shifted to 25 Mg and 35 Cl standard reference compounds. Our results indicate that 25 Mg NMR should be able to distinguish very well between charged Mg x Cl y complexes (i.e. MgCl + (nT) and  35 Cl NMR isotropic shifts (in ppm) of relevant species magnesium-chloride complex ions in the MACC electrolytes. Colors for different magnesiumchloride complexes. Coordinating THF molecules indicated by T. Note that NMR data are not shifted to 25 Mg or 35 Cl standard reference compounds. Range of isotropic shifts for compounds with more than one Mg or Cl atoms is indicated by error bars.
Mg 2 Cl + 3 (nT)) and neutral species (MgCl 2 (nT)) in the MACC electrolyte. In addition we predict that 35 Cl NMR can discriminate between monomer and dimer species (MgCl + (nT) and Mg 2 Cl + 3 (nT)), complementing 25 Mg NMR data. Though the combination of 25 Mg and 35 Cl NMRs can clearly differentiate between the stoichiometry of magnesium-chloride complexes, our calculations suggest that it will be more difficult to make conclusive claims on the effect played by the solvent (THF) with NMR. Furthermore, while the analysis of the Mg-Cl grand-potential PD suggests that agglomeration of MgCl + · · · MgCl 2 is significantly more likely to occur than the distinct dimer (Mg 2 Cl + 3 , see discussion later), the spectroscopic differences between the two species may be subtle. For 25 Mg data an increase of the isotropic shift is observed for increasing THF coordination, see for example the trend for MgCl + (2T) to MgCl + (5T).
Less pronounced is the 35 Cl NMR shift decrease as a response to an increase of the THF coordination number (see Fig. 9b).

IV. DISCUSSION
In this work, the stable species present in the MACC electrolyte are predicted using CMD and ab initio calculations.
Although this investigation provides an important understanding of the composition of the MACC electrolyte, it deals with bulk MACC solution and does not explicitly account for: i ) the effect of the anode and cathode surfaces, ii ) the existence of parasitic chemical reactions that might alter the electrolyte composition, and iii ) the presence of impurities.
From the formation energies and grand-potential phase diagrams of magnesium-chloride complexes we demonstrated that only two major Mg(Al) species are present at equilibrium conditions in MACC, namely the neutral MgCl 2 (AlCl 3 ) and electro-active MgCl + (AlCl − 4 ). We demonstrate that larger Mg x Cl y units such as dimer and trimer are not stable, though they might become accessible at room temperature by changing the solvent conditions (drying/crystallization). Polymerization of THF by AlCl 3 is also possible 20,47 , and has the effect of decreasing the solvating capabilities of THF towards the species in solution (MgCl + and MgCl 2 ). Therefore THFpolymerization represents an alternative mechanism to emulate drying conditions in solution and stabilize the dimer species. In drying conditions achieved with crystallization procedures, the dimer Mg 2 Cl + 3 has been successfully isolated, 16 but results in a electrochemically inert solution when redissolved in THF. Benzmayza et al., 48 speculated that the lack of solvent in certain electrochemical conditions, for example when MgCl + and MgCl 2 approach the anode surface, is responsible for the formation of the dimer species. These experimental observations are consistent with our theoretical findings suggesting that the operation of the MACC electrolyte is ascribed to its simple chemical structure/composition, and regulated by uncomplicated equilibria.
Interestingly, previous theoretical investigations of the monomer and dimer coordination in THF, 43 have demonstrated that the symmetry of the dimer is largely perturbed by the THF solvent, forming an open structure that resembles an isolated magnesium chloride molecule interacting with a dangling monomer, i.e. MgCl 2 · · · MgCl + . Combining these observations, we speculate that the dimer Mg 2 Cl + 3 originates from the agglomeration of MgCl 2 available in solution and MgCl + . Under conditions of drying/crystallization, similar agglomeration mechanisms can explain the formation of larger order magnesium-chloride structures (e.g. trimer and polymeric units), which have been speculated to exist. 20 To this end, we have computed useful 25 Mg and 35 Cl NMR fingerprints of the stable and unstable MACC species.
Our findings also shed light on the coordination of inorganic aluminum magnesium-chloride complexes. In line with preliminary experimental and theoretical work, [43][44][45] we demonstrate that magnesium-chloride salts in THF solutions cannot fulfill the typical 6-fold coordination of Mg 2+ in solids, but always prefer lower coordination numbers (e.g. 4-fold for the monomer MgCl + (3THF)). According to the vast organic literature, [50][51][52] Grignard reagents' MgXR 2 (with X = Cl, Br) and halides salts (MgCl 2 and MgBr 2 ) in THF are typically found 4-fold coordinated, and confirm our findings. Compared to multidentate linear glymes (e.g. diglyme and tetraglyme) the ability for THF to coordinate ions is limited by the bulkier structure of the ring, and this has been also demonstrated experimentally and computationally by Seo et al. 53 Moreover, the coordination environment in the crystalline state does not necessarily reflect the coordination in the liquid phase. 54,55 A closer analysis of our data shows that the stable Mg coordination number increases as a function of the Mg-Cl complex size from monomer to trimer. In a recent study, some of us attested that lower Mg 2+ coordination numbers decreases the desolvation energy required to shed the solvent during plating and stripping. 47 We speculate that the larger Mg 2+ desolvation energy for bigger Mg-Cl complexes (e.g. dimer and trimer) can inhibit the delivery of fresh Mg 2+ at the Mg-anode during plating.
By identifying the principal species of the MACC electrolyte at equilibrium, MgCl + (3THF), MgCl 2 (2THF), AlCl − 4 , and AlCl 3 (THF), we can explain the phenomenological effects observed in the MACC electrolyte under electrochemical cycling. A thermodynamic analysis of the bulk electrolyte properties suggests that the equilibrium between MgCl + and MgCl 2 (and AlCl − 4 and AlCl 3 ) in THF tends towards a solution dominated by charged MgCl + (and AlCl − 4 ) species, (see reaction (c) Table II corrected by the Debye-Hückel model), which provides the appropriate conditions for ion conductivity. The ∆Es calculated for each equilibria dictate the activity ratio between MgCl + and MgCl 2 that impacts the number of charge carriers (MgCl + ) available in solution, and ultimately impacts the ionic conductivity of the MACC electrolyte. In MACC AlCl − 4 functions as a shuttle replenishing Cl − ions (at the anode surface) during Mg stripping (at the anode); 47 reaction (c) of Table II suggest that the ratio between AlCl − 4 and AlCl 3 is large, hence allowing the complex dynamics of Mg stripping and dissolutions.
The availability of MgCl + in solution is not only controlled by reaction (c) but also depends on the low solubility of MgCl 2 in THF (see reaction (a)). Liao et al. 49 demonstrated that the solubility of MgCl 2 can increase dramatically provided the presence of Cl − acceptors in solution. While AlCl 3 seems appropriate (as demonstrated by reaction (c)), other Cl − ions acceptors can be introduced as "additives" (e.g. Mg(HMDS) 2 ) promoting large quantities of MgCl + in solution.
However, by using the Debye-Hückel corrected ∆E of reaction (c) we find that a significant concentration of charge carriers is still available in solution. For example using a typical concentration of 0.5 M for AlCl 3 , and assuming that the maximum activity of soluble MgCl 2 in THF is 7.8×10 −4 M (set by reaction (a)), we expect a concentration of MgCl + (3THF) in solution to be ∼ 0.092 M. Notably, for this concentration we could derive, using the Kohlrausch's law for weak electrolytes, an ionic conductivity of ∼ 1.96 mS cm −1 , which is in very good agreement with the experimental value measured by Doe et al. (∼ 2 mS cm −1 ) for a fully conditioned electrolyte. 18 See Supplementary Information for the full derivation of the ionic conductivity. The Al-Cl-Mg-THF phase diagram does not indicate the formation of stable AlCl − 4 · · · Mg x Cl y ionic couples, though some of these clusters might be accessible within small energy windows (0.064 − 0.088 eV) with further repercussions on electrolyte conductivity. In general, the small dielectric constant of THF (∼ 7.58) and glymes favor the formation of ionic couples, an indication that the next generation of solvents for Mg-ion batteries requires solvent with better screening properties.
Although we do not explicitly consider the Mgelectrode, from the reaction energy discussed in Table II we provide important considerations on the process of aging of the electrolyte. Figure 10 summarizes the processes of aging (a) and conditioning (b) of the MACC electrolyte. From the equilibrium between Mg-Cl-Al species in solutions and Mg/Al bulk metals, we demonstrate that AlCl − 4 ions in solutions are easily displaced during the initial stages of Mg deposition. In fact, Al deposition at the anode is ensured by a small Al reduction potential (∼ -1.67 V vs. NHE) compared to Mg (∼ -2.35 V vs. NHE) setting a thermodynamic driving force for the process of aging. Finally, further aluminum depletion from the solution upon electrolyte resting which impacts the amount of MgCl + in solution, could be one of the causes of aging of the MACC electrolyte. Additionally, parasitic polymerization reactions of the solvent have also been speculated 20 to be the source of electrolyte aging.
Under open circuit conditions (battery at rest), the reaction at the anode/electrolyte interface is largely controlled by the activity of MgCl + species available since reaction (c) dominates the composition of the electrolyte (see Table II). Reactions (d) and (e) favor the formation of Al deposition under open circuit, leading to AlCl − 4 (and MgCl + ) depletion form the solution, resulting in the aging of the electrolyte. However, when an aged electrolyte is subjected to charging, the presence of an applied potential drives Mg deposition on the anode, resulting in not only setting a concentration gradient of MgCl + (AlCl − 4 ) from the bulk towards the anode (cathode) but also a continuous regeneration of MgCl + in the solution. After aging, the electrolyte will require a few charge-discharge cycles before the composition in the solution is stabilized and the charged species (MgCl + and AlCl − 4 ) are abundantly present leading to smooth Mg deposition/stripping. Therefore, the state of con-ditioning in the electrolyte represents a transition between the Al-deposition regime (aging) and the Mg deposition/stripping regime during regular battery operation. Barile et al. 20 have estimated that about 100 electrochemical cycles are needed to condition the MACC electrolyte. This explains why low coulombic efficiencies of fresh MACC solutions have been attributed to Al deposition during the initial electrochemical cycles. SEM-EDS measurements of a Pt electrode that underwent Mg deposition during electrolyte conditioning showed large quantities of permanently deposited Al, 20 corroborating our modeling results. Barile et al. 20 suggested that the MACC electrolyte is conditioned when the Mg/Al molar ratio in solution is ∼ 2.6:1, from which they concluded that dimer species must be present in the electrolyte. However, our grandpotential phase diagrams (see Fig. 4 and Fig. 6) indicate that dimer species are unlikely to be present in the electrolyte at equilibrium, but only become accessible when drying or crystallizing the electrolyte. The Mg/Al ratio observed experimentally (∼ 2.6:1) for conditioned electrolytes can alternatively stem from the presence of agglomerates MgCl + · · · MgCl 2 (the only stable species in solution) instead of distinct dimer ions -MgCl + · · · MgCl 2 clusters have been isolated previously using ab initio MD on a similar electrolyte. 43

V. CONCLUSIONS
With the intention of elucidating the structural composition of the MACC electrolyte, we carried out ab initio calculations and classical molecular dynamics simulations on more than a hundred molecules and ions that could be structurally and functionally relevant for this electrolyte. We find that only MgCl + , MgCl 2 , AlCl − 4 and AlCl 3 are stable constituents of the electrolyte. The thermodynamic analysis of the MACC composition excludes the presence of multimeric Mg x Cl + y units such as dimer and trimer under equilibrium conditions. These species can be stabilized under conditions of solvent drying.
Equilibrium between the MACC species (i.e MgCl + MgCl 2 , AlCl − 4 and AlCl 3 ) in liquid THF and Mg and Al metals suggests that Al is easily displaced from the solution during early Mg deposition cycles. This effect reduces the electrolyte coulobmic efficiency providing an explanation for the process of aging. In general, Al deposition on Mg-metal is always favored and leads to the more complex issue of electrolyte aging. We explain conditioning as the process which promotes the stabilization of charged species (MgCl + and AlCl − 4 ) in solution due to a potential (chemical or applied), enabling Mg smooth deposition/stripping.
Computation of the NMR shifts of the relevant MACC species shows distinct 25 Mg and 35 Cl NMR signatures for monomer, dimer and MgCl 2 , concluding that in-situ NMR can clarify the composition of the MACC elec- trolyte as well as transformation of the MACC solution occurring during aging and conditioning of the electrolyte. Our analysis indicates that MgCl 2 is sparingly soluble in THF, but its solubility can be increased by introducing Cl − acceptors. Finally, the computational strategy adopted in this investigation is readily applicable in a high-throughput fashion to study other liquid media, specifically to progress the understanding of liquid electrolytes, and to screen for new electrolytes for the next generation of rechargeable batteries.