  Quantum networks can enable various applications such as distributed quantum
computing, long-distance quantum communication, and network-based quantum
sensing with unprecedented performances. One of the most important building
blocks for a quantum network is a photonic quantum memory which serves as the
interface between the communication channel and the local functional unit. A
programmable quantum memory which can process a large stream of flying qubits
and fulfill the requirements of multiple core functions in a quantum network is
still to-be-realized. Here we report a high-performance quantum memory which
can simultaneously store 72 optical qubits carried by 144 spatially separated
atomic ensembles and support up to a thousand consecutive write or read
operations in a random access way, two orders of magnitude larger than the
previous record. Due to the built-in programmability, this quantum memory can
be adapted on-demand for several functions. As example applications, we realize
quantum queue, stack, and buffer which closely resemble the counterpart devices
for classical information processing. We further demonstrate the
synchronization and reshuffle of 4 entangled pairs of photonic pulses with
probabilistic arrival time and arbitrary release order via the memory, which is
an essential requirement for the realization of quantum repeaters and efficient
routing in quantum networks. Realization of this multi-purpose programmable
quantum memory thus constitutes a key enabling building block for future
large-scale fully-functional quantum networks.
