Skip to content
samanvithkashyapPublic

About

A QML model for options pricing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

QPrice

A team project exploring the use of Quantum Machine Learning (QML) for options pricing, originally built for the Qiskit Fall Fest 2025.

The Core Idea

This project was our team's submission for the "Quantum Option Pricing" challenge. The prompt was:

Problem Statement: Option pricing is an important problem in finance. The goal of this prompt is to explore how quantum circuits can be used to price options either using a quantum random walk or a quantum machine learning (QML) model.

QPrice is our exploration of that second track: an attempt to build a working QML model for pricing options.

The entire experiment is contained within the QPrice.ipynb Jupyter Notebook. It trains a Variational Quantum Regressor (VQR) and compares its performance against a classical Random Forest model on the same dataset.

Technologies Used

This project was built using the following core libraries:

  • Qiskit: For building and simulating the VQR model.
  • Scikit-learn: For data preprocessing and training the classical Random Forest model.
  • yfinance: For downloading SPY options data.
  • Pandas & NumPy: For data manipulation.
  • Matplotlib: For plotting the results.

How to Run

The easiest way to run this project and see the results for yourself is to open it directly in Google Colab.

Open In Colab

Results

The VQR model was trained and evaluated alongside a classical Random Forest (RF) model on the same data for comparison.

Model Performance (This plot is generated by the notebook and compares VQR vs. Random Forest performance)

Key Metrics (Test Set)

Model R² Score MAE
VQR (Quantum) 0.6292 $40.21
Random Forest (Classical) 0.9865 $6.25

Results Analysis & Inference

This comparison is the core finding of our project.

  • Classical Benchmark: The Random Forest model achieved a very high $R^2$ score of 0.9865. This is expected, as it's a powerful, mature algorithm well-suited for this kind of non-linear, tabular data. It serves as our "best-in-class" classical baseline.

  • Quantum Model: Our VQR model achieved an $R^2$ of 0.629. While this is numerically lower than the Random Forest, this result is highly encouraging. It successfully demonstrates that a quantum circuit, even one with only 3 qubits, can learn the complex, non-linear relationships in financial options data.

  • Conclusion: The goal of the hackathon was to produce a working QML model. Our project confirms the viability of the QML approach as a proof-of-concept. The significant performance gap with the classical model is expected and highlights a key area of QML research: finding problems and model architectures where simple quantum circuits can be competitive with (or eventually outperform) highly optimized classical ones.


Context Within QML Research

This project serves as a practical exploration of several open problems in the field of Quantum Machine Learning:

  • Finding Practical Applications: We directly address the high-priority challenge of finding "real-life, practical problems" for QML by applying our model to the complex, real-world task of options pricing.

  • Benchmarking QML Algorithms: The question "How can we benchmark QML algorithms?" is a major one. Our project answers this directly. By comparing the VQR (R²: 0.629) against a powerful classical Random Forest (R²: 0.9865), we provide a clear performance benchmark for this specific task and model architecture.

  • Encountering Barren Plateaus: Our VQR's flat training convergence plot is a textbook example of the "Barren Plateau" problem. It demonstrates this major research hurdle in a practical setting, showing the difficulty of optimizing variational quantum circuits.


Project Status

This was a team research project submitted for the Qiskit Fall Fest. The model and findings are experimental and reflect the work done during that event. It's intended to serve as a proof-of-concept and a learning exercise.


Future Work

Given more time, we would have loved to explore:

  • Different Ansatzes: Trying more complex ansatz (circuit) designs for the VQR to potentially mitigate the barren plateau problem.
  • More Features: Adding other features like the risk-free interest rate or different volatility measures.
  • Other QML Models: Comparing the VQR against other models like a Quantum-enhanced SVM.

Authors

About

A QML model for options pricing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages