TensorFlow Quantum Simulations Reveal Advantages in Quantum Machine Learning

TensorFlow Quantum Simulations Reveal Advantages in Quantum Machine Learning

By Hsin-Yuan Huang, Google/California Institute of Technology; Michael Broughton, Google; Jarrod R. McClean, Google; Masoud Mohseni, Google

Machine learning is a data-driven science. Both big data research and industrial machine learning rely on large and high-quality data sources, and more data is often better. Machine learning algorithms, which depend on training data, exhibit superior performance in many aspects compared to traditional algorithms, such as image recognition, understanding human language, and even tasks previously dominated by quantum computers (e.g., predicting the properties of new molecules in drug development, designing better catalysts, batteries, or OLEDs). Without data, the advantages of these machine learning algorithms over traditional algorithms vanish.

  • More is betterhttps://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35179.pdf

Current machine learning models are designed for classical computers, while quantum computers require the implementation of higher-performing quantum machine learning algorithms, especially when modeling quantum mechanical systems such as molecules, catalysts, or high-temperature superconductors. The quantum world is filled with countless states that evolve and interfere with each other. Classical computers often struggle with such tasks, and it is expected that quantum computers are better suited for machine learning problems with quantum characteristics. There is also hope that this quantum advantage (the advantage of using quantum computers over classical computers) can extend to traditional machine learning problems in areas such as computer vision or natural language processing.

  • Quantum machine learning algorithmshttps://www.nature.com/articles/nature23474

  • Quantum advantagehttps://www.nature.com/articles/s41586-019-1666-5

TensorFlow Quantum Simulations Reveal Advantages in Quantum Machine Learning

For some problems that are difficult to solve due to lack of data, traditional computers can collect data from reality (e.g., physical experiments) and learn based on that data. However, quantum computers can solve a broader range of problems. If we envision using quantum computers to simulate reality, then the data collected from reality does not provide any further computational advantage.

To understand the advantages of quantum computers in machine learning problems, we consider the following key questions:

  1. If the data has quantum characteristics (e.g., from experiments in developing new materials), does the quantum model consistently outperform traditional models in prediction?
  2. When modeling a given dataset with traditional or quantum features, can we evaluate quantum computers to determine when they have advantages?
  3. Is it possible to find or construct datasets in quantum models that are more advantageous than those in traditional models?

In a recent paper, we developed a mathematical framework to compare quantum models and traditional models (including neural networks, tree-based models, etc.) to explore the potential advantages of quantum modeling in making accurate predictions. This framework is applicable whether the data comes from traditional domains (MNIST, product reviews, etc.) or from quantum experiments (chemical reactions, quantum sensors, etc.).

  • Recent paperhttps://arxiv.org/abs/2011.01938

Traditional views may suggest that data from quantum experiments is difficult to reproduce using classical methods, thus providing a potential quantum advantage when using such data. However, we have confirmed that this is not always the case. With sufficient data, any function can be learned, which may not be surprising to machine learning experts. It turns out that this also applies to learning functions with quantum characteristics. By collecting data from real physical experiments (e.g., developing new catalysts, superconductors, or drugs), traditional machine learning models can achieve a certain level of generalization beyond the training set. This allows data-driven traditional (machine learning) algorithms to solve problems that traditional algorithms, which are not based on data training, struggle to address (our paper rigorously argues this point).

We provide a quantitative method to determine the sample size needed for accurate predictions on datasets with quantum characteristics. Perhaps surprisingly, sometimes there is little difference in the sample size required between traditional models and quantum models. This method also offers a constructive way to help generate datasets that are difficult for certain traditional models to learn.

TensorFlow Quantum Simulations Reveal Advantages in Quantum Machine Learning

The above figure demonstrates the empirically validated predictive advantages of using quantum models compared to the best models among a range of common traditional models at different training data volumes (N). The mapping quantum kernel function we introduced shows significant advantages over the best-tested traditional machine learning.

We continue to test the datasets generated using this framework (models), where all traditional machine learning methods fail, but quantum methods do not. The above figure provides an example of such a dataset. These studies have been empirically validated in the largest gate-based quantum machine learning simulations to date, implemented using TensorFlow Quantum, an open-source library for quantum machine learning. To perform this work on larger-scale quantum systems requires extremely high computational power. Quantum circuit simulations written using TensorFlow and TensorFlow Quantum (approximately 300 TeraFLOP/second) combined with analytical code (approximately 800 TeraFLOP/second) can easily achieve throughput of up to 1.1 PetaFLOP/second, a performance level that is quite rare in the intersection of quantum computing and machine learning (though this has precedent for traditional machine learning that has already reached exaflop performance levels).

When preparing distributed workloads for quantum machine learning research in TensorFlow Quantum, the underlying setup and architecture should be very similar to conventional TensorFlow. One way to handle distributed computing in TensorFlow is to use the tf.distribute module, which allows users to configure device layouts and machine configurations under multi-machine workloads. In this work, we used tf.distribute to distribute workloads across approximately 30 Google Cloud computers (some with GPUs) managed by Kubernetes. The main phases of development included:

  1. Developing a single-node functional prototype using TensorFlow and TensorFlow Quantum.
  2. Making minimal code changes to use MultiWorkerMirroredStrategy in a manually configured dual-node environment.
  3. Creating a Docker image using the functional code from step 2 and uploading it to Google Container Registry.
  4. Using Google Kubernetes Engine, launching a Job following the ecosystem template provided here.

  • tf.distributehttps://tensorflow.google.cn/guide/distributed_training
  • MultiWorkerMirroredStrategyhttps://tensorflow.google.cn/guide/distributed_training

  • Google Container Registryhttps://cloud.google.com/container-registry

  • Google Kubernetes Enginehttps://cloud.google.com/kubernetes-engine

  • Herehttps://github.com/tensorflow/ecosystem/tree/master/kubernetes

The tutorials provided by TensorFlow Quantum demonstrate a variant of Step 1, where you can create (simulated) datasets that traditional neural networks cannot use.

  • Step 1https://tensorflow.google.cn/quantum/tutorials/quantum_data

In Conclusion

We hope that the framework and tools outlined in this article can help the TensorFlow community explore the prototype datasets required for quantum computers to make accurate predictions.

If you want to start researching quantum machine learning, please refer to the beginner tutorials provided on the TensorFlow Quantum website. If you are a quantum machine learning researcher, you can read the paper we wrote discussing the importance of data in quantum machine learning for more details.

  • TensorFlow Quantum websitehttps://tensorflow.google.cn/quantum

  • Paper discussing the importance of data in quantum machine learninghttps://arxiv.org/abs/2011.01938

We look forward to seeing what other types of large quantum machine learning experiments the community can conduct using TensorFlow Quantum. The more people engage in research, the sooner the potential capabilities of quantum computers in machine learning can be realized.

— Recommended Reading —

TensorFlow Quantum Simulations Reveal Advantages in Quantum Machine Learning

TensorFlow Quantum Simulations Reveal Advantages in Quantum Machine Learning

TensorFlow Quantum Simulations Reveal Advantages in Quantum Machine Learning

For more information, please click “Read the original” to visit the official website.

TensorFlow Quantum Simulations Reveal Advantages in Quantum Machine Learning

Share 💬 Like 👍 Follow ❤️

Support quality content with a “three-in-one” action!

Leave a Comment