Fig. 7: Code.
From: Nearest centroid classification on a trapped ion quantum computer

An example of a jupyter notebook that runs the Quantum Nearest Centroid algorithm, as well as the scikit-learn Nearest Centroid algorithm, and prints and plots the results.