Fig. 6

Diagrams showing the structure of the proposed quantum optical neuron module: a the basic structure of inputs and outputs, b a more detailed circuit diagram, and c the structure of the experimental implementation. a Simplifying restriction: the first neuron takes one input and one dummy input and its designated output is fed into the next neuron. b A circuit diagram of the neural module. Following C–A–K there are 3 qubits, with basis \(\left| {0{\rm{/}}1} \right\rangle \left| {H{\rm{/}}V} \right\rangle \left| {0{\rm{/}}1} \right\rangle\), 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. (6), 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. c The optics circuit of the neuron module. There are four spatial modes labelled \(\left| {00} \right\rangle ,\left| {01} \right\rangle ,\left| {10} \right\rangle\) and \(\left| {11} \right\rangle\). Initially only \(\left| {00} \right\rangle\) and \(\left| {10} \right\rangle\) have non-zero amplitudes and the second spatial qubit is not manipulated. The polarisation of the single photon is also manipulated. The two beamsplitters in bold at points A and D are variable (and can be replaced by Mach–Zehnder interferometers with variable phase). B and E are variable phase shifters and C shows a variable polarisation shifter. G and F are the two spatial modes available before a splitting occurs at H via a polarising beamsplitter, where the (fixed) polarisation rotator implements SWAP1. The beamsplitters with extra inputs at I allow for an additional spatial qubit to be manipulated, with J, K and L representing the components required for a SWAP gate. Before entering the second unitary, the second level splitting modes are brought close