<<

www.nature.com/npjqi

ARTICLE OPEN Quantum-enhanced analysis of discrete stochastic processes ✉ Carsten Blank 1, Daniel K. Park 2 and Francesco Petruccione 3,4

Discrete stochastic processes (DSP) are instrumental for modeling the dynamics of probabilistic systems and have a wide spectrum of applications in science and engineering. DSPs are usually analyzed via Monte-Carlo methods since the number of realizations increases exponentially with the number of time steps, and importance sampling is often required to reduce the variance. We propose a quantum algorithm for calculating the characteristic function of a DSP, which completely defines its probability distribution, using the number of quantum circuit elements that grows only linearly with the number of time steps. The quantum algorithm reduces the Monte-Carlo sampling to a Bernoulli trial while taking all stochastic trajectories into account. This approach guarantees the optimal variance without the need for importance sampling. The algorithm can be further furnished with the quantum amplitude estimation algorithm to provide quadratic speed-up in sampling. The Fourier approximation can be used to estimate an expectation value of any integrable function of the random variable. Applications in finance and correlated random walks are presented. Proof-of-principle experiments are performed using the IBM quantum cloud platform. npj (2021) 7:126 ; https://doi.org/10.1038/s41534-021-00459-2

INTRODUCTION the importance sampling strategy relies on a sophisticated 1234567890():,; Simulation of physical processes on quantum computers1,2 has understanding of the probability distribution. many facets, with recent developments improving the usage of In this manuscript, we show that the characteristic function of a – fi this technology3 14. While one obvious task for a quantum DSP can be ef ciently calculated on a quantum computer, and in so computer is to simulate quantum mechanical behaviors of nature1, doing we introduce an effect called quantum brute force. The quantum simulation of probability distributions and stochastic random variables of the DSP of interest do not need to be identically processes has gained attention recently15–20. Since quantum and independently distributed, and non-Markovian processes can mechanics can be viewed as a mathematical generalization of also be studied. The quantum-state space that grows exponentially probability theory, where nonnegative real-valued probabilities are with the number of qubits is used to move along all paths of the replaced by complex-valued probability amplitudes, quantum discrete stochastic process simultaneously in a quantum super- computing appears to be a natural tool for simulating classical position, and hence the term quantum brute force is adequate. The method proposed in this work maps the expectation value probabilistic processes. Intuitively, some quantum advantage is of interest into a probability of measuring a particular computa- expected since the probability amplitudes can interfere, unlike in tional basis state of a qubit. This probability can essentially be classical probabilistic computing. Indeed, a quadratic quantum thought of as the success parameter of a Bernoulli trial, i.e., a coin speed-up has been reported for solving financial problems when 16,21 toss, whose statistics are well-known. As a consequence, the compared to Monte-Carlo simulations . variance is optimal in the sense that it behaves according to the Classically, Monte-Carlo methods are essential for estimating central limit theorem for all sample sizes, not only for large expected values of random variables in DSPs, since the number of numbers. This leads to a crucial result that no sampling strategies realizations increases exponentially with the time steps. When the are necessary. Monte Carlo sampling is repeatedpNffiffiffiffi times, the expectation value 29 = Moreover, we connect quantum amplitude estimation (AE) , to be found converges with Oð1 NÞ regardless of the number of which can be utilized to overcome the classical limit on the realizations. The central limit theorem ensures this, but it is sampling convergence of Monte-Carlo methods15,16,30,31, to our important to note that this convergence is only attained in the method. In brief, the single-qubit measurement scheme can be → ∞ limit of N . When this limit is not nearly attained, it is often replaced by an application of AE to the full system. With this crucial to have sampling strategies to reduce the variance of the modification, our algorithm uses resources that scale linearly estimate. The reason for this is that less likely events can, on the instead of quadratically, and thus achieves a quantum speed-up. other hand, be of high impact. This can create a bias in the The methods developed here point therefore to an exciting and computation as the estimation can be dominated by more promising use of quantum computers: less variance and faster probable, but less important values. To correctly sample with a convergence for Monte-Carlo sampling. Equivalently, it is possible given N that is not near the limit of the large number, it is to reduce the sample size without losing precision. beneficial to modify the probability of the process in a way that Applications of our method span extensively across many fields balances the importance of the events. This is called importance in science and engineering; any physical behavior that can be sampling22–28. This makes apparent two problems with Monte- mathematically modeled as a DSP can be studied in principle. In Carlo algorithms. First, it may be difficult to calculate the particular, we show how the found simulation procedure can be probability of a particular realization of a random variable. Second, applied to option pricing theory and to correlated random walks

1Data Cybernetics, Landsberg, Germany. 2Sungkyunkwan University Advanced Institute of Nanotechnology, Suwon, Republic of Korea. 3Quantum Research Group, School of Chemistry and Physics, University of KwaZulu-Natal, Durban, KwaZulu-Natal, South Africa. 4National Institute for Theoretical and Computational Sciences (NITheCS), KwaZulu- ✉ Natal, South Africa. email: [email protected]

Published in partnership with The University of New South Wales C. Blank et al. 2 which leads to various applications in biology, ecology, and where M(j) = U†(j)MU(j). The coefficient p2(j) can be identified with finance. For each example, we experimentally demonstrate the the joint probability and the expectation value with the evaluation proof-of-principle using the IBM quantum cloud platform. of f, i.e., Âà Although the main focus of this work is to achieve quantum 2 p ðjÞP X ¼ x ; ; ¼ ; X ¼ x ; (4) sampling advantage for discrete stochastic processes, we note 1 1 j1 n n jn that quantum memory advantages have been shown for 18–20,32 M j f x ; x ; (5) stochastic processes with causal structures and in rare- h ð Þi  ð 1 j1 þÁÁÁþ n jn Þ 33 events sampling . An interesting connection concerning our for a function f : R ! R that we will specify below. result to this line of research comes from the work by Binder In the worst case, evaluation of Eq. (3) requires two expensive 32 et al. which presented the construction of a unitary quantum procedures as follows. First, kn probabilities need to be encoded as simulator for generating all possible realizations of a hidden the amplitudes of kn computational basis given by n qudits of Markov model (HMM) that requires less memory than any classical dimension k. This can be done with various quantum state counterparts throughout the simulation. The focus of this body of preparation techniques with a substantial amount of computa- work has been sampling from a distribution, but with respect to tional overhead35,36. Next, kn unitary operators, conditioned on all the results discussed here, it can also be used to estimate possible index states, need to be applied to an input state jiψ . expectation values, in particular characteristic functions. Such operators can be expressed as ÀÁ ; ; c-UðjÞ¼jij hjj Vðxn jn ÞÁÁÁVðx1 j1 Þ þ jij hjj ? ID RESULTS with V : R !HD. On the other hand, for many interesting DSPs, A discrete stochastic process can be described with n discrete the number of necessary unitary operators can be reduced to random variables Xl : Ωl ! R, l = 1, …, n for some n 2 Nþ, each Ω OðnkÞ. having at most k nonzero realizations, i.e., given a sample space l, Before explaining such exponential reduction in detail, we there exist at most k elements xl;0; ¼ ; xl;kÀ1 2 R with Xl(Ωl) = … introduce two results in the next two propositions (with proofs {xl,0, , xl,k−1}. In plain words, a discrete stochastic process consists provided in Supplementary Information) to establish the grounds of n steps, and in each step, one of k possible events occurs at for the measurement scheme. random with a certain probability. Hereinafter, we use the Proposition 1 (Pauli X and Y Measurement). Let VðxÞ¼ following notations. Each realization of the stochastic process is ix R = σ > Rzð2xÞ¼ji0 hjþ0 e ji1 hj1 withpffiffiffi x 2 , then by setting M x or 1234567890():,; identified with an index vector j ¼ðj ; ¼ ; j Þ 2 Kn with K = {0, 1 n M = σy and jiψ ¼ðji0 þ jiÞ1 = 2, we find > …, k − 1} and is denoted by xðjÞ¼ðx ; ; ¼ ; x ; Þ . Moreover, we P 1 j1 n jn σ E ; n m > hII xiΨ ¼ ½ŠcosðSnÞ (6) fi : ; ð Þ ; ; ¼ ; ; f de ne sumfgxðjÞ ¼ l¼1 xl jl and x ðjÞ¼ðx1 j1 xm jm Þ with m ≤ n. The first and the second subscripts of the random variables hII σyiΨ ¼ E½ŠsinðSnÞ : (7) and probabilities label the time step and the event, respectively. A f

