A Python library designed for the machine learning community to help users design quantum-driven similarity metrics for graphs and to use them inside kernel-based machine learning algorithms for graph data.ide the right environment to explore new ideas - both in terms of methodologies and data domain - while always interacting with a simple and intuitive QPU interface.
Project description
Quantum Evolution Kernel
The Quantum Evolution Kernel is a Python library designed for the machine learning community to help users design quantum-driven similarity metrics for graphs and to use them inside kernel-based machine learning algorithms for graph data.
The core of the library is focused on the development of a classification algorithm for molecular-graph dataset as it is presented in the published paper Quantum feature maps for graph machine learning on a neutral atom quantum processor(Journal Paper, arXiv).
Users setting their first steps into quantum computing will learn how to implement the core algorithm in a few simple steps and run it using the Pasqal Neutral Atom QPU. More experienced users will find this library to provide the right environment to explore new ideas - both in terms of methodologies and data domain - while always interacting with a simple and intuitive QPU interface.
Installation
Using hatch, uv or any pyproject-compatible Python manager
Edit file pyproject.toml to add the line
"quantum-evolution-kernel"
to the list of dependencies.
Using pip or pipx
To install the pipy package using pip or pipx
- Create a
venvif that's not done yet
$ python -m venv venv
- Enter the venv
$ . venv/bin/activate
- Install the package
$ pip install quantum-evolution-kernel
# or
$ pipx install quantum-evolution-kernel
QuickStart
# Load a dataset
import torch_geometric.datasets as pyg_dataset
og_ptcfm = pyg_dataset.TUDataset(root="dataset", name="PTC_FM")
# Setup a quantum feature extractor for this dataset.
# In this example, we'll use QutipExtractor, to emulate a Quantum Device on our machine.
import qek.data.graphs as qek_graphs
import qek.data.extractors as qek_extractors
extractor = qek_extractors.QutipExtractor(compiler=qek_graphs.PTCFMCompiler())
# Add the graphs, compile them and look at the results.
extractor.add_graphs(graphs=og_ptcfm)
extractor.compile()
processed_dataset = extractor.run().processed_data
# Prepare a machine learning pipeline with Scikit Learn.
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
X = [data for data in processed_dataset] # Features
y = [data.target for data in processed_dataset] # Targets
X_train, X_test, y_train, y_test = train_test_split(X, y, stratify = y, test_size=0.2, random_state=42)
# Train a kernel
from qek.kernel import QuantumEvolutionKernel as QEK
kernel = QEK(mu=0.5)
model = SVC(kernel=kernel, random_state=42)
model.fit(X_train, y_train)
Documentation
We have a two parts tutorial:
- Using a Quantum Device to extract machine-learning features;
- Machine Learning with the Quantum Evolution Kernel
See also the full API documentation.
Getting in touch
- Pasqal Community Portal (forums, chat, tutorials, examples, code library).
- GitHub Repository (source code, issue tracker).
- Professional Support (if you need tech support, custom licenses, a variant of this library optimized for your workload, your own QPU, remote access to a QPU, ...)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quantum_evolution_kernel-0.3.4.tar.gz.
File metadata
- Download URL: quantum_evolution_kernel-0.3.4.tar.gz
- Upload date:
- Size: 34.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be487745dbd755040e0bb552f620e324896375837affa82f990070095130e161
|
|
| MD5 |
c282a1b9c5b053ca622eb83f2d8adb3f
|
|
| BLAKE2b-256 |
627af4c77cbabecd63f9f572693b3dcc001a04f6949f79e1264527ea37cfbb64
|
Provenance
The following attestation bundles were made for quantum_evolution_kernel-0.3.4.tar.gz:
Publisher:
publish.yml on pasqal-io/quantum-evolution-kernel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quantum_evolution_kernel-0.3.4.tar.gz -
Subject digest:
be487745dbd755040e0bb552f620e324896375837affa82f990070095130e161 - Sigstore transparency entry: 473297458
- Sigstore integration time:
-
Permalink:
pasqal-io/quantum-evolution-kernel@79c5d81418d536bf35999294fc180664350bbd1b -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/pasqal-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@79c5d81418d536bf35999294fc180664350bbd1b -
Trigger Event:
release
-
Statement type:
File details
Details for the file quantum_evolution_kernel-0.3.4-py3-none-any.whl.
File metadata
- Download URL: quantum_evolution_kernel-0.3.4-py3-none-any.whl
- Upload date:
- Size: 35.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
076cc7062821349e9d6bb72ad37b9615b5cd906fa30eb6d7bada5a150892ce98
|
|
| MD5 |
c6529e47ae59273220f701c43dabaad6
|
|
| BLAKE2b-256 |
e66d93b0dae053abba2181b62750d6706d44af1bfb56fe1998b3896f84050f85
|
Provenance
The following attestation bundles were made for quantum_evolution_kernel-0.3.4-py3-none-any.whl:
Publisher:
publish.yml on pasqal-io/quantum-evolution-kernel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quantum_evolution_kernel-0.3.4-py3-none-any.whl -
Subject digest:
076cc7062821349e9d6bb72ad37b9615b5cd906fa30eb6d7bada5a150892ce98 - Sigstore transparency entry: 473297465
- Sigstore integration time:
-
Permalink:
pasqal-io/quantum-evolution-kernel@79c5d81418d536bf35999294fc180664350bbd1b -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/pasqal-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@79c5d81418d536bf35999294fc180664350bbd1b -
Trigger Event:
release
-
Statement type: