Skip to main content
Log in

Recovering the Original Simplicity: Succinct and Exact Quantum Algorithm for the Welded Tree Problem

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

This work revisits quantum algorithms for the well-known welded tree problem, proposing a succinct quantum algorithm based on the simple coined quantum walks. It iterates the naturally defined coined quantum walk operator for a classically precomputed number of iterations, and measures. The number of iterations is linear in the depth of the tree. The success probability of this procedure is inversely linear in the depth of the tree. Moreover, it is the same for all instances of the problem of a fixed size, therefore, we can use the exact quantum amplitude amplification subroutine to answer with probability 1. This gives an exponential speedup over any classical algorithm for the same problem. The significance of the results may be seen as follows. (i) Our algorithm is rather simple compared with the one in (Jeffery and Zur, STOC’2023), which not only breaks the stereotype that coined quantum walks can only achieve quadratic speedups over classical algorithms, but also demonstrates the power of the simplest quantum walk model. (ii) Our algorithm achieves certainty of success for the first time. Thus, it becomes one of the few examples that exhibit exponential separation between exact quantum and randomized query complexities.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Algorithm 1
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

Explore related subjects

Discover the latest articles, news and stories from top researchers in related subjects.

Data Availability

No datasets were generated or analysed during the current study.

References

  1. Aharonov, Y., Davidovich, L., Zagury, N.: Quantum random walks. Phys. Rev. A 48, 1687–1690 (1993). https://doi.org/10.1103/PhysRevA.48.1687

    Article  Google Scholar 

  2. Kempe, J.: Quantum random walks: an introductory overview. Contemp. Phys. 44(4), 307–327 (2003). https://doi.org/10.1080/00107151031000110776

    Article  Google Scholar 

  3. Ambainis, A.: Quantum walks and their algorithmic applications. Int. J. Quantum Inform. 01(04), 507–518 (2003). https://doi.org/10.1142/S0219749903000383

    Article  Google Scholar 

  4. Venegas-Andraca, S.E.: Quantum walks: a comprehensive review. Quantum Inf. Process. 11(5), 1015–1106 (2012). https://doi.org/10.1007/s11128-012-0432-5

    Article  MathSciNet  Google Scholar 

  5. Kadian, K., Garhwal, S., Kumar, A.: Quantum walk and its application domains: a systematic review. Comput. Sci. Rev. 41, 100419 (2021). https://doi.org/10.1016/j.cosrev.2021.100419

    Article  MathSciNet  Google Scholar 

  6. Ambainis, A., Bach, E., Nayak, A., Vishwanath, A., Watrous, J.: One-dimensional quantum walks. In: Proceedings of the 33rd ACM Symposium on Theory of Computing, pp. 37–49 (2001). https://doi.org/10.1145/380752.380757

  7. Aharonov, D., Ambainis, A., Kempe, J., Vazirani, U.V.: Quantum walks on graphs. In: Proceedings of the 33rd ACM Symposium on Theory of Computing, pp. 50–59 (2001). https://doi.org/10.1145/380752.380758

  8. Szegedy, M.: Quantum speed-up of markov chain based algorithms. In: 45th Annual IEEE Symposium on Foundations of Computer Science, pp. 32–41 (2004). https://doi.org/10.1109/FOCS.2004.53

  9. Magniez, F., Nayak, A., Roland, J., Santha, M.: Search via quantum walk. SIAM J. Comput. 40(1), 142–164 (2011). https://doi.org/10.1137/090745854

    Article  MathSciNet  Google Scholar 

  10. Krovi, H., Magniez, F., Ozols, M., Roland, J.: Quantum walks can find a marked element on any graph. Algorithmica 74(2), 851–907 (2016). https://doi.org/10.1007/s00453-015-9979-8

    Article  MathSciNet  Google Scholar 

  11. Belovs, A.: Quantum Walks and Electric Networks (2013). arXiv:1302.3143

  12. Apers, S., Gilyén, A., Jeffery, S.: A Unified Framework of Quantum Walk Search. In: Bläser, M., Monmege, B. (eds.) 38th International Symposium on Theoretical Aspects of Computer Science (STACS 2021). Leibniz International Proceedings in Informatics (LIPIcs), vol. 187, pp. 6–1613. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany (2021). https://doi.org/10.4230/LIPIcs.STACS.2021.6

  13. Ambainis, A.: Quantum walk algorithm for element distinctness. SIAM J. Comput. 37(1), 210–239 (2007). https://doi.org/10.1137/S0097539705447311

    Article  MathSciNet  Google Scholar 

  14. Buhrman, H., Spalek, R.: Quantum verification of matrix products. In: Proceedings of the Seventeenth ACM-SIAM Symposium on Discrete Algorithms, pp. 880–889 (2006). https://dl.acm.org/doi/10.5555/1109557.1109654

  15. Magniez, F., Santha, M., Szegedy, M.: Quantum algorithms for the triangle problem. SIAM J. Comput. 37(2), 413–424 (2007). https://doi.org/10.1137/050643684

    Article  MathSciNet  Google Scholar 

  16. Jeffery, S., Kothari, R., Magniez, F.: Nested quantum walks with quantum data structures. In: Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms. SODA ’13, pp. 1474–1485. Society for Industrial and Applied Mathematics, USA (2013). https://doi.org/10.1137/1.9781611973105.106

  17. Gall, F.L.: Improved quantum algorithm for triangle finding via combinatorial arguments. In: 2014 IEEE 55th Annual Symposium on Foundations of Computer Science, pp. 216–225 (2014). https://doi.org/10.1109/FOCS.2014.31

  18. Magniez, F., Nayak, A.: Quantum complexity of testing group commutativity. Algorithmica 48(3), 221–232 (2007). https://doi.org/10.1007/s00453-007-0057-8

    Article  MathSciNet  Google Scholar 

  19. Childs, A.M., Cleve, R., Deotto, E., Farhi, E., Gutmann, S., Spielman, D.A.: Exponential algorithmic speedup by a quantum walk. In: Proceedings of the Thirty-Fifth Annual ACM Symposium on Theory of Computing. STOC ’03, pp. 59–68. Association for Computing Machinery, New York (2003). https://doi.org/10.1145/780542.780552

  20. Childs, A.M., Farhi, E., Gutmann, S.: An example of the difference between quantum and classical random walks. Quantum Inf. Process. 1(1), 35–43 (2002). https://doi.org/10.1023/A:1019609420309

    Article  MathSciNet  Google Scholar 

  21. Kempe, J.: Quantum Random Walks Hit Exponentially Faster (2002). arXiv:quant-ph/0205083

  22. Jeffery, S., Zur, S.: Multidimensional quantum walks. In: Proceedings of the 55th Annual ACM Symposium on Theory of Computing. STOC 2023, pp. 1125–1130. Association for Computing Machinery, New York (2023). https://doi.org/10.1145/3564246.3585158

  23. Childs, A.M., Wang, D.: Can graph Properties Have Exponential Quantum Speedup? (2020). arXiv:2001.10520

  24. Ben-David, S., Childs, A.M., Gilyén, A., Kretschmer, W., Podder, S., Wang, D.: Symmetries, graph properties, and quantum speedups. In: 2020 IEEE 61st Annual Symposium on Foundations of Computer Science (FOCS), pp. 649–660 (2020). https://doi.org/10.1109/FOCS46700.2020.00066

  25. Brassard, G., Hoyer, P.: An exact quantum polynomial-time algorithm for Simon’s problem. In: Proceedings of the Fifth Israeli Symposium on Theory of Computing and Systems, pp. 12–23 (1997). https://doi.org/10.1109/ISTCS.1997.595153

  26. Ye, Z., Huang, Y., Li, L., Wang, Y.: Query complexity of generalized Simon’s problem. Inf. Comput. 281, 104790 (2021). https://doi.org/10.1016/j.ic.2021.104790

    Article  MathSciNet  Google Scholar 

  27. Ide, Y., Konno, N., Segawa, E., Xu, X.-P.: Localization of discrete time quantum walks on the glued trees. Entropy 16(3), 1501–1514 (2014). https://doi.org/10.3390/e16031501

    Article  MathSciNet  Google Scholar 

  28. Atia, Y., Chakraborty, S.: Improved upper bounds for the hitting times of quantum walks. Phys. Rev. A 104, 032215 (2021). https://doi.org/10.1103/PhysRevA.104.032215

    Article  MathSciNet  Google Scholar 

  29. Gilyén, A., Su, Y., Low, G.H., Wiebe, N.: Quantum singular value transformation and beyond: Exponential improvements for quantum matrix arithmetics. In: Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing. STOC 2019, pp. 193–204. Association for Computing Machinery, New York (2019). https://doi.org/10.1145/3313276.3316366

  30. Yoder, T.J., Low, G.H., Chuang, I.L.: Fixed-point quantum search with an optimal number of queries. Phys. Rev. Lett. 113, 210501 (2014). https://doi.org/10.1103/PhysRevLett.113.210501

    Article  Google Scholar 

  31. Fenner, S.A., Zhang, Y.: A note on the classical lower bound for a quantum walk algorithm (2003). arXiv:quant-ph/0312230

  32. Childs, A.M.: On the relationship between continuous-and discrete-time quantum walk. Commun. Math. Phys. 294(2), 581–603 (2010). https://doi.org/10.1007/s00220-009-0930-1

    Article  MathSciNet  Google Scholar 

  33. Kitaev, A.Y.: Quantum measurements and the Abelian Stabilizer Problem. arXiv (1995). arXiv:quant-ph/9511026

  34. Bernstein, E., Vazirani, U.: Quantum complexity theory. In: Proceedings of the Twenty-Fifth Annual ACM Symposium on Theory of Computing. STOC ’93, pp. 11–20. Association for Computing Machinery, New York (1993). https://doi.org/10.1145/167088.167097

  35. Long, G.L.: Grover algorithm with zero theoretical failure rate. Phys. Rev. A 64, 022307 (2001). https://doi.org/10.1103/PhysRevA.64.022307

    Article  Google Scholar 

  36. Evolution of the reduced state vector of DTQW on welded tree. https://www.bilibili.com/video/BV1kK411179r/

  37. Jordan, C.: Essai sur la géométrie à \(n\) dimensions. Bull. Soc. Math. France 3, 103–174 (1875)

    Article  MathSciNet  Google Scholar 

  38. Li, G., Li, L.: Optimal deterministic quantum algorithm for the promised element distinctness problem. Theoret. Comput. Sci. 999, 114551 (2024). https://doi.org/10.1016/j.tcs.2024.114551

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgements

