  It is known that computing the permanent of the matrix $1+A$, where $A$ is a
finite-rank matrix, requires a number of operations polynomial in the matrix
size. Motivated by the boson-sampling proposal of restricted quantum
computation, I extend this result to a generalization of the matrix permanent:
an expectation value in a product of a large number of identical bosonic states
with a bounded number of bosons. This result complements earlier studies on the
computational complexity in boson sampling and related setups. The proposed
technique based on the Gaussian averaging is equally applicable to bosonic and
fermionic systems. This also allows us to improve an earlier polynomial
complexity estimate for the fermionic version of the same problem.
