The electronic structure of lithium pyrophosphates (Li4P2O7) and sodium(Na4P2O7) was calculated by the density functional theory method. The calculations were performed for ordered (crystalline) and disordered (corresponding to glassy) structural states of lithium and sodium pyrophosphates. The disordering of the structure is simulated by ab initio molecular dynamics from crystal state with the same atomic basis as used for ideal crystal electronic calculations.