We would like to thank Yongzhen Xu and Qingwen Wang for helpful discussions on quantum walk search frameworks. We would also like to thank the reviewers for their valuable suggestions which have improved the presentation of the paper. This work is supported by the National Natural Science Foundation of China (Grant No. 62272492), the Guangdong Provincial Quantum Science Strategic Initiative (Grant No. GDZX2303007), and the Innovation Program for Quantum Science and Technology (No.2021ZD0302901).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lvzhou Li.

Ethics declarations

Conflict of interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This work was originally presented at SODA2024 conference.

Appendices

Implementing \(U_\varphi \) in Lemma 2.1

In this appendix, we will implement the unitary operator \(U_\varphi : {|{u,\perp }\rangle } \mapsto {|{u, \varphi (u)}\rangle }\) in Lemma 2.1. We first introduce five auxiliary registers

$$\begin{aligned} {|{0}\rangle }_{q_1} {|{0}\rangle }_{q_2} {|{0}\rangle }_{q_3} {|{0}\rangle }_a {|{0}\rangle }_b {|{0}\rangle }_c, \end{aligned}$$
(A1)

where register \(q_i\) consists of 2n qubits storing the query result, register a is a qutrit with state space \({\mathbb {C}}^3=\text {span} \{{|{0}\rangle },{|{1}\rangle },{|{2}\rangle } \}\) used for generating \({|{\varphi (u)}\rangle }\) when u is an internal node, register b is a qudit with state space \({\mathbb {C}}^5=\text {span} \{{|{0}\rangle },\cdots ,{|{4}\rangle } \}\) storing conditions, and register c is a qubit used for generating \({|{\varphi (u)}\rangle }\) when u is one of the roots. Now \(U_\varphi \) can be implemented as follows, where oracle query happens in the first and last step.

  1. 1.

    Query the oracle O on registers \(r_1,q_1,q_2,q_3\) to obtain

    $$\begin{aligned} {|{u}\rangle }_{r_1} {|{\perp }\rangle }_{r_2} \bigotimes _{i=1}^{3} {|{\Gamma (u,i)}\rangle }_{q_i}\ {|{0}\rangle }_a {|{0}\rangle }_b {|{0}\rangle }_c. \end{aligned}$$
    (A2)
  2. 2.

    Apply the transformation \({|{q}\rangle }{|{b}\rangle } \mapsto {|{q}\rangle } {|{b+f(q)}\rangle }\) on register \(q:=(q_1,q_2,q_3)\) and b. The function \(f: \{0,1\}^{6n} \rightarrow \{0,\cdots ,4\}\) is defined as: \(f(q)=0\) iff there’s no \(q_i=\perp \), so that u is an internal node; \(f(q)=i\) for \(i=1,2,3\) iff there’s one and only one \(q_i=\perp \), so that \(u \in \{s,t\}\), and the ith register \(q_i\) stores the value \(\perp \); \(f(q)=4\) iff there’s more than one \(q_i=\perp \), so that \(u\notin V(G_n)\). It can be easily seen that calculating f takes O(n) basic operations.

  3. 3.

    Conditioned on \(b=0\), i.e. u is an internal node, apply the following two steps.

    1. 3.1.

      Flip all the qubits of register \(r_2\) so that it’s set to \({|{0^{2n}}\rangle }\). Apply quantum Fourier transform \(QFT_3\) to register a, and then controlled by \({|{i}\rangle }_a,\, i\in \{0,1,2\}\), add (i.e. bit-wise modulo 2 addition) the value of register \(q_{(i+1)}\) to register \(r_2\), obtaining

      $$\begin{aligned} {|{u}\rangle }_{r_1} (\frac{1}{\sqrt{3}}\sum _{i=0}^2 {|{\Gamma (u,i+1)}\rangle }_{r_2} {|{i}\rangle }_a)\ \bigotimes _{i=0}^{2} {|{\Gamma (u,i+1)}\rangle }_{q_{(i+1)}} {|{b}\rangle }_b {|{0}\rangle }_c. \end{aligned}$$
      (A3)

      This controlled addition can be done in O(n) basic operations.

    2. 3.2.

      Compare \({|{\Gamma (u,i)}\rangle }_{r_2}\) with \({|{\Gamma (u,j)}\rangle }_{q_j}\) for \(j=1,2,3\) and subtract \({|{i}\rangle }_a\) with \((j-1)\), where j is the unique index j such that \({|{\Gamma (u,i)}\rangle }_{r_2}={|{\Gamma (u,j)}\rangle }_{q_j}\), obtaining

      $$\begin{aligned} {|{u}\rangle }_{r_1} {|{\varphi (u)}\rangle }_{r_2} \bigotimes _{i=1}^{3} {|{\Gamma (u,i)}\rangle }_{q_{i}}\ {|{0}\rangle }_a {|{b}\rangle }_b {|{0}\rangle }_c. \end{aligned}$$
      (A4)

      The uniqueness of the index j can be easily seen from the condition that all of u’s neighbours \(\Gamma (u,i)\) are distinct. This compare (between binary strings) and subtract operation can be done in O(n) basic operations.

  4. 4.

    Conditioned on \(b\in \{1,2,3\}\), i.e. u is one of the two roots and register \(q_b\) stores \(\perp \), apply the following steps.

    1. 4.1.

      Swap register \(q_b\) and \(q_3\) so that the first two auxiliary registers store the genuine adjacent vertex name of \(u \in \{s,t\}\). The conditioned SWAP operation can be done in O(n) basic operations.

    2. 4.2.

      similar to step 3.1 and 3.2, transform \({|{\perp }\rangle }_{r_2}\) to \({|{\varphi (u)}\rangle }_{r_2}\) with the help of \(H {|{0}\rangle }_c = \frac{1}{\sqrt{2}}({|{0}\rangle }+{|{1}\rangle })\).

    3. 4.3.

      Repeat step 4.1 so that the order of register \(q_i\) is restored, ensuring the success of step 6 and step 7.

  5. 5.

    Conditioned on \(b = 4\), apply the identity transformation I, since register \(r_1\) already stores \({|{\varphi (u)}\rangle }={|{\perp }\rangle }\) (the three ‘neighbours’ of \(u\notin V(G_n)\) are all \(\perp \)).

  6. 6.

    Similar to step 2, apply the transformation \({|{q}\rangle }{|{b}\rangle } \mapsto {|{q}\rangle }{|{b-f(q)}\rangle }\) to register qb, where the subtraction is modulo 5. Therefore, register b is recovered to \({|{0}\rangle }_b\).

  7. 7.

    Query the oracle O once more as in step 2, so that all the auxiliary registers are restored to zero.

