Electrochemistry: Theoretical Foundations - Quantum and Statistical Mechanics, Thermodynamics, the Solid State