The past decade has seen a hectic development in the field of machine learning (ML), with applications touching every sector from healthcare and energy grids to manufacturing and autonomous driving. ML represents a major change in the way we devise algorithms: instead of hard-coding a specific set of rules, only the high-level structure of the solution needs to be defined while the rest is obtained by learning the underlying patterns in data. This approach allowed the development of powerful algorithms with a compact representation in memory for certain types of problems.

At the same time with the rapid development of the ability to control quantum systems, the need to simulate or validate experiments with more particles has increased. But the size of the Hilbert space, and thus the memory and runtime cost of computations, increases exponentially with the number of particles. To avoid this unmanageable cost several methods have been engineered, for example, semiclassical or phase space representations, which eschew encoding part or all of the entanglement in the system or plaquette states, which truncate it to some finite-range, or product states, a method that is extremely effective in 1D, but not in higher dimensions.

Credit: Filippo Vicentini

A new approach has emerged bridging the gap between quantum physics and ML. The central idea is to encode the quantum state into a compact function approximator that can capture the underlying structure: neural networks. Their strength comes from their ability to capture long range correlations in arbitrary dimensions with few parameters, and from their flexibility, as it is relatively easy to enforce symmetries or constraints of the Hilbert space within the approximation itself. This dense representation is then complemented by Monte Carlo sampling of the configuration space in order to address the exponential blow-up of both memory and runtime.

The field is still young, and new applications are being proposed continuously. However, the most promising results so far, beating traditional algorithms, have been obtained on the variational search of the ground- or steady-state, and quantum state tomography. In the former, the variational parameters of a neural quantum state are optimized by minimizing the energy defined by a Hamiltonian until the minimum value, corresponding to the ground state, is obtained. In the latter, the unknown state of a quantum system, such as that of a quantum simulator, is reconstructed starting from a set of experimental measurements in a similar spirit to unsupervised learning.

Although the algorithms are conceptually simple, writing efficient kernels for networks, samplers and quantum operators requires a very diverse skillset. For this reason, we developed NetKet, an open source Python toolbox providing an easy-to-use interface for the techniques described above without the need to delve into the details of the implementation. NetKet follows a simple mental model, where the users can separately define their system by specifying its spatial structure and Hamiltonian, the variational quantum state, the sampler and the optimiser. Several common neural networks are already included and ready to use, but defining custom ones using Google’s Jax and NumPy-like operations is encouraged. Lastly, predefined optimization drivers can be used to easily put everything together and determine, for example, the ground state, but it is also possible to write a customized optimization loop.

Even though it is now easy to apply ML techniques to real problems using software such as NetKet, many open questions remain. More reliable optimization strategies, improved second order methods, and the precise relationship between network depth and representation power are all issues that we hope will be addressed in the coming years.