Superiority of the Quantum Support Vector Machine
credit for the picture to Tim Hinchliffe

Superiority of the Quantum Support Vector Machine

Concepts behind Quantum Computing include those of parallel universes within a single multiverse. As David Deutsch said,

"Quantum computation is … nothing less than a distinctly new way of harnessing nature … It will be the first technology that allows useful tasks to be performed in collaboration between parallel universes, and then sharing the results."

In this short post, to satisfy your curiosity, I will give you a taste of this parallel universe superiority which the Quantum Support Vector Machine Algorithm (QSVM) could offer over the ordinary Support Vector Machine Algorithm (SVM).??QSVM is a quantum version of the classical SVM algorithm which utilizes laws of quantum mechanics to perform calculations.

QSVM can be used to classify a dataset into various classes. For example, let's examine this dataset.

No alt text provided for this image

The dataset has only 4 data points and essentially implements the XOR function. We did add "Label" column to translate "lbl" 1 and -1 values into familiar 0 and 1 XOR values. As we can see, data points 1 and 2 belong to class 1 (Label 1), while data points 0 and 3 are in class 0. This is a 2-dimensional dataset and there is no way to draw a line to separate 1 and 2 points from 0 and 3 points. We say the dataset is not linearly separable.

No alt text provided for this image

Let's assume now points 0 and 1 are our training points and 2 and 3 are testing points.

SVM

Classical SVM completely fails for testing points returning 0 accuracies for the testing set, no matter what kernel we use.

No alt text provided for this image

QSVM

Surprisingly, QSVM returns accuracy = 1 for the testing set!

To shed some light on this, we first prepare the Training and Testing Data and the Data Points in the format suitable for the QSVM algorithm.

No alt text provided for this image
No alt text provided for this image

Next, we import all necessary libraries and initialize quantum instance.

No alt text provided for this image

Then we train and test

No alt text provided for this image
No alt text provided for this image

resulting in 100% accuracy for the testing data.

No alt text provided for this image

Amazing, isn't it??

The above code was executed on the IBM quantum simulator (qasm_simulator), but the same 100% accuracy is returned on the real IBM quantum computer (ibmq_valencia).

No alt text provided for this image
No alt text provided for this image

Sources:


Samir Lipovaca

Quality Specialist II at Bank of America

3 年

Thank you Sir.

回复

要查看或添加评论,请登录

Samir Lipovaca的更多文章

社区洞察

其他会员也浏览了