a, Schematic illustration of the three-dimensional device layout. b, Schematic illustration of the side view of the device, with the semiconducting multilayer MoS2 sandwiched between the GrT and GrB electrodes. Red and blue colours indicate electrons and holes, respectively. The silicon substrate can be used as a back-gate electrode with 300 nm SiO2 as the dielectric layer. c, Experimental current–voltage characteristic of the vertical device in the dark (blue) and under illumination (red) by a focused laser beam (wavelength, 514 nm; power, 80 µW; spot size, 1 µm).