
Solving NP-hard portfolio constraints with Simulated Quantum Annealing (PyTorch)
Adding real-world constraints—like sector caps or HHI concentration limits—turns standard portfolio optimization into an NP-hard Mixed-Integer problem. Traditional solvers quickly hit a computational wall as the asset universe scales.
To bypass this, I built a Quantum-Inspired Optimizer that maps continuous allocation weights and structural constraints into an Ising Hamiltonian framework using PyTorch. Instead of deterministic branch-and-bound, it uses simulated thermal annealing to navigate the complex energy landscape, treating constraint violations as physical "friction" to settle into a strictly compliant ground state.
Full architectural breakdown and a video of the live Streamlit UI in action here: Link