quantity of interest for such processes is the expectation value of As the true value of E½ŠcosðSnÞ and E½ŠsinðSnÞ must be an integrableP function f : R ! R of the random variable estimated, in general, the convergence behaves according to S ¼ n X n l¼1 Xl the central limit theorem, which guarantees that the measure- E P : ment statistics approaches to a normal distribution around a mean ½Š¼fðSnÞ fðsumfgÞxðjÞ ½ŠX ¼ xðjÞ (1) E n that corresponds to ½ŠfðSnÞ as the number of experiments j2K → ∞ NS pffiffiffiffiffi. The speed of convergence is moreover given by The summation is over all possible realizations, each indexed by Oð1= NSÞ. Taking into account that the Pauli measurements j, and X is the random variable representing the sequence of have two eigenvalues, the task is essentially estimating a events that can occur in a particular realization. The number of probability of a Bernoulli trial, which specifies how the central terms in the summation (i.e., the number of realizations) is kn. limit theorem is realized. Given confidence of 1 − α, the number of 2 2 Now, we explain how to encode the described stochastic experiments to be within a margin of error ϵ >0isNS ¼dzα=ð4ϵ Þe process in a quantum state, and evaluate Eq. (1) by making a with zα = z (1 − α/2) being the quantile function. In contrast, with measurement on the quantum state. The quantum state consists classical Monte-Carlo sampling, the convergence rate by the of an index system and a data system defined in a Hilbert space central limit theorem is achieved with the caveat that the Monte- kn 2 HI HD ¼ C C , where I (D) indicates the index (data) Carlo simulation samples from a usually unknown stochastic system. Each realization of the stochastic process is represented as process and concise estimates on the number of experiments n a unitary operator UðÁÞ : R À! BðHI HDÞ parametrized by given a margin of error are in general not easily accessible. As we some n-dimensional vector (BðHÞ is the space of linear operators see, the property that Eq. (2) encompasses all possible paths with on a Hilbert space H). Then a DSP can be represented as the correct probability with a quantum measurement leads to the X seemingly small advantage of knowing the convergence before- Ψ ψ : jif ¼ pðjÞjij UðjÞji (2) hand, irrespective of the distribution of the underlying DSP. j2Kn Contemplation on this fact reveals that this is no small feat: the 2 The factor of each part of the sum is denoted by p(j) with ∑jp (j) quantum advantage lies in the fact that no sampling strategies are = 1 and the state of the index system is denoted by necessary. = … − 29 jij ¼ jijn ÁÁÁj1 ¼ jijn ÁÁÁ jij1 , where jijl for jl 0, , k 1is The quantum amplitude estimation algorithm can provide the orthogonal basis. Measuring an expectation value of an further speed-up compared to the convergence rate of the observable M on the data system of the final state in Eq. (2) yields classical Monte-Carlo method given by the central limit theo- the convex sum of independent expectation values measured rem15,16,30,31. The algorithm uses m ancilla qubits in addition to from all kn trajectories34 as data and index qubits and OðpolyðmÞÞ number of Grover-like iterators followed by Oðm2Þ Hadamard and controlled phase-shift hMi¼hjΨ I MjiΨ Pf I f gates for quantum Fourier transform (QFT)37 to estimate an 2 y ¼ p ðjÞhjψ U ðjÞMUðjÞjiψ amplitude with an error of Oð1=2mÞ. The number of repeated j2Kn (3) P measurements needed to reach confidence that the estimation 2 ¼ p ðjÞhMðjÞiψ; succeeded is independent of m. The quantum AE algorithm can j2Kn be adapted to our method to construct an even more powerful

