Paper The following article is Open access

Experimental implementation of quantum-walk-based portfolio optimization

, , , and

Published 23 February 2024 © 2024 The Author(s). Published by IOP Publishing Ltd
, , Citation Dengke Qu et al 2024 Quantum Sci. Technol. 9 025014 DOI 10.1088/2058-9565/ad27e9

2058-9565/9/2/025014

Abstract

The application of quantum algorithms has attracted much attention as it holds the promise of solving practical problems that are intractable to classical algorithms. One such application is the recent development of a quantum-walk-based optimization algorithm approach to portfolio optimization under the modern portfolio theory framework. In this paper, we demonstrate an experimental realization of the alternating phase-shift and continuous-time quantum walk unitaries that underpin this quantum algorithm using optical networks and single photons. The experimental analysis confirms that the probability of states corresponding to high-quality solutions is efficiently amplified by increasing the number of phase-shift and quantum walk iterations. This work provides strong evidence for practical applications of quantum-walk-based algorithms such as financial portfolio optimization.

Export citation and abstract BibTeX RIS

Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 license. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

1. Introduction

Quantum computation promises advantages for certain problems, such as prime factoring, exhaustive search and optimization [19]. Although only small quantum processors are currently available, there are tremendous expectations for quantum technology to assist with the solving of difficult real-life problems in the near future [1012]. Modern financial trading relies on extensive computational resources for the analysis of historical data, high-frequency trading, portfolio optimization and risk analysis [1316]. In the case of portfolio optimization, the computational complexity stems from the analysis of the balance between return and risk of portfolios involving many assets, motivating quantum computing to solve financial problems [1723].

Recent works have combined financial services and quantum software to implement and test a financial portfolio rebalancing use case using hybrid quantum–classical algorithms [24]. Based on the mean-variance Markowitz model [25] with discrete asset constraints, Hodson et al explored the problem of portfolio optimization and rebalancing with the help of the quantum approximate optimization algorithm and quantum alternating operator ansatz, collectively known as QAOA [2636].

Such heuristic, or approximation, algorithms are designed to identify high-quality solutions to optimization problems [3740]. The problem solution space is mapped to a superposition of quantum states that is acted on by an interleaved sequence of solution-quality-dependent phase shits and mixing operations parameterised by classically tunable variational parameters. These are tuned using a classical algorithm that seeks to optimise the mean of the measured solution qualities. In doing so, constructive interference is produced at states corresponding to high-quality solutions.

Extending the QAOA schema to constrained optimization problems requires strategies for restricting or guiding probability amplitude to a subset of the problem solution space. The Quantum Walk-based Optimization Algorithm (QWOA) achieves this using an efficient indexing algorithm for the valid solutions and generalizing the QAOA mixing operation to a Continuous-Time Quantum Walk (CTQW) [41]. Slate et al proposed an application of the QWOA to the portfolio optimization problem, with numerical results indicating a significant advantage over previously explored methods [42]. Key to this was the ability of the QWOA to restrict the quantum search and, consequently, variational parameter optimization to a non-degenerate subspace of valid solutions.

This paper investigates the efficacy of the QWOA mixing operator as applied to the portfolio optimization problem. Using linear optical elements and single photons, we realize the first experimental implementation of the QWOA mixing unitary and demonstrate its reliable convergence to high-quality solutions over a wide range of quantum circuit depths. Our work provides strong evidence for the potential of quantum-walk-based algorithms to solve complex optimization problems of practical significance.

2. QWOA for combinatorial optimization

Combinatorial optimization problems seek solutions of the form

Equation (1)

where the problem cost-function C(s) is defined to map a solution s from an ordered set of problem solutions $\boldsymbol{\mathcal{S}}^{\prime} = \{s_i\}$ to $\mathbb{R}$, s is a k-permutation of discrete elements selected from a finite set and,

Equation (2)

is the valid problem solution space where

Equation (3)

represents constraints imposed on $\bar{s}$, while $\boldsymbol{a} = \{a_i\}$ defines the constraints.

The QWOA [41, 43] begins by establishing an injective map from the complete solution space $\boldsymbol{\mathcal{S}}$ to a Hilbert space consisting of n qubits $\mathcal{H}$ where $2^n \unicode{x2A7E} |\boldsymbol{\mathcal{S}}|$ in order to define the quality operator

