  Programmable photonic circuits of reconfigurable interferometers can be used
to implement arbitrary operations on optical modes, facilitating a flexible
platform for accelerating tasks in quantum simulation, signal processing, and
artificial intelligence. A major obstacle to scaling up these systems is static
fabrication error, where small component errors within each device accrue to
produce significant errors within the circuit computation. Mitigating this
error usually requires numerical optimization dependent on real-time feedback
from the circuit, which can greatly limit the scalability of the hardware. Here
we present a deterministic approach to correcting circuit errors by locally
correcting hardware errors within individual optical gates. We apply our
approach to simulations of large scale optical neural networks and infinite
impulse response filters implemented in programmable photonics, finding that
they remain resilient to component error well beyond modern day process
tolerances. Our results highlight a new avenue for scaling up programmable
photonics to hundreds of modes within current day fabrication processes.
