Inspiration
Portfolio optimization is a classic combinatorial problem — as the number of assets grows, the number of possible allocations explodes exponentially, and classical solvers start to struggle. We kept coming back to the same question: quantum computers are supposed to be good at exactly this kind of combinatorial search, so what would it actually look like to point one at a real financial problem instead of a toy example? QuantumHacks, with its overlap of Quantum, Fintech, and Databases tracks, felt like the right place to find out.
What it does
QuantumFolio takes a list of assets and a risk tolerance from the user, pulls historical price data, and computes an optimal portfolio allocation two ways in parallel:
Quantum: formulates the problem as a QUBO (Quadratic Unconstrained Binary Optimization) and solves it with QAOA (Quantum Approximate Optimization Algorithm) on a Qiskit simulator. Classical: solves the same formulation with a standard mean-variance optimizer.
The dashboard shows both allocations side by side, along with computation time and solution quality, so the trade-offs between the two approaches are visible rather than just asserted.
How we built it Data layer: historical price data pulled via yfinance, cached in a SQL database so repeated runs don't hit rate limits and so we can track performance across asset universes of different sizes. Quantum layer: qiskit-optimization to convert the portfolio problem into a QUBO, then QAOA to search for the optimal bitstring representing which assets to include/weight. Classical baseline: a scipy-based mean-variance optimizer solving the identical formulation, so the comparison is apples-to-apples. API/Backend: FastAPI ties the data layer and both optimizers together. Frontend: a React dashboard for selecting assets, setting risk tolerance, and visualizing the resulting allocations and comparison metrics. Challenges we ran into Translating a continuous financial optimization problem (weights on a simplex) into a binary QUBO formulation that QAOA can actually consume, without losing too much of the original problem's structure. Circuit depth and simulator runtime grow quickly with the number of assets, which forced us to be deliberate about scope — we prioritized a comparison that's honest about where quantum currently helps (or doesn't), rather than overselling results on a toy-sized problem. Keeping the classical and quantum solvers on a genuinely equivalent formulation, so the benchmark is fair rather than comparing two different problems. Accomplishments that we're proud of A working end-to-end pipeline from real market data → QUBO formulation → QAOA solution → visualized, comparable output. An honest, side-by-side benchmark rather than a "quantum is magic" claim — we show the actual runtime and quality trade-offs. What we learned How to translate a real-world optimization problem into QUBO form, and the practical constraints (qubit count, circuit depth) that come with running it on current quantum simulators/hardware. A much more concrete sense of where quantum optimization is (and isn't) currently competitive with classical methods for problems like this. What's next for QuantumFolio Testing on real quantum hardware (via IBM Quantum) rather than simulator-only, and comparing noise-related degradation. Scaling the asset universe further and exploring hybrid quantum-classical approaches (e.g., using QAOA output to warm-start a classical solver). Adding more realistic constraints (transaction costs, sector limits) to the optimization problem.
Built With
- fastapi
- github
- javascript
- numpy
- pandas
- pydantic
- python
- qaoa
- qiskit
- qiskit-algorithms
- qiskit-optimization
- quantum-computing
- scipy
- sqlalchemy
- uvicorn
Log in or sign up for Devpost to join the conversation.