Equation (4)

where $q_i = C(s_i)$.

We next require that there exists an efficient indexing algorithm from the complete solution space $\boldsymbol{\mathcal{S}}$ to the subset of valid solutions $\boldsymbol{\mathcal{S}}^{\prime}$, which makes possible an indexing unitary

Equation (5)

where $U^{\dagger}_\#$ maps the states corresponding to valid solutions $\vert s^{\prime}\rangle$ to the indexed states $\vert \text{id}_{\boldsymbol{\chi}}(i)\rangle$. This enables the preparation of an initial state $\vert \psi_0\rangle$ that is equally superposed over qubits corresponding only to the valid solution space $\boldsymbol{\mathcal{S}}^{\prime}$,

Equation (6)

The quality operator Q and the indexing unitary $U_\#^\dagger$ are used as part of a variational quantum circuit that works to amplify probability density associated with high-quality (low-cost) solutions. The variational quantum circuit implements a sequence of alternating operators. The first of these is the 'phase-shift' unitary

Equation (7)

where $\gamma \in \mathbb{R}$, applies a quality-dependent phase shift to all quantum states $\vert i\rangle$.

Next is the indexed-walk unitary,

Equation (8)

where $t \unicode{x2A7E} 0$ and $W = \sum_{i, j \in \boldsymbol{\mathcal{S}}^{\prime}} \vert \text{id}_{\boldsymbol{\chi}}(j)\rangle\langle \text{id}_{\boldsymbol{\chi}}(i)\vert$ for i ≠ j is equivalent to the adjacency matrix of a complete graph. The indexed-walk unitary Uw indexes $\vert \psi_0\rangle$ and induces a maximal unbiased coupling over the valid solution subspace which drives the mixing of probability amplitude between states in the subspace. Equivalent to a CTQW for time t, during this stage phase differences encoded by UQ contribute to constructive and destructive interference. After competition of the CTQW, the indexing unitary un-indexes $U_\#^\dagger \vert i\rangle$ such that measurement is conducted with respect to the unindexed states $\vert i\rangle$.

An application of UQ and Uw is carried out for p repetitions, with the final state of the quantum system being

Equation (9)

With each of the p iterations, the potential for probably amplitude concentration at $\vert i\rangle$ corresponding to high-quality solutions increases—given suitable values for the variational parameters γ and t [44, 45]. Optimal variational parameters γ and t are obtained using a classical optimiser that minimises with respect to the objective function

Equation (10)

such that a lowering of $f(\boldsymbol{\gamma}, \boldsymbol{t})$ entails an increased probability of measuring a quantum state that corresponds to a high-quality solution. In this sense, the QWOA is a hybrid algorithm whereby a small set of classical values parametrise the evolution of an exponentially larger quantum Hilbert space.

3. The portfolio optimization problem

Consider an investor with a portfolio of assets $\{m_i\}$ of size M. For each asset, they must take one of three positions:

  • (i)  
    Short position: the buying and short-term selling of an asset under the expectation that it will drop in value.
  • (ii)  
    Long position: the buying and long-term holding of an asset with the expectation that it will increase in value.
  • (iii)  
    No position: not investing in the asset (taking neither the long nor short position).

A quantum encoding of the possible solutions si to qubit states $\vert i\rangle$ uses two qubits per asset:

  • (i)  
    $\vert 10\rangle \rightarrow \text{short position}$.
  • (ii)  
    $\vert 01\rangle \rightarrow \text{long position}$.
  • (iii)  
    $\vert 00\rangle$ or $\vert 11\rangle \rightarrow \text{no position}$.

Such that for a portfolio of size M we require $n = 2M$ qubits for complete representation of the solution space $\boldsymbol{\mathcal{S}}$.

The discrete mean-variance Markowitz model implements a cost function for a given combination of solutions that takes into account the historical behavior of the assets. It may be expressed as a minimization problem with respect to the above quantum mapping as a

Equation (11)

