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.
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.
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.
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.
Next, we import all necessary libraries and initialize quantum instance.
领英推荐
Then we train and test
resulting in 100% accuracy for the testing data.
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).
Sources:
Quality Specialist II at Bank of America
3 年Thank you Sir.