Controlled on-chip fabrication of large-scale perovskite single crystal arrays for high-performance laser and photodetector integration