Skip to content

Latest commit

 

History

History
92 lines (66 loc) · 3.54 KB

README.md

File metadata and controls

92 lines (66 loc) · 3.54 KB

Quantum Ansatz Exploration

Explore how the complexity of variational quantum circuits (ansatz) impacts the performance of quantum machine learning models on real-world datasets.


Overview

This project dives into the fascinating world of quantum machine learning (QML), using Google Cirq to experiment with simple and complex ansatz designs. Through this, we aim to understand the relationship between ansatz complexity and classification performance, while maintaining execution efficiency.

In this repository, you will:

  • Train a quantum classifier on datasets with different ansatz configurations.
  • Visualize and compare performance metrics like accuracy, precision, recall, and F1-score.
  • Learn how to design and tweak ansatz circuits to optimize quantum models.

Whether you're a beginner in QML or exploring advanced concepts, this project is designed to educate, inspire, and simplify learning quantum computing concepts.


Features

Customizable Ansatz: Learn to design circuits that balance complexity and performance.
Quick Execution: Designed to provide fast results for easy experimentation.
📊 Performance Visualization: Compare simple vs complex ansatz using bar charts.
🛠️ Google Cirq Implementation: A clean, modular implementation for quantum enthusiasts.
🎓 Educational Insights: Teaching-focused explanations to help students and beginners.


Datasets

We train the quantum model on real-world datasets:

  1. Statlog Heart Dataset
  2. Ionosphere Dataset

Both datasets are preprocessed, split into training, validation, and testing sets to evaluate performance systematically.


Installation

Clone the repository and install the required libraries:

git clone /~https://github.com/hamzaskhan/quantum-ansatz-exploration.git
cd quantum-ansatz-exploration
pip install -r requirements.txt

How to Use

  1. Open the Google Colab Notebook included in the repository.
  2. Follow the step-by-step instructions provided in the notebook.
  3. Experiment with both simple and complex ansatz designs to observe the differences in performance.
  4. Visualize the circuits and performance metrics to deepen your understanding.

Project Structure

  • quantum_ansatz_simple.py: Code for a simple ansatz.
  • quantum_ansatz_complex.py: Code for the complex ansatz with increased layers and parameters.
  • visualize_performance.py: Code for visualizing performance metrics.
  • datasets/: Directory containing the datasets used.

Learning Outcomes

By the end of this project, you will:

  • Understand the role of ansatz design in quantum machine learning.
  • Learn how to optimize circuits for better classification accuracy.
  • Gain hands-on experience with Google Cirq for quantum computing.
  • Appreciate the balance between complexity and efficiency in quantum models.

Visualization Example

Here’s a sneak peek of what you’ll learn to visualize:
peak


Contributing

Feel free to contribute by:

  • Adding new ansatz designs.
  • Improving performance with optimized circuits.
  • Suggesting other real-world datasets for experimentation.

License

This project is licensed under the MIT License.


Acknowledgments

Special thanks to the open-source quantum computing community for their valuable resources and inspiration. 🙌