Linear optical systems acting on photon number states produce many interesting evolutions, but cannot give all the allowed quantum operations on the input state. Using Toponogov’s theorem from differential geometry, we propose an iterative method that, for any arbitrary quantum operator U acting on n photons in m modes, returns an operator $$\widetilde{U}$$
U
~
which can be implemented with linear optics. The approximation method is locally optimal and converges. The resulting operator $$\widetilde{U}$$
U
~
can be translated into an experimental optical setup using previous results.