The Inherent States of Glassy Systems and Granular Media