Thus \(U_\varphi \) can be implemented with 2 oracle queries and O(n) basic operations.

Spectral Decomposition of the Reduced Walk Matrix

In this Appendix, we prove Lemma 4.1 about the spectral decomposition of the reduced coined quantum walk matrix \(M_U = M_S M_C\). The proof is inspired by [27], but we improved it with an easy observation of the relationship between monic and regular Chebyshev polynomial of the second kind (see Eq. (B47)), which allows us to obtain the analytical expression of \(U_k\) shown in Eq. (B48). We will show in detail the complete proof for the sake of completeness and convenience of the readers.

We also expand or improve some of the implicit or complicated steps in [27], and point out a connection with another commonly used technique for analyzing quantum walk operators, i.e. the singular value decomposition, or more precisely, Jordan’s Lemma [37] about common invariant subspaces of two reflection operator, which has been used in Refs. [8, 10, 29, 38].

We first present the following helper Lemma B.1, which is implicit in [27] and similar to [32, Theorem 1], saying that in order to obtain the spectral decomposition of \(M_U = M_S M_C\), we can instead consider the spectral decomposition of the following matrix

$$\begin{aligned} A^\dagger M_S A =: J_{2n}. \end{aligned}$$
(B5)

Lemma B.1

Consider the quantum walk operator \(U=\textrm{Ref}_B\, \textrm{Ref}_A\), where \(\textrm{Ref}_A = (2A A^\dagger -I)\) and A is a matrix with full column rank satisfying \(A^\dagger A =I\). Let

