Skip to content

Manaswani96/Q-FINLAB

Repository files navigation

🧭 Q-FINLAB — Quantum × Classical Finance Modelling Framework

A modular and extensible system for exploring ML, quantum circuits, and financial modelling.

⚡ Active Development

This project is evolving with ongoing commits and improvements.
Maintained by Mahi

Expect structural updates, refinements, and new experiments as the framework grows.
Suggestions and improvement ideas are always appreciated.

Q-FINLAB provides a structured environment for testing and comparing classical, quantum, and hybrid machine-learning models in the context of quantitative finance.
The framework emphasizes:

  • reproducibility

  • modular design

  • clarity of implementation

  • experimentation grounded in curiosity

  • modern software engineering practices

The goal is simple:to understand how different modelling paradigms behave on well-defined quantitative finance problems.

What This Framework Offers

Classical ML

  • PyTorch MLP regressors

  • Configurable architectures

  • Stable convergence on synthetic pricing datasets

  • Standard optimization (Adam + MSE)

Quantum ML

  • PennyLane QNodes

  • Simple variational circuits with adjustable qubits/layers

  • Manual batch handling for deterministic behaviour

  • Quantum feature-map regressors as baseline implementations

Hybrid Approaches

  • Classical layers + quantum outputs

  • Useful for early-fusion insights

Financial Data Utilities

  • Black–Scholes synthetic dataset generator

  • Monte Carlo GBM path simulation

  • Deterministic seeding for consistent results

Experimentation Tools

  • Unified training loop

  • Validation tracking

  • Auto-saved loss curves inside assets/plots/

  • Lightweight experiment runners (Python scripts, not notebooks)

Everything is structured to let you iterate quickly without losing clarity.

3. Directory Structure

Q-FINLAB/
│
├── qfinlab/                # Core package
│   ├── datasets/           # BS + Monte Carlo data generation
│   ├── models/             # classical, quantum, hybrid models
│   ├── utils/              # training utilities, dataloaders, plotting
│   └── experiments/        # modular experiment definitions
│
├── notebooks/              # experiment runner scripts
├── scripts/                # helper tools (dataset generation, profiling)
├── assets/                 # saved plots and visuals
├── docs/                   # conceptual notes and architecture
├── requirements.txt
├── pyproject.toml
└── README.md

This structure aligns with modern Python project conventions and supports clean scaling.

4. Installation

git clone https://github.com/Manaswani96/Q-FINLAB.git
cd Q-FINLAB

python -m venv .venv
.\.venv\Scripts\activate

pip install -r requirements.txt
pip install -e .

5. Running Experiments

Activate environment

.\.venv\Scripts\activate

Classical baseline

python notebooks/01_black_scholes_demo.py

Quantum + Classical comparison

python notebooks/02_quantum_regression.py

Save loss curves

python notebooks/03_qfm_vs_mlp.py

Generated plots will appear under:

assets/plots/

Current Behaviour

MLP (Classical):

  • Fast, stable convergence on Black–Scholes synthetic data

QFM (Quantum):

  • Expected slower convergence with small circuit

  • Useful as a baseline for future quantum circuit improvements

This repository doesn’t aim for performance claims — only understanding and structured experimentation.

🧩 Extension Ideas (Planned Additions)

  • Improved quantum feature maps

  • Stronger variational circuits (entanglement patterns)

  • Input scaling for quantum models

  • Additional pricing models (Heston, SABR)

  • Real-market datasets (via yfinance)

  • Hybrid model variations

  • Additional metrics + evaluation protocols

  • Optional Jupyter notebook versions

These will be introduced incrementally as understanding deepens.

Project Note

Q-FINLAB will continue evolving as new ideas, insights, and modelling strategies are explored.The repository is intentionally designed to stay modular and adaptable, making future extensions straightforward.All current components serve as a reliable foundation for further experimentation in quantum, classical, and hybrid financial modelling.

END OF THE README.

Releases

No releases published

Packages

No packages published