where σij is the covariance between assets i and j, ri is the average return, $0 \unicode{x2A7D} \omega \unicode{x2A7D} 1$ and $z_i \in \{1,-1,0\}$ represents a choice of long, short and no position respectively. As $\omega \rightarrow 0$, the optimal portfolio is one providing maximum returns, while as $\omega \rightarrow 1$, the optimal portfolio is the one that minimizes asset volatility. Equation (11) is subject to the constraint

Equation (12)

which maintains the relative net position for a pre-existing portfolio.

Altogether, the key steps of the QWOA algorithm as applied to the portfolio optimization problem are:

  • (i)  
    Preparation of $\vert \psi_0\rangle$ over $\boldsymbol{\mathcal{S}}^{\prime}$ (solutions satisfying constraint a).
  • (ii)  
    Computation of $\vert \boldsymbol{\gamma}, \boldsymbol{t}\rangle$ by p applications of $U_Q(\gamma)$ with phase-shift quality operator $Q = \sum_{\boldsymbol{\mathcal{S}}}C(s)\vert s\rangle\langle s\vert$ and indexed-walk unitary $U_w(t)$.
  • (iii)  
    Minimization of $f(\boldsymbol{\gamma}, \boldsymbol{t}) = \sum_{s \in \boldsymbol{\mathcal{S}}^{\prime}}C(s)\left|\langle s\,|\,\boldsymbol{\gamma}, \boldsymbol{t}\rangle\right|^2$ via classical optimization of variational parameters $\boldsymbol{\gamma} = (\gamma_0, \dots, \gamma_{p-1})$ and $\boldsymbol{t} = (t_0, \dots, t_{p-1})$.

The QWOA algorithm, originating from a quantum walk perspective [46], can be implemented using a sequence of quantum gates, as detailed in [41]. Extensive simulations [42] highlight QWOA's advantages over other QAOA-based algorithms, notably due to its significantly reduced search space, achieving high-quality portfolios with fewer iterations. Furthermore, the inherent global symmetry in the QWOA mixing operator contributes to an unbiased convergence to optimal solutions with sufficient quantum circuit depth. QWOA has also shown great promise in handling diverse optimization challenges with intricate constraints and solution domains. The portfolio optimization problem can be efficiently solved using the QWOA with a gate complexity of $\mathcal{O}(m^2)$ [42]. These theoretical results depend on the efficient encoding of Q into the phase of the $\vert i\rangle$ states, implementation of the indexed-mixing operator $U_w(t)$, and identification of (at least) locally optimal variational parameters γ and t.

4. Experimental implementation

In this work, we consider a partial physical implementation of the QWOA as applied to the portfolio optimization problem to experimentally verify the effectiveness of the alternating phase-shift and quantum-walk operations. We consider a restricted phase-shift operator $U_{Q^{\prime}}$ which encodes the cost of only the valid solutions over a Hilbert space of size $|\boldsymbol{\mathcal{S}^{\prime}}|$ and a corresponding quantum walk unitary $U_{w^{\prime}}$. Within this framework, solutions in $\boldsymbol{\mathcal{S}^{\prime}}$ are computed and indexed classically.

A portfolio consisting of three stocks (Google, IBM and Microsoft) is considered under the constraint a = 0, for which there are seven valid solutions ($|\boldsymbol{\mathcal{S}^{\prime}}| = 7$). We show the seven valid solutions in the supplemental material. The quality values qi have been calculated classically from the adjusted closing prices between 1/1/2019 and 12/31/2020 [47]. These are used to simulate the QWOA using the software package QuOp_MPI to obtain optimal values of t and γ for p = 1 to 8 [48]. Optimization of γ and t is carried out using the BFGS algorithm [49] with initial values generated following a uniform distribution between 0 and 2π for 20 repeats at each p.

The restricted QWOA operators $U_{Q^{\prime}}$ and $U_{w^{\prime}}$ are implemented with single photons following the experimental setup as illustrated in figure 1(a). The seven computational basis states correspond to the QWOA indexes representing valid portfolios. In a 7-dimensional qudit, the basis states are encoded as $\vert 0\rangle = \vert V1\rangle$, $\vert 1\rangle = \vert H2\rangle$, $\vert 2\rangle = \vert V2\rangle$, ⋯, $\vert 5\rangle = \vert H4\rangle$, $\vert 6\rangle = \vert V4\rangle$. Here, i ($i = 1, \cdots, 4$) denotes the spatial modes of the single photons, and $H~(V)$ indicates the horizontal (vertical) polarization of the photons.

