This repository implements the K-means clustering algorithm using quantum state encoding for classical data points, and encode it to Quntum .
Generates a NumPy array of random data with one column < Ket>
Returns a NumPy array representing the ground state (|0> state).
Randomly initializes k centroids from the data points.
Encodes classical data points into quantum states using an RXGate.
Computes the centroid memberships for every encoded data point.
Returns the new centroids by computing the means of the data points assigned to each centroid.
Performs K-means clustering on classical data points using quantum state encoding.
1-Generate Random Data
2-python
3-from qiskit.circuit.library import XGate
4-import numpy as np
pip install qiskit for gates You can install the required libraries using pip: pip install qiskit matplotlib