  Recent breakthroughs in photonics-based quantum, neuromorphic and analogue
processing have pointed out the need for new schemes for fully programmable
nanophotonic devices. Universal optical elements based on interferometer meshes
are underpinning many of these new technologies, however this is achieved at
the cost of an overall footprint that is very large compared to the limited
chip real estate, restricting the scalability of this approach. Here, we
consider an ultracompact platform for low-loss programmable elements using the
complex transmission matrix of a multi-port multimode waveguide. We propose a
deep learning inverse network approach to design arbitrary transmission
matrices using patterns of weakly scattering perturbations. The demonstrated
technique allows control over both the intensity and phase in a multiport
device at a four orders reduced device footprint compared to conventional
technologies, thus opening the door for large-scale integrated universal
networks.
