Abstract
To solve the subset sum problem, a well-known nondeterministic polynomial-time complete problem that is widely used in encryption and resource scheduling, we propose a feasible quantum algorithm that utilizes fewer qubits to encode and achieves quadratic speedup. Specifically, this algorithm combines an amplitude amplification algorithm with quantum phase estimation, and requires n + t + 1 qubits and O(2(0.5+o(1))n) operations to obtain the solution, where n is the number of elements, and t is the number of qubits used to store the eigenvalues. To verify the performance of the algorithm, we simulate the algorithm with the online quantum simulator of IBM named ibmq_simulator using Qiskit and then run it on two IBM quantum computers called ibmq_santiago and ibmq_bogota. The experimental results indicate that compared with the brute force algorithm, the proposed algorithm results in quadratic acceleration for the problem of a set S with four elements and two subsets whose sum equals target w. Using the iterator twice, we obtain success probabilities of 0.940 ± 0.004, 0.751 ± 0.040, and 0.665 ± 0.060 on the simulator, ibmq_santiago, and ibmq_bogota, respectively, and the fidelity between the theoretical and experimental quantum states is calculated to be 0.944 ± 0.002, 0.753 ± 0.017, and 0.657 ± 0.028, respectively. If the error rates of the experimental quantum logic gates can be reduced, the success probabilities of the proposed algorithm on real quantum devices can be further improved.
Similar content being viewed by others
References
Garey M R. Computers and intractability: a guide to the theory of np-completeness. Rev Esc Enferm USP, 1979, 44: 340
Merkle R, Hellman M. Hiding information and signatures in trapdoor knapsacks. IEEE Trans Inform Theor, 1978, 24: 525–530
Kate A, Goldberg I. Generalizing cryptosystems based on the subset sum problem. Int J Inf Secur, 2011, 10: 189–199
Murakami Y, Sakai R. Security of knapsack cryptosystem using subset-sum decision problem against alternative-solution attack. In: Proceedings of International Symposium on Information Theory and Its Applications (ISITA), 2018. 614–617
Murakami Y, Hamasho S, Kasahara M. A public-key cryptosystem based on decision version of subset sum problem. In: Proceedings of International Symposium on Information Theory and its Applications, 2012. 735–739
Glass C A, Kellerer H. Parallel machine scheduling with job assignment restrictions. Naval Res Logist, 2007, 54: 250–257
Guéret C, Prins C. A new lower bound for the open-shop problem. Ann Oper Res, 1999, 92: 165–183
Qi X T. Coordinated logistics scheduling for in-house production and outsourcing. IEEE Trans Automat Sci Eng, 2008, 5: 188–192
Cai L, Chan S M, Chan S O. Random separation: a new method for solving fixed-cardinality optimization problems. In: Proceedings of International Workshop on Parameterized and Exact Computation. Berlin: Springer, 2006. 239–250
Caro Y, Yuster R. The characterization of zero-sum (mod 2) bipartite Ramsey numbers. J Graph Theor, 1998, 29: 151–166
Borgwardt K H, Tremel B. The average quality of greedy-algorithms for the Subset-Sum-Maximization Problem. ZOR — Methods Model Oper Res, 1991, 35: 113–149
Koiliaris K, Xu C. Faster pseudopolynomial time algorithms for subset sum. ACM Trans Algorithms, 2019, 15: 1–20
Horowitz E, Sahni S. Computing partitions with applications to the knapsack problem. J ACM, 1974, 21: 277–292
Pisinger D. Linear time algorithms for knapsack problems with bounded weights. J Algorithms, 1999, 33: 1–14
Kellerer H, Pferschy U, Pisinger D. Multidimensional Knapsack Problems. In: Knapsack Problems. Berlin: Springer, 2004. 235–283
Tsai S. Fast parallel molecular solution for DNA-based computing: the 0–1 knapsack problem. In: Proceedings of International Conference on Algorithms and Architectures for Parallel Processing, 2009. 416–427
Nicolau J D V, Lard M, Korten T, et al. Parallel computation with molecular-motor-propelled agents in nanofabricated networks. Proc Natl Acad Sci USA, 2016, 113: 2591–2596
van Delft F C M J M, Ipolitti G, Nicolau J D V, et al. Something has to give: scaling combinatorial computing by biological agents exploring physical networks encoding NP-complete problems. Interface Focus, 2018, 8: 20180034
Henkel C V, Bäck T, Kok J N, et al. DNA computing of solutions to knapsack problems. Biosystems, 2007, 88: 156–162
Henkel C V, Bladergroen R S, Balog C I A, et al. Protein output for DNA computing. Nat Comput, 2005, 4: 1–10
Isenberg C. The soap film: an analogue computer: soap films provide a simple method of obtaining analogue solutions to some mathematical problems. Am Scientist, 1976, 64: 514–518
Aaronson S. Guest column: NP-complete problems and physical reality. SIGACT News, 2005, 36: 30–52
Wu K, García de Abajo J, Soci C, et al. An optical fiber network oracle for NP-complete problems. Light Sci Appl, 2014, 3: e147
Shaked N T, Messika S, Dolev S, et al. Optical solution for bounded NP-complete problems. Appl Opt, 2007, 46: 711–724
Caulfield H J, Dolev S. Why future supercomputing requires optics. Nat Photon, 2010, 4: 261–263
Xu X Y, Huang X L, Li Z M, et al. A scalable photonic computer solving the subset sum problem. Sci Adv, 2020, 6: eaay5853
Schroeppel R, Shamir A. A T = O(2n/2), S = O(2n/4) algorithm for certain NP-complete problems. SIAM J Comput, 1981, 10: 456–464
Becker A, Coron J S, Joux A. Improved generic algorithms for hard knapsacks. In: Proceedings of Annual International Conference on the Theory and Applications of Cryptographic Techniques. Berlin: Springer, 2011. 364–385
Howgrave-Graham N, Joux A. New generic algorithms for hard knapsacks. In: Proceedings of Annual International Conference on the Theory and Applications of Cryptographic Techniques. Berlin: Springer, 2010. 235–256
Childs A M, Eisenberg J M. Quantum algorithms for subset finding. 2003. ArXiv:quant-ph/0311038
Bernstein D J, Jeffery S, Lange T, et al. Quantum algorithms for the subset-sum problem. In: Proceedings of International Workshop on Post-Quantum Cryptography. Berlin: Springer, 2013. 16–33
Helm A, May A. Subset sum quantumly in 1.17n. In: Proceedings of the 13th Conference on the Theory of Quantum Computation, Communication and Cryptography (TQC 2018), 2018
Bonnetain X, Bricout R, Schrottenloher A, et al. Improved classical and quantum algorithms for subset-sum. In: Proceedings of International Conference on the Theory and Application of Cryptology and Information Security. Cham: Springer, 2020. 633–666
Chang W L, Ren T T, Feng M, et al. Quantum algorithms of the subset-sum problem on a quantum computer. In: Proceedings of WASE International Conference on Information Engineering, 2009. 54–57
Daskin A. A quantum approach to subset-sum and similar problems. 2017. ArXiv:1707.08730
Aleksandrowicz G, Alexander T, Barkoutsos P, et al. Qiskit: an open-source framework for quantum computing. 2019. https://www.qiskit.org/
García-Pérez G, Rossi M A C, Maniscalco S. IBM Q Experience as a versatile experimental test bed for simulating open quantum systems. npj Quantum Inf, 2020, 6: 10
Kitaev A Y. Quantum measurements and the Abelian stabilizer problem. 1995. ArXiv:quant-ph/9511026
Brassard G, Hoyer P, Mosca M, et al. Quantum amplitude amplification and estimation. Contemporary Math, 2002, 305: 53–74
Grover L K. A fast quantum mechanical algorithm for database search. In: Proceedings of the 28th Annual ACM Symposium on Theory of Computing, Philadelphia, 1996. 212–219
Cross A W, Bishop L S, Sheldon S, et al. Validating quantum computers using randomized model circuits. Phys Rev A, 2019, 100: 032328
Altepeter J B, Jeffrey E R, Kwiat P G. Photonic state tomography. Adv Atom Mol Opt Phys, 2005, 52: 105–159
Acknowledgements
This work was supported by National Key Research and Development Program of China (Grant Nos. 2019YFA0308700, 2017YFA0303700) and National Natural Science Foundation of China (Grant No. 11690031).
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Zheng, Q., Zhu, P., Xue, S. et al. Quantum algorithm and experimental demonstration for the subset sum problem. Sci. China Inf. Sci. 65, 182501 (2022). https://doi.org/10.1007/s11432-021-3334-1
Received:
Revised:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11432-021-3334-1