  Miniaturized spectrometers are of immense interest for various on-chip and
implantable photonic and optoelectronic applications. State-of-the-art
conventional spectrometer designs rely heavily on bulky dispersive components
(such as gratings, photodetector arrays, and interferometric optics) to capture
different input spectral components that increase their integration complexity.
Here, we report a high-performance broadband spectrometer based on a simple and
compact van der Waals heterostructure diode, leveraging a careful selection of
active van der Waals materials -- molybdenum disulfide and black phosphorus,
their electrically tunable photoresponse, and advanced computational algorithms
for spectral reconstruction. We achieve remarkably high peak wavelength
accuracy of ~2 nanometers, and broad operation bandwidth spanning from ~500 to
1600 nanometers in a device with a ~30x20 {\mu}m2 footprint. This diode-based
spectrometer scheme with broadband operation offers an attractive pathway for
various applications, such as sensing, surveillance and spectral imaging.
