Skip to main content

quantum-learn: quantum machine learning in Python

Project description

Quantum-Learn

PyPI Version License Python Versions

Quantum-Learn is an open-source Python library that simplifies Quantum Machine Learning (QML) using PennyLane. Inspired by scikit-learn, it provides a high-level interface for creating and training Variational Quantum Circuits (VQCs) with ease.

Features

  • Simple API for training quantum models
  • Currently only supports Variational Quantum Circuits (VQC)
  • Works with PennyLane, scikit-learn, and standard ML tools
  • All aspects of a VQC are customizable

Installation

Quantum-Learn requires Python 3.6+. Install it via pip:

pip install quantum-learn

Or install from source:

git clone https://github.com/OsamaMIT/quantum-learn.git
cd quantum-learn
pip install .

Quick Start

Train a Quantum Model

import pennylane as qml
import pandas as pd
from qmlearn import VariationalQuantumCircuit

# Create a sample dataset
features = pd.DataFrame({
    "feature1": [0, 1],
    "feature2": [1, 0]
})
labels = pd.DataFrame({
    "label": [
        [1, 0, 0, 0],  # Encoded quantum state for class 0
        [0, 0, 0, 1]   # Encoded quantum state for class 1
    ]
})

# Initialize and train the model
vqc = VariationalQuantumCircuit()
vqc.train(features, labels, epochs=5)

# Make predictions
predictions = vqc.predict(features)
print(predictions)

Documentation

For detailed usage and examples, check out the Quantum-Learn Documentation (coming soon).

Planned Features

  • Implement quantum kernel methods
  • Implement more abstract classes for applied QML tasks (similar to fastai)

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a new branch (feature-branch)
  3. Commit your changes and open a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantum_learn-0.0.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quantum_learn-0.0.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file quantum_learn-0.0.2.tar.gz.

File metadata

  • Download URL: quantum_learn-0.0.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for quantum_learn-0.0.2.tar.gz
Algorithm Hash digest
SHA256 70572ab153ccfff0d6863325f35a2f693baa865d138c8fc57f4701cf52a862cc
MD5 d8da54505eee68517196fcd191378c99
BLAKE2b-256 5062f40bf14bf2f5a884fdd682cf534177758aff735b872b5769fa33a99490fe

See more details on using hashes here.

File details

Details for the file quantum_learn-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: quantum_learn-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for quantum_learn-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2ed85b70e9ef029ec6c8a39c696c0d9fa83e4aa809ea1c2713bf736c56fdec13
MD5 7c127cf9a46c6446dc049ce166ae8b19
BLAKE2b-256 39888493041f9f1ab730467f97f3ff5e606865e806f8a55bc0e3fe54d980dd61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page