where z is the valency. z = 1 and z = 2 for Li and Mg, respectively. The open-circuit voltage for the above reaction is the Gibbs free energy (G(x)) which is defined as G(x) = ∆E + P ∆V -T ∆S. Here, ∆E is the internal energy change (computing from the DFT simulations at T= 0K), P is the pressure, ∆V is the volume change, T indicates the temperature and ∆S represents the entropy change of the system. We can neglect P ∆V and T ∆S terms, since those quantities are approximately equal to 10 -5 eV and 25 meV, respectively . As a result, voltage can be determined calculating G(x) using the total energy (E) of Ti 2 CSTA x1 , Ti 2 CSTA x2 , and A atoms, as shown in Eq.7.