Applying the QAOA algorithm to investment opportunities in IBEX 35 companies

Quantum optimisation
Nov
13
2024

In previous posts, we have discussed the optimisation of portfolios using quantum annealing. Now, we will examine an alternative approach within a gate-based quantum computer [1], providing a view to understanding how QAOA works and a practical use case for the top ten enterprises in IBEX 35.

In the context of combinatorial optimisation, the definition of an objective function is the first step of the problem-solving process. Once the objective function has been defined, the QAOA algorithm [2] comprises the repetition of a two-block process. The two-block structure incorporates both phase and mixing operators. The idea behind utilising phase operators is to map the objective function to the phase Hamiltonian, thereby rendering the search for the optimal value equivalent to finding the eigenvalues of the phase Hamiltonian. The mixing operators are used to explore the solution space by driving the quantum state away from its initial configuration. The alternation between the encoding of the objective function and the mixing of the quantum state permits the exploration of a wide range of potential solutions.

We will now proceed to illustrate a toy problem, using the QAOA algorithm for investments within IBEX 35 companies. The primary objective of portfolio optimisation is to achieve the greatest possible return while simultaneously minimising risk. We will focus our analysis on the top ten IBEX 35 enterprises with the aim of developing a model to identify the three most suitable enterprises for a fixed-risk investment strategy. This implies that our basic approach will merely identify the stocks to be purchased, without specifying the amount to be invested in each company. This entails that we will allocate the funds in an equitable manner between the three aforementioned companies. In order to construct our objective function, it is necessary to have a measure of the return and the variance of the assets in question. For the return of each asset, we use: 

Where prepresents the cash value of the last transacted price before the market closes on day i, with the summation extending over a fixed number of days (T).

The variance and covariance between the different assets can be calculated as:

We are now able to construct our objective function:

The risk factor, defined by q, may vary between different investors. Furthermore, it is necessary to introduce a constraint, designated as budget, which will determine the number of assets that an investor can purchase.

In our specific use case, we will be utilising the historical records of Ferrovial, Telefónica, Bankinter, Acerinox, Amadeus, Logista, Mapfre, Inditex, Aena and Endesa between 1/1/2022 and 1/1/2024. Once we set a budget = 3 and the risk factor = 0.2, we can run the QAOA algorithm, which gives Acerinox Mapfre and Inditex as a solution. In conclusion, we observe the performance of these three enterprises over the course of 2024 and calculate potential income streams for a portfolio on that basis.

 

References

  1. Giuseppe Buonaiuto, Francesco Gargiulo, Giuseppe De Pietro, Massimo Esposito, and Marco Pota. Best practices for portfolio optimization by quantum computing, experimented on real quantum devices. Scientific Reports, 13(1):19434, 2023.

  2. Jaeho Choi and Joongheon Kim. A tutorial on quantum approximate optimization algorithm (qaoa): Fundamentals and applications. In 2019 international conference on information and communication technology convergence (ICTC), pages 138–142. IEEE, 2019.

Do you have any questions?

Add new comment

Restricted HTML