Programmable and reconfigurable photonic simulator for classical XY models | Synapse