Figure 1.

Figure 1. (a) Experimental setup. Heralded single photons are generated through type-I spontaneous parametric down-conversion in a β-barium-borate (BBO) nonlinear crystal. The initial state is encoded using both polarizing and spatial degrees of freedom, which are prepared by a polarizing beam splitter (PBS) followed by beam displacers (BDs) and wave plates (WPs). Subsequently, the photons pass through an optical network that implements the QWOA phase-shift and mixing unitaries, consisting of WPs and BDs. Finally, the photons are projected onto the basis states using a PBS. Avalanche photodiodes (APDs) detect the photons in coincidence with the trigger within a coincident window of 3 ns. We record photon detections for a duration of 10s, resulting in approximately $27\,000$ single photons being registered. (b) A complete graph with 7 vertices K7, in which an edge connects every pair of distinct vertices.

Standard image High-resolution image

In this experiment, the initial state of the qudit is prepared in an equal superposition state represented as $\vert s\rangle = \frac{1}{\sqrt{7}}\sum_{i = 0}^{6}\vert i\rangle$. Initially, the photons pass through a polarizing beam splitter (PBS) and a half-wave plate (HWP) set at $-20.4^\circ$, which divides the transmitted photons with different polarizations into two parallel paths using a beam displacer (BD). Next, in the upper and lower modes, two additional HWPs at $-27.4^\circ$ and $-22.5^\circ$ are inserted, respectively. Finally, the initial state is prepared as $\vert s\rangle$ by passing through the second BD, followed by four HWPs set at 90, 22.5, $-22.5^\circ$, and 22.5.

We simulate the probability amplification process in the QWOA using the mixing operator $U_{w^{\prime}}(t)$ and the phase shift operator $U_{Q^{\prime}}(\gamma)$. The mixing operator is the CTQW $U_{w^{\prime}}(t) = e^{-iWt}$ on the complete graph K7 with adjacency matrix W shown in figure 1(b), which connects all valid solutions. The phase shift operator is a diagonal unitary that applies a phase shift proportional to the variational parameter γ and the value of the mean-variance Markowitz model, $U_{Q^{\prime}}(\gamma) = e^{-i\gamma Q}$, where the quality operator $Q = \textrm{diag}(q_0, q_1, \cdots, q_6)$ is a diagonal operator defined by solution qualities. Thus, we apply the unitary operation $U_p = \prod_{i = 1}^{p}U_{w^{\prime}}(t_i)U_{Q^{\prime}}(\gamma_i)$ ($p = 1, \cdots, 6$) on the state $\vert s\rangle$. Details of the variational parameters ti and γi can be found in supplemental material.

With the method introduced in [1, 50, 51], an arbitrary n×n unitary matrix can be decomposed into a product of $\frac{1}{2}n^2-\frac{1}{2}n$ two-level unitary matrices, which act non-trivially only on two-dimensional subspaces of the n-dimensional Hilbert space. In this experiment, each $7\times 7$ unitary operator Up ($p = 1, \cdots, 6$) can be decomposed as

Equation (13)

where $U_{i,j}$ are two-level unitary matrices. A two-level unitary matrix takes the form with only four elements $E_{i,i}$, $E_{i,j}$, $E_{j,i}$ and $E_{j,j}$, which are neither 0 or 1. For the remaining elements, all the diagonal elements are set to 1, while all the off-diagonal elements are set to 0.

According to the requirement of realizing a two-level matrix $U_{i,j}$ [52], the horizontal and vertical polarization states of the photons in different paths are recombined into polarization states of the photons in the same path via BDs and 45 HWPs. Then we apply a $2\times2$ unitary transformation $\left(\begin{array}{ll}E_{i, i} & E_{i, j} \\ E_{j, i} & E_{j, j}\end{array}\right)$ to the polarization state of this path, which can be realized via a set of wave plates (WPs), thus producing an exact correspondence with equations (4) and (8).

