  Reconfigurable devices capable to implement any unitary operation with a
given fidelity are crucial for photonic universal quantum computation, optical
neural networks, and boson sampling. Here, we address the problems of
approximating with a given infidelity any unitary operation and any pure state
using multi-port interferometers, which are of current interest due to the
recent availability of multi-core fiber integrated multi-port interferometers.
We show that any pure state, in any dimension $d$, can be prepared with
infidelity $\le 10^{-15}$ with $3$~layers of $d$-dimensional Fourier transforms
and $3$~layers of configurable phase shifters. In contrast, the schemes in
[Phys. Rev. Lett. \textbf{73}, 58 (1994) and Optica \textbf{3}, 1460 (2016)],
require optical depth $2(d-1)$. We also present numerical evidence that
$d+1$~layers of $d$-dimensional Fourier transforms and $d+2$~layers of
configurable phase shifters can produce any unitary with infidelity $\le
10^{-14}$, while the scheme in [Phys. Rev. Lett. \textbf{124}, 010501 (2020)]
only achieves an infidelity in the order of $10^{-7}$ for block-diagonal
unitary transformations
