Controlled assembly of perovskite nanoparticles byphotoswitchable functional ligands