The complexity of our experimental setup is independent of the number of the iterations and only depends on the dimension of Up which in our experiment is always 7. In this case, we employ a total of 10 beam displacers (BDs) to implement each Up . The variational parameters, which can be considered as parameters of $U_{i,j}$, are adjusted by configuring the setting angles of WPs. A detailed resource analysis of our experimental implementation of QWOA mixing unitary with the bulk optics is included in Supplemental Material, together with the corresponding system-agnostic quantum circuits.

Once the transformation Up is implemented, we determine the square of the overlap between the final state $\vert \psi\rangle$ and the basis states $\vert i\rangle$ through a projection measurement. To perform the projective measurement, a PBS is employed to map the basis states of the qudit state onto separate spatial modes. By calculating the proportion of photon counts in each spatial mode to the total photon counts, we estimate the probability of the photons being measured in each basis state.

5. Experimental results

Theoretical predictions and experimental results of the probability distribution for the final states are presented in figure 2, covering iterations p = 1 to 6. The probabilities of the final state projected onto basis state $\vert 2\rangle$ after the 1st, 2nd, ⋯, and 6th iterations are $0.324\pm 3$, $0.502\pm 3$, $0.763\pm 3$, $0.812\pm 2$, $0.816\pm 2$ and $0.797\pm 2$, respectively. These results align closely with the theoretical predictions of 0.363, 0.567, 0.876, 0.970, 0.998 and 0.998, respectively. Thus, the probability of the optimal portfolio occupying the valid solution space increases with the number of iterations and finally tends to be stable. The experimental results show that we will find the highest-quality portfolio with a probability close to 1.

Figure 2.

Figure 2. The experimental results present the probability distribution of the final state after p iterations. The state index denotes the corresponding basis state, which corresponds to different valid solutions. The solid blue line represents the theoretical predictions, while the blue pentagram denotes the experimental results. The error bars indicate the statistical uncertainty calculated assuming Poissonian statistics.

Standard image High-resolution image

In addition, we measure the expectation value of the quality operator that encodes the objective function, given by $\langle \psi\vert Q\vert \psi\rangle = \sum_{i = 0}^{6}q_i|\langle i|\psi\rangle|^2$, as shown in figure 3. It can be seen that as the number of iterations increases, the value of the objective function is in a gradual downward trend, which indicates that the probability of the high-quality portfolio is gradually increasing. In our experiment, the imperfections of the results include the imperfections of the interferometers and inaccuracies of WPs. The former leads to the dephasing whose impact on the objective function can be estimated by assuming the dephasing rate is $\thicksim0.97$.

Figure 3.

Figure 3. Experimental results of the expectation value of quality operator $\langle \psi\vert Q\vert \psi\rangle$ for p = 1 to 6. The red line and blue points represent theoretical predictions and experimental results, respectively. The black line represents the estimated values of the objective function by numerical simulations, taking into account the imperfection caused by the dephasing. The dephasing rate is considered here $\thicksim 0.97$.

Standard image High-resolution image

6. Conclusion

The implementation of quantum optimization algorithms on current quantum processors is still constrained by the compounding effects of system noise [3133]. In contrast, we present the realization of a variational search up to p = 6 with strong agreement with predictions for a noise-free system. At all considered p, minimization of the objective function amplifies probability at the basis state corresponding to the highest-quality solution.

We consider a 3 asset portfolio where, as two qubits are used to encode the position per asset, the complete Hilbert space is of size $2^{2\times 3} = 64$. However, the QWOA reduces the quantum search to a globally-symmetric sub-space of seven valid solutions. For the portfolio optimization problem, compared to the QAOA, this significantly reduces the search space and eliminates bias resulting from mixing asymmetry.

In this paper, we present compelling evidence that demonstrates the applicability of quantum algorithms in solving portfolio optimization problems. Our experimental approach is direct, flexible, and holds the potential for scalability. The exploration of quantum algorithms in practical applications is gaining momentum [5355], even though they are currently in a preliminary stage. With the dedicated efforts of scientific researchers, we anticipate that quantum technology will soon be leveraged to tackle challenging real-life problems.

Acknowledgments

