Articles on Quantum Computing

A first look at D-wave’s Leap 2 Application suite: Quantum Machine Learning

February 27, 2020

D-wave just launched their new Quantum Computing application suite and opened to users with free application or Quantum run-time meaning that anyone can literally get exposure on their Quantum Computing platform. here we take a first look at the suite.

For the first instalment we’ll highlight some of the demo’s that are included for using on D-wave. The point of these demo’s is to illustrate how the hardware and software is working and enable users to see the underlying principles. Included are two initial demos: Factoring and Social Network Analysis.

D-wave have made it super easy to run these examples right out of the box. You don’t need to do anything other then click a couple of buttons to run your first demo on real Quantum Hardware. It’s as easy as that. The documentation around these demo’s explains in words how the algorithms are working (and we suspect intentionally) without a single formula or piece of code. Of course you can get access to the raw code in another section of the dashboard.

Lets now look at some of the other features in the dashboard: code examples. This is for people who are more comfortable with code, and there are 16 examples one of which is Factorization example but there are some examples such as Sudoku. We will take a quick look at loading the python code into the IDE. You can do everything you need to do within a browser including running the python scripts to solve the clustering problem and display the results.

The D-wave Leap 2 IDE illustrating the ability to code in python within the browser and run on a QPU. In this example showing python clustering code. Note the problem inspector which shows the created configuration of Qubits.

Delving deeper into clustering

If you want to learn about some of the differences between gate based systems and D-wave systems you can follow a basic article we published on the differences here (for example IBM vs D-wave).

One of the important ‘things’ we must tell the QA (Quantum Annealer) is what our constraints are. We can list these below:

  • Each data point can only be a part of one cluster
  • Data points that are close together should be a part of the same cluster
  • Data points that are far apart should be in different clusters

We can then go about the business of building some of the rules such as computing the distance metrics between points and how we label. The point of the code is to be able to cluster N points into k clusters. The exercise defines the clusters as being 3, {red, green, blue} and each qubit can only be specified in terms of whether it is in one (and only one) of those clusters.

The QA with the appropriate constraints and rules can then perform an energy minimisation to find the lowest energy states. For example if we specify the energy relations using BQM (Binary Quadratic Model), points which are closer have a lower energy. We can also impact points which are far away but with a different cluster and use energy to penalise their positions.

You can go ahead and run the clustering example, it works right out of the box and you can try and play with some of the parameters.

Summary of Leap 2

This aimed to be a quick introduction to the new Leap 2 platform from D-wave that also provided a quick summary of one common ML (Machine Learning) algorithms (clustering). For reference to the classical ML algorithms look at k-means for K-NN for examples that work classically.

Leap 2 is going to be a crucial set of tools for experienced and novice Quantum developers alike and represents a great suite of learning and development tools. Its been seamless and straightforward to use with its pure demos (to dive right in) and it’s numerous examples with code showing how problems can be structured to work on a Quantum Annealer.