key: cord-0308154-c1bspgiv authors: Slate, N.; Matwiejew, E.; Marsh, S.; Wang, J. B. title: Quantum walk-based portfolio optimisation date: 2020-11-17 journal: nan DOI: 10.22331/q-2021-07-28-513 sha: aa695a5a447705d1edc9569d2c781257d557cad0 doc_id: 308154 cord_uid: c1bspgiv This paper proposes a highly efficient quantum algorithm for portfolio optimisation targeted at near-term noisy intermediate-scale quantum computers. Recent work by Hodson et al. (2019) explored potential application of hybrid quantum-classical algorithms to the problem of financial portfolio rebalancing. In particular, they deal with the portfolio optimisation problem using the Quantum Approximate Optimisation Algorithm and the Quantum Alternating Operator Ansatz. In this paper, we demonstrate substantially better performance using a newly developed Quantum Walk Optimisation Algorithm in finding high-quality solutions to the portfolio optimisation problem. Quantum computers are powerful devices that utilise intrinsic properties of quantum mechanics, such as superposition and entanglement, to provide substantial speedups for solving computationally hard problems [1, 2] . A recent influx of interest and technological advancements in this field have lead to the discussion of practical applications especially in the Noisy Intermediate-Scale Quantum (NISQ) era [3] . This includes solving difficult financial problems [4] [5] [6] [7] ; one such problem is portfolio optimisation and periodic re-balancing [8] . When considering a set of n assets there are 3 n different portfolio combinations when we consider three different discrete asset positions: 1. Long position: the buying of an asset such as a stock, commodity or currency with the expectation that it will rise in value; 2. Short position: the selling of an asset with the expectation that it will drop in value; 3. No position: neither a long nor short position is taken. In this work, we take the mean-variance Markowitz model [9, 10] as the basis for portfolio optimisation, which is fundamental to modern portfolio theory. Although this model was developed in the 1950s, its simplicity, relative accuracy and relevance persists as an area of exploration for the quantum computing community [8] . Financial portfolio optimisation and the Markowitz model have been shown, when discrete asset constraints are involved, to fall into the category of NP-hard combinatorial optimisation problems [11, 12] . Thus, the portfolio optimisation problem provides a real-world model to investigate quantum speedups through quantum approximate optimisation algorithms. Of interest are implementations appropriate for near-term noisy intermediate-scale quantum (NISQ) computers, which have become increasingly available in the cloud, and are fast approaching sufficient scale and fidelity [3] . The problem of portfolio optimisation and rebalancing using the Markowitz model with discrete asset constraints has been previously evaluated using the Quantum Approximate Optimisation Algorithm and Quantum Alternating Operator Ansatz [8] . Collectively known as QAOA, the algorithms were developed by [13] and [14] to solve combinatorial optimisation problems. The latter algorithm generalises the original QAOA to incorporate optimisation constraints. Since we aim to compare these algorithms in this paper, we distinguish them as QAOA and QAOAz respectively. These algorithms are known as hybrid quantum-classical algorithms, as they utilise both quantum computing advantages and classical optimisation in order to minimise a given objective function. QAOA can be thought of as a Trotterised approximation to the Quantum Adiabatic Algotithm (QAA) [14] , where the system is evolved into the ground state of some operator that encodes the problem solution. As a heuristic or approximation algorithm, QAOA accepts high-quality solutions when the optimal solution is not found. Specifically, QAOA-based algorithms utilise an alternating state evolution consisting of solutionquality-dependant phase shifts and a mixing of probability amplitude across a state-space of possible solutions. Using a hybrid quantum-classical variational scheme, the expectation value of an operator encoding the objective function of an associated scalar optimisation problem is minimised; such that the probability of measuring the system in a state corresponding to a high quality solution is amplified. This paper evaluates a further development in QAOA schema known as the Quantum Walk Optimisation Algorithm (QWOA) [15] . QWOA utilises an efficient indexing algorithm in conjunction with a generalisation of the QAOA mixing operator to a continuous-time quantum walk over a circulant graph that connects all feasible solutions. Our earlier work indicated that QWOA offers significant advantages over pre-existing methods through a reduction in the search space and an unbiased encoding of optimisation constraints [15] . In this paper we provide numerical evidence for the efficacy of QWOA through its application to portfolio optimisation. The paper is organised as follows. In Sec. IIA, we introduce the Markowitz model for portfolio optimisation, along with its quantum encoding for approximate optimisation. In Sec. IIB, we compute the size of the search space for QAOAz and QWOA. This is followed by a detailed description and circuit comparison of the three quantum approximate optimisations under consideration. Finally, in Sec. III and Sec. IV, we present numerical results and analysis. The formalisation and models used in this paper are based upon the work done by Hodson et al. [8] as to provide a basis for comparison between QAOA, QAOAz, and QWOA. The discrete mean-variance Markowitz model can be expressed through minimisation of the objective function which we subject to the optimisation constraint In the above formulation, z = z 1 . . . z n encodes a particular choice of portfolio from n assets, where for each asset i we have z i ∈ {1, −1, 0} representing the choice of a long position, a short position, or no position. Associated with each asset is an expected return r i , and the correlation between two assets i and j is given by the covariance σ ij . These values are derived from historical data. The risk aversion parameter λ, taking a value between 0 and 1, reflects the balance between returns and risk. As this risk parameter approaches 0, the optimal portfolio is based purely on obtaining maximum returns. As λ approaches 1, the only consideration becomes minimisation of risk (for example, leading to a preference for government bonds over real estate). The value A defines the net total of discrete lots to be invested for the portfolio. Note that in the definition of A, the signed quantity z i is summed rather than the absolute value |z i |, which is a formulation generally used in portfolio rebalancing to treat the relative net position with respect to an existing portfolio [8] . The mean-variance formulation is standard and well-studied in finance, both in the continuous and discrete domain [16, 17] . The model formalises the idea of portfolio diversification, where an investor can reduce risk by owning a number of assets having low correlations on returns. The application of discrete variables commonly applies to situations where the class of assets is traded in discrete quantities (e.g. real estate), and when the cost of a single asset is substantial (bonds often meet this criteria). It additionally is applicable where one wishes to subdivide a fixed budget equally amongst the assets in the portfolio. In order to 'quantise' the formulation and encode each portfolio using a quantum register, we require two qubits per asset as shown in Table 1 , representing the three possible position choices for each asset. 'Short' qubit 'Long' qubit z i value |z encoding For the QWOA, it is a necessary condition [15] to identify the cardinality of the solution set for any given parameters (n, A). It is also useful to see the difference in the size of the constrained search subspace to compare between QAOA, QAOAz and QWOA. As there are n assets under consideration, and each asset uses two qubits to encode its position, the Hilbert space is of size N = 2 2n , which is the ordinary QAOA search space. However, only a subset of these states correspond to valid portfolio configurations that satisfy the constraint given in Eq. (2) . Furthermore, portfolio configurations that include a stock with both position qubits set to |1 are degenerate -the |11 configuration is interpreted as equivalent to the |00 configuration, i.e. no position. This means there can be a large amount of degeneracy amongst the 'valid' states. We aim to count the number of valid and non-degenerate states, which we will later see corresponds to the size of the search subspace for QWOA. First, we note that the number of valid nondegenerate (n, A)-portfolios has an exact correspondence with the number of lattice paths from (0, 0) to (n, A) with steps taken from the set {U = (1, 1), D = (1, −1), H = (1, 0)}. An example of this correspondence is given in Fig. 1 . Choosing a long position on a stock is equivalent to stepping diagonally up, while choosing a short position is equivalent to stepping diagonally down. Choosing no position on a stock takes a step horizontally. To satisfy the investment constraint of having A more long positions than short positions, the path must end at (n, A). where the second binomial coefficient is set to 0 if its bottom parameter is not an integer. Proof. We follow the techniques used in [18] . In particular, the lattice path is similar to a socalled Motzkin path, for which the number of paths is given by Eq. (10.43) in [18] . Suppose that there are j H-moves in a given path from (0, 0) to (n, A). If these are removed, we are left with a path from (0, 0) to (n − j, A) using only diagonal moves. Performing the coordinate mapping (x, y) → ( 1 2 (x+y), 1 2 (x−y)) transforms the problem into finding a path to ( 1 2 (n+A−j), 1 2 (n−A−j)) using standard basis steps (1, 0) and (0, 1). The number of paths to this endpoint with standard basis steps, using Eq. (10.3) in [18] , is where the binomial coefficient is 0, if the bottom component is fractional. There are n j ways to re-insert the originally removed H-moves, and after summing over j we arrive at the desired result. The search space of QAOAz is larger than M(N, A), since we will later see that it incorporates valid but also degenerate solutions. The number of all valid portfolio encodings, including degeneracies, can be expressed as since if there are j H-moves the corresponding j stocks may each be encoded as |00 or |11 . More simply, the second expression is derived from choosing (n + A) bits to flip in the 2n-qubit state encoding. In the following section it will be shown that this is the size of the search space for QAOAz. The Quantum Approximate Optimisation Algorithms evolve a given initial state as Here, U C (γ) |z = e −iγc(z) |z for any portfolio qubit encoding |z as per Table 1 , applying a relative phase shift to the solution proportional to the variational parameter γ and to the value of the portfolio with respect to the objective function. This operator, as defined based on the objective function c(z) given in Eq. (1), is the same for all methods discussed in this section. We also define the corresponding Hamiltonian C such that U C (γ) = e −iγC , which encodes the values of the objective function c(z) as its diagonal elements. The operator U mix is the mixing operator that differs depending on the choice of connectivity between solution states. In this section, we contrast three different algorithms that have differing U mix operators and associated initial states |ψ 0 . The integer parameter p is the number of QAOA iterations, with increased p providing improved solution quality at the cost of increased circuit depth and ( t, γ) are circuit parameters which are classically optimised in order to minimise the expectation value ψ f | C |ψ f . In this framework, a lower expectation value corresponds to a greater probability of measuring a portfolio with an optimal, or near optimal, balancing of predicted future returns and risk. For the original QAOA scheme, the mixing operator U mix is defined as . One method of encoding the investment constraint is to incorporate it within the objective function. This so-called 'soft constraint' occurs as the addition of a penalty function to Eq. (1), where > max(c(z)) − min(c(z)). Thus for QAOA applied to portfolio optimisation, C |z = (c(z) + ζ(z)) |z . Final states with minimal expectation value correspond to 'good' solutions to the given optimisation problem. The penalty function penalises portfolios with a net long position of more than or less than A assets. With the use of the inequality, this penalty function ensures that the minimum objective function value corresponds to a state which satisfies the constraint. The soft constraint method enables the QAOA algorithm to optimise given the constraint, but there are states in which the constraint is not satisfied which are still being considered by the algorithm. The initial state for the soft constraint method is simply an equal superposition across all states, This extension of the QAOA provides a means of constraining the optimisation process to the subspace of valid solutions by modification of the mixing operator. The phase unitary, U C (γ), maintains the same form for all algorithms discussed in this paper. However, the mixing operator is now replaced by U QAOAz , which is an approximation to the time evolution of the 'dual parity ring' Hamiltonian as given in [8, 19] , where all addition is modulo n. This Hamiltonian preserves the Hamming weight of both the short and long qubits independently, and consequently meets the A-constraint. Hadfield et al. [19] provide a method for approximating the time evolution of the dual parity ring mixer Hamiltonian by decomposing it into three non-commuting unitaries. The QWOAz mixer for portfolio optimisation is thus defined as where again all addition is modulo n. In the above expressions, the first exponential acts independently on the short position qubits, whilst the second acts on the long position qubits. When given an initial state satisfying Eq. (2), the action of the dual parity ring mixer ensures that QAOAz has non-zero amplitude only in solution states satisfying the net investment constraint. The mixing operator U QAOAz creates a structure known as parity bands, which are a result of the preservation of both the long and short qubits independently. Given there are more than one way to satisfy the investment constraint (e.g. for n = 5 and A = 4, two valid portfolios are 4 long positions and 1 no position, or 5 long positions and 1 short position), the parity bands are disconnected. Consequently, there is no ability to transfer amplitude between parity bands through this mixing operator. We must thus ensure the initial state is in a superposition across all possible valid parity bands. Given n assets with a net portfolio position of A, a simple initial state given in [8] that meets this criteria is which represents an equal superposition over all the (degenerate) portfolios having exactly A more long positions than short positions and (n−A) no-positions. This initial state is efficient to prepare, but at the cost of bias -the probability amplitude is binomially distributed across parity bands [8] . QWOA generalises the original QAOA mixer as a continuous-time quantum walk (CTQW) over the subspace of valid solutions [15] . QWOA again evolves the initial state as given by Eq. (6), but with a new quantum walk mixer U QWOA . The quantum analogy to the classical random walk, a CTQW is the evolution of a quantum system under a Hamiltonian defined by a graph adjacency matrix [20, 21] . The advantage of QWOA for the portfolio optimisation problem lies in its flexibility in 'connecting' only the solutions in the valid subspace, the ability to eliminate degenerate portfolio states (thus significantly reducing the search space), and complete global symmetry amongst valid solutions (eliminating bias of one valid solution over another due to mixing asymmetry). In order to implement a QWOA mixer on a desired subspace of solutions S, we first design an efficiently computable bijection S id − → {0, 1, . . . , |S| − 1} [15] , as illustrated in Table 2 . In the case of portfolio optimisation, we need a classical algorithm id n,A (x) to index the valid and canonical (non-degenerate) portfolio encodings x. In the following, we provide such an algorithm to compute id n,A (x) for any given valid portfolio x and id −1 n,A (j) for any given index j. We use a simple recursion relation to index, based on the counting function in Eq. (3). Observe that M(n, A) = M(n−1, A)+M(n−1, A−1)+M(n, A+1). Using the lattice analogy, the number of paths reaching (n, A) is the sum of the number of paths one step from (n, A). This inspires a recursive ranking algorithm as per Algorithm 1. The un-indexing algorithm works similarly, mapping an integer index to a binary portfolio representation as per Algorithm 2. The quantum circuit shown in Fig. 3 performs the unitary mapping U † # |j = id −1 (n, A, j) , i.e. un-indexes an integer to the corresponding portfolio. The correctness of the circuit follows directly from Algorithm 2, where we use the property that y = 0 and A = 0 at the end of the recursive sequence to ensure that there are no registers entangled with the output. Clearly by reversing the circuit, the indexing unitary U # is obtained. In the sub-circuit shown in Fig. 3a , we rely on a unitary implementation of the counting function M j k |A |0 = |A |M(j, A + k) . Since j is known classically for each sub-circuit, and we must have −j ≤ A + k ≤ j, this can be implemented by classically pre-computing the unique possible values of M(j, A + k) and applying at most j + 1 = O(n) controlled additions of these possible values (where the control is on equality with each possible value of A + k). In addition, the given indexing sub-circuit uses O(1) quantum comparators and other controlled subtraction/addition operations. This leads to a sub-circuit complexity of O(n) as per Fig. 3a and thus an overall indexing gate complexity of O(n 2 ) as per Fig. 3b , omitting polylogarithmic factors. The quantum circuit for quantum portfolio indexing relies on three main registers. An ancilla register of size O(log n) is used to track the value of A through the indexing process. The input index is held in a register of size O(log M(n, A)) = O(n), and the output portfolio encoding is also O(n). Note that the second ancilla register shown in Fig. 3a is not required and is shown for graphical convenience -the un-set bits of the output register can be used instead. With the indexing unitary in hand, the M valid portfolios can be 'connected' using any Mvertex graph over which an efficient quantum walk can be implemented. In particular, [15] describes an efficient approach for using an arbitrary circulant graph as a mixer, since this class of graphs can be simulated efficiently using the Quantum Fourier Transform [22] [23] [24] [25] [26] [27] [28] [29] . In this work, we choose the complete graph, K M , due to its efficiency of implementation and global symmetry. Details of the circuit for quantum walk over K M can be found in [15, 30, 31] , having asymptotic gate complexity O(n) to simulate the walk with exponential precision, again omitting polylogarithmic factors. Thus, we have where the depth of the mixing unitary is dominated by that of the indexing procedure, leading to an overall complexity of O(n 2 ). The associated equal superposition initial state is In Fig. 4 , we represent the Hamiltonian underlying each mixing operator as the adjacency matrix of a graph for a 3-asset example problem, to illustrate the connectivity between solutions. The generic QAOA mixing operator can be considered as a quantum walk on the 2n-dimensional hypercube shown in Fig. 4a . QAOAz mixes only valid solutions, but as per Fig. 4b there are a number of disconnected graph components, asymmetry in vertex degree and connectivity, and degeneracy amongst some of the valid portfolio solutions. Finally, associated with QWOA is a complete graph connecting the canonical valid solutions. In Fig. 5 we contrast the search space and gate complexity for the three approaches. Also shown is a plot of the search space for varying n, with fixed A = 0. QAOA scales like 4 n , while QAOAz scales like 4 n √ πn for large n. QWOA in contrast reduces the search space by more than half on mean, scaling approximately as 3 n 2 √ πn (this result is obtained by observing that for even n, M(n, 0) are the sum of squared trinomial coefficients). We argue that the significant reduction in the size of the search space is worth the quadratic increase in mixing circuit complexity as per Fig. 5a . As shown in the following section, QWOA converges to high-quality solutions far more quickly, with a small choice of p producing near-optimal solutions. Numerical simulation of the portfolio optimisation problem was carried out for QAOA, QAOAz and QWOA, using the software package QuOP MPI [32, 33] . For all reported results, the γ and t parameters were optimised using the Broyden-Fletcher-Goldfarb-Shanno algorithm. The Newton-Conjugate-Gradient, Nelder-Mead Simplex and Powell's method algorithms were also considered. However, these yielded equivalent, or uniformly poorer, results. The simulations utilised daily share prices from two data sets, Data Set A and B, which selected n = 8 stocks from the ASX.20 index. The adjusted close price was used to ensure that all possible corporate actions were considered in the share performance, such as dividends. Data Set A contained the daily adjusted close prices from 01/01/2017 to 31/12/2018 for the shares: AMP, ANZ, AMC, BHP, BXB, CBA, CSL and IAG. Data Set B ranged over the period of 24/03/2020 to 06/09/2020 and selected shares based on sectors heavily impacted by the COVID-19 pandemic: FLT, QAN, WEB, REX, AIZ, SYD, SCG and CTD. Both data sets were obtained from Yahoo Finance using a Python based API [34] . For all simulations, A = 4 and λ = 0.5. In each case, the presented results correspond to the mean and standard deviation for 15 repeats of each algorithm. These used the same set of randomly generated initial γ and t values, uniformly distributed between 0 to 2π. With N = 8 and A = 4, the search spaces of the three algorithms are 2 16 for QAOA, 1820 for QAOAz and 266 for QWOA. The size of the disconnected QAOAz parity bands are shown in Fig. 6a for N = 8 along with the distribution of |ψ 0 across all bands satisfying A = 4. We note that the largest connected components correspond to states satisfying A equal or close to 0, and that the binomial distribution of the initial state centers on these larger components. As mixing of probability amplitude does not occur across the parity bands, the probabilities shown in Fig. 6b are the maximum possible for a single state in each of the parity bands, as opposed to QAOA and QWOA which converge to a single state as p → ∞. For Data Set A, this influences the minimum possible objective function value which is −0.318 for QAOA and QWOA, and −0.305 for QAOAz. For Data Set B the minimum is −1.25 for QAOA, QWOA and QAOAZ as the optimal portfolio exists in all four of the populated QAOAz parity bands. The small and fully-connected search space of QWOA is expected to result in it outperforming QAOA and QAOAz at sufficiently high p. Of critical note is that the classical optimisation component suffers from the curse of dimensionality as the number of optimisation parameters increase (i.e. with increasing p). Each time p increases by 1, two additional independent classical optimisation parameters are needed to maximally explore the available search subspace. In hybrid quantum-classical optimisation an estimation of ψ f | C |ψ f is obtained by repeated sampling of the |ψ f state, and the optimisation parameters are tuned to optimise this quantity. Consequently, with increasing dimensionality the classical optimisation deteriorates [35] , making less progress per optimisation iteration, and thus increasing the overall number of quantum circuit shots required. A practical hybrid quantum-classical variational algorithm must therefore demonstrate rapid convergence at low p. In this sense, the polynomial difference in circuit depth per iteration given in Fig. 5 is negligible compared to the exponentially increasing classical parameter space with increasing p. In the following numerical results we demonstrate that QWOA is by far the best candidate in this regard out of the three considered algorithms, needing drastically smaller p to reach a given expected solution quality ψ f | C |ψ f . Fig. 7a shows the final value of the optimised objective function for QAOA, QAOAz and QWOA. On average, QAOA performs poorly as compared to the other two algorithms. Additionally, QAOA consistently exhibits the largest standard deviation in the optimised objective function value ψ f | C |ψ f with a maximum of 12.96 as compared to 0.038 for QAOAz and 0.011 for QWOA. This is consistent with the inclusion of invalid portfolio states and the QAOA mixing operator's action over the complete Hilbert space, as per Fig. 5 , which increases the likelihood of the classical optimiser converging to a poor local minima when compared to QAOAz or QWOA. Note that the minimum objective function value (red line), derived from the globally optimal portfolio selection, is obtained by classical brute-force iteration through all feasible solutions and shown for the purpose of comparison. The optimised expectation value after p iterations for QAOAz and QWOA is shown in Fig. 7b . QAOAz shows diminishing improvement past p ≈ 8, reaching an expected portfolio value approximately 0.2 above the optimum portfolio objective function value after 19 iterations. To explore the reason behind this performance, Fig. 8b plots the QAOAz output state probabilities for solutions contained in the parity band of Hamming weight 8, see also Fig. 6 , which corresponds to a parity band containing the optimal solution. It is clear that degeneracy plays a part, with the two highest-probability states in the parity band representing the same portfolio. Even though this is a parity band containing the (degenerate) optimal solution state, its associated probability has not been amplified, remaining below 10 −9 . Conversely, QWOA exhibits rapid improvement with p over the range considered as per Fig. 7b and, as shown in Fig. 8a , is able to amplify the optimal portfolio configuration to above 40% probability by p = 19. Overall, the superior performance of QWOA at low p is consistent with the algorithm's reduction of the search space to 0.406% of QAOA and 14.61% of QAOAz; along with a reduction in state and mixing bias. Given n = 8 with an investment constraint of A = 4, there are 1554 degenerate states, which are not equally distributed over the valid solutions. As per Eq. (5), the number of the degenerate states for a given portfolio is directly related to the number of 'no positions' it contains, with a higher number corresponding to more degenerate states. This clearly effects the performance of QAOA and QAOAz, producing lower-quality portfolios on average for a given choice of p. Fig. 9a and Fig. 9b show the expected annual return and expected annual risk for Data Set A. These values were obtained by multiplying the probability of a each portfolio configuration by the corresponding annual return and risk respectively. QWOA performs significantly better than QAOA and QAOAz with respect to the annual return. We note that, as the mean-variance model is trying to find the best combination of return vs risk, the optimal portfolio will not necessarily exhibit the lowest possible risk -as low risk assets are typically associated with decreased return. Fig. 9c displays the historic mean return and the projected return of the final QWOA state at p = 19. It is clear that the obtained data is a good match for the historic data used, with an accurate representation of the trend and volatility of the data. Data Set B is consistent with the pattern of performance observed for Data Set A. As shown in Fig. 10a and Fig. 10b , QWOA consistently finds the best expected solution quality, followed by QAOAz and then QAOA. The same trend in the standard deviation of ψ f | C |ψ f is also observed with QAOA having a maximum of 12.75, followed by 0.61 for QAOAz and 0.115 for QWOA. As shown in Fig. 10b , QWOA again offers significant advantage over QAOAz. As previously discussed, the QAOAz parity mixer is expected to lead to performance variation dependant on the distribution of the optimal solutions amongst the disconnected parity bands. However, for Data Set B, the optimal solution is present in each of the 5 parity bands, as opposed to Data Set A, which contained the optimal solution in only 3 of the 5 graphs (of sizes 448, 784 and 448 respectively). A convergence to the optimal solution is observed in the QWOA numerical simulations, shown in Fig. 7b and Fig. 10b . Reinforcing the above observations, we note significant differences between QAOAz and QWOA in the probability distribution of the optimised state |ψ f for p = 19, as shown in Fig. 11 . QWOA manages to boost the probability of the optimal portfolio state to approximately 20%. It also amplifies other high-quality portfolios, as demonstrated in Fig. 11a . Examining the parity band shown in Fig. 11b , the optimised parameters amplify solutions of comparatively lower quality than the optimum with the probability for the degenerate optimal solutions remaining below 10 −6 . Also notable is the presence of solution degeneracy, with the 12 significantly amplified portfolios corresponding to four distinct degenerate solutions. Fig. 12a and Fig. 12b display the expectation value for the returns and expected risk. QWOA yields the highest expected return for p > 2. Unlike Data Set A, QAOA is observed to provide the next best expected return for p > 7. However, this is associated with a consistently higher expected risk as compared to QAOAz and QWOA, which indicates convergence to a sub-optimal local minima. The mean expected return and risk across across the occupied QAOAz parity bands is 490% and 542%, taking into account the binomial distribution of the initial state. This is significantly different from the expected risk and return observed for QAOAz in Fig. 12a and Fig. 12b for p ≥ 3 which, in combination with the relatively flat QAOAz response to increasing p, is indicative of convergence to a state highly influenced by solution degeneracy. As shown in Fig. 12c , the projected return of the final QWOA state at p = 19 is a good match for the historic data used, as it again accurately represents the trend and volatility of the data. The above results illustrate that the QWOA has an improved rate of convergence (expected solution quality gained per iteration) over the other two approaches. Additionally, the stability of the classical parameter optimisation procedure is higher, as indicated by the smaller error bars. The reasons behind this are multifaceted. The primary improvement is derived from the fact that the combinatorial domain consisting of M(n, A) valid portfolios is not a binary power in general -if it were, there would be no 'leftover' computational basis states that do not represent a valid solution. In this case, the QWOA would not gain an advantage from considering the valid subspace of solutions. Note that this same advantage holds in general, even under various modifications of the objective function. For example, even if the number of possible asset positions is increased from 3 to 4 such that there is no degeneracy in the qubit encoding, introducing an investment constraint will again reduce the number of valid solutions down from 4 n to (in general) a non-binary power. Thus, QWOA will achieve this advantage over any QAOA-based algorithm that cannot restrict to only the subspace of non-degenerate valid solutions. The secondary advantage is the choice of the complete graph as the mixer between valid solutions. This leads to an improvement over QAOAz, which has a non solution-transitive connectivity as shown in Fig. 4b and does not have a connected solution space. Furthermore, the complete graph is likely the optimal choice of mixer for combinatorial optimisation, based on its proven optimality with respect to spatial database search [36] [37] [38] . This holds intuitively, considering the maximal symmetry and connectivity, and the minimal possible graph diameter of 1. These conclusions are supported by the smooth convergence of the QWOA optimisation procedure, where the optimisation of the variational parameters t represent optimisation of quantum walk times on the complete graph. Note that the above comments do not depend on portfolio optimisation-specific assumptions. The 'energy penalty' constraint encoding approach of the QAOA is applicable to any optimisation problem, and the parity ring mixer formulation of QAOAz is applicable to a wide range of nontrivial combinatorial optimisation domains [19] . Thus, we suggest that these results apply to general 'black-box' optimisation problems where the number of valid solutions is not a power of 2. An example of another applicable real-world combinatorial optimisation problem is the wellknown Travelling Salesman Problem on n cities [39] , where the n! feasible solutions necessarily incur leftover states for any qubit solution representation. Rather than introducing degenerate solutions or energy penalties, it is advantageous to restrict strictly to the non-degenerate subspace of valid solutions using the QWOA. As demonstrated by the results in this section, the modest polynomial increase in circuit depth of the QWOA is worth the alleviation of the exponential curse of dimensionality with respect to the classical parameter optimisation. This paper carries out a detailed comparison between the performance of the well-known Quantum Approximate Optimisation Algorithm (QAOA), the Quantum Alternating Operator Ansatz (QAOAz), and the newly-developed Quantum Walk Optimisation Algorithm (QWOA) on the NPhard problem of portfolio optimisation with discrete asset constraints. We perform a detailed analysis of the different mixing operators involved with each technique, and the associated search subspaces. Our numerical simulations highlight key advantages of QWOA when compared to both QAOA and QAOAz. QWOA reduces the search space by a significant factor, leading to consistently improved performance in obtaining a high quality portfolio configuration using fewer iterations, and with significantly smaller standard deviation across numerical simulations. Additionally, the global symmetry of the QWOA mixing operator leads to clear advantages in convergence rate and expected solution quality, while QAOA and QAOAz are hindered by bias in the mixing operator over nontrivial feasible solution spaces. These results show not only the applicability of quantum combinatorial optimisation algorithms to an important real-world problem in the financial realm, but also express the advantages of using the QWOA on arbitrary optimisation problems with complex discrete constraints and associated solution domains. This work was supported by resources provided by the Pawsey Supercomputing Centre with funding from the Australian Government and the Government of Western Australia. JBW and SM thank Yuying Li for valuable discussions on computational finance and optimisation. EM and SM acknowledge the support of the Australian Government Research Training Program Scholarship. SM's research was also supported by a Hackett Postgraduate Research Scholarship at the University of Western Australia. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer Quantum Computation and Quantum Information. Cambridge University Press Quantum computing in the NISQ era and beyond. Quantum, 2:79 Quantum computational finance: quantum algorithm for portfolio optimization Quantum computational finance: Monte Carlo pricing of financial derivatives Quantum computing for finance: Overview and prospects Quantum risk analysis Portfolio rebalancing experiments using the Quantum Alternating Operator Ansatz Portfolio selection LP algorithms for portfolio optimization: The PortfolioOptim package Heuristic algorithms for the portfolio selection problem with minimum transaction lots Minimizing tracking error while restricting the number of assets The Quantum Alternating Operator Ansatz on max-k vertex cover Quantum supremacy through the Quantum Approximate Optimization Algorithm Combinatorial optimization via highly efficient quantum walks Markowitz revisited: Mean-variance models in financial portfolio analysis The mean-variance cardinality constrained portfolio optimization problem: An experimental evaluation of five multiobjective evolutionary algorithms Handbook of enumerative combinatorics From the Quantum Approximate Optimization Algorithm to a Quantum Alternating Operator Ansatz Quantum computation and decision trees Physical implementation of quantum walks Efficient quantum walk on a quantum processor Efficient quantum circuits for Toeplitz and Hankel matrices Quantum Fourier transform in computational basis Efficient quantum circuits for dense circulant and circulant-like operators Efficient quantum circuits for Szegedy quantum walks Efficient quantum circuits for continuous-time quantum walks on composite graphs Large-scale silicon quantum photonics implementing arbitrary two-qubit processing Quantum algorithm for visual tracking Fast parallel circuits for the quantum Fourier transform Improved algorithms for approximate quantum Fourier transforms and sparse Hamiltonian simulations QuOp MPI: Parallel distributed memory simulation of Quantum Approximate Optimization Algorithms QSW MPI: A framework for parallel simulation of quantum stochastic walks Data Structures for Statistical Computing in Python Effect of dimensionality on the Nelder-Mead simplex method Grover's quantum searching algorithm is optimal Spatial search by quantum walk Quantum-circuit model of Hamiltonian search algorithms The Traveling Salesman Problem: A Computational Study