July 3, 2018

New machine learning and quantum chemistry apps for Strawberry Fields

By Josh Izaac

Introducing OpenFermion support and the Quantum Machine Learning Toolbox (QMLT)

Since our last update, we have been hard at work improving Strawberry Fields, our photonics-based quantum software platform; this includes new features for decomposing optical circuits into the continuous-variable gate set. It has also been great to see the burgeoning community growing around Strawberry Fields, creating content ranging from tutorials that help us understand Bell correlations in continuous-variable (CV) systems to quantum battleship games. We are also incorporating feedback we have received from users — come say hi on our Slack channel if you haven’t already!

Behind the scenes, Strawberry Fields is an integral part of our research workflow. Our latest paper, Continuous-variable quantum neural networks, uses Strawberry Fields to demonstrate a new architecture for quantum neural networks — including a neat example where a quantum neural network is trained to generate Tetris blocks, or “Tetrominos”.

The potential applications of quantum computing are huge, and our goal with Strawberry Fields is to make them as accessible as possible — whether you are a quantum physicist, chemist, machine learning scientist, or just having a bit of fun. To that end, we are delighted to introduce two new applications that build on the Strawberry Fields platform: SFOpenBoson and the Quantum Machine Learning Toolbox (QMLT).

OpenFermion and SFOpenBoson

The quantum simulation of photons and other bosons is a natural fit for Strawberry Fields and the photonic hardware we are developing at Xanadu. We are thrilled to announce that this is now even more accessible — we have joined forces with the Google Quantum A.I. research team to introduce bosonic systems to OpenFermion, the collaborative open-source chemistry package for quantum computers.

Not only that, but bosonic systems constructed in OpenFermion can be simulated in Strawberry Fields via our new SFOpenBoson plugin — no prior knowledge of quantum circuits or decompositions required! We handle that for you behind the scenes, and allow you to view which quantum gates were applied.

For example, quantum simulation of the Bose-Hubbard model can be done in as little as 6 lines of code:

Bose-Hubbard simulation performed in Strawberry Fields, using a Hamiltonian defined in OpenFermion.

OpenFermion is the definitive quantum chemistry library for quantum computation, and we are excited to be part of a collaboration that includes companies on the forefront of quantum computing, such as Google, D-Wave, and Rigetti.

“Many important physical phenomena in electronic structure arise due to interactions between bosons (e.g., photons, phonons) and fermions (e.g., electrons).” says Ryan Babbush, the lead researcher of OpenFermion at Google Quantum A.I.

“The introduction of tools for representing bosonic systems adds important new functionality to OpenFermion, and meaningfully extends the scope of the library.”

Have a read of the Strawberry Fields section in the OpenFermion paper, and check out our SFOpenBoson documentation and tutorials to see how you can use OpenFermion in conjunction with Strawberry Fields.

Quantum Machine Learning Toolbox

Quantum machine learning is a rapidly advancing area, with applications stretching across multiple disciplines. We believe everyone — no matter your machine learning prowess — can take advantage of this functionality in Strawberry Fields. To help lessen the learning curve, we are delighted to introduce the Quantum Machine Learning Toolbox (QMLT) — a Strawberry Fields application that enhances the core machine learning functionality with useful tools, functions, and abilities.

The toolbox supports a number of things that make your life easier:

  • Easily set up optimization, supervised, and unsupervised learning tasks
  • Run and score trained circuits, predict new inputs, and compute the accuracy on a training set
  • Use different optimizers, including numerical and automatic methods
  • Visualize and log the cost function and parameters during training (see image)
  • Include regularization
  • Do a warm start with pretrained models.

The QMLT integrates with Strawberry Fields and quantum circuits, making complicated machine learning exercises simple to define and run. The built-in numerical learner even opens up all three SF simulator backends for machine learning, with built-in live plots so you can track your optimization progress in real time.

Live plotting interface of the QMLT numerical learner

The Quantum Machine Learning Toolbox is available right now at our GitHubrepository, with online documentation available here. Check out the docs for examples covering optimization, supervised, and unsupervised learning. You can get started by reading our introduction to quantum variational circuits, then have a go working through some of the curated machine learning and optimization tutorials.

We hope you enjoy using these new tools and applications; if you do any cool projects or research, reach out to us and we’ll post them in the Strawberry Fields gallery. We have more exciting things in the works for Strawberry Fields — stay tuned!