  Residue number system (RNS) enables dimensionality reduction of an arithmetic
problem by representing a large number as a set of smaller integers, where the
number is decomposed by prime number factorization using the moduli as basic
functions. These reduced problem sets can then be processed independently and
in parallel, thus improving computational efficiency and speed. Here we show an
optical RNS hardware representation based on integrated nanophotonics. The
digit-wise shifting in RNS arithmetic is expressed as spatial routing of an
optical signal in 2x2 hybrid photonic-plasmonic switches. Here the residue is
represented by spatially shifting the input waveguides relative to the routers
outputs, where the moduli are represented by the number of waveguides. By
cascading the photonic 2x2 switches, we design a photonic RNS adder and a
multiplier forming an all-to-all sparse directional network. The advantage of
this photonic arithmetic processor is the short (10's ps) computational
execution time given by the optical propagation delay through the integrated
nanophotonic router. Furthermore, we show how photonic processing
in-the-network leverages the natural parallelism of optics such as
wavelength-division-multiplexing or optical angular momentum in this RNS
processor. A key application for photonic RNS is the functional analysis
convolution with widespread usage in numerical linear algebra, computer vision,
language- image- and signal processing, and neural networks.
