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, training, and evaluating Variational Quantum Circuits (VQCs) with ease.

Features

  • Simple API for training quantum models
  • Supports Variational Quantum Circuits (VQC)
  • Works with PennyLane, scikit-learn, and standard ML tools
  • Customizable Ansätze (quantum circuit templates)
  • Compatible with both classical simulators and real quantum devices

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

Copy
Edit
import pennylane as qml
import pandas as pd
from quantum_learn 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.

Roadmap

  • Implement quantum kernel methods
  • Add pre-built ansätze for VQCs
  • Support more backends (IBM Q, Braket)
  • Improve compatibility with scikit-learn

Contributing

Contributions are welcome! To contribute:

Fork the repository Create a new branch (feature-branch) 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.1.tar.gz (4.2 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.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quantum_learn-0.0.1.tar.gz
  • Upload date:
  • Size: 4.2 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.1.tar.gz
Algorithm Hash digest
SHA256 027ea07b126e230f1c4352732c6b4d334f6fdea635b0064dac95ea3d95c70bb6
MD5 e092768279b659d7f25306de0a9019f1
BLAKE2b-256 35d04f23d46b2501d4e9b5751ddb9c91b4f9e35ccb75b8336b1deab7d2b314a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: quantum_learn-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ca3c2dde8118861f229e43cd51a91bcd795a37c35f27b6853b2c28afa1cef59
MD5 32d7a36e6d1ec0482898a6b3ed1d7b49
BLAKE2b-256 482bd56094737d6247ad2d747d10ed5c03cbd17b54caa270abdb34b90c7f938c

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