$$\begin{aligned} {|{a}\rangle }:=A{|{v}\rangle },\ {|{b}\rangle }:= \textrm{Ref}_B {|{a}\rangle }, \end{aligned}$$
(B6)

where \(\Vert {|{v}\rangle }\Vert ^2=1\). If

$$\begin{aligned} A^\dagger \textrm{Ref}_B A {|{v}\rangle } = \lambda {|{v}\rangle }. \end{aligned}$$
(B7)

Then, when \(\left| \lambda \right| < 1\), we have

$$\begin{aligned} U {|{u_{+}}\rangle } = e^{i\varphi } {|{u_{+}}\rangle }, \quad U {|{u_{-}}\rangle } = e^{-i\varphi } {|{u_{-}}\rangle }, \end{aligned}$$
(B8)

where \({|{u_{\pm }}\rangle }:= {|{a}\rangle } -e^{\pm i\varphi } {|{b}\rangle }\), \(\varphi := \arccos \lambda \), and \(\Vert {|{u_{\pm }}\rangle }\Vert ^2 =2(1-\lambda ^2)\). And when \(\lambda = \pm 1\), we have

$$\begin{aligned} U {|{a}\rangle } = \pm {|{a}\rangle }. \end{aligned}$$
(B9)

Proof

We first consider the case when \( \left| \lambda \right| < 1 \). From Eq. (B6) we know

$$\begin{aligned} U{|{a}\rangle }&= \textrm{Ref}_B (2AA^\dagger -I) A {|{v}\rangle } \end{aligned}$$
(B10)
$$\begin{aligned}&= \textrm{Ref}_B A {|{v}\rangle } \end{aligned}$$
(B11)
$$\begin{aligned}&= {|{b}\rangle }. \end{aligned}$$
(B12)

From Eq. (B7) we know

$$\begin{aligned} U {|{b}\rangle }&= \textrm{Ref}_B (2AA^\dagger -I) (\textrm{Ref}_B A {|{v}\rangle }) \end{aligned}$$
(B13)
$$\begin{aligned}&= 2\textrm{Ref}_B A \lambda {|{v}\rangle } -A{|{v}\rangle } \end{aligned}$$
(B14)
$$\begin{aligned}&= 2\lambda {|{b}\rangle } -{|{a}\rangle }. \end{aligned}$$
(B15)

Therefore, \(\textrm{span} \{{|{a}\rangle },{|{b}\rangle }\}\) is an invariant subspace of U, and U takes the following matrix form:

$$\begin{aligned} L=\begin{bmatrix} 0 & -1 \\ 1 & 2\lambda \end{bmatrix}. \end{aligned}$$
(B16)

Let \(\lambda =\cos \varphi \), then we obtain the eigenvalues and eigenvectors of L: \(e^{\pm i\varphi }\) and \([1,-e^{\pm i\varphi }]^T\). This can be verified by the following identities:

$$\begin{aligned} 1-2\lambda e^{\pm i\varphi }&= 1 -2\cos (\pm \varphi ) e^{\pm i\varphi } \end{aligned}$$
(B17)
$$\begin{aligned}&= 1 -2\cos ^2(\pm \varphi ) -2i\cos (\pm \varphi ) \sin (\pm \varphi ) \end{aligned}$$
(B18)
$$\begin{aligned}&= -\cos (\pm 2\varphi ) -i\sin (\pm 2\varphi ) \end{aligned}$$
(B19)
$$\begin{aligned}&= - e^{\pm 2i\varphi } = e^{\pm i\varphi }\cdot (-e^{\pm i\varphi }). \end{aligned}$$
(B20)

Therefore, we obtain two eigenvalues \(e^{\pm i\varphi }\) of U and their respective eigenvectors \({|{u_{\pm }}\rangle }:={|{a}\rangle } -e^{\pm i\varphi } {|{b}\rangle }\). We now calculate the square of its norm:

$$\begin{aligned} {\langle {u_{\pm }|u_{\pm }}\rangle }&=2-2\, \text {Re} ( e^{\pm i\varphi } {\langle {a|b}\rangle } ) \end{aligned}$$
(B21)
$$\begin{aligned}&= 2(1-\lambda ^2). \end{aligned}$$
(B22)

The second line follows from \({\langle {a|b}\rangle }={\langle {v}|} A^\dagger \text {Ref}_B A {|{v}\rangle } =\lambda \) and the fact that \(A^\dagger \text {Ref}_B A\) is Hermitian whose eigenvalue \(\lambda \) is a real number.

We now consider the case when \(\lambda = \pm 1\). From Eq. (B7), we know \({\langle {v}|} A^\dagger \textrm{Ref}_B A {|{v}\rangle } = \pm 1\), and thus \(\textrm{Ref}_B A {|{v}\rangle } = \pm A {|{v}\rangle }\). Therefore,

$$\begin{aligned} U {|{a}\rangle }&= U A {|{v}\rangle } \end{aligned}$$
(B23)
$$\begin{aligned}&= \textrm{Ref}_B (2AA^\dagger - I) A {|{v}\rangle } \end{aligned}$$
(B24)
$$\begin{aligned}&= \textrm{Ref}_B A {|{v}\rangle } \end{aligned}$$
(B25)
$$\begin{aligned}&= \pm A {|{v}\rangle } \end{aligned}$$
(B26)
$$\begin{aligned}&=\pm {|{a}\rangle }. \end{aligned}$$
(B27)

\(\square \)

Remark B.1

Suppose \(\textrm{Ref}_B = 2BB^\dagger -I\). Let \(D:=A^\dagger B\), and consider its singular value decomposition \(\sum _i s_i {|{v_i}\rangle } {\langle {w_i}|}\), which is a common approach in Refs. [8, 10, 29, 38]. Then the connection between the eigenvalue \(\lambda \) of \(A^\dagger \, \textrm{Ref}_B\, A\) and the singular value s of D is:

$$\begin{aligned} \arccos (\lambda ) =2 \arccos (s). \end{aligned}$$
(B28)

Proof

Since \(DD^\dagger {|{v_i}\rangle } =s_i^2 {|{v_i}\rangle }\), we have

$$\begin{aligned} A^\dagger \, \text {Ref}_B\, A&= A^\dagger (2BB^\dagger -I) A \end{aligned}$$
(B29)
$$\begin{aligned}&= 2(A^\dagger B) (A^\dagger B)^\dagger -I \end{aligned}$$
(B30)
$$\begin{aligned}&= 2DD^\dagger - I. \end{aligned}$$
(B31)

Therefore,

$$\begin{aligned} A^\dagger \, \text {Ref}_B\, A {|{v}\rangle } =\lambda {|{v}\rangle } \Leftrightarrow DD^\dagger {|{v}\rangle } = \frac{\lambda +1}{2} {|{v}\rangle }. \end{aligned}$$
(B32)

From the identity \( \frac{\cos \phi _i +1}{2} = \cos ^2\frac{\phi _i}{2} \), we obtain Eq.(B28). \(\square \)

We now analyze the eigenvalues and eigenvectors of \(J_{2n}=A^\dagger M_S A\). First, we will need the matrix expression of \(J_{2n}\). Recall from Eq. (36) that the \(2(2n+1)\times 2(n+1)\) matrix A is as follows:

$$\begin{aligned} A= \left[ \begin{array}{cccc|cccc} 1 & & & & & & & \\ & \sqrt{p} & & & & & & \\ & \sqrt{q} & & & & & & \\ & & \ddots & & & & & \\ & & & \sqrt{p} & & & & \\ & & & \sqrt{q} & & & & \\ \hline & & & & \sqrt{q} & & & \\ & & & & \sqrt{p} & & & \\ & & & & & \ddots & & \\ & & & & & & \sqrt{q} & \\ & & & & & & \sqrt{p} & \\ & & & & & & & 1 \end{array}\right] . \end{aligned}$$
(B33)

Since \(M_S\) swaps two adjacent rows (columns), the \({2(n+1)\times 2(2n+1)}\) matrix \(A^\dagger M_S\) is as follows:

$$\begin{aligned} A^\dagger M_S= \left[ \begin{array}{ccccccc|ccccccc} 0 & 1 & & & & & & & & & & & & \\ \sqrt{p} & 0 & 0 & \sqrt{q} & & & & & & & & & & \\ & & \sqrt{p} & 0 & 0 & \sqrt{q} & & & & & & & & \\ & & & & \ddots & & & & & & & & & \\ & & & & \sqrt{p} & 0 & 0 & \sqrt{q} & & & & & & \\ \hline & & & & & & \sqrt{q} & 0 & 0 & \sqrt{p} & & & & \\ & & & & & & & & & \ddots & & & & \\ & & & & & & & & \sqrt{q} & 0 & 0 & \sqrt{p} & & \\ & & & & & & & & & & \sqrt{q} & 0 & 0 & \sqrt{p} \\ & & & & & & & & & & & & 1 & 0 \\ \end{array}\right] . \end{aligned}$$
(B34)

Thus \(J_{2n}\) is a \({2(n+1)\times 2(n+1)}\) tridiagonal matrix as shown below:

$$\begin{aligned} J_{2n}= \left[ \begin{array}{ccccc|ccccc} 0 & \sqrt{p} & & & & & & & & \\ \sqrt{p} & 0 & \sqrt{pq} & & & & & & \\ & \sqrt{pq} & 0 & \ddots & & & & & & \\ & & \ddots & \ddots & \sqrt{pq} & & & & & \\ & & & \sqrt{pq} & 0 & q & & & & \\ \hline & & & & q & 0 & \sqrt{pq} & & & \\ & & & & & \sqrt{pq} & \ddots & \ddots & & \\ & & & & & & \ddots & 0 & \sqrt{pq} & \\ & & & & & & & \sqrt{pq} & 0 & \sqrt{p} \\ & & & & & & & & \sqrt{p} & 0 \end{array} \right] . \end{aligned}$$
(B35)

I. Eigenvalues of \(J_{2n}\)

Denote by \(|M|:= \det (M) \) the determinant of matrix M. We will calculate the characteristic equation \(p(\lambda ):=|\lambda I -J_{2n}|\) of \(J_{2n}\) as shown below:

$$\begin{aligned} p(\lambda ) =\left| \begin{array}{ccccc|ccccc} \lambda & -\sqrt{p} & & & & & & & & \\ -\sqrt{p} & \lambda & -\sqrt{pq} & & & & & & \\ & -\sqrt{pq} & \lambda & \ddots & & & & & & \\ & & \ddots & \ddots & -\sqrt{pq} & & & & & \\ & & & -\sqrt{pq} & \lambda & -q & & & & \\ \hline & & & & -q & \lambda & -\sqrt{pq} & & & \\ & & & & & -\sqrt{pq} & \ddots & \ddots & & \\ & & & & & & \ddots & \lambda & -\sqrt{pq} & \\ & & & & & & & -\sqrt{pq} & \lambda & -\sqrt{p} \\ & & & & & & & & -\sqrt{p} & \lambda \end{array} \right| . \end{aligned}$$
(B36)

We first introduce the following two principal submatrices. Here, we use the notation \(J_{2n}[l:k]\) to represent the main sub-matrix of \(J_{2n}\) formed by the rows and the columns with indices from l to k.

$$\begin{aligned} E_k&:= \lambda I - J_{2n}[1:k], \end{aligned}$$
(B37)
$$\begin{aligned} F_k&:= \lambda I -J_{2n}[2:k+1]. \end{aligned}$$
(B38)

Then we have the following recursive relations:

