A comparative study of classical boosting algorithms with and without
quantum-circuit-based hyperparameter optimization via PennyLane variational circuits
- Overview
- Motivation
- Algorithms Covered
- Quantum Hyperparameter Optimization Approach
- Repository Structure
- Installation
- Usage
- Input Data
- Results
- Limitations and Honest Notes
- Future Work
- How to Cite
- License
This project compares classical boosting algorithms (XGBoost, AdaBoost, Gradient Boost, CatBoost, LightGBM, HistGradientBoosting) in two configurations:
- Classical baseline — standard model with GridSearchCV or default hyperparameters
- Quantum hyperparameter optimization — hyperparameters are proposed by a variational quantum circuit implemented in PennyLane, then used to configure the same classical model
The quantum circuit acts as a hyperparameter proposal mechanism: it takes encoded input, applies parameterized rotation gates and entangling layers, and maps measurement outcomes (Pauli-Z expectation values) to valid hyperparameter ranges via a scaling function.
This is a learning and exploration project, not a production system. The goal is to build hands-on experience with quantum machine learning by applying variational circuits to a familiar ML context — boosting algorithm hyperparameter search.
Hyperparameter optimization is one of the most resource-intensive parts of machine learning workflows. Classical approaches (grid search, random search, Bayesian optimization) can be slow for large search spaces. Variational quantum circuits are being explored as potential alternatives for optimization tasks due to their ability to represent complex probability distributions in compact parameterized form.
This project investigates a simple question in a controlled setting:
Can a variational quantum circuit propose competitive hyperparameters for classical boosting algorithms, compared to classical grid search?
The scope is intentionally narrow — this is a first exploration, not a definitive benchmark.
| Algorithm | Classical Notebook | Quantum Notebook |
|---|---|---|
| XGBoost | xgboost_classic.ipynb |
xgboost_quantum_hyperopt.ipynb |
| XGBoost (refined) | — | xgboost_quantum_final.ipynb |
| AdaBoost | adaboost_classic.ipynb |
adaboost_quantum_hyperopt.ipynb |
| Gradient Boost | gradient_boost_classic.ipynb |
gradient_boost_quantum_hyperopt.ipynb |
| CatBoost | catboost_classic.ipynb |
catboost_quantum_hyperopt.ipynb |
| LightGBM | lightgbm_classic.ipynb |
lightgbm_quantum_hyperopt.ipynb |
| HistGradientBoosting | histgradient_classic.ipynb |
histgradient_quantum_hyperopt.ipynb |
Each quantum notebook uses a variational quantum circuit with the following structure:
For each qubit i:
RY(params[i]) ← angle embedding of input
RZ(params[i] * 0.5) ← additional phase rotation
Entanglement:
CNOT(0→1), CNOT(1→2), ..., CNOT(n-1→n) ← linear chain
Measurement:
<Z_i> for all i → expectation values in [-1, 1]
Pauli-Z expectation values are mapped to hyperparameter ranges using linear scaling:
n_estimators = int(150 + 250 * abs(outputs[0])) # [150, 400]
learning_rate = 0.01 + 0.2 * abs(outputs[1]) # [0.01, 0.21]
max_depth = int(3 + 8 * abs(outputs[2])) # [3, 11]
subsample = 0.4 + 0.6 * abs(outputs[3]) # [0.4, 1.0]
colsample = 0.4 + 0.6 * abs(outputs[4]) # [0.4, 1.0]
reg_lambda = 0.1 + 7 * abs(outputs[2]) # [0.1, 7.1]
reg_alpha = 0.1 + 7 * abs(outputs[1]) # [0.1, 7.1]The quantum circuit parameters are optimized using scipy.optimize.minimize with the Powell method. The objective function trains the boosting model with circuit-proposed hyperparameters and returns the validation loss.
The results/ folder contains experiments run with 0 to 40 qubits for both XGBoost and Gradient Boost. Each .txt file contains the full code used for that qubit configuration, allowing reproduction and comparison across circuit sizes.
quantum-boosting-hyperopt/
│
├── notebooks/ # Jupyter notebooks — one folder per algorithm
│ ├── xgboost/
│ │ ├── xgboost_classic.ipynb # XGBoost with GridSearchCV
│ │ ├── xgboost_quantum_hyperopt.ipynb # Quantum hyperopt v1
│ │ └── xgboost_quantum_final.ipynb # Quantum hyperopt refined
│ ├── adaboost/
│ │ ├── adaboost_classic.ipynb
│ │ └── adaboost_quantum_hyperopt.ipynb
│ ├── gradient_boost/
│ │ ├── gradient_boost_classic.ipynb
│ │ └── gradient_boost_quantum_hyperopt.ipynb
│ ├── catboost/
│ │ ├── catboost_classic.ipynb
│ │ └── catboost_quantum_hyperopt.ipynb
│ ├── lightgbm/
│ │ ├── lightgbm_classic.ipynb
│ │ └── lightgbm_quantum_hyperopt.ipynb
│ └── histgradient_boost/
│ ├── histgradient_classic.ipynb
│ └── histgradient_quantum_hyperopt.ipynb
│
├── results/ # Qubit scaling experiment results (0–40 qubits)
│ ├── xgboost/ # xgboost_0qubit.txt ... xgboost_40qubit.txt
│ └── gradient_boost/ # gradient_boost_0qubit.txt ... _40qubit.txt
│
├── data/ # Input datasets
│ ├── dataset_quantum_hyperopt.csv # Primary dataset used in quantum experiments
│ └── dataset_boosting_v1.csv # Original dataset from first experiments
│
├── docs/ # Extended documentation
│ ├── methodology.md
│ ├── quantum_circuit_design.md
│ ├── limitations.md
│ └── future_work.md
│
├── requirements.txt
├── LICENSE
├── CITATION.cff
├── CONTRIBUTING.md
├── CHANGELOG.md
└── README.md
git clone https://github.com/MuratKarslioglu/quantum-boosting-hyperopt.git
cd quantum-boosting-hyperopt
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
pip install -r requirements.txtCore dependencies:
| Package | Purpose |
|---|---|
pennylane |
Quantum circuit simulation |
torch |
GPU tensor support for quantum simulation |
xgboost |
XGBoost algorithm |
lightgbm |
LightGBM algorithm |
catboost |
CatBoost algorithm |
scikit-learn |
AdaBoost, GradientBoosting, HistGradientBoosting, metrics |
scipy |
Powell optimizer for quantum circuit parameters |
pandas, numpy |
Data handling |
Each notebook is self-contained. Open the relevant notebook in Jupyter and run all cells.
Before running, update the dataset path at the top of each notebook:
file_path = "../../data/dataset_quantum_hyperopt.csv"To reproduce qubit scaling experiments, refer to the .txt files in results/xgboost/ or results/gradient_boost/. Each file is a complete, runnable Python script for that qubit count.
The primary dataset used in all quantum hyperparameter optimization experiments.
| Column | Description |
|---|---|
Feature1, Feature2, Feature3 |
Input features (numerical) |
Target |
Target variable (regression) |
The original dataset used in early exploratory experiments (first paper version).
Qubit scaling experiment outputs are stored in results/xgboost/ and results/gradient_boost/ for 0 to 40 qubits. Each file contains the full code and configuration used, enabling full reproducibility.
Metrics reported per experiment:
- MSE (Mean Squared Error) on test set
- R² Score on test set
- Optimized hyperparameter values proposed by the quantum circuit
This is a learning and exploration project. The following limitations apply:
- Quantum circuits run on classical simulator (
default.qubit) — no real quantum hardware - The quantum circuit proposes hyperparameters through a fixed scaling function, not a learned search distribution
- No rigorous statistical comparison (e.g., multiple runs, significance tests) is included
- Some notebooks are minimal or incomplete — this reflects the exploratory nature of the work
- The approach is closer to "quantum-assisted search" than "quantum machine learning" in the strict sense
- Results may vary significantly between runs due to random initialization of circuit parameters
This project is shared as part of a personal learning journey in quantum computing, not as a definitive benchmark.
- Add statistical comparison: multiple random seeds, mean ± std for all metrics
- Implement gradient-based quantum optimization (parameter-shift rule) instead of Powell
- Extend to classification tasks and additional datasets
- Add a structured results summary table across all algorithms and qubit counts
- Explore noise-aware training with PennyLane noise models
- Compare against Bayesian optimization as a stronger classical baseline
@software{karslioglu2026quantum_boosting,
author = {Karslioglu, Murat},
title = {Quantum Hyperparameter Optimization for Boosting Algorithms},
year = {2026},
publisher = {GitHub},
url = {https://github.com/MuratKarslioglu/quantum-boosting-hyperopt}
}MIT License — see LICENSE for details.
PennyLane varyasyonel devreleri aracılığıyla kuantum devre tabanlı hiperparametre optimizasyonu ile
klasik boosting algoritmalarının karşılaştırmalı çalışması
- Genel Bakış
- Motivasyon
- Kapsanan Algoritmalar
- Kuantum Hiperparametre Optimizasyon Yaklaşımı
- Depo Yapısı
- Kurulum
- Kullanım
- Girdi Verisi
- Sonuçlar
- Sınırlılıklar ve Dürüst Notlar
- Gelecek Çalışmalar
- Atıf
- Lisans
Bu proje, klasik boosting algoritmalarını (XGBoost, AdaBoost, Gradient Boost, CatBoost, LightGBM, HistGradientBoosting) iki konfigürasyonda karşılaştırır:
- Klasik referans noktası — GridSearchCV veya varsayılan hiperparametrelerle standart model
- Kuantum hiperparametre optimizasyonu — hiperparametreler PennyLane ile uygulanan varyasyonel bir kuantum devre tarafından önerilir, ardından aynı klasik modeli yapılandırmak için kullanılır
Kuantum devresi hiperparametre öneri mekanizması olarak işlev görür: kodlanmış girdiyi alır, parametreleştirilmiş rotasyon kapıları ve dolaşma katmanları uygular ve ölçüm sonuçlarını (Pauli-Z beklenti değerleri) bir ölçekleme fonksiyonu aracılığıyla geçerli hiperparametre aralıklarıyla eşleştirir.
Bu bir öğrenme ve keşif projesidir, üretim sistemi değildir. Amaç, varyasyonel devreleri tanıdık bir ML bağlamına uygulayarak — boosting algoritması hiperparametre araması — kuantum makine öğrenmesiyle uygulamalı deneyim kazanmaktır.
Hiperparametre optimizasyonu, makine öğrenmesi iş akışlarının en kaynak yoğun bölümlerinden biridir. Klasik yaklaşımlar (ızgara araması, rastgele arama, Bayesian optimizasyon) büyük arama uzayları için yavaş olabilir. Varyasyonel kuantum devreler, kompakt parametreleştirilmiş formda karmaşık olasılık dağılımlarını temsil edebilme yetenekleri nedeniyle optimizasyon görevleri için potansiyel alternatifler olarak araştırılmaktadır.
Bu proje, kontrollü bir ortamda basit bir soruyu araştırır:
Varyasyonel bir kuantum devresi, klasik ızgara aramasına kıyasla klasik boosting algoritmaları için rekabetçi hiperparametreler önerebilir mi?
| Algoritma | Klasik Notebook | Kuantum Notebook |
|---|---|---|
| XGBoost | xgboost_classic.ipynb |
xgboost_quantum_hyperopt.ipynb |
| XGBoost (rafine) | — | xgboost_quantum_final.ipynb |
| AdaBoost | adaboost_classic.ipynb |
adaboost_quantum_hyperopt.ipynb |
| Gradient Boost | gradient_boost_classic.ipynb |
gradient_boost_quantum_hyperopt.ipynb |
| CatBoost | catboost_classic.ipynb |
catboost_quantum_hyperopt.ipynb |
| LightGBM | lightgbm_classic.ipynb |
lightgbm_quantum_hyperopt.ipynb |
| HistGradientBoosting | histgradient_classic.ipynb |
histgradient_quantum_hyperopt.ipynb |
Her kubit i için:
RY(params[i]) ← girdi açı gömme
RZ(params[i] * 0.5) ← ek faz rotasyonu
Dolaşma:
CNOT(0→1), CNOT(1→2), ..., CNOT(n-1→n) ← doğrusal zincir
Ölçüm:
<Z_i> tüm i için → [-1, 1] aralığında beklenti değerleri
Pauli-Z beklenti değerleri, doğrusal ölçekleme kullanılarak hiperparametre aralıklarına eşlenir:
n_estimators = int(150 + 250 * abs(outputs[0])) # [150, 400]
learning_rate = 0.01 + 0.2 * abs(outputs[1]) # [0.01, 0.21]
max_depth = int(3 + 8 * abs(outputs[2])) # [3, 11]
subsample = 0.4 + 0.6 * abs(outputs[3]) # [0.4, 1.0]results/ klasörü, hem XGBoost hem Gradient Boost için 0'dan 40'a kadar kubit ile çalıştırılan deneyleri içerir. Her .txt dosyası, o kubit konfigürasyonu için kullanılan kodun tamamını içerir.
quantum-boosting-hyperopt/
│
├── notebooks/ # Jupyter notebookları — algoritma başına bir klasör
│ ├── xgboost/
│ ├── adaboost/
│ ├── gradient_boost/
│ ├── catboost/
│ ├── lightgbm/
│ └── histgradient_boost/
│
├── results/ # Kubit ölçekleme deney sonuçları (0–40 kubit)
│ ├── xgboost/
│ └── gradient_boost/
│
├── data/ # Girdi veri setleri
├── docs/ # Genişletilmiş belgeler
├── requirements.txt
├── LICENSE
└── README.md
git clone https://github.com/MuratKarslioglu/quantum-boosting-hyperopt.git
cd quantum-boosting-hyperopt
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txtHer notebook bağımsızdır. İlgili notebook'u Jupyter'da açın ve tüm hücreleri çalıştırın.
Çalıştırmadan önce her notebook'un başındaki veri seti yolunu güncelleyin:
file_path = "../../data/dataset_quantum_hyperopt.csv"dataset_quantum_hyperopt.csv — Tüm kuantum hiperparametre optimizasyon deneylerinde kullanılan birincil veri seti. Sütunlar: Feature1, Feature2, Feature3, Target.
dataset_boosting_v1.csv — İlk makale versiyonundaki erken keşif deneylerinde kullanılan orijinal veri seti.
Bu bir öğrenme ve keşif projesidir. Aşağıdaki sınırlılıklar geçerlidir:
- Kuantum devreler klasik simülatörde (
default.qubit) çalışır — gerçek kuantum donanımı yoktur - Kuantum devresi, öğrenilmiş bir arama dağılımı değil, sabit bir ölçekleme fonksiyonu aracılığıyla hiperparametreler önerir
- Titiz istatistiksel karşılaştırma (birden fazla çalıştırma, anlamlılık testleri) dahil değildir
- Bazı notebook'lar minimal veya tamamlanmamıştır — bu çalışmanın keşifsel niteliğini yansıtır
- Proje, kesin bir kıyaslama değil, kuantum bilişimde kişisel bir öğrenme yolculuğunun parçası olarak paylaşılmaktadır
@software{karslioglu2026quantum_boosting,
author = {Karslioglu, Murat},
title = {Quantum Hyperparameter Optimization for Boosting Algorithms},
year = {2026},
publisher = {GitHub},
url = {https://github.com/MuratKarslioglu/quantum-boosting-hyperopt}
}MIT Lisansı — ayrıntılar için LICENSE dosyasına bakınız.