# How to interpret photon number 'gates' in quantum circuit?

Peng et. al. Describe a circuit for entanglement cloning (i.e. entanglement broadcasting) which on its own looks fairly straightforward:

Confusingly however, the gates $$U_1$$ and $$U_2$$ are not logical gates per sey. Rather, they act on the creation operators for their respective modes. In the supplimentary material for the paper, U is defined in the following way:

Apparently, Peng has a way to find the resulting state post-selected on the condition that all modes have exactly one photon:

Obviously I'm not asking anyone to do the math and show why this is true. What I am asking is how one would go about doing this? I've never seen a quantum circuit that has these kinds of "gates" thrown in like this before. Is there any way to systematically unpack this circuit into something that qiskit would be able to handle?

However, as long as you stick with linear operations, meaning in this context operations that preserve the total number of bosons, things can be again represented as just matrices applied to vectors. So, for example, the $$U_i$$ operations you seem to be defining here can be understood as just standard beamsplitter operations with elements $$\begin{pmatrix}\sqrt{1-R} & i\sqrt R \\ i\sqrt R & \sqrt{1-R}\end{pmatrix},$$ wrt the appropriate basis. Of course, the major catch is that this is only true when these operations are applied to input single bosons. The moment you inject, say, one boson in each input mode of the operation, this naive matrix description fails, and you get e.g. HOM-like effects.
You can still describe each operation in a linear optical context as a matrix in the above sense, even when more bosons are used, but you'll have to be more careful about the associated matrix representation. For example, the action of an $$n$$-mode unitary $$U$$ acting on $$k$$-boson input states will correspond to a matrix $$\varphi_k(U)$$ of dimension $$\binom{n+k-1}{k}$$, whose elements correspond, modulo factors, to permanents of $$k\times k$$ submatrices of the "standard" matrix representation of $$U$$. Though explaining how this works precisely might be a bit OT here.