The project in a nutshell: You can plug any noisy measurement data into this neural network and it will learn an approximately conserved energy-like quantity, which enables the network to make predictions of real trajectories much more accurately than any conventional deep learning approach.

The concept of Hamiltonian Neural Networks has been introduced by Greydanus et al. as an exciting variant of a deep neural network that predicts the time derivatives of position and momentum coordinates from learned data. However, it doesn't do so directly, instead, it learns to find a scalar quantity similar to total energy and compute its gradient to then carry out a prediction. The authors apply this concept to many classical systems, like a spring pendulum or the two- or three-body problems.

Our initial idea sought to learn the total energy of a quantum system by adapting Greydanus et al.'s implementation, in particular to a spin (a two-level qubit) that is coupled to a magnetic field. Naturally, the qubit will want to align with the magnetic field, so consider both of them to point along the positive z-axis initially. In many applications (e.g. in Quantum Computing), one wants to rotate this state, say into the x-direction, where it will be more susceptible to measurements and thus easier to observe. To do so, one only needs to rotate the magnetic field and the qubit will follow suit, at the expense of a conversion error which becomes smaller the slower one rotates (see adiabatic theorem).

To train the neural network, we use noisy data obtained from a qubit simulation which we had previously implemented. Unfortunately, soon after first connecting our simulation with an adapted network, we had to realize that in this system, there is no pattern for the neural network to learn. Initially, it should want to 'optimize energy' along the z-direction, but in the end, we want it to optimize along x. Hence, we transformed into a co-rotating frame, where the qubit would always want to be aligned with the magnetic field, but unsurprisingly, there was not much to be learned in this system.

Instead, we had to think broader than the original problem and find a method to learn from input data even if the total energy is not approximately constant in the system. To do this, we considered up to 500 neural networks in parallel, each for one instantaneous moment in time, where the instantaneous energy eigenvalue of the Hamiltonian will be conserved. And this approach turned out to work really well; in fact, much better than anticipated.

In order to train 500 neural networks, we need a lot of data. Not just that, also should the data cover all the relevant positions in phase space so that the neural network can appropriately generalize. Hence, we optimized and parallelized the existing simulation and generated many different trajectories, each starting from a different initial state of the qubit. Slicing these trajectories into the individual time steps then gives the training and test data for the networks. And voila – the neural networks together were able to accurately predict a trajectory that closely matches the simulated path, and it even managed to exclude all noise that was intentionally included in the training data.

Don't hesitate to contact us for more information! Also check out the sister project Something from Nothing that was developed in parallel!

Built With

Share this project:

Updates