design below would need to be modified to something less simple, e.g. accepting probabilistic gates in the spirit of the KLM scheme [@klm], or using measurement-based cluster state quantum computation approaches [@silicon].

Before describing the module we make the simplifying restriction that there is one input qubit to the neuron and one dummy input. We will ensure that the designated output qubit can be fed into another neuron, as in FIG. \[fig:onn\] and FIG. \[fig:ocircuit\].

![\[fig:onn\] The first neuron takes one input and one dummy input and its designated output is fed into the next neuron.](neural_net.png){height="2cm"}

![\[fig:ocircuit\] A circuit diagram of our neural module. Following C-A-K there are three qubits, with basis $\ket{0/1}\ket{H/V}\ket{0/1}$, where $H/V$ label different polarisation states, and the other bits label the four spatial modes. We define the input to the module to be carried by the middle (polarisation) qubit. The neuron $U_1$ has the form of Eq. \[eq:u\_nrestr\], modifying the output conditional on the input state. The swaps ensure that the next neuron module $U_2$ also gets the input via the polarisation.](circuit.png){width="\linewidth"}

![image](optics_circuit.png){width="\linewidth"}

We propose to update the neural network by adjusting both variable polarisation rotators, and spatial phase shifters in a set of Mach-Zehnder interferometers 