final layer is then removed, revealing the second last layer, which should enclose the compressed data. The number of neurons in a given hidden layer for a classical neuron will not exceed $j_{max}$. Once the network is trained, the removal of the post-bottleneck layer(s) will yield a second last layer of fewer neurons, achieving dimensional reduction [@Azoff94].

### Quantum autoencoder {#quantum-autoencoder .unnumbered}

We now generalise the classical autoencoder as shown in FIG. \[fig:cl\_autoencoder\] to the quantum case. We generalise the neurons labelled 1, 2 and 3 in FIG. \[fig:cl\_autoencoder\] into unitary matrices $U_{1}$, $U_{2}$ and $U_{3}$, respectively, with the addition of a ‘fan-out’ gate, $U_{F}$, as motivated in the previous sections. The result is shown in FIG. \[fig:quantum\_autoencoder\] as a quantum circuit model. (We follow the classical convention that this neural network is drawn with the input neurons as well, but they are identity operators which let the inputs through regardless, and can be ignored in the simulation of the network.) The input state of interest $\ket{in_{12}}$ is on 2 qubits, each fed into a different neuron, generalising the classical autoencoder in FIG. \[fig:cl\_autoencoder\]. From each of these neurons, one output qubit each is led into the bottleneck neuron $U_1$, 