npj Quantum Information (2021) 126 Published in partnership with The University of New South Wales C. Blank et al. 3 fi Ck strategy by formulating an AE problem as follows. Given the nal where each HI l ¼ represents a qudit Hilbert space. Let state in Eq. (2) written as a linear combination jiΨf ¼ jiΨ0 þ jiΨ1 jiαðnÞ 2HI be the index-state. Then it can be described as a by separating the full Hilbert space into two orthogonal product state subspaces, we estimate the amplitude defined as a = 〈Ψ ∣Ψ 〉. ! 1 1 X On XkÀ1 Then, the following proposition connects AE with the DSP ji¼αðnÞ pðjÞji¼j p ; jij : (14) simulation. l jl l j l¼1 j ¼0 Proposition 2 (Amplitude Estimation). Let l VðxÞ¼RyðxÞ¼cosðx=2ÞI À i sinðx=2Þσy, x 2 R, jiψ ¼ ji0 , then Each evolution from jiαðlÞ ! jiαðl þ 1Þ isP done by an unitary fi kÀ1 the nal state is operator Alþ1 2 BðHI l Þ as given by Alþ1ji0 ¼ j¼0 plþ1;jjij . After n = ⋯ fi levels, i.e., the application of A An A1, the nal state Aji0 n ¼ ji¼Ψf jiþΨ0 jiΨ1 (8) jiαðnÞ shown in Eq. (14) is created. Since each of the operators Al with only acts on a separate subspace H , they commute and can be  I l X 1 applied in parallel. This is a consequence of the independence of jiΨ ¼ pðjÞ cos sumfgxðjÞ jij ji0 the increments X . For example, an n-step DSP with k = 2 possible 0 2 (9) l j2Kn paths at each time step can be realized with n index qubits each X  prepared by a single-qubit unitary operation Alji¼0 1 θ θ = θ = θ Ψ : Ryð lÞji0 ¼ cosð l 2Þji0 þ sinð l 2Þji1 , where l is chosen to ji¼1 pðjÞ sin sumfgxðjÞ jij ji1 (10) 2 satisfy cos θ =2 p ; and sin θ =2 p ; . j2Kn ð l Þ¼ l 0 ð l Þ¼ l 1 Now, for each step of the DSP, k unitary operators applied to the ~ E ~ With AE the value a will be estimated, hence ½Š¼cosðSnÞ 1 À 2a. data system controlled by an index qudit split the data space into = − ψ π= Conversely, if V(x) Ry ( x), ji ¼ R yð 2Þ ji0 , then there exists a k spaces, each attached to an orthogonal subspace of the index Ψ0 Ψ0 Ψ0 0 similar decomposition f ¼ 0 þ 1 so that with a ¼ system. In other words, in each time step, the data system Ψ0 Ψ0 fi E ~0 h 1j 1i we therefore nd ½Š¼sinðSnÞ 1 À 2a . undergoes k independent trajectories. Thus n steps of k controlled The above result opens up an exciting avenue towards a fast unitary operations allow for the encoding of kn independent Monte-Carlo alternative without the need of sampling strategies. realizations of a DSP to the index-data quantum state. To this end, These propositions in conjunction with Theorem 1 which is stated ; we identify to each realization xl jl of the random variable Xl to the in the following section show that a quantum computer can application of the operator Vðx ; Þ2BðH Þ to the data system. In E E fi l jl D simulate the quantities ½ŠcosðSnÞ and ½ŠsinðSnÞ ef ciently. As a fact, the operator will be defined in such a way that the lth index- result, one can calculate a random variable’s characteristic ’ ∈ level state s branches jijl l with the amplitudes pl;j (for jl K) function φ ðvÞ¼E½Š¼eivX E½ŠþcosðvXÞ iE½ŠsinðvXÞ with two sets l 2 X controlÂà the operator, thereby identifying the probability p ; ¼ of experiments per v 2 R. l jl P Xl ¼ xl;j with the occurrence of Vðxl;j Þ. We denote a In order to extend the above ideas to estimate expectation l l projection to the lth index subsystem I l as values of a range of integrable functions f : R ! R, a Fourier Π b lÀ1 nÀl; series is used. If f is P-periodic, then lj ¼ jij hjj l ¼ Ik jij hjj Ik (15) XL i2πlx where Ik is the k-by-k unit matrix and its perpendicular pendant as f LðxÞ¼ cle P (11) Π? lj . Then the following theorem establishes the desired result (see l¼ÀL Supplementary Information for the proof). is the Fourier approximation of order L for f(x). By linearity of the Theorem 1 Let x 2 R and j ∈ K. Define operators expectation value, this approximation carries over to : Π Π?  c- Vljl ðxÞ ¼ ljl VðxÞþ lj I (16) XL 2πl l E f S c φ : (12) ½Š¼Lð nÞ l Sn with c- V ðxÞ2BðH H Þ. Furthermore, for l = 1, …, n and P ljl I l D l¼ÀL x 2 Rk, define the operator As a consequence, it is possible to approximate any such YkÀ1 expectation value in OðLNÞ experiments, where N is the number of U ðxÞ¼ c- V ðx Þ2BðH H Þ: (17) shots per experiment. Convergence on Fourier series is a rich and l ljl j I D j¼0 mature field38–40, which establishes basic results about conver- k gence and the rate of convergence of each coefficient for given Then U(j) = Un(xn) ⋯ U1(x1) for xl 2 R ; l ¼ 1; ¼ ; n. The appli- ; properties of the function f. cation of nk controlled operations c- Vljl ðxl jl Þ is thus necessary. See The underlying idea of simulating DSPs on a quantum Fig. 1 for a depiction of Eqs. (16) and (17). computer has been laid out. Now we show that the simulation Propositions 1, 2 and Theorem 1 establish that for V(x) = Rz(2x) can be performed efficiently with a quantum circuit. or V(x) = Ry(x), x 2 R, we can compute given expectation values of Eqs. (6) and (7), respectively, with OðnkÞ controlled gates. The Independent increments above algorithm can be visualized quite intuitively. Consider a set of unitary operators V¼fV ¼ Vðx ; Þ : l ¼ 1; ¼ ; n; j 2 Kg as To deliver the underlying idea with a simple example, we start by ljl l jl l above. These operators span an ordered tree of height n and a presenting the case for DSPs with independent increments. To this maximal degree of k. The label of the nodes themselves are of end, the strategy taken is as follows. We first construct the state P secondary importance, but each edge is labeled by one of the n pðjÞji2Hj , and systematically entangle the data system D j2K I operators of the family V in such a way that, given the level l (l = 1 with the index system. When each of theÂà increments are P ; is the root), each node of the lth level has k edges, each of them independentÂà of each other, i.e., Xi ¼ x Xj ¼ y ¼ ; are labeled by Vlj jl 2 K. A path between any two nodes, i.e., P½ŠXi ¼ x P Xj ¼ y for pairwise different i ≠ j, Eq. (1) can be l ðVlj ; ¼ ; V Þ, can be interpreted as a concatenation of written as l ðlþiÞjlþi operators, i.e., V j ; ¼ ; j V V . After l level ð l lþiÞ¼ ðlþiÞjlþi ÁÁÁ ljl X Yn Âà operations, paths from the root to every nodes at (l + 1)th level E½Š¼f ðS Þ f ðsumfgÞxðjÞ P X ¼ x ; ; n l l jl (13) in the operator tree are traveled simultaneously. Hence the data j2Kn l¼1 ; ¼ ; Âà system is evolved by the operator UðjÞ¼Vðj1 jlÞ¼Vljl ÁÁÁ 2 P ; = and pl;j ¼ Xl ¼ xl jl . This structure allows to partitionNI into V1j1 for all possible j. An example of the operator tree with n 3 l n = subsystems, so-called level-index (sub)systems: HI ¼ l¼1HI l , and k 2 is depicted in Fig. 2.

Published in partnership with The University of New South Wales npj Quantum Information (2021) 126 C. Blank et al. 4

Fig. 1 Circuit design of DSPs with independent increments. a A quantum circuit including preparation of the index system (operators in blue denoted by Al) and the realization of c − U(j) (operators in green denoted by Ul(x) with a verticle line connected to black squares). A black square is placed on a control register, and the green box denoted by Ul(x) is placed on a target register. Unlike the conventional symbol for a controlled-NOT gate between qubits, the black square indicates that one of the k different unitary transformations is performed conditioned = … on the state of the control register of dimension k. b Schematic circuit representation of the applications of c À Ul 2 BðHI l HDÞ for l 1, , n as used in (a). We use the notation Vlj = V(xl,j). The open circle with a number j means that the unitary operator Vlj is applied if the control register state is jij .

Fig. 2 Operator tree. a The operator tree spanned by a binary example (k = 2) of V for three time steps with the edges named. Each edge represents a state transformation from a parent node to a child node, and each node represents a quantum state. Three states at the final leaves starting from an initial state jiψ at the root node are explicitly shown as an example. b The path j = (2, 1, 2)⊤ ∈ K3 and the operator U(j) = V32V21V12 are shown as an example.

