Exploring the future of AI: Where Quantum Computing meets Federated Learning
Research/Educational Project โ Not Production Ready
Documentation โข Quick Start โข Contributing โข License
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 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
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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 โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
Python 3.10+
Flutter 3.0+
Docker (optional)# 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.pycd mobile_app
flutter pub get
flutter run -d chrome # or your preferred deviceq-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
Mobile Device A โโ
โ Encrypted
Mobile Device B โโผโโโโโโโโโโโโโโโถ Q-Edge Server โโโถ Quantum Aggregation
โ Weights
Mobile Device C โโ
# 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))| 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 |
โ ๏ธ Note: Results from local simulator with synthetic data
| Qubits | Layers | Parameters | Execution Time |
|---|---|---|---|
| 4 | 2 | 24 | ~12ms |
| 8 | 4 | 96 | ~45ms |
| 16 | 6 | 288 | ~180ms |
| Clients | Rounds | Convergence |
|---|---|---|
| 5 | 10 | ~95% |
| 10 | 20 | ~97% |
Simulated convergence with synthetic random data
| 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 |
- 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
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Star this repo if you find it interesting!
Made for the Quantum Computing Community