  In this work, we generalize the Balasubramanian-Bax-Franklin-Glynn (BB/FG)
permanent formula to account for row multiplicities during the permanent
evaluation and reduce the complexity of permanent evaluation in scenarios where
such multiplicities occur. This is achieved by incorporating n-ary Gray code
ordering of the addends during the evaluation. We implemented the designed
algorithm on FPGA-based data-flow engines and utilized the developed accessory
to speed up boson sampling simulations up to $40$ photons, by drawing samples
from a $60$ mode interferometer at an averaged rate of $\sim80$ seconds per
sample utilizing $4$ FPGA chips. We also show that the performance of our BS
simulator is in line with the theoretical estimation of Clifford \& Clifford
\cite{clifford2020faster} providing a way to define a single parameter to
characterize the performance of the BS simulator in a portable way. The
developed design can be used to simulate both ideal and lossy boson sampling
experiments.
