https://blog.tensorflow.org/2020/03/announcing-tensorflow-quantum-open.html

Quantum AI

https://4.bp.blogspot.com/-GUt0ejrXIjM/XmLl0mZvLhI/AAAAAAAACwk/Ww39mOqcoc87RGzvw5jW0xWArwckxSAmACLcBGAsYHQ/s1600/quantum%2Bmodel.png

March 09, 2020 —
*Posted by Alan Ho, Product Lead and Masoud Mohseni, Technical Lead, Google Research*

Cross posted with the Google AI blog.*“Nature isn’t classical, damnit, so if you want to make a simulation of nature, you’d better make it quantum mechanical.” -*Physicist Richard Feynman

Machine learning (ML), while it doesn’t exactly simulate systems in nature, has the ability to learn a model of a system and pred…

Announcing TensorFlow Quantum: An Open Source Library for Quantum Machine Learning

Cross posted with the Google AI blog.

Machine learning (ML), while it doesn’t exactly simulate systems in nature, has the ability to learn a model of a system and predict the system’s behavior. Over the past few years, classical ML models have shown promise in tackling challenging scientific issues, leading to advancements in image processing for cancer detection, forecasting earthquake aftershocks, predicting extreme weather patterns, and detecting new exoplanets. With the recent progress in the development of quantum computing, the development of new

Today, in collaboration with the University of Waterloo, X, and Volkswagen, we announce the release of TensorFlow Quantum (TFQ), an open-source library for the rapid prototyping of quantum ML models. TFQ provides the tools necessary for bringing the quantum computing and machine learning research communities together to control and model natural or artificial quantum systems; e.g. Noisy Intermediate Scale Quantum (NISQ) processors with ~50 - 100 qubits.

Under the hood, TFQ integrates Cirq with TensorFlow, and offers high-level abstractions for the design and implementation of both discriminative and generative quantum-classical models by providing quantum computing primitives compatible with existing TensorFlow APIs, along with high-performance quantum circuit simulators.

A technical, but key insight is that quantum data generated by NISQ processors are noisy and are typically entangled just before the measurement occurs. However, applying quantum machine learning to noisy entangled quantum data can maximize extraction of useful classical information. Inspired by these techniques, the TFQ library provides primitives for the development of models that disentangle and generalize correlations in quantum data, opening up opportunities to improve existing quantum algorithms or discover new quantum algorithms.

The second concept to introduce is

TFQ contains the basic structures, such as qubits, gates, circuits, and measurement operators that are required for specifying quantum computations. User-specified quantum computations can then be executed in simulation or on real hardware. Cirq also contains substantial machinery that helps users design efficient algorithms for NISQ machines, such as compilers and schedulers, and enables the implementation of hybrid quantum-classical algorithms to run on quantum circuit simulators, and eventually on quantum processors.

We’ve used TensorFlow Quantum for hybrid quantum-classical convolutional neural networks, machine learning for quantum control, layer-wise learning for quantum neural networks, quantum dynamics learning, generative modeling of mixed quantum states, and learning to learn with quantum neural networks via classical recurrent neural networks. We provide a review of these quantum applications in the TFQ white paper; each example can be run in-browser via Colab from our research repository.

To provide some intuition on how to use quantum data, one may consider an supervised classification of quantum states

**Prepare a quantum dataset**- Quantum data is loaded as tensors (a multi-dimensional array of numbers). Each quantum data tensor is specified as a quantum circuit written in Cirq that generates quantum data on the fly. The tensor is executed by TensorFlow on the quantum computer to generate a quantum dataset.

**Evaluate a quantum neural network model**- The researcher can prototype a quantum neural network using Cirq that they will later embed inside of a TensorFlow compute graph. Parameterized quantum models can be selected from several broad categories based on knowledge of the quantum data's structure. The goal of the model is to perform quantum processing in order to extract information hidden in a typically entangled state. In other words, the quantum model essentially disentangles the input quantum data, leaving the hidden information encoded in classical correlations, thus making it accessible to local measurements and classical post-processing.

**Sample or Average**- Measurement of quantum states extracts classical information in the form of samples from a classical random variable. The distribution of values from this random variable generally depends on the quantum state itself and on the measured observable. As many variational algorithms depend on mean values of measurements, also known as expectation values, TFQ provides methods for averaging over several runs involving steps (1) and (2).

**Evaluate a classical neural networks model**- Once classical information has been extracted, it is in a format amenable to further classical post-processing. As the extracted information may still be encoded in classical correlations between measured expectations, classical deep neural networks can be applied to distill such correlations.

**Evaluate Cost Function**- Given the results of classical post-processing, a cost function is evaluated. This could be based on how accurately the model performs the classification task if the quantum data was labeled, or other criteria if the task is unsupervised.

**Evaluate Gradients & Update Parameters**- After evaluating the cost function, the free parameters in the pipeline should be updated in a direction expected to decrease the cost. This is most commonly performed via gradient descent.

A high-level abstract overview of the computational steps involved in the end-to-end pipeline for inference and training of a hybrid quantum-classical discriminative model for quantum data in TFQ. To see the code for an end-to-end example, please check the “Hello Many-Worlds” example, the quantum convolutional neural networks tutorial, and our guide. |

Next post

Quantum AI

Announcing TensorFlow Quantum: An Open Source Library for Quantum Machine Learning

March 09, 2020
—
*Posted by Alan Ho, Product Lead and Masoud Mohseni, Technical Lead, Google Research*

Cross posted with the Google AI blog.*“Nature isn’t classical, damnit, so if you want to make a simulation of nature, you’d better make it quantum mechanical.” -*Physicist Richard Feynman

Machine learning (ML), while it doesn’t exactly simulate systems in nature, has the ability to learn a model of a system and pred…

Build, deploy, and experiment easily with TensorFlow