Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

❤️⚡ Variational Quantum Classifier – Heart Disease Prediction

🎉 Introduction

Welcome to our Variational Quantum Classifier (VQC) project! Developed as the capstone project for the Road to Quantum Practitioner program, organized by IBM Quantum and Freeya Mind Campus, this project explores how quantum machine learning can be applied to predict heart disease using the UCI Heart Disease dataset.

We implemented the model using Qiskit 2.0 to harness the potential of noisy intermediate-scale quantum (NISQ) devices, with careful attention to feature selection, optimization strategies, and practical considerations for real-world deployment.


⚙️ Key Features

🔄 Flexible Optimization Options

  • Choice of Optimizers:
    • CMA-ES (evolutionary strategy) for global optimization
    • COBYLA (gradient-free) for faster convergence
  • Tunable Parameters:
    • Adjustable population size for CMA-ES
    • Customizable iteration limits for both optimizers
    • Configurable shot count for measurement precision

💾 Checkpoint System

  • Automatic saving of parameters and cost values after each iteration
  • Resume training from last checkpoint after interruptions
  • Particularly valuable for real quantum hardware runs with long queue times

🔬 Experimental Controls

  • Switch between real quantum backends and high-performance simulators
  • Region selection for IBM Quantum access (us-east or eu-de)
  • Reproducibility via fixed random seeds

📊 Analysis Tools

  • Live cost function tracking during optimization
  • Multiple test runs for reliable accuracy estimation
  • Statistical reporting (mean, standard deviation, confidence intervals)
  • Comparison tool against previous runs

⚙️ Requirements

  • Python 3.10+
  • Qiskit 2.0+
  • NumPy, Pandas, Matplotlib, Scikit-learn
  • Jupyter Notebook
  • (Optional) CMA-ES for evolutionary optimization

🚀 Installation

  1. Clone this repository:

    git clone https://github.com/sebsop/vqc-heart-disease-prediction.git
  2. Navigate into the folder:

    cd vqc-heart-disease-prediction

▶️ Running the Project

  1. Open the Jupyter notebook:

    jupyter notebook
  2. Run through heart-disease-vqc.ipynb in the notebook folder to train and evaluate the quantum classifier.


🌟 Implementation Highlights

Quantum Circuit Design

  • 4-Qubit Architecture: Matches selected clinical features
  • ZZFeatureMap: For effective classical-to-quantum encoding
  • RealAmplitudes Ansatz: Optimized for NISQ devices

Feature Selection

  • Clinically relevant features: chest pain type (cp), ST depression (oldpeak), sex (gender), exang (exercise-induced angina)
  • Rigorous preprocessing: Normalized to [0,π] for angle encoding
  • Correlation-validated feature set

Hybrid Optimization

  • Classical optimization of quantum parameters
  • Noise-adaptive CMA-ES variant for hardware runs
  • Cost-efficient COBYLA for rapid prototyping

🛠️ Challenges & Solutions

Challenge Our Approach
Limited Qubits Careful feature selection + dimensionality reduction
Noisy Hardware CMA-ES with noise adaptation + multiple test runs
Long Queue Times Checkpoint system + session management
Training Speed Hybrid classical-quantum optimization

🖥️ Project Presentation

For a detailed explanation of our approach, workflow, and results, check out our presentation:
📑 View Presentation


Acknowledgements

  • Special thanks to IBM Quantum and Freeya Mind Campus for the Road to Practitioner program
  • Gratitude to the Qiskit team for their powerful quantum computing tools
  • Heartfelt thanks to our teacher Tudor Mihoc for guidance and opportunity
  • Appreciation to my teammates Rodica, Gheorghe, and Adrian for their collaboration
  • Inspired by the quantum computing community's open knowledge sharing

📄 License

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


💡 Contact

Questions, feedback, or ideas? Reach out anytime at sebastian.soptelea@proton.me.


🔗 Resources

About

Implementation of a Variational Quantum Classifier (VQC) to predict heart disease, created as the capstone project for the IBM and Freeya Mind Campus’ Road to Practitioner program.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages