Machine learning provides a shortcut to simulate interactions in materials for solar energy harvesting