Path-dependent increments For a DSP with path-dependent increments, the probability of a particular realization can be expressed as Qn Âà P P ; ; ½Š¼X ¼ xðjÞ Xi ¼ xi ji jXiÀ1 ¼ xiÀ1 jiÀ1 i¼2 Âà (18) ´ P ; : X1 ¼ x1 j1 This is the first-order Markov chain that the probability to take a Fig. 3 Quantum circuit to prepare the index system for simulating particular path in a given time step is determined by which path fi fi was taken in the previous step. Discussions thus far can easily be a path-dependent DSP. The gure depicts an example of the rst- order Markov chain of two steps each consisting of two realizations. extended to such DSPs. The only difference is in the preparationP of the index system, i.e., in the construction of the state j2Kn pðjÞjij . Unlike in the case of the independent increments, one needs to introduce entangling operations directly within the index system. have an impact on the event at step 2 (i.e., second-order Markov Without loss of generality, we use the index system consisting of chain), then the single-qubit controlled rotations applied on the qubits, i.e., two paths at each level, to describe the procedure. index qubit for step 2 should be replaced with the two-qubits controlled rotations controlled by both step 0 and step 1 index First, the index qubit for the first level is prepared in A0ji0 ¼ qubits. The number of three-qubit operations applied to the step 2 cosðθ0=2Þji0 þ sinðθ0=2Þji1 as before, while the rest of the qubits are inji 0 . Then the second index qubit is prepared by using the index qubit is four. Similarly, more complicated path-dependence, θð0Þ θð1Þ such as higher-order Markov chains, can be realized by designing controlled operationji 0 hj 0 Ryð 2 Þþji1 hj 1 Ryð 2 Þ, con- trolled by the first index qubit, where the superscript indicates multiqubit operations among index registers such that the path index of the previous step. Then the second index qubit the rotation of the future state is controlled by the past states. Dq is used as the control to prepare the third index qubit and so on. The quantum circuit depth increases as Oðk Þ where Dq is the 41–43 fi ≤ Thus, the index system state preparation can be done in n steps quantum topological memory , which satis es Dq q for a qth- and the lth index qubit is prepared by applying a controlled order Markov chain (i.e., the current state is affected by q past θð0Þ θð1Þ states). Equality is given if each past state generates a unique operatorji 0 hj0 Ryð l Þþji1 hj1 Ryð l Þ. An example quan- tum circuit for preparing the index quantum state for a DSP of n = future state. Note that many interesting applications can be 3 time steps (levels), each branch to two possibilities, is shown in described with small q (e.g., the first- or second-order Markov Fig. 3. chain), and in some cases, Dq can even stay constant for It is also straightforward to generalize the above procedure to unbounded q43. implement path-dependence between events that are more than Besides the index-state preparation procedure, the analysis of one time steps away. As an example, let us consider the n = 3, k = the DSP follows exactly the same procedure as described in the 2 cases depicted in Fig. 3. When the events at step 0 and step 1 previous section.

npj Quantum Information (2021) 126 Published in partnership with The University of New South Wales C. Blank et al. 5 State-dependent increments The Delta for European call option The increments in a given DSP can also vary in each step, An exciting potential application of is determined by the state in the preceding step. In this case, the financial analysis15,16,31. In particular, the framework developed probability of a particular realization can be expressed as in this work can be employed to compute the Delta of an  European call option, which is central to various hedging Qn iPÀ1 fi fi P½Š¼X ¼ xðjÞ P X ¼ x ; j X strategies and hence of signi cant importance in nancial i i ji l 21 fi i¼2 ÂÃl¼1 (19) engineering . In brief, options are nancial contracts that give the holder the right to buy (call) or sell (put) an underlying ´ P X1 ¼ x1;j : 1 financial asset (e.g., stock) at a prescribed price (strike) on or Intuitively, in order to control the increment given a particular before a prescribed date (expiration), whose value derives from realization of the current step, one needs to apply controlled the underlying asset. For European options, the holder can operation to the index register, controlled by the data register in exercise the option only at the time of expiration. In this context, between each successive step. We leave the explicit details on Delta measures the rate of change of the theoretical option value how to realize the above process with quantum circuits as with respect to changes in the price of the underlying asset, which future work. is instrumental for risk analysis. Let St be stochastic process of an underlying asset then the Delta of a European call option can be expressed as State machine simulation 0  1 σ2 In the “Introduction”, we mentioned that there is another way of St ln K þ r þ 2 ðT À tÞ simulating discrete stochastic processes by using a hidden Markov fðS Þ¼Φ@ pffiffiffiffiffiffiffiffiffiffiffi A (22) t σ model (HMM). This is a state machine that has states Σ = {s1, s2, T À t …}, output alphabets A = {a1, …, ak}, and a transition probability where Φ : R !½0; 1Š is the cumulative distribution function (CDF) from state ÂÃsi to sj while outputting the symbol ak, i.e., p2ðj; kjiÞ¼P S ¼ s ; A ¼ a jS ¼ s . A quantum advantage of the standard normal distribution, K > 0 is the strike price, r is the n j n k nÀ1 i − σ in simulating such processes has been reported in several risk-free interest rate, T t is the time to maturity and is the places32,42,43, which requires provably less memory than its volatility of the underlying asset. We are interested in the E classical counterpart18. This uses the unifilarity property which expectation value of the Delta, ½ŠfðStÞ when the underlying states that the output symbol uniquely defines the next state. asset is described by a geometric Brownian motion, i.e., St ¼ μ σ2= σ μ R Consequently, the above probability notation can be shortened to S0 expððÞÀ 2 t þ WtÞ where 2 and S0 denote the drift 2 and the starting value, respectively. Indeed, Eq. (22) considers a p ðkjiÞ¼P½ŠSn ¼ λðk; iÞ; An ¼ akjSnÀ1 ¼ si with a function λ that maps uniquely the output symbol to a state. Models with this value reminiscent of the log-return, which is modeled by the property are fairly common through a topological equivalence Brownian motion and can be approximated as a random walk by ’ 45,46 relation41,44; unifilar models exist for any stochastic process with Donsker s invariance principle . The following result establishes finite topological memory, which even includes some instances the way to implement this on a quantum computer. fi 18,19,32,43 Proposition 3 Given n independent and identically distributed with in nite Markov order . P P = While the references above focus on sampling from a random variables Xl with ½Š¼Xl ¼ x1 ½Š¼Xl ¼ x2 1 2 where distribution rather than calculating an expectation value, we point μ σ2 Àffiffiffiffiffiffiffiffiffiffiffi2 1ffiffiffiffiffiffiffiffiffiffiffi out that our methods can be used to expand these ideas in the x1 ¼ p À pffiffiffip (23) nσ T À t n T À t following way. First, it is necessary to map si to a quantum state σ Cs jii 2HS  on a subspace that will be added to the total μ σ2 system. The unifilarity property allows the HMM states to be À 2 1 x2 ¼ pffiffiffiffiffiffiffiffiffiffiffi þ pffiffiffipffiffiffiffiffiffiffiffiffiffiffi (24) translated to non-orthogonal quantum states (i.e., jiσi ≠ jisi in nσ T À t n T À t general) which can reduce the memory requirement even further and an initial starting point of and more interestingly, s < ∣Σ∣. Going forward, as described above,  σ2 the index space HI is constructed by nk-dimensional qudits. A ln S0 À ln K þ r þ ðT À tÞ ffiffiffiffiffiffiffiffiffiffiffi 2 (25) unitary operator is applied to HS HI l on the lth step. To be x0 ¼ p σ fi σ T À t precise, given an initial state jii , the rst step P X ~ n fi with Sn ¼ x0 þ l¼1 Xl, we nd that Ujiσ ji0 ¼ pðk jiÞ σλ ; jik i 1 ðk1 iÞ 1 (20)  1X0 π k12A 1 i À2π2l2=P2 2 l E½Š¼fðStÞ À e φ~ (26) 2 2πl Sn P creates a superposition of all possible outputs and their current l¼À1 state. The subsequent step creates when Φ is limited on the interval [−P/2, P/2]. Note that we define the X X σ λ ; σ : sum with prime as the sum over all summands except for l = 0 (see U pðk1jiÞ λðk1Þ jik1 ji¼0 pðk2j ðk1 iÞÞpðk1jiÞ λðk2;λðk1;iÞÞ jik1 jik2 k12A k1;k22A Supplementary Information). (21) When using the Pauli measurement scheme as explained in Proposition 1, one needs to use V(vx) = Rz(2vx) as operators with By repeating the application of U with a fresh qudit initialized in constants v = 2πl/P for l = −L, …, L to evaluate the characteristic ji0 l times, a quantum state that encodes all possible paths of the function at those points for the Fourier-series approximation. This l-step HMM can be created. makes a total of 2L experiments (L measurements for each Pauli By introducing a mapping from the output alphabet to a observable) with n Hadamard gates on n index qubits for numerical value g : A ! R, we can create the process Xn = g(An) encoding the probability information, n bit-flip gates on the index and then apply propositions 1 or 2 by adding a data system HD. qubits for implementing the controlled operations that operate if Therefore the quantum memory advantage reported18 and the control qubit is 0, and 2n controlled-Rz gates, which of each fi 19,20 experimentally veri ed can be carried over to our reported can be further decomposed to two controlled-NOT and two Rz advantages to estimate the characteristic function efficiently. An gates, applied on a data qubit controlled by the index qubit for interesting avenue for future work is also to apply these methods implementing x1 and x2. In addition, the initial value x0 can be 33 to rare-event sampling strategies . implemented by one Rz gate (see Supplementary Fig. 2).

