Quantum Computational Finance: Quantum Algorithm for Portfolio Optimization

Patrick Rebentrost, Seth LloydKünstliche Intell 2018 · DOI

TL;DR

This paper introduces a quantum algorithm for portfolio optimization that can achieve a run time logarithmic in the number of assets, significantly outperforming classical methods that scale polynomially with the number of assets. The algorithm leverages quantum linear systems algorithms to efficiently determine the optimal risk-return tradeoff curve and sample from optimal portfolios, offering a potential speedup for a crucial financial task.

What Problem Does This Paper Address?

Modern finance relies heavily on complex computational tasks, including portfolio optimization. The goal of portfolio optimization is to find the best allocation of capital across various assets to achieve a desired return while minimizing risk, or vice versa. Classical approaches to this problem, particularly those involving the calculation of the risk-return curve and the identification of optimal portfolios, often involve constructing and manipulating large covariance matrices. This process can be computationally intensive, scaling polynomially with the number of assets ($N$). As the financial markets grow and the volume of data increases, these classical methods can become a bottleneck. The paper addresses this by proposing a quantum algorithm that can tackle portfolio optimization with a potentially exponential speedup, achieving a run time that scales logarithmically with the number of assets.

Methods

The core of the proposed quantum algorithm for portfolio optimization relies on the Harrow-Hassidim-Lloyd (HHL) algorithm for solving linear systems of equations. The problem of portfolio optimization is framed as an equality-constrained quadratic programming problem. This problem is then transformed into a linear system that can be solved using HHL.

Key methodological aspects include:

  • Quantum Data Access (qRAM): The algorithm assumes access to financial data (asset prices, historical returns) via quantum random access memory (qRAM). This allows for quantum-parallel access to data, which is crucial for achieving quantum speedups.
  • State Preparation: The algorithm involves preparing quantum states that encode relevant financial information, such as the vector of expected returns and the covariance matrix. Techniques like quantum state exponentiation are used for this purpose.
  • HHL Algorithm Application: The HHL algorithm is applied to solve the linear system derived from the portfolio optimization problem. This allows for the efficient computation of the optimal portfolio allocation.
  • Sampling: Instead of outputting the full portfolio vector (which would require classical post-processing and negate the speedup), the algorithm outputs a quantum state representing the optimal portfolio. This state can then be sampled to obtain a sparse representation of the optimal portfolio. The probability of sampling a particular asset is proportional to its weight in the portfolio.

Datasets

The paper does not introduce new datasets. Instead, it assumes access to historical financial data, such as:

  • Asset prices: Time series of prices for $N$ assets over $T$ time instances.
  • Historical returns: Derived from asset prices, these are used to compute expected returns and covariance matrices.

The paper discusses how this data can be stored and accessed using qRAM.

Key Insights and Ideas

  • Logarithmic Complexity for Portfolio Optimization: The most significant insight is the potential for a poly(log N) run time for portfolio optimization, a substantial improvement over classical poly(N) algorithms. This speedup is achieved by leveraging quantum linear algebra techniques.
  • Risk-Return Tradeoff as a Quantum State: The algorithm determines the optimal risk-return tradeoff curve and represents the optimal portfolio as a quantum state. This allows for efficient manipulation and analysis of complex financial relationships in a quantum framework.
  • Sampling for Practical Portfolios: Directly extracting the full optimal portfolio vector from a quantum state can be inefficient. The paper proposes sampling from the quantum state to obtain a sparse, near-optimal portfolio, which is more practical for implementation.
  • qRAM as a Crucial Enabler: The efficiency of the quantum algorithm is heavily reliant on the availability and efficient implementation of quantum random access memory (qRAM) for accessing financial data.

Key Results

  • The quantum algorithm can determine the optimal risk-return tradeoff curve and sample from the optimal portfolio.
  • The algorithm can achieve a run time of poly(log N), where $N$ is the number of assets. This is a significant theoretical speedup compared to classical algorithms that take poly(N) time.
  • The paper demonstrates how to prepare quantum states representing the expected return vector and the covariance matrix, which are essential inputs for the optimization.
  • Sampling from the resulting quantum state can yield a sparse portfolio with an expected standard deviation within $O(1/\sqrt{M})$ of the minimum standard deviation, where $M$ is the number of samples.

Limitations and Future Work

  • Hardware Requirements: The paper acknowledges that the proposed algorithm requires significant quantum hardware, particularly for implementing qRAM and performing complex quantum operations. The hardware requirements for storing and accessing data are $O(N)$.
  • Data Loading: While the algorithm's computation time is logarithmic, the initial loading of data into qRAM can take $O(TN)$ time, where $T$ is the number of time steps.
  • Measurement Overhead: While the algorithm provides a quantum state for the optimal portfolio, extracting all its components classically would negate the speedup. The paper focuses on sampling and measuring specific properties.
  • Error Analysis: The paper touches upon error analysis, particularly concerning the HHL algorithm's pseudoinverse approximation and finite sampling effects. Further detailed error analysis and mitigation strategies would be beneficial.
  • Future Work: The authors suggest that further research could explore more sophisticated measurement operators to extract valuable classical information from the quantum portfolio state, beyond just risk and investment decisions. Investigating the full set of interesting measurements on the portfolio vector is also highlighted as a future research direction. The intersection of quantum computing and finance is identified as a fertile ground for further study, with potential for significant financial rewards from even small speedups.

Summary updated

BibTeX
@inproceedings{rebentrost2018quantum,
  author = {Patrick Rebentrost and Seth Lloyd},
  title = {{Quantum Computational Finance: Quantum Algorithm for Portfolio Optimization}},
  booktitle = {Künstliche Intell},
  year = {2018},
  doi = {10.48550/arxiv.1811.03975},
}
Figure