This work is supported by the National Key R\&D Program of China (Grant No. 2023YFA1406701) and the National Natural Science Foundation of China (Grant Nos. 92265209, 12025401, 12104009 and 12305008) and an Australian Government Research Training Program Scholarship at the University of Western Australia. D K Q acknowledge support from the China Postdoctoral Science Foundation (Grant No. 2023M730198) and the fellowship of China National Postdoctoral Program for Innovative Talents (Grant No. BX20230036). J B W wishes to express gratitude to Yuying Li and Song Wang for valuable and insightful discussions, particularly within the domain of computational finance.

Data availability statement

No new data were created or analysed in this study.

Conflict of interest

The authors declare no conflict of interest.

Appendix A: The Markowtiz model

The mean-variance Markowitz model expresses the problem of choosing the optimal set of positions through minimization of the objective function,

Equation (A.1)

which is subject to,

Equation (A.2)

for the case of discrete asset constraints. Variable ri represents the expected returns for a given asset, σij represents the covariance between assets i and j, $z_i \in \{1,-1,0\}$ represents long, short and no position respectively, and ω is between 0 and 1 [42]. Equation (A.1) formalizes the idea of asset diversification. For a pair of assets in a given portfolio, the first term is minimized by taking the same position on both assets if they are anti-correlated or by taking a short position on one asset and a long position on the other if they are correlated. The second term is minimized by taking a long position on appreciating assets and a short position on depreciating assets. The ω parameter balances the influence of risk and potential return with the value chosen according to the preference of the portfolio manager. Equation (A.2) arises in the context of portfolio rebalancing, with constraint value a preserving the net position with respect to a pre-existing portfolio.

With M assets with three possible positions per asset (long, short or none), the size of the unconstrained solution space is 3M . Introducing the constraint defined in equation (A.2), the number of valid solutions with net position a is

Equation (A.3)

where, if the bottom parameter of the rightmost binomial coefficient is not an integer, it is set to 0 [42]. While $\mathcal{M}(M, a)$ is always less than 3M , for any possible a, the number of valid solutions nevertheless grows exponentially with M.

Consider a portfolio of three stocks: Google, IBM and Microsoft, under the constraint that we have the same number of long and short positions (a = 0). This results in a valid solution space spanning 7 computational basis states.

The daily closing and opening prices of the three stocks between the $1/1/2019$ and $12/31/2020$ were obtained from Yahoo Finance, and the expected returns $(r_i)$ and covariance matrix (σij ) calculated see table A1. The 7 valid solution qualities, as given by the mean-variance Markowitz model with ω = 0.5 are shown in table A2. These define the diagonal, $\boldsymbol{q} = q_0, \ldots, q_6$, of the Q operator. Note that, for a problem of this size, the qi are of the order 10−4. To assist in the optimization process all qi have been scaled by a constant factor of 250.

Table A1. Mean return $(r_i)$ of the assets and covariance $(\sigma_{ij})$ between the assets from $1/1/2019$ to $12/31/2020$.

Covariance (σij )Mean return (ri )
StockGoogleIBMMicrosoft
Google0.0004070.0002430.0003440.001245
IBM0.0002430.0004150.0002700.000604
Microsoft0.0003440.0002700.0004600.001833

Table A2. Quality vector, q , describes the 7 valid solutions under the given the constraint of a = 0. The position on each stock (Google, IBM and Microsoft) can be read from the 6 qubits, where $\vert 01\rangle$ denotes a long position, $\vert 10\rangle$ denotes a short position and $\vert 00\rangle$ is no position.

QWOA Index $\vert \text{id}_{\boldsymbol{\chi}}(i)\rangle$ quantum encoding $\vert i\rangle$ qi
$\vert 0\rangle$ $\vert 000000\rangle$ 0.0
$\vert 1\rangle$ $\vert 000110\rangle$ 0.19537791107281657
$\vert 2\rangle$ $\vert 001001\rangle$ −0.1119084583542568
$\vert 3\rangle$ $\vert 010010\rangle$ 0.09592313540638248
$\vert 4\rangle$ $\vert 011000\rangle$ −0.038186379903069514
$\vert 5\rangle$ $\vert 100001\rangle$ −0.05124555365045395
$\vert 6\rangle$ $\vert 100100\rangle$ 0.12193130046716749