Published in partnership with The University of New South Wales npj Quantum Information (2021) 126 C. Blank et al. 6

Fig. 4 Evaluation of the Delta for the European call option. Left: The Delta of an European call option is calculated for various strike prices. The underlying asset is defined with μ = 0, σ = 0.02, r = 0.02, S0 = 100, t = 1, and the time of maturity T = 10. The dotted black line is the true evaluation of the Delta. The black (blue) solid line is the real (imaginary) part of the theoretical Delta calculation obtained by a Fourier approximation with P = 100 and L = 100, which serves as the reference for the experimental validation. The black crosses (blue tri-downs) are the real (imaginary) part of the Delta calculated with the experiment on the IBM quantum computer with error mitigation applied. The black dots (blue triangles) are the simulation with noise model provided in qiskit with the same error mitigation applied. Right: This plot shows the characteristic function calculated in theory ( × ), by simulation with noise and error mitigation (dot) and the IBM quantum experiment with error mitigation (tri-down) for the example strike price of K = 110.

To demonstrate the proof-of-principle, we performed classical with the second property. Then a controlled rotation gate is simulations and experiments of the quantum algorithm for applied from each index qubit to an index qubit of the successive calculating the Delta of an European call option on a IBM step. The controlled operation can be expressed as quantum device named ibmqx2. As an example, the underlying ji0 hj0 R ðθ Þþji1 hj1 R ðθ Þ; (27) asset is given with μ = 0, σ = 0.02, r = 0.02, S = 100, t = 1, and the y pl y ql 0 ffiffiffiffi ffiffiffiffi time of maturity T = 10. The Fourier-series approximation is θ À1 p θ À1 p where pl ¼ 2cos ð plÞ and ql ¼ 2cos ð qlÞ. For example, performed by choosing L = 100 and P = 100. The standard error after one application of the above-controlled operation, the index 47 mitigation protocol available in qiskit is applied to reduce qubits representing the probability distribution of the first two experimental errors. Despite imperfections, the experiment steps of the CRW is given as predicts the expectation value with high accuracy for the most pffiffiffiffiffi pffiffiffiffiffiffiffiffiffiffiffiffiffi pffiffiffiffiffiffiffiffiffiffiffiffiffi pffiffiffiffiffi jið0 p ji0 þ 1 À p jiÞ1 þ jið1 1 À q ji0 þ q jiÞ1 important region, which is where it changes drastically, i.e., where 1 1 pffiffiffi 1 1 : (28) the strike price varies between 100 and 150. We also performed a 2 classical simulation of the quantum algorithm with the standard P qiskit The above state shows that ½Š¼X2 ¼ x1jX1 ¼ x1 p1 and noise model provided in . These results are compared P with the theoretical values in Fig. 4. The comparison shows that ½Š¼X2 ¼ x2jX1 ¼ x2 q1 as required by the property (3) of the noise model provided in qiskit explains the experimental the CRW. error reasonably well (see “Methods” for a brief comment on the We demonstrate the proof-of-principle with an example remaining difference between the two results). designed as follows. The correlated random walk is given by increments xl1 = 1 and xl2 = −1 with an initial value x0 = 0. The persistence parameters are pl = (1/2, 2/3, 5/6, 1) and ql = (1/2, 1/3, Correlated random walks 1/6, 0) with l = 1, 2, 3, 4. Experiments were performed to calculate The quantum advantage against classical methods manifests the characteristic function for vl = 2πl/P, l = −L, …, L with L = 100 when the DSP strictly requires the ability to simulate path- and P = 100 on ibmqx2. The standard error mitigation protocol dependent increments. We demonstrate the simulation of available in qiskit is applied to reduce experimental errors. We correlated random walks as one such example in this section. also performed classical simulation of the quantum algorithm with Correlated random walk (CRW) is a mathematical model that the standard noise model provided by qiskit. These results are describes discrete random processes with correlations between compared with the theoretical values in Fig. 5. successive steps48. It has been a useful tool to study biological processes49,50, and can also be used to approximate fractional Brownian motion51,52, which has broad applications for example in DISCUSSION mathematical finance53–55 and data network56–59. The correlation, We presented a quantum-classical hybrid framework for estimat- often referred to as persistence, results in a local directional bias as ing an expectation value of a random variable based on a discrete theP walker moves. More precisely, the CRW denoted by Sn ¼ stochastic process under the action of function that admits a n = … l¼0 Xl with n discrete random variables Xl, l 1, , n and Fourier-series approximation. As the main ingredient of the persistence parameters pl ∈ [0, 1] and ql ∈ [0, 1] has the following framework, we developed a quantum algorithm for efficiently properties: (1) X0 = x0, (2) P½Š¼X1 ¼ x1 P½Š¼X1 ¼ x2 1=2, and (3) calculating point evaluations of the characteristic function of a P P ∀ ≥ ½Š¼Xlþ1 ¼ x1jXl ¼ x1 pl and ½Š¼Xlþ1 ¼ x2jXl ¼ x2 ql l 1. random variable. This may also lead to other interesting The first two properties can be incorporated in quantum applications since the probability distribution of a random variable simulations easily by following the same procedure used in the can be completely defined by its characteristic function. More previous example. Given pl and ql, the third property can be specifically, in the quantum part, the framework proposes a implemented as follows. First, all index qubits except the first one succinct representation of a classical DSP as a quantum state in that encodes the probability distribution of X1 arepffiffiffi initialized inji 0 . the form of Eq. (2). The joint probability and the value of each The first index qubit is prepared in ðji0 þ jiÞ1 = 2 in accordance realization are encoded in an entangled state jiΨf , and therefore

npj Quantum Information (2021) 126 Published in partnership with The University of New South Wales C. Blank et al. 7 to maximize the precision of the characteristic function evaluation for regularly used DSPs. Furthermore, our framework promotes the idea for a co-design quantum computer60–63, which focuses on optimizations and design decisions at the hardware level to particularly support the DSP simulations at hand. We underscore our findings with two interesting examples. First, we showed an application to finance, the calculation of the Delta of a European call option. The key idea was to model the stochastic behavior of an underlying asset as a Brownian motion, which is then approximated as a random walk by Donsker’s invariance principle. Next, an application to DSPs with path- dependent increments is demonstrated by an example of correlated random walks. We presented the results of proof-of- principle experiments for each example to demonstrate the validity and the feasibility of our method. The framework can be extended to multivariate functions d f : R ! R. Given P1; ¼ ; Pd 2 R, the period of the respective argument of f and L1; ¼ ; Ld 2 Nþ, a multi-dimensional Fourier- series approximation

P π 2 lj XL1 XLd i xj Pj j fðx1; ¼ ; xdÞ¼ ÁÁÁ cðω1; ¼ ; ωdÞe

l1¼1 ld ¼1

Fig. 5 Characteristic functions of a correlated random walk. can be applied like Eq. (11) and consequentlyÂà Eq. (12). The primary φ E ivÁSn Characteristic functions of a random walk is calculated theoretically harmonics to calculate are thus Sn ðvÞ¼ e , which can be ( × ), by simulation (dot), and by experiment (tri-down). The achieved by increasing the dimension of the index system and simulation includes the standard noise model provided in qiskit. applying a new set of a unitary family Vr (r = 1, …, d) to the same The experiment employs the standard error mitigation technique data system D. provided in qiskit. The parameters that define the correlated The ability to simulate multivariate stochastic dynamics with the random walk is described in the main text. optimal variance and quadratic quantum speed-up without requiring any sampling strategies is highly beneficial for various all necessary information about a DSP is present. We also detailed analyses in the quantitative and computational science. The path- the construction of a quantum circuit for preparing the quantum dependent and state-dependent DSP simulations are excellent fits Ψ state jif using the number of circuit elements that only grow for studying random walks with internal states64, and discrete linearly with the total number of time steps. For a DSP of n total processes that converge to Ornstein–Uhlenbeck65 and fractional n steps each consisting of k possibilities, there are k paths. Such a Brownian motion51. Due to the broad applicability of these process can be encoded in a quantum state using nk-dimensional mathematical models, the framework developed in this work index qudits (or dlog 2ðkÞe qubits) and nk controlled gates. There is opens tremendous and extensive opportunities in physics, no need for sampling strategies since all realizations exist in biology, epidemiology, hydrology, engineering, and finance. quantum superposition. In future work, we plan to provide explicit quantum circuit Two different measurement schemes are proposed for the design for simulating state-dependent DSPs. Interesting applica- E E estimation of expectation values ½ŠcosðSnÞ and ½ŠsinðSnÞ . The tions to accompany this model include the analysis of stochastic fi σ σ rst scheme is to measure an expectation value of x and y epidemic models66,67 and of hot streak68. Ψ directly on thepffiffiffiffi data system of jif , resulting in a convergence error of Oð1= NÞ for N repeated experiments for any N > 0. This shows that the quantum brute-force approach acquires the METHODS optimal importance distribution. Furthermore, the sampling All experiments are performed using one of the publicly available IBM convergence can be improved by utilizing the quantum amplitude quantum devices consisting of five superconducting qubits, named as estimation technique, which promises to reduce the approxima- ibmqx2. In order to fully utilize the IBM quantum cloud platform, we used the tion error by a factor of Oð1=2mÞ using m additional qubits. IBM quantum information science kit (qiskit)framework47. The versions— However, the resource overhead of the latter approach is m ancilla as defined by PyPi version numbers—used for this work were 0.20.0. qubits, OðpolyðmÞÞ Grover-like controlled operations, and Oðm2Þ Superconducting quantum computing devices that are currently one- and two-qubit gates for implementing QFT. Therefore, with available via the cloud service, such as those used in this work, have limited coupling between qubits. Resolving coupling constraints as well as the noisy intermediate-scale quantum (NISQ) devices, it may be optimizations are done in qiskit with a preset of so-called pass desirable to use the former approach. managers. The optimization level ranges from 0 to 3. As we chose the The advantage of this algorithm lies in two facts. First, it is a ibmqx2 for our experiments the mapping of data register and index quantum-classical hybrid computation and thus is a viable register follow the connectivity. For the family of devices that contains candidate to be solved with near-term quantum devices. One ibmq_ourense, one swap operation must be used to exchange the can envisage multiple near-term quantum devices running in physical qubit 3 and 4. For both layouts see Supplementary Fig. 1a, b. parallel to calculate all 2L terms independently at the same time. During the compilation step of the experiments, we first use a level 0 pass Similar parallelization is also suitable for multiple partitions of a and then a subsequent level 3 pass to optimize and resolve connectivity constraints. To reduce experimental errors, we used the standard error large quantum device where the qubit connectivity is high within qiskit each partition but low among partitions. Second, given one type mitigation functionality of . This requires an extra set of experiments to be executed prior to the main experiment. of process Sn, we can pre-compute a number of evaluations of the In order to understand the source of experimental discrepancy, the characteristic functions φ ± v for v <

