@@ -42,7 +42,40 @@ $ pip install quantum-evolution-kernel
4242$ pipx install quantum-evolution-kernel
4343```
4444
45- ## Usage
45+ ## QuickStart
46+
47+ ``` python
48+ # Load a dataset
49+ import torch_geometric.datasets as pyg_dataset
50+ og_ptcfm = pyg_dataset.TUDataset(root = " dataset" , name = " PTC_FM" )
51+
52+ # Setup a quantum feature extractor for this dataset.
53+ # In this example, we'll use QutipExtractor, to emulate a Quantum Device on our machine.
54+ import qek.data.graphs as qek_graphs
55+ import qek.data.extractors as qek_extractors
56+ extractor = qek_extractors.QutipExtractor(compiler = qek_graphs.PTCFMCompiler())
57+
58+ # Add the graphs, compile them and look at the results.
59+ extractor.add_graphs(graphs = og_ptcfm)
60+ extractor.compile()
61+ processed_dataset = extractor.run().processed_data
62+
63+ # Prepare a machine learning pipeline with Scikit Learn.
64+ from sklearn.model_selection import train_test_split
65+ from sklearn.svm import SVC
66+
67+ X = [data for data in processed_dataset] # Features
68+ y = [data.target for data in processed_dataset] # Targets
69+ X_train, X_test, y_train, y_test = train_test_split(X, y, stratify = y, test_size = 0.2 , random_state = 42 )
70+
71+ # Train a kernel
72+ from qek.kernel import QuantumEvolutionKernel as QEK
73+ kernel = QEK(mu = 0.5 )
74+ model = SVC(kernel = kernel, random_state = 42 )
75+ model.fit(X_train, y_train)
76+ ```
77+
78+ ## Documentation
4679
4780We have a two parts tutorial:
4881
0 commit comments