Heterodimensional contacts and optical detectors