quantum-evolution-kernel


Namequantum-evolution-kernel JSON
Version 0.2.9 PyPI version JSON
download
home_pageNone
SummaryA 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.
upload_time2025-02-21 08:16:23
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.10
licenseMIT-derived
keywords quantum
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.107.042615).

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`

1. Create a `venv` if that's not done yet

```sh
$ python -m venv venv

```

2. Enter the venv

```sh
$ . venv/bin/activate
```

3. Install the package

```sh
$ pip install quantum-evolution-kernel
# or
$ pipx install quantum-evolution-kernel
```

## QuickStart

```python
# 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:

1. [Using a Quantum Device to extract machine-learning features](https://github.com/pasqal-io/quantum-evolution-kernel/blob/main/examples/tutorial%201%20-%20Using%20a%20Quantum%20Device%20to%20Extract%20Machine-Learning%20Features.ipynb);
2. [Machine Learning with the Quantum Evolution Kernel](https://github.com/pasqal-io/quantum-evolution-kernel/blob/main/examples/tutorial%202%20-%20Machine-Learning%20with%20the%20Quantum%20EvolutionKernel.ipynb)

See also the [full API documentation](https://pasqal-io.github.io/quantum-evolution-kernel/latest/).

## Getting in touch

- [Pasqal Community Portal](https://community.pasqal.com/) (forums, chat, tutorials, examples, code library).
- [GitHub Repository](https://github.com/pasqal-io/quantum-evolution-kernel) (source code, issue tracker).
- [Professional Support](https://www.pasqal.com/contact-us/) (if you need tech support, custom licenses, a variant of this library optimized for your workload, your own QPU, remote access to a QPU, ...)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "quantum-evolution-kernel",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": null,
    "keywords": "quantum",
    "author": null,
    "author_email": "Shaheen Acheche <shaheen.acheche@pasqal.com>, Roland Guichard <roland.guichard@pasqal.com>, David Teller <david.teller@pasqal.com>, Manu Lahariya <manu.lahariya@pasqal.com>",
    "download_url": "https://files.pythonhosted.org/packages/12/ea/42f7d06f181e0e762b909bcbca6f9a9331791e7f113b09ea840147adb1b7/quantum_evolution_kernel-0.2.9.tar.gz",
    "platform": null,
    "description": "# Quantum Evolution Kernel\n\n\nThe 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.\n\nThe 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](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.107.042615).\n\nUsers 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.\n\n## Installation\n\n### Using `hatch`, `uv` or any pyproject-compatible Python manager\n\nEdit file `pyproject.toml` to add the line\n\n```\n  \"quantum-evolution-kernel\"\n```\n\nto the list of `dependencies`.\n\n### Using `pip` or `pipx`\nTo install the `pipy` package using `pip` or `pipx`\n\n1. Create a `venv` if that's not done yet\n\n```sh\n$ python -m venv venv\n\n```\n\n2. Enter the venv\n\n```sh\n$ . venv/bin/activate\n```\n\n3. Install the package\n\n```sh\n$ pip install quantum-evolution-kernel\n# or\n$ pipx install quantum-evolution-kernel\n```\n\n## QuickStart\n\n```python\n# Load a dataset\nimport torch_geometric.datasets as pyg_dataset\nog_ptcfm = pyg_dataset.TUDataset(root=\"dataset\", name=\"PTC_FM\")\n\n# Setup a quantum feature extractor for this dataset.\n# In this example, we'll use QutipExtractor, to emulate a Quantum Device on our machine.\nimport qek.data.graphs as qek_graphs\nimport qek.data.extractors as qek_extractors\nextractor = qek_extractors.QutipExtractor(compiler=qek_graphs.PTCFMCompiler())\n\n# Add the graphs, compile them and look at the results.\nextractor.add_graphs(graphs=og_ptcfm)\nextractor.compile()\nprocessed_dataset = extractor.run().processed_data\n\n# Prepare a machine learning pipeline with Scikit Learn.\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.svm import SVC\n\nX = [data for data in processed_dataset]  # Features\ny = [data.target for data in processed_dataset]  # Targets\nX_train, X_test, y_train, y_test = train_test_split(X, y, stratify = y, test_size=0.2, random_state=42)\n\n# Train a kernel\nfrom qek.kernel import QuantumEvolutionKernel as QEK\nkernel = QEK(mu=0.5)\nmodel = SVC(kernel=kernel, random_state=42)\nmodel.fit(X_train, y_train)\n```\n\n## Documentation\n\nWe have a two parts tutorial:\n\n1. [Using a Quantum Device to extract machine-learning features](https://github.com/pasqal-io/quantum-evolution-kernel/blob/main/examples/tutorial%201%20-%20Using%20a%20Quantum%20Device%20to%20Extract%20Machine-Learning%20Features.ipynb);\n2. [Machine Learning with the Quantum Evolution Kernel](https://github.com/pasqal-io/quantum-evolution-kernel/blob/main/examples/tutorial%202%20-%20Machine-Learning%20with%20the%20Quantum%20EvolutionKernel.ipynb)\n\nSee also the [full API documentation](https://pasqal-io.github.io/quantum-evolution-kernel/latest/).\n\n## Getting in touch\n\n- [Pasqal Community Portal](https://community.pasqal.com/) (forums, chat, tutorials, examples, code library).\n- [GitHub Repository](https://github.com/pasqal-io/quantum-evolution-kernel) (source code, issue tracker).\n- [Professional Support](https://www.pasqal.com/contact-us/) (if you need tech support, custom licenses, a variant of this library optimized for your workload, your own QPU, remote access to a QPU, ...)\n",
    "bugtrack_url": null,
    "license": "MIT-derived",
    "summary": "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.",
    "version": "0.2.9",
    "project_urls": {
        "Issues": "https://github.com/pasqal-io/quantum-evolution-kernel/issues",
        "Source": "https://github.com/pasqal-io/quantum-evolution-kernel"
    },
    "split_keywords": [
        "quantum"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "36cd1e1c548ecf750d3fdeb826c00368ba3746aa4f8b2345e0caf47b367b4877",
                "md5": "e5549c1aa8d033edd296abf73e6703cd",
                "sha256": "51dbcb27f8fdd86a8e4ad61d0f11ca8d3c49cde1f0ecee85ec28668c05bde7b7"
            },
            "downloads": -1,
            "filename": "quantum_evolution_kernel-0.2.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e5549c1aa8d033edd296abf73e6703cd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.10",
            "size": 32309,
            "upload_time": "2025-02-21T08:16:20",
            "upload_time_iso_8601": "2025-02-21T08:16:20.827418Z",
            "url": "https://files.pythonhosted.org/packages/36/cd/1e1c548ecf750d3fdeb826c00368ba3746aa4f8b2345e0caf47b367b4877/quantum_evolution_kernel-0.2.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "12ea42f7d06f181e0e762b909bcbca6f9a9331791e7f113b09ea840147adb1b7",
                "md5": "7bd3de456898468377b9d38066314725",
                "sha256": "9e5035c1f2f473e56700da61f566751fdb07de70283c5db946fce594f558bc60"
            },
            "downloads": -1,
            "filename": "quantum_evolution_kernel-0.2.9.tar.gz",
            "has_sig": false,
            "md5_digest": "7bd3de456898468377b9d38066314725",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.10",
            "size": 30948,
            "upload_time": "2025-02-21T08:16:23",
            "upload_time_iso_8601": "2025-02-21T08:16:23.756756Z",
            "url": "https://files.pythonhosted.org/packages/12/ea/42f7d06f181e0e762b909bcbca6f9a9331791e7f113b09ea840147adb1b7/quantum_evolution_kernel-0.2.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-21 08:16:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pasqal-io",
    "github_project": "quantum-evolution-kernel",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "quantum-evolution-kernel"
}
        
Elapsed time: 1.71341s