statistical mechanics and magnetism