Skip to content

๐Ÿ”ฎ Experimental platform exploring the integration of Federated Learning, Quantum Machine Learning (VQC, QKA), and Post-Quantum Cryptography. Built with PennyLane, FastAPI, and Flutter. Features quantum-enhanced aggregation, zero-noise extrapolation, and Kyber/Dilithium security. Research/educational project - not production ready.

License

Notifications You must be signed in to change notification settings

rasidi3112/q-edge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Q-Edge

Federated Hybrid Quantum-Neural Network Platform

Research

Python PennyLane Flutter FastAPI

License Stars Forks


Exploring the future of AI: Where Quantum Computing meets Federated Learning

Research/Educational Project โ€” Not Production Ready


Documentation โ€ข Quick Start โ€ข Contributing โ€ข License


What is Q-Edge?

Q-Edge is an experimental platform that explores the intersection of three cutting-edge technologies:

Technology Description Status
Federated Learning Distributed ML without exposing raw data Simulated
Quantum ML Variational Quantum Circuits (VQC) & Quantum Kernel PennyLane Simulator
Post-Quantum Crypto Kyber & Dilithium (NIST standards) Placeholder
Azure Quantum Cloud quantum hardware integration Code Ready

Why Quantum?

"Why does FL aggregation need quantum?"

Aspect Classical FL Quantum-Enhanced FL
Aggregation FedAvg (linear) Quantum kernel for non-linear patterns
Privacy Differential privacy + Quantum key distribution potential
Optimization Gradient descent Variational quantum optimization
Scalability O(n) parameters Quantum parallelism for high-dim data

Honest take: At this stage, quantum advantages are still theoretical and only running on simulators. But research shows potential for:

  • Better resistance against adversarial attacks
  • More efficient loss function landscape exploration
  • Quantum-secure communication between FL clients

Key Features

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        Q-EDGE ARCHITECTURE                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                 โ”‚
โ”‚   Mobile Clients            Backend              Quantum        โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚   โ”‚ Flutter App โ”‚ โ”€โ”€PQCโ”€โ”€โ–ถ โ”‚  FastAPI    โ”‚ โ”€โ”€โ”€โ–ถ โ”‚ PennyLane โ”‚   โ”‚
โ”‚   โ”‚ FL Client   โ”‚          โ”‚  + Celery   โ”‚      โ”‚ Circuits  โ”‚   โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                                                 โ”‚
โ”‚   Security: Kyber-1024 KEM + Dilithium-5 Signatures             โ”‚
โ”‚   Aggregation: FedAvg + Quantum-Enhanced                        โ”‚
โ”‚   Error Mitigation: Zero-Noise Extrapolation                    โ”‚
โ”‚                                                                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Important Disclaimer

What This IS

  • Educational/research project
  • Working quantum circuits on simulator
  • Learning resource for FL + QML + PQC
  • Architecture proof-of-concept

What This is NOT

  • Production-ready software
  • Connected to real quantum hardware
  • Real Kyber/Dilithium (simulated)
  • Trained on real datasets

Quick Start

Prerequisites

Python 3.10+
Flutter 3.0+
Docker (optional)

Installation

# Clone the repository
git clone https://github.com/rasidi3112/q-edge.git
cd q-edge

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run demo
python demo.py

Run Flutter App

cd mobile_app
flutter pub get
flutter run -d chrome  # or your preferred device

Project Structure

q-edge/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ quantum/              # Quantum ML modules
โ”‚   โ”‚   โ”œโ”€โ”€ circuits.py       # Variational Quantum Circuits
โ”‚   โ”‚   โ”œโ”€โ”€ kernels.py        # Quantum Kernel Alignment
โ”‚   โ”‚   โ”œโ”€โ”€ error_mitigation.py # Zero-Noise Extrapolation
โ”‚   โ”‚   โ”œโ”€โ”€ aggregator.py     # Quantum-Enhanced Aggregation
โ”‚   โ”‚   โ””โ”€โ”€ azure_connector.py # Azure Quantum Integration
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ backend/              # FastAPI Backend
โ”‚   โ”‚   โ”œโ”€โ”€ main.py           # API endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ security.py       # PQC implementation
โ”‚   โ”‚   โ””โ”€โ”€ celery_app.py     # Async task queue
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ mobile/               # Mobile FL Client
โ”‚       โ”œโ”€โ”€ fl_client.py      # Flower-based FL client
โ”‚       โ””โ”€โ”€ pqc_transport.py  # PQC transport layer
โ”‚
โ”œโ”€โ”€ mobile_app/               # Flutter UI
โ”‚   โ””โ”€โ”€ lib/main.dart         # Mobile dashboard
โ”‚
โ”œโ”€โ”€ tests/                    # Unit & integration tests
โ”œโ”€โ”€ docs/                     # Documentation
โ”œโ”€โ”€ demo.py                   # Demo script
โ”œโ”€โ”€ requirements.txt          # Python dependencies
โ””โ”€โ”€ docker-compose.yml        # Container orchestration

How It Works

1. Federated Learning Flow

Mobile Device A โ”€โ”
                 โ”‚    Encrypted
Mobile Device B โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ Q-Edge Server โ”€โ”€โ–ถ Quantum Aggregation
                 โ”‚    Weights
Mobile Device C โ”€โ”˜

2. Quantum Circuit

# Variational Quantum Circuit for Global Aggregation
@qml.qnode(dev)
def vqc(params, data):
    # Data encoding
    for i, x in enumerate(data):
        qml.RY(x, wires=i)
    
    # Parameterized layers
    qml.StronglyEntanglingLayers(params, wires=range(n_qubits))
    
    return qml.probs(wires=range(n_qubits))

3. Post-Quantum Security

Algorithm Purpose Security Level
Kyber-1024 Key Encapsulation NIST Level 5
Dilithium-5 Digital Signatures NIST Level 5
AES-256-GCM Symmetric Encryption NIST Approved

Simulation Results

โš ๏ธ Note: Results from local simulator with synthetic data

Quantum Circuit Performance

Qubits Layers Parameters Execution Time
4 2 24 ~12ms
8 4 96 ~45ms
16 6 288 ~180ms

Federated Learning Simulation

Clients Rounds Convergence
5 10 ~95%
10 20 ~97%

Simulated convergence with synthetic random data


Tech Stack

Category Technologies
Quantum PennyLane, NumPy, SciPy
Backend FastAPI, Celery, Redis
Mobile Flutter, Dart
Security cryptography, python-jose
Cloud Azure Quantum (ready)
DevOps Docker, GitHub Actions

Roadmap

  • Variational Quantum Circuits
  • Quantum Kernel Alignment
  • Zero-Noise Extrapolation
  • Federated Learning Simulation
  • Flutter Mobile App
  • FastAPI Backend
  • Real PQC with liboqs
  • Azure Quantum Integration
  • Real Dataset Training
  • Mobile Device Testing

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


Acknowledgments


Star this repo if you find it interesting!

Made for the Quantum Computing Community

About

๐Ÿ”ฎ Experimental platform exploring the integration of Federated Learning, Quantum Machine Learning (VQC, QKA), and Post-Quantum Cryptography. Built with PennyLane, FastAPI, and Flutter. Features quantum-enhanced aggregation, zero-noise extrapolation, and Kyber/Dilithium security. Research/educational project - not production ready.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages