"The QSVM function needs a test dataset and a prediction dataset. Since for the test dataset only the accuracy is computed, and we need a plot of the results, we use the sub-image as a prediction dataset and keep only a small number of samples for the test dataset to lower the time overhead."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"X_test_0_indices = [i for i, y in enumerate(Y_test) if y == 0]\n",
"X_test_1_indices = [i for i, y in enumerate(Y_test) if y == 1]\n",
The QSVM function needs a test dataset and a prediction dataset. Since for the test dataset only the accuracy is computed, and we need a plot of the results, we use the sub-image as a prediction dataset and keep only a small number of samples for the test dataset to lower the time overhead.