$$\begin{aligned} |E_2|&= \lambda |E_1| - p |E_0|, \end{aligned}$$
(B39)
$$\begin{aligned} |E_k|&=\lambda |E_{k-1}| -pq |E_{k-2}|,\ (3\le k \le n+1) \end{aligned}$$
(B40)
$$\begin{aligned} |E_k|&=\lambda |F_{k-1}| -p|F_{k-2}|,\ (2\le k \le n+1) \end{aligned}$$
(B41)
$$\begin{aligned} |F_k|&= \lambda |F_{k-1}| -pq |F_{k-2}|,\ (2\le k \le n) \end{aligned}$$
(B42)

where the first two terms are \(|F_1|=\lambda ,\ |F_0|:=1\) and \( |E_1|=\lambda ,\ |E_0|:=1\). Here, Eq. (B40) is obtained by expanding \(|E_k|\) from its lower right corner, while Eq. (B41) is obtained by expanding \(|E_k|\) from its upper left corner. Equation (B42) can be obtained by expanding \(|F_k|\) from either from its upper left corner or its lower right corner. Dividing all the elements in \(F_{k}\) by \(\sqrt{pq}\) and denoting

$$\begin{aligned} |F_k|/\sqrt{pq}^k:= U_k(\lambda /\sqrt{pq}), \end{aligned}$$
(B43)

Eq. (B42) is now transformed to \(U_k(\lambda /\sqrt{pq}) =\lambda /\sqrt{pq}\, U_{k-1}(\lambda /\sqrt{pq}) -U_{k-2}(\lambda /\sqrt{pq})\). If we let \(x:=\frac{\lambda }{\sqrt{pq}}\), then Eq. (B42) further simplifies to

$$\begin{aligned} U_0(x)&=1, \ U_1(x)=x, \end{aligned}$$
(B44)
$$\begin{aligned} U_{k}(x)&= x\,U_{k-1}(x)-U_{k-2}(x). \end{aligned}$$
(B45)

Comparing the above equations with the recurrence relation of Chebyshev polynomial of the second kind:

$$\begin{aligned} {\tilde{U}}_0(x)&=1, \ {\tilde{U}}_1(x)=2x, \nonumber \\ {\tilde{U}}_k(x)&=2x {\tilde{U}}_{k-1}(x) -{\tilde{U}}_{k-2}(x), \ \text {for}\ k\ge 2, \end{aligned}$$
(B46)

we know:

$$\begin{aligned} U_k(x) = {\tilde{U}}_k(x/2). \end{aligned}$$
(B47)

From the general formula \({\tilde{U}}_k(\cos \theta ) = \frac{\sin (k+1)\theta }{\sin \theta }\), we let \(\theta \) be such that it satisfies \(\cos \theta := x/2 = \frac{\lambda }{2\sqrt{pq}}\). Therefore,

$$\begin{aligned} U_{k}(\lambda /\sqrt{pq}) = {\tilde{U}}_k(\cos \theta )=\frac{\sin (k+1)\theta }{\sin \theta }. \end{aligned}$$
(B48)

We now calculate \(p(\lambda ) = |\lambda I -J_{2n}|\) (Eq. (B36)) by expanding its \((n+1)\)-th row as follows. Denote by \(E_{k}' = \lambda I -J_{2n}[2n+2-k+1:2n+2]\) the last k rows and columns of \(\lambda I -J_{2n}\). It is easy to see that \(|E_k'|=|E_k|\) from the centrosymmetry of \(J_{2n}\).

$$\begin{aligned} p(\lambda )&= \sqrt{pq} \left| \begin{array}{ccc} E_{n-1} & & \\ -\sqrt{pq} & -\sqrt{pq} & \\ & -q & E_{n+1}' \end{array}\right| +\lambda \left| \begin{array}{cc} E_n & \\ & E_{n+1} \end{array}\right| +q \left| \begin{array}{ccc} E_{n} & -\sqrt{pq} & \\ & -q & -\sqrt{pq} \\ & & E_{n}' \end{array}\right| \end{aligned}$$
(B49)
$$\begin{aligned}&= -pq |E_{n-1}|\cdot |E_{n+1}| +\lambda |E_{n}|\cdot |E_{n+1}| -q^2 |E_{n}|^2 \end{aligned}$$
(B50)
$$\begin{aligned}&= (\lambda ^2 -q^2) |E_n|^2 -2pq\lambda |E_{n}|\cdot |E_{n-1}| +(pq)^2 |E_{n-1}|^2 \end{aligned}$$
(B51)
$$\begin{aligned}&= \big ((\lambda - q) |E_n| -pq |E_{n-1}|\big ) \big ((\lambda + q) |E_n| -pq |E_{n-1}|\big ). \end{aligned}$$
(B52)

Note that when choosing \(-q\) as the pivot to expand the first determinant in Eq. (B49), the following sub-determinant is zero.

$$\begin{aligned} \left| \begin{array}{c|cc} E_{n-1} & & \\ -\sqrt{pq} & & \\ \hline & -\sqrt{pq} & E_n' \end{array}\right| = 0. \end{aligned}$$
(B53)

This is because the first n rows are rank deficient as there are only \(n-1\) columns with non zero elements. The same reasoning applies to expanding the third determinant in Eq. (B49). The third line (Eq. (B51)) uses Eq. (B40) to further expand \(|E_{n+1}|\).

We can further simplify the two components of \(p(\lambda )\) in Eq. (B52) by using Eqs. (B40), (B41), (B42) to expand until \(|F_{n-1}|,\ |F_{n-2}|\):

$$\begin{aligned}&(\lambda \mp q) |E_n| -pq |E_{n-1}| \end{aligned}$$
(B54)
$$\begin{aligned}&= (\lambda |E_n| -pq |E_{n-1}|) \mp q |E_n| \end{aligned}$$
(B55)
$$\begin{aligned}&= |E_{n+1}| \mp q |E_n| \end{aligned}$$
(B56)
$$\begin{aligned}&= \lambda |F_{n}| -p|F_{n-1}| \mp q(\lambda |F_{n-1}| -p|F_{n-2}|) \end{aligned}$$
(B57)
$$\begin{aligned}&= \lambda (\lambda |F_{n-1}| -pq |F_{n-2}|) +(\mp (1-p)\lambda -p) |F_{n-1}| \pm pq|F_{n-2}| \end{aligned}$$
(B58)
$$\begin{aligned}&= [\lambda (\lambda \mp 1) \pm p(\lambda \mp 1)]\cdot |F_{n-1}| -pq(\lambda \mp 1) |F_{n-2}| \end{aligned}$$
(B59)
$$\begin{aligned}&= (\lambda \mp 1)\ (|F_{n}| \pm p |F_{n-1}|). \end{aligned}$$
(B60)

