A gradient-based optimization framework is developed to tune the material properties of granular crystals and design them for desired wave-based computational functionalities.