Published in partnership with The University of New South Wales npj Quantum Information (2021) 126 C. Blank et al. 8 also applying error mitigation on the result. The remaining discrepancy 24. Rubinstein, R. Y. & Kroese, D. P. Simulation and the Monte Carlo Method, Vol. 10 between experimental and simulation results can be attributed to errors (John Wiley & Sons, 2016). that are not included in the basic error model, such as various cross-talk 25. Owen, A. & Zhou, Y. Safe and effective importance sampling. J. Am. Stat. Assoc. effects, drift, and non-Markovian noise. The standard noise model is 95, 135–143 (1998). described in the supplementary information of ref. 69 in detail. 26. Cappé, O., Douc, R., Guillin, A., Marin, J.-M. & Robert, C. P. Adaptive importance The example for the Delta applied the strike price K from 10 to 220 in sampling in general mixture classes. Stat. Comput. 18, 447–459 (2008). increments of 5 for the theoretical calculation, while the experiments were 27. Srinivasan, R. Importance Sampling: Applications in Communications and Detection performed for K = 25, 55, 85, 105, 110, 115, 120, 125, 130, 160, 190, 220. The (Springer Science & Business Media, 2013). experiment for each K is executed for characteristic function evaluations at 28. Martino, L., Elvira, V., Luengo, D. & Corander, J. Layered adaptive importance vl = 2πl/P with l = −L, …, L, L = 100 and P = 100, each with 8129 shots. For sampling. Stat. Comput. 27, 599–623 (2017). the correlated random walk experiment, we used 32786 shots for each of 29. Brassard, G., Hoyer, P., Mosca, M. & Tapp, A. Quantum amplitude amplification the evaluations of vl = 2πl/P with l = −L, …, L and P = L = 100. Note that and estimation. Contemp. Math. 305,53–74 (2002). this example did not use the Fourier approximation, and P has been 30. Montanaro, A. Quantum speedup of monte carlo methods. Proc. Math. Phys. Eng. chosen to be the same as L so that vl goes through one period on each Sci. 471, 20150301 (2015). side, resulting in a symmetric picture. As the IBM quantum cloud platform 31. Rebentrost, P. & Lloyd, S. Quantum computational finance: quantum algorithm allows for 8192 shots per execution, we created multiple identical for portfolio optimization. Preprint at https://arxiv.org/abs/1811.03975 (2018). experiments and manually added the results. 32. Binder, F. C., Thompson, J. & Gu, M. Practical unitary simulator for non-markovian complex processes. Phys. Rev. Lett. 120, 240502 (2018). 33. Aghamohammadi, C., Loomis, S. P., Mahoney, J. R. & Crutchfield, J. P. Extreme DATA AVAILABILITY quantum memory advantage for rare-event sampling. Phys. Rev. X 8, 011025 The data that support the findings of this study are available from C.B. upon (2018). reasonable request. 34. Park, D. K., Sinayskiy, I., Fingerhuth, M., Petruccione, F. & Rhee, J.-K. K. Parallel quantum trajectories via forking for sampling without redundancy. N. J. Phys. 21, 083024 (2019). Received: 4 October 2020; Accepted: 14 July 2021; 35. Möttönen, M., Vartiainen, J. J., Bergholm, V. & Salomaa, M. M. Transformation of quantum states using uniformly controlled rotations. Quantum Info Comput. 5, 467–473 (2005). 36. Park, D. K., Petruccione, F. & Rhee, J.-K. K. Circuit-based quantum random access memory for classical data. Sci. Rep. 9, 3949 (2019). REFERENCES 37. Nielsen, M. A. & Chuang, I. L. Quantum Computation and Quantum Information: 1. Feynman, R. P. Simulating physics with computers. Int. J. Theor. Phys. 21, 467–488 10th Anniversary Edition. (Cambridge University Press, 2011). (1982). 38. Zygmund, A. Trigonometric Series, Vol. 1 (Cambridge University Press, 2002). 2. Lloyd, S. Universal quantum simulators. Science 273, 1073–1078 (1996). 39. Bary, N. K. A Treatise on Trigonometric Series, Vol. 1 (, 2014). 3. Kassal, I., Whitfield, J. D., Perdomo-Ortiz, A., Yung, M.-H. & Aspuru-Guzik, A. 40. Katznelson, Y. An Introduction to Harmonic Analysis (Cambridge University Press, Simulating chemistry using quantum computers. Annu. Rev. Phys. Chem. 62, 2004). fi 185–207 (2011). 41. Crutch eld, J. P. & Young, K. Inferring statistical complexity. Phys. Rev. Lett. 63, – 4. Zalka, C. Simulating quantum systems on a quantum computer. Proc. Math. Phys. 105 108 (1989). Eng. Sci. 454, 313–322 (1998). 42. Liu, Q., Elliott, T. J., Binder, F. C., Di Franco, C. & Gu, M. Optimal stochastic mod- 5. Blatt, R. & Roos, C. F. Quantum simulations with trapped ions. Nat. Phys. 8, eling with unitary quantum dynamics. Phys. Rev. A 99, 062110 (2019). 277–284 (2012). 43. Elliott, T. J. et al. Extreme dimensionality reduction with quantum modeling. Phys. 6. Barreiro, J. T. et al. An open-system quantum simulator with trapped ions. Nature Rev. Lett. 125, 260501 (2020). fi 470, 486–491 (2011). 44. Crutch eld, J. P. The calculi of emergence: computation, dynamics and induction. – 7. Gerritsma, R. et al. Quantum simulation of the dirac equation. Nature 463,68–71 Phys. D: Nonlinear Phenom. 75,11 54 (1994). (2010). 45. Donsker, M. D. An invariance principle for certain probability limit theorems. 8. Aspuru-Guzik, A. & Walther, P. Photonic quantum simulators. Nat. Phys. 8, Mem. Am. Math. Soc. 6, 12 (1951). 285–291 (2012). 46. Fristedt, B. E. & Gray, L. F. A Modern Approach to Probability Theory (Springer 9. Friedenauer, A., Schmitz, H., Glueckert, J. T., Porras, D. & Schätz, T. Simulating a Science & Business Media, 2013). quantum magnet with trapped ions. Nat. Phys. 4, 757–761 (2008). 47. ANIS, M. S. et al. Qiskit: An Open-source Framework for Quantum Computing. 10. Weimer, H., Müller, M., Lesanovsky, I., Zoller, P. & Büchler, H. P. A rydberg https://doi.org/10.5281/zenodo.5096364 (2021). – quantum simulator. Nat. Phys. 6, 382–388 (2010). 48. Gillis, J. Correlated random walk. Math. Proc. Camb. Philos. Soc. 51, 639 651 11. Aspuru-Guzik, A., Dutoi, A. D., Love, P. J. & Head-Gordon, M. Simulated quantum (1955). ’ computation of molecular energies. Science 309, 1704–1707 (2005). 49. Bovet, P. & Benhamou, S. Spatial analysis of animals movements using a corre- – 12. Lanyon, B. P. et al. Towards quantum chemistry on a quantum computer. Nat. lated random walk model. J. Theor. Biol. 131, 419 433 (1988). Chem. 2, 106–111 (2010). 50. Codling, E. A., Plank, M. J. & Benhamou, S. Random walk models in biology. J. R. – 13. Abrams, D. S. & Lloyd, S. Quantum algorithm providing exponential speed Soc. Interface 5, 813 834 (2008). increase for finding eigenvalues and eigenvectors. Phys. Rev. Lett. 83, 5162 (1999). 51. Mandelbrot, B. B. & Van Ness, J. W. Fractional Brownian motions, fractional noises – 14. Berry, D. W., Ahokas, G., Cleve, R. & Sanders, B. C. Efficient quantum algorithms for and applications. SIAM Rev. 10, 422 437 (1968). simulating sparse hamiltonians. Commun. Math. Phys. 270, 359–371 (2007). 52. Enriquez, N. A simple construction of the fractional Brownian motion. Stoch. – 15. Rebentrost, P., Gupt, B. & Bromley, T. R. Quantum computational finance: Monte Process. Their Appl. 109, 203 223 (2004). fi Carlo pricing of financial derivatives. Phys. Rev. A 98, 022321 (2018). 53. Elliott, R. J. & van der Hoek, J. Fractional brownian motion and nancial model- 16. Woerner, S. & Egger, D. J. Quantum risk analysis. npj Quant. Inf. 5, 15 (2019). ling. In Kohlmann M., Tang S. (eds) Mathematical Finance. Trends in Mathematics, – 17. Heinrich, S. From monte carlo to quantum computation. Math. Comput. Simul. 62, 140 151, https://doi.org/10.1007/978-3-0348-8291-0_13 (Birkhäuser Basel, 2001). 219–230 (2003). 54. Cheridito, P. Arbitrage in fractional Brownian motion models. Financ. Stoch. 7, – 18. Gu, M., Wiesner, K., Rieper, E. & Vedral, V. can reduce the 533 553 (2003). complexity of classical models. Nat. Commun. 3,1–5 (2012). 55. Rostek, S. & Schöbel, R. A note on the use of fractional Brownian motion for fi – 19. Ghafari, F. et al. Dimensional quantum memory advantage in the simulation of nancial modeling. Econ. Model. 30,30 35 (2013). stochastic processes. Phys. Rev. X 9, 041013 (2019). 56. Norros, I. On the use of fractional Brownian motion in the theory of con- – 20. Ghafari, F. et al. Interfering trajectories in experimental quantum-enhanced sto- nectionless networks. IEEE J. Sel. Areas Commun. 13, 953 962 (1995). chastic simulation. Nat. Commun. 10,1–8 (2019). 57. Konstantopoulos, T. & Lin, S.-J. In Stochastic Networks (eds Glasserman, P., Sigman, – 21. Stamatopoulos, N. et al. Option pricing using quantum computers. Quantum 4, K. & Yao, D. D.) 257 273 (Springer New York, 1996). 291 (2020). 58. Belly, S. & Decreusefond, L. In Fractals in Engineering (eds Lévy Véhel, J., Lutton, E. – 22. Blanchet, J. H. & Liu, J. State-dependent importance sampling for regularly & Tricot, C.) 170 184 (Springer London, 1997). varying random walks. Adv. Appl. Probab. 40, 1104–1128 (2008). 59. Filatova, D. Mixed fractional Brownian motion: some related questions for com- fi 23. Hastings, W. K. Monte Carlo Sampling Methods Using Markov Chains and Their puter network traf c modeling. In 2008 International Conference on Signals and – Applications (Oxford University Press, 1970). Electronic Systems, 393 396 (IEEE, 2008).

npj Quantum Information (2021) 126 Published in partnership with The University of New South Wales C. Blank et al. 9 60. Brown, K. R., Kim, J. & Monroe, C. Co-designing a scalable quantum computer Q. All authors reviewed and discussed the analyses and results, and contributed with trapped atomic ions. npj Quant. Inf. 2,1–10 (2016). toward writing the manuscript. 61. Langford, N. et al. Experimentally simulating the dynamics of quantum light and matter at deep-strong coupling. Nat. Commun. 8,1–10 (2017). 62. Parra-Rodriguez, A., Lougovski, P., Lamata, L., Solano, E. & Sanz, M. Digital-analog COMPETING INTERESTS quantum computation. Phys. Rev. A 101, 022305 (2020). The authors declare no competing interests. 63. Lamata, L., Parra-Rodriguez, A., Sanz, M. & Solano, E. Digital-analog quantum simulations with superconducting circuits. Adv. Phys. 3, 1457981 (2018). 64. Hughes, B. Random Walks and Random Environments: Random Walks (Clarendon ADDITIONAL INFORMATION Press, 1995). 65. Uhlenbeck, G. E. & Ornstein, L. S. On the theory of the brownian motion. Phys. Rev. Supplementary information The online version contains supplementary material 36, 823–841 (1930). available at https://doi.org/10.1038/s41534-021-00459-2. 66. Tuckwell, H. C. & Williams, R. J. Some properties of a simple stochastic epidemic model of sir type. Math. Biosci. 208,76– 97 (2007). Correspondence and requests for materials should be addressed to F.P. 67. Allen, L. J. A primer on stochastic epidemic models: formulation, numerical simulation, and analysis. Infect. Dis. Model. 2, 128 – 142 (2017). Reprints and permission information is available at http://www.nature.com/ 68. Liu, L. et al. Hot streaks in artistic, cultural, and scientific careers. Nature 559, reprints 396–399 (2018). ’ 69. Blank, C., Park, D. K., Rhee, J.-K. K. & Petruccione, F. Quantum classifier with Publisher s note Springer Nature remains neutral with regard to jurisdictional claims fi tailored quantum kernel. npj Quant. Inf. 6,1–7 (2020). in published maps and institutional af liations.

ACKNOWLEDGEMENTS This article is licensed under a Creative Commons We acknowledge the use of IBM Q for this work. The views expressed are those of the Attribution 4.0 International License, which permits use, sharing, fl fi authors and do not re ect the of cial policy or position of IBM or the IBM Q team. We adaptation, distribution and reproduction in any medium or format, as long as you give thank Philipp Leser, Mile Gu, and Jayne Thompson for fruitful discussions, and James appropriate credit to the original author(s) and the source, provide a link to the Creative fi Crutch eld for sharing references. This research is supported by the National Commons license, and indicate if changes were made. The images or other third party Research Foundation of Korea (No. 2019R1I1A1A01050161 and 2021M3H3A1038085), material in this article are included in the article’s Creative Commons license, unless Quantum Computing Development Program (No. 2019M3E4A1080227), and the indicated otherwise in a credit line to the material. If material is not included in the South African Research Chair Initiative of the Department of Science and Technology article’s Creative Commons license and your intended use is not permitted by statutory and the National Research Foundation (UID: 64812). regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons. org/licenses/by/4.0/. AUTHOR CONTRIBUTIONS C.B. and D.K.P. contributed equally to this work. C.B. and D.K.P. designed and analyzed the model. C.B. conducted the simulations and the experiments on the IBM © The Author(s) 2021

Published in partnership with The University of New South Wales npj Quantum Information (2021) 126