Quantum chemical analysis of the structures of MgSO4 hydrates