Appendix B: The optimal variational parameters

The optimal variational parameters of ti and γi are obtained by the software package QuOp_MPI, for which detailed instructions and simulation code for the portfolio optimization problem are provided in [48, 56]. We experimentally realize the unitary operator of p-iteration QWOA ($p = 1, \cdots, 6$) as follows

Equation (B.1)

Appendix C: Resource analysis of realization of QWOA in bulk optical setup

The key to running QWOA on hardware is to implement the unitary matrix $U = \prod _{i = 1}^pU_w(t_i)U_Q(\gamma_i)$. For larger databases, the bulk optical setup can realize QWOA with the n×n arbitrary unitary matrix and the number of the beam displacers $N_\mathrm{BD}$ increases with n linearly, i.e. $N_\textrm{BD}\sim 2n-4$, as shown in figure C1. An arbitrary n×n unitary matrix can be decomposed into a product of $\frac{1}{2}n^2-\frac{1}{2}n$ two-level unitary matrices, which act non-trivially only on two-dimensional subspaces of the n-dimensional Hilbert space:

Equation (C.1)

Therefore, such an implementation does make a significant contribution to the general scheme of QWOA.

Figure C1.

Figure C1. Experimental setup with cascaded interferometers which is able to implement arbitrary n×n unitary operator.

Standard image High-resolution image

Appendix D: Quantum circuit of QWOA

In this section, we present the quantum circuit of QWOA to demonstrate that the algorithm can also be implemented in other systems. The design of quantum circuits is based on the cosine-sine decomposition (CSD) [57, 58]. As an example, we describe the factorization of an arbitrary $8\times 8$ unitary matrix using the CSD. For the $8 \times 8$ unitary matrix U8, it can be decomposed as $U_8 = \mathbb{L}_8(S_4\oplus \mathbb{I}_4)\mathbb{R}_8$, where $\mathbb{L}_8$ and $\mathbb{R}_8$ are block diagonal,

Equation (D.1)

and L4, $L^{^{\prime}}_4$, R4, and $R^{^{\prime}}_4$ are $4\times 4$ unitary matrix. The matrix S4 is an orthogonal cosine-sine matrix,

Equation (D.2)

For convenience, the unitary transformations $\mathbb{L}_8$ and $\mathbb{R}_8$ can be written as

Equation (D.3)

Then the $8\times 8$ unitary transformations can be implemented by three controlled three-qubit transformations in figure D1(a). In addition, the $4\times 4$ unitary matrix U4 (L4, $L^{^{\prime}}_4$, R4, and $R^{^{\prime}}_4$) can be decomposed as $U_4 = \mathbb{L}S_4\mathbb{R}$, where

Equation (D.4)

are block-diagonal, and L, Lʹ, R, and Rʹ are $2\times 2$ unitary transformations. The $4\times 4$ unitary transformations $\mathbb{L}$, S4, and $\mathbb{R}$ can be rewritten as

where $S = \left[\begin{array}{cc} \text{cos}\theta_1 & \text{sin}\theta_1 \\ -\text{sin}\theta_1 & \text{cos}\theta_1 \end{array}\right]$ and $S^{^{\prime}} = \left[\begin{array}{cc} \text{cos}\theta_2 & \text{sin}\theta_2 \\ -\text{sin}\theta_2 & \text{cos}\theta_2 \end{array}\right]$. Then these $4\times 4$ unitary transformations can be implemented by three controlled two-qubit transformations in figures D1(b) and (c). The decomposition method can be used to decomposed higher-dimensional unitary operators. Therefore, our idea can in principle design quantum circuit of any dimension, so as to realize the unitary matrix required by QWOA for generalization in other systems.

Figure D1.

Figure D1. (a) The quantum circuit for the $8\times 8$ unitary matrix U8. (b) The quantum circuit for the $4\times 4$ unitary matrix U4 (R4, $R^{^{\prime}}_4$, L4, $L^{^{\prime}}_4$). (c) The quantum circuit for the cosine-sine matrix S4.

Standard image High-resolution image
Please wait… references are loading.
10.1088/2058-9565/ad27e9