Using Eq. (B43), we now obtain the eigenvalues of \(J_{2n}\): \(\pm 1\) and \(\lambda _{\pm k}:= 2\sqrt{pq} \cos \theta _{\pm k}\), where \(\lambda _{\pm k}\) are the 2n roots of the following equation:

$$\begin{aligned} \sqrt{q}\, U_n(\lambda /\sqrt{pq}) \pm \sqrt{p}\, U_{n-1}(\lambda /\sqrt{pq}) =0. \end{aligned}$$
(B61)

Combined with \(U_{k}(\lambda /\sqrt{pq}) = \frac{\sin (k+1)\theta }{\sin \theta }\) shown by Eq. (B48), we obtain Eq. (41) in Lemma 4.1. It can also be seen that when \(\theta _{k}\) corresponds to a root with ‘\(+\)’, then \(\theta _{-k}:= \pi -\theta _k\) corresponds to a root with ‘−’, thus \(\lambda _{-k} = -\lambda _k\).

II. Eigenvectors of \(J_{2n}\)

We now consider the eigenvectors of \(J_{2n}\). Using Eqs. (B39), (B40), and “\((\lambda _{\pm k} \mp q) |E_n| -pq |E_{n-1}| = 0\)” by Eq. (B54), it is not difficult to verify that the respective (unnormalized) eigenvector \({|{v_{\pm k}}\rangle }\) (which satisfies \((\lambda I -J_{2n}) {|{v_{\pm k}}\rangle }=0\), cf. Equation (B36) for \(\lambda I -J_{2n}\)) is

$$\begin{aligned} {[}1, \frac{|E_1|}{\sqrt{p}}, \frac{|E_2|}{\sqrt{p}\sqrt{pq}},\cdots , \frac{|E_{n-1}|}{\sqrt{p}\sqrt{pq}^{n-2}}, \frac{|E_n|}{\sqrt{p}\sqrt{pq}^{n-1}}, \pm (*)], \end{aligned}$$
(B62)

Where \((*)\) can be deduced from centrosymmetry. Combined with the relation of the sub-determinant \(|E_k|\), \(|F_k|\) shown in Eqs. (B41), (B42), the components and the square of the norm of the eigenvector \({|{v_{\pm k}}\rangle }\) can be calculated as follows.

1. \(\lambda =\pm 1\)

Since \(\lambda ^2 =1\), we have

$$\begin{aligned} |F_k|&=\pm |F_{k-1}| -pq |F_{k-2}| \end{aligned}$$
(B63)
$$\begin{aligned}&= \pm (q+p)|F_{k-1}| -pq |F_{k-2}| \end{aligned}$$
(B64)
$$\begin{aligned}&= \pm q |F_{k-1}| \pm p(\pm |F_{k-2}|-pq|F_{k-3}|) -pq |F_{k-2}| \end{aligned}$$
(B65)
$$\begin{aligned}&= \pm q (|F_{k-1}| -p^2|F_{k-3}|) +p(1-q) |F_{k-2}| \end{aligned}$$
(B66)
$$\begin{aligned}&= \pm q (|F_{k-1}| -p^2|F_{k-3}|) +p^2 |F_{k-2}|. \end{aligned}$$
(B67)

Thus we know the difference between every other term, i.e. \(|F_k|-p^2 |F_{k-2}|\), is a power series. Therefore,

$$\begin{aligned} |E_k|&= \pm |F_{k-1}| -p |F_{k-2}| \end{aligned}$$
(B68)
$$\begin{aligned}&= |F_{k}| -p^2 |F_{k-2}| \end{aligned}$$
(B69)
$$\begin{aligned}&= (\pm q)^{k-2} (|F_2| -p^2 |F_0|) \end{aligned}$$
(B70)
$$\begin{aligned}&= (\pm q)^{k-2}(1-pq -p^2) \end{aligned}$$
(B71)
$$\begin{aligned}&= (\pm 1)^k q^{k-1}. \end{aligned}$$
(B72)

The second line follows from substituting \(q=1-p\) into Eq. (B42) and rearranging the terms. Thus the \((i+1)\)-th component of \({|{v_{\pm 1}}\rangle }\) is

$$\begin{aligned} {\langle {i|v_{\pm 1}}\rangle }&=\frac{|E_i|}{\sqrt{p}\sqrt{pq}^{i-1}} \end{aligned}$$
(B73)
$$\begin{aligned}&= \frac{(\pm 1)^i q^{i-1}}{\sqrt{p}\sqrt{pq}^{i-1}} \end{aligned}$$
(B74)
$$\begin{aligned}&= (\pm 1)^i (\sqrt{{q}/{p}})^i /\sqrt{q}, \end{aligned}$$
(B75)

which corresponds to Eqs. (38), (39) in Lemma 4.1. Hence, the square of the norm of \({|{v_{\pm 1}}\rangle }\) is:

$$\begin{aligned} \Vert {|{v_{\pm 1}}\rangle }\Vert ^2&=2(1 +\frac{1}{q} \sum _{i=1}^{n} (\frac{q}{p})^i ) \end{aligned}$$
(B76)
$$\begin{aligned}&=2(1 + \frac{1}{q} \cdot \frac{q}{p} \cdot \frac{1-(q/p)^n}{1-q/p}) \end{aligned}$$
(B77)
$$\begin{aligned}&=2(1 + \frac{(q/p)^n - 1}{q-p}) \end{aligned}$$
(B78)
$$\begin{aligned}&= \frac{2}{q-p}( (q/p)^n -2p ), \end{aligned}$$
(B79)

which is Eq. (40) in Lemma 4.1.

2. \(\lambda _{\pm k}\) for \(k\in \{2,\dots ,n+1\}\)

The \((i+1)\)-th component of \({|{v_{\pm k}}\rangle }\) can be calculated as follows, where we omit the subscript “\(\pm k\)” for simplicity.

$$\begin{aligned} {\langle {i|v_\lambda }\rangle } =&\frac{\lambda |F_{i-1}| -p |F_{i-2}|}{\sqrt{p} \sqrt{pq}^{i-1}} \end{aligned}$$
(B80)
$$\begin{aligned}&=\frac{\lambda \sqrt{pq}^{i-1} U_{i-1}(\lambda /\sqrt{pq}) -p \sqrt{pq}^{i-2} U_{i-2}(\lambda /\sqrt{pq})}{\sqrt{p} \sqrt{pq}^{i-1}} \end{aligned}$$
(B81)
$$\begin{aligned}&= \frac{\lambda }{\sqrt{p}} U_{i-1}(\lambda /\sqrt{pq}) -\frac{1}{\sqrt{q}} U_{i-2}(\lambda /\sqrt{pq}), \end{aligned}$$
(B82)

which corresponds to Eqs. (46), (47) in Lemma 4.1, and the next Eq. (48) follows from Eq. (B48).

We now consider \(\Vert {|{v_\lambda }\rangle } \Vert ^2\). We first calculate the square of the \((i+1)\)-th component. For simplicity we denote \(U_{i}(\lambda /\sqrt{pq})\) by \(U_i\) in the following.

$$\begin{aligned} |{\langle {i|v_\lambda }\rangle }|^2&= \frac{\lambda ^2}{p} U_{i-1}^2 -\frac{2\lambda }{\sqrt{pq}} U_{i-1} U_{i-2} +\frac{1}{q} U_{i-2}^2 \end{aligned}$$
(B83)
$$\begin{aligned}&= \frac{\lambda ^2}{p} U_{i-1}^2 +(U_i^2 -\frac{\lambda ^2}{pq}U_{i-1}^2 -U_{i-2}^2) +\frac{1}{q} U_{i-2}^2 \end{aligned}$$
(B84)
$$\begin{aligned}&= \frac{p}{q}U_{i-2}^2 -\frac{\lambda ^2}{q} U_{i-1}^2 +U_i^2. \end{aligned}$$
(B85)

The second line is obtained by squaring both sides of the relation \(U_i = \frac{\lambda }{\sqrt{pq}} U_{i-1} -U_{i-2}\) which follows from Eq. (B45). In order to make the relation true for \(i\ge 1\), we set \(U_{-1}:=0\). Then, using the identity \(p/q -\lambda ^2/q +1 =(1-\lambda ^2)/q\), we have

$$\begin{aligned} \Vert {|{v_\lambda }\rangle } \Vert ^2/2&= 1 +\sum _{i=1}^n |{\langle {i|v_\lambda }\rangle }|^2 \end{aligned}$$
(B86)
$$\begin{aligned}&= 1+ 0 +\frac{p}{q} -\frac{\lambda ^2}{q} + \frac{1-\lambda ^2}{q} \sum _{i=1}^{n-2}U_i^2 -\frac{\lambda ^2}{q}U_{n-1}^2 +U_{n-1}^2 + U_{n}^2 \end{aligned}$$
(B87)
$$\begin{aligned}&=\frac{1-\lambda ^2}{q} +\frac{1-\lambda ^2}{q} \sum _{i=1}^{n-2}U_i^2 +(-\frac{\lambda ^2}{q}+1+\frac{p}{q})U_{n-1}^2 \end{aligned}$$
(B88)
$$\begin{aligned}&= \frac{1-\lambda ^2}{q} \sum _{i=0}^{n-1} U_i^2. \end{aligned}$$
(B89)

The third line uses Eq. (B61) satisfied by the eigenvalue \(\lambda \). From the trigonometric expression of \(U_i\) (Eq. (B48)), we have

$$\begin{aligned} \sum _{i=0}^{n-1} U_i^2&= \frac{1}{\sin ^2\theta } \sum _{i=0}^{n-1} \sin ^2(i+1)\theta \end{aligned}$$
(B90)
$$\begin{aligned}&=\frac{1}{\sin ^2\theta } \sum _{i=1}^{n} \frac{1-\cos i2\theta }{2} \end{aligned}$$
(B91)
$$\begin{aligned}&= \frac{1}{2\sin ^2\theta } (n- \frac{\sin n\theta \cdot \cos (n+1)\theta }{\sin \theta }) \end{aligned}$$
(B92)
$$\begin{aligned}&= \frac{1}{2\sin ^2\theta } (n \pm \sqrt{\frac{q}{p}} \frac{\sin 2(n+1)\theta }{2\sin \theta }). \end{aligned}$$
(B93)

Hence combined with \(\Vert {|{u}\rangle }\Vert ^2 =2(1-\lambda ^2)\) in Lemma B.1 and the identity \(\theta _{-k} =\pi -\theta _k\), we obtain Eq. (49) in Lemma 4.1. Note that the last line above uses Eq. (41) satisfied by \(\theta \). The third line uses the identity obtained from comparing the real part of the following identities:

$$\begin{aligned}&\sum _{k=1}^n \cos kx +i\sin kx \end{aligned}$$
(B94)
$$\begin{aligned}&= \sum _{k=1}^n e^{ikx} = \frac{e^{ix}(e^{inx}-1)}{e^{ix}-1} \end{aligned}$$
(B95)
$$\begin{aligned}&= \frac{e^{ix} e^{\frac{inx}{2}} 2i \sin \frac{nx}{2}}{e^{\frac{ix}{2}} 2i\sin \frac{x}{2}} = \frac{\sin \frac{nx}{2}}{\sin \frac{x}{2}} e^{i\frac{(n+1)x}{2}} \end{aligned}$$
(B96)
$$\begin{aligned}&= \frac{\sin \frac{nx}{2}}{\sin \frac{x}{2}} (\cos \frac{(n+1)x}{2} +i\sin \frac{(n+1)x}{2}). \end{aligned}$$
(B97)

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Li, G., Li, L. & Luo, J. Recovering the Original Simplicity: Succinct and Exact Quantum Algorithm for the Welded Tree Problem. Algorithmica 86, 3719–3758 (2024). https://doi.org/10.1007/s00453-024-01273-w

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-024-01273-w

Keywords