Collocated data processing and storage are the norm in biological computing systems such as the mammalian brain. As our ability to create better hardware improves, new computational paradigms are being explored beyond von Neumann architectures. Integrated photonic circuits are an attractive solution for on-chip computing which can leverage the increased speed and bandwidth potential of the optical domain, and importantly, remove the need for electro-optical conversions. Here we show that we can combine integrated optics with collocated data storage and processing to enable all-photonic in-memory computations. By employing nonvolatile photonic elements based on the phase-change material, Ge2Sb2Te5, we achieve direct scalar and matrix-vector multiplication, featuring a novel single-shot Write/Erase and a drift-free process. The output pulse, carrying the information of the light-matter interaction, is the result of the computation. Our all-optical approach is novel, easy to fabricate and operate, and sets the stage for development of entirely photonic computers.
Optically storing and addressing data on photonic chips is of particular interest as such capability would eliminate optoelectronic conversion losses in data centers. It would also enable on-chip non-von Neumann photonic computing by allowing multinary data storage with high fidelity. Here, we demonstrate such an optically addressed, multilevel memory capable of storing up to 34 nonvolatile reliable and repeatable levels (over 5 bits) using the phase change material integrated on a photonic waveguide. Crucially, we demonstrate for the first time, to the best of our knowledge, a technique that allows us to program the device with a single pulse regardless of the previous state of the material, providing an order of magnitude improvement over previous demonstrations in terms of both time and energy consumption. We also investigate the influence of write-and-erase pulse parameters on the single-pulse recrystallization, amorphization, and readout error in our multilevel memory, thus tailoring pulse properties for optimum performance. Our work represents a significant step in the development of photonic memories and their potential for novel integrated photonic applications.