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.
-
PyTorch MLP regressors
-
Configurable architectures
-
Stable convergence on synthetic pricing datasets
-
Standard optimization (Adam + MSE)
-
PennyLane QNodes
-
Simple variational circuits with adjustable qubits/layers
-
Manual batch handling for deterministic behaviour
-
Quantum feature-map regressors as baseline implementations
-
Classical layers + quantum outputs
-
Useful for early-fusion insights
-
Black–Scholes synthetic dataset generator
-
Monte Carlo GBM path simulation
-
Deterministic seeding for consistent results
-
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.
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.
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
.\.venv\Scripts\activate
Classical baseline
python notebooks/01_black_scholes_demo.py
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.
-
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.
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.