top of page
  • Writer's pictureInfinityQ

Quantum-Inspired Methods for Trading & Portfolio Optimization

In this post we demonstrate the use of InfinityQ's quantum-inspired TitanQ optimizer to construct a stock portfolio to outperform the S&P 500 index.

Overall, our portfolio performed better than the S&P 500 (in terms of Sharpe Ratio) in 8 out of 12 of the years tested on.

NOTE: This post represents a summary only, the full article with details, mathematical method and references is available for download here:


A particular branch of quantitative finance is portfolio optimization, a complex field that deals with the construction and rebalancing of portfolios (weighted set of assets) as well as the trade-off between expected return and risk.

Even though quantum computers won’t be ready to solve meaningful problems for several years, quantum-inspired methods like TitanQ can provide meaningful advantages today in solving this class of NP-hard combinatorial optimization problems through probabilistic computing.

According to Markowitz’s Modern Portfolio Theory, investors want to maximize their expected return while minimizing their risk (standard deviation of returns).

In this study, we take an alternate approach to portfolio optimization by formulating it as a Maximum Weighted Independent Set (MWIS) problem.

Using historical data from a full year, we attempt to construct a portfolio that outperforms the S&P 500 index in the following year using components from the S&P 500 index.

Our strategy is to model the S&P 500 as an MWIS problem to select an optimal subset of uncorrelated assets.

Finally, we assign weights to the stocks based on the ratio of their mean return to risk (in that same year) to form the portfolioWe then evaluate the performance of the portfolio in the following year and graph their cumulative returns against the S&P 500 index. 

For example, consider the performance of the MWIS-constructed portfolio in 2022 (formed using historical data from 2021):

Overall, the MWIS-constructed portfolio performs better than the S&P 500 in terms of a greater Sharpe Ratio in 8 out of 12 of the years we tested on.

Many trading strategies such as the one we presented include large NP-hard computations, which are much more efficient using quantum-inspired methods versus classical ones.

Compared to other quantum-inspired solvers, TitanQ supports many more variables, which means we can solve much larger problems. Moreover, the potential for hardware acceleration using our FPGA methods makes this strategy viable in high frequency trading.

As we have shown, TitanQ is able to handle such computations, opening a door to new trading strategies as well as the potential of improving existing ones.

Download Full Article Here:


Interested in trying out this problem on TitanQ? All the code for this problem and many other applications are publicly available on our GitHub.



Ethan Wang - Ethan is a Mathematical Algorithms Developer on the Algorithms team at InfinityQ Technology. He is currently pursuing an undergraduate major in mathematical finance and a minor in pure math and statistics at the University of Waterloo. Before InfinityQ, Ethan worked as a software developer at BMO where he led the integration of an audit service that aimed to enhance observability of internal data pipelines.

Despite his work history in software development, his true passion lies in mathematics and problem solving. Ethan’s mathematical expertise and interest in quantitative finance pushes InfinityQ to explore new areas of application.

Brian Mao, MMath - Brian is Head of Algorithms at InfinityQ Technology. with a background in both mechanical engineering and applied mathematics. Prior to InfinityQ, he was the Path Planning and Controls Lead at MIT Driverless where he led multiple sub-teams to program a modified Dallara IL-15 to drive fully autonomously around the Las Vegas Motor Speedway at over 240 km/h.

He also worked at Apple under the Metal Tooling team to simulate the manufacturing process of various components. Brian continues to pursue the intersection between engineering and mathematics through finding solutions to many different mathematical optimization problems at InfinityQ.

bottom of page