zero as is to be expected, but the training rather results in an approximately compressing unitary. FIG. \[fig:quantum\_autoencoder\] shows the network learning to compress in the case of two possible inputs: $(\ket{00} +\ket{11})/\sqrt{2}$ and $(\ket{00} -
\ket{11})/\sqrt{2}$. One can force the compressed output to be diagonal in a particular basis by adding an extra term to the cost-function (e.g. desiring the expectation value of Pauli X and Y to be zero in the case of a single qubit will push the network to give an output diagonal in the Z-basis).

Example: Neural network discovers teleportation protocol {#example-neural-network-discovers-teleportation-protocol .unnumbered}
--------------------------------------------------------

![\[fig:teleport\_circuit\]A circuit diagram of a quantum neural network that can learn and carry out teleportation of the state $\ket{\psi}$ from Alice to Bob using quantum entanglement. The standard teleportation protocol allows only classical communication of 2 bits [@NielsenChuang00]; this is enforced by only allowing two connections, which are dephased in the Z-basis ($D$). $U_{1}, U_{2}$ and $U_{3}$ are unitaries,. The blue line is the boundary between Alice and Bob.](teleportation_fixed.png){height="3.6cm"}

With quantum neural networks already shown to be able to perform generalisations of classical tasks, we now consider the possibility of quantum networks discovering solutions to existing and potentially undiscovered quantum protocols. 