Abstract
Case-Based Reasoning (CBR) is an artificial intelligence approach to problem-solving with a good record of success. This article proposes using Quantum Computing to improve some of the key processes of CBR, such that a quantum case-based reasoning (qCBR) paradigm can be defined. The focus is set on designing and implementing a qCBR based on the variational principle that improves its classical counterpart in terms of average accuracy, scalability and tolerance to overlapping. A comparative study of the proposed qCBR with a classic CBR is performed for the case of the social workers’ problem as a sample of a combinatorial optimization problem with overlapping. The algorithm’s quantum feasibility is modelled with docplex and tested on IBMQ computers, and experimented on the Qibo framework.
Similar content being viewed by others
References
Aamodt A, Plaza E (1994) Case-based reasoning: foundational issues, methodological variations, and system approaches. Artif Intell Commun 7:39–59
Abdiansah A, Wardoyo R (2015) Time complexity analysis of support vector machines (SVM) in LibSVM. Int J Comput Appl 128(3):28–34. https://doi.org/10.5120/ijca2015906480
Alonso-Linaje G, Atchade-Adelomou P (2021) Eva: a quantum exponential value approximation algorithm. arXiv:2106.08731
Altaisky MV, Kaputkina NE, Krylov VA (2014) Quantum neural networks: current status and prospects for development. Phys Part Nucl 45(6):1013–1032. https://doi.org/10.1134/s1063779614060033
Amailef K, Jie L (2013) Ontology-supported case-based reasoning approach for intelligent m-government emergency response services. Decis Support Syst 55(1):79–97. https://doi.org/10.1016/j.dss.2012.12.034
Armengol E, Palaudaries A, Plaza E (2001) Individual prognosis of diabetes long-term risks: a cbr approach. Methods Inf Med-Methodik der Information in der Medizin 40(1):46–51
Arutyunov G, Frolov S, Staudacher M (2004) Bethe ansatz for quantum strings. J High Energy Phys 2004(10):016–016. https://doi.org/10.1088/1126-6708/2004/10/016
Atchade-Adelomou P (2021) quantum cases based reasoning. https://github.com/pifparfait/qCBR
Atchade-Adelomou P, Alonso-Linaje G (2021) Quantum enhanced filter: qfilter. arXiv:2104.03418
Atchade-Adelomou P, Golobardes-Ribé E, Vilasis-Cardona X (2020a) Formulation of the social workers’ problem in quadratic unconstrained binary optimization form and solve it on a quantum computer. J Comput Commun 8(11):44–68
Atchade-Adelomou P, Golobardes-Ribé E, Vilasís-cardona X (2020b) Using the variational-quantum-eigensolver (vqe) to create an intelligent social workers schedule problem solver. In: International conference on hybrid artificial intelligence systems. Springer, Cham, pp 245–260
Atchade-Adelomou P, Golobardes-Ribe E, Vilasis-Cardona X (2020c) Using the parameterized quantum circuit combined with variational-quantum-eigensolver (vqe) to create an intelligent social workers’ schedule problem solver. Arxiv, arXiv:2010.05863
Atchade-Adelomou P, Alonso-Linaje G, Albo-Canals J, Casado-Fauli D (2021) qrobot: a quantum computing approach in mobile robot order picking and batching problem solver optimization. Algorithms. https://doi.org/10.3390/a14070194
Baccigalupo C, Plaza E (2006) Case-based sequential ordering of songs for playlist recommendation. Lecture notes in computer science. Springer, Berlin, pp 286–300. https://doi.org/10.1007/11805816_22
Beer K, Bondarenko D, Farrelly T, Osborne TJ, Salzmann R, Scheiermann D, Wolf R (2020) Training deep quantum neural networks. Nat Commun. https://doi.org/10.1038/s41467-020-14454-2
Benfenati F, Mazzola G, Capecci C, Barkoutsos PK, Ollitrault PJ, Tavernelli I, Guidoni L (2021) Improved accuracy on noisy devices by nonunitary variational quantum eigensolver for chemistry applications. J Chem Theory Comput 17:3946–3954
Biamonte J, Wittek P, Pancotti N, Rebentrost P, Wiebe N, Lloyd S (2017) Quantum machine learning. Nature 549(7671):195–202. https://doi.org/10.1038/nature23474
Blencowe M (2010) Quantum RAM. Nature 468(7320):44–45. https://doi.org/10.1038/468044a
Bliek1ú C, Bonami P, Lodi A (2014) Solving mixed-integer quadratic programming problems with ibm-cplex: a progress report. In: Proceedings of the twenty-sixth RAMP symposium, pp 16–17
Browne MW (2000) Cross-validation methods. J Math Psychol 44(1):108–132. https://doi.org/10.1006/jmps.1999.1279
Bruza PD,Cole RJ (2006) Quantum logic of semantic space: an exploratory investigation of context effects in practical reasoning. arXiv preprint quant-ph/0612178
Byrd RH, Peihuang L, Nocedal J, Zhu C (1995) A limited memory algorithm for bound constrained optimization. SIAM J Sci Comput 16(5):1190–1208. https://doi.org/10.1137/0916069
Cerezo M, Sone A, Volkoff T, Cincio L, Coles Patrick J (2021) Cost function dependent barren plateaus in shallow parametrized quantum circuits. Nat Commun 12(1):1–12
Chai WW (2005) On rayleigh–ritz ratios of a generalized laplacian matrix of directed graphs. Linear Algebra Appl 402:207–227. https://doi.org/10.1016/j.laa.2004.12.014
Chowdhury GG (2003) Natural language processing. Ann Rev Inf Sci Technol 37(1):51–89
community The SciPy. Cobyla (2021). URL: https://docs.scipy.org/doc/scipy/reference/optimize.minimize-cobyla.html
Deerwester S, Dumais ST, Furnas GW, Landauer TK, Harshman R (1990) Indexing by latent semantic analysis. J Am Soc Inf Sci 41(6):391–407
Efthymiou S, Ramos-Calderer S, Bravo-Prieto C, Pérez-Salinas A, García-Martín D, Garcia-Saez A, Latorre JI, Carrazza S (2020) Qibo: a framework for quantum simulation with hardware acceleration. arXiv:2009.01845
Farhi E, Goldstone J, Gutmann S (2014) A quantum approximate optimization algorithm. arXiv:1411.4028
Friedman JH, Baskett F, Shustek LJ (1975) An algorithm for finding nearest neighbors. IEEE Trans Comput 24(10):1000–1006. https://doi.org/10.1109/t-c.1975.224110
Fukunaga K, Narendra PM (1975) A branch and bound algorithm for computing k-nearest neighbors. IEEE Trans Comput C24(7):750–753. https://doi.org/10.1109/t-c.1975.224297
Gleason A (1957) Measures on the closed subspaces of a Hilbert space. Indiana Univ Math J 6:885–893
Goldberg Y, Levy O (2014) word2vec explained: deriving mikolov et al.’s negative-sampling word-embedding method. arXiv preprint arXiv:1402.3722
González-Bermejo S, Alonso-Linaje G, Atchade-Adelomou P (2021) Gps: improvement in the formulation of the tsp for its generalizations type qubo. arXiv:2110.12158
Grimsley HR, Economou SE, Barnes E, Mayhall NJ (2019) An adaptive variational algorithm for exact molecular simulations on a quantum computer. Nat Commun 10(1):1–9
Grover LK (1996) A fast quantum mechanical algorithm for database search. In: Proceedings of the twenty-eighth annual ACM symposium on theory of computing—STOC ’96. ACM Press. https://doi.org/10.1145/237814.237866
Guerreschi GG, Matsuura AY (2019) QAOA for max-cut requires hundreds of qubits for quantum speed-up. Sci Rep. https://doi.org/10.1038/s41598-019-43176-9
Havlíček V, Córcoles AD, Temme K, Harrow AW, Kandala A, Chow JM, Gambetta JM (2019) Supervised learning with quantum-enhanced feature spaces. Nature 567(7747):209–212. https://doi.org/10.1038/s41586-019-0980-2
Kakde HM (2005) Range searching using kd tree. From the citeseerx database on the World Wide Web http://citeseerx.ist.psu.edu/viewdoc/summary
Kenneth WC (2017) Word2vec. Nat Lang Eng 23(1):155–162
Diederik A, Khrennikov A, Melucci M, Toni B (eds) (2019) Quantum-like models for information retrieval and decision-making. Springer. https://doi.org/10.1007/978-3-030-25913-6
Kim D, Seo D, Cho S, Kang P (2019) Multi-co-training for document classification using various document representations: Tf-idf, lda, and doc2vec. Inf Sci 477:15–29
Kitto K, Bruza P, Gabora L (2012) A quantum information retrieval approach to memory. In: The 2012 international joint conference on neural networks (IJCNN), IEEE, pp 1–8
Lamata Lucas (2020) Quantum machine learning and quantum biomimetics: a perspective. Mach Learn: Sci Technol 1(3):033002
Lau JH, Baldwin T (2016) An empirical evaluation of doc2vec with practical insights into document embedding generation. arXiv preprint arXiv:1607.05368
Lebedev A, Khrennikov A (2020) Introductory review to quantum information retrieval. arXiv:2008.13541
Li H, Sun Jie (2008) Ranking-order case-based reasoning for financial distress prediction. Knowl-Based Syst 21(8):868–878. https://doi.org/10.1016/j.knosys.2008.03.047
Liddy ED (2001) Natural Language Processing. In Encyclopedia of Library and Information Science, 2nd Ed. NY. Marcel Decker, Inc
Liu DC, Nocedal J (1989) On the limited memory BFGS method for large scale optimization. Math Program 45(1–3):503–528. https://doi.org/10.1007/bf01589116
Lozano L, Fernández J (2008) Razonamiento basado en casos: Una visión general. Recuperado el
Lund K, Burgess C (1996) Producing high-dimensional semantic spaces from lexical co-occurrence. Behav Res Methods Instrum Comput 28(2):203–208
Lupiani E, Juarez JM, Palma J, Marin R (2017) Monitoring elderly people at home with temporal case-based reasoning. Knowl-Based Syst 134:116–134. https://doi.org/10.1016/j.knosys.2017.07.025
Ma Z (2014) A tutorial on principal component analysis. https://doi.org/10.13140/2.1.1593.1684
McKay DC, Alexander T, Bello L, Biercuk MJ, Bishop L, Chen J, Chow JM, Córcoles AD, Egger D, Filipp S et al (2018) Qiskit backend specifications for openqasm and openpulse experiments. arXiv preprint arXiv:1809.03452
Mezquita Y, Alonso RS, Casado-Vara R, Prieto J, Corchado JM (2020) A review of k-NN algorithm based on classical and quantum machine learning. In: Distributed computing and artificial intelligence, special sessions, 17th international conference, Springer, pp 189–198. https://doi.org/10.1007/978-3-030-53829-3_20
Morgan SL, Deming SN (1974) Simplex optimization of analytical chemical methods. Anal Chem 46(9):1170–1181. https://doi.org/10.1021/ac60345a035
Mostafa SA, Ahmad MS, Firdaus MA (2012) A soft computing modeling to case-based reasoning implementation. Int J Comput Appl 47(7):14–21. https://doi.org/10.5120/7199-9976
Munaga H, Jarugumalli V (2012) Performance evaluation: ball-treeand KD-tree in the context of MST. In: Lecture notes of the institute for computer sciences, social informatics and telecommunications engineering, Springer, Berlin, pp 225–228. https://doi.org/10.1007/978-3-642-32573-1_38
Nielsen MA, Chuang I, Grover LK (2002) Quantum computation and quantum information. Am J Phys 70(5):558–559. https://doi.org/10.1119/1.1463744
Noble WS (2006) What is a support vector machine? Nat Biotechnol 24(12):1565–1567. https://doi.org/10.1038/nbt1206-1565
Peruzzo A, McClean J, Shadbolt P, Yung M-H, Zhou X-Q, Love PJ, Aspuru-Guzik A, O’Brien JL (2014a) A variational eigenvalue solver on a photonic quantum processor. Nat Commun. https://doi.org/10.1038/ncomms5213
Peruzzo A, McClean J, Shadbolt P, Yung M-H, Zhou X-Q, Love PJ, Aspuru-Guzik A, O’Brien JL (2014b) A variational eigenvalue solver on a photonic quantum processor. Nat Commun. https://doi.org/10.1038/ncomms5213
Piwowarski B, Frommholz I, Lalmas M, Van Rijsbergen K (2010a) What can quantum theory bring to information retrieval. In: Proceedings of the 19th ACM international conference on Information and knowledge management, pp 59–68
Piwowarski B, Frommholz I, Lalmas M, Van Rijsbergen K (2010b) Exploring a multidimensional representation of documents and queries (extended version). arXiv preprint arXiv:1002.3238
Piwowarski B, Frommholz I, Moshfeghi Y, Lalmas M, van Rijsbergen K (2010c) Filtering documents with subspaces. In: Lecture notes in computer science, Springer, Berlin, pp 615–618. https://doi.org/10.1007/978-3-642-12275-0_60
Pratt WK, John W (1978) A wiley-interscience publication. Digital image processing. Wiley, Hoboken, pp 636–646
Preskill J (2018) Quantum computing in the nisq era and beyond. Quantum 2:79. https://doi.org/10.22331/q-2018-08-06-79
Priore P, De La Fuente D, Pino R, Puente J (2002) Utilización del razonamiento basado en casos en la toma de decisiones. Aplicación en un problema de secuenciación. Dirección y Organización 28
Pérez-Salinas A, Cervera-Lierta A, Gil-Fuster E, Latorre JI (2020) Data re-uploading for a universal quantum classifier. Quantum 4:226. https://doi.org/10.22331/q-2020-02-06-226
Pérez-Salinas A, López-Núñez D, García-Sáez A, Forn-Díaz P, Latorre José I (2021) One qubit as a universal approximant, 2021. arXiv:2102.04032
Rebentrost P, Mohseni M, Lloyd S (2014) Quantum support vector machine for big data classification. Phys Rev. https://doi.org/10.1103/physrevlett.113.130503
Roffe J (2019) Quantum error correction: an introductory guide. Contemp Phys 60(3):226–245. https://doi.org/10.1080/00107514.2019.1667078
Rong X (2014) word2vec parameter learning explained. arXiv preprint arXiv:1411.2738
Roszak k, Filip R, Novotný N (2015) Decoherence control by quantum decoherence itself. Sci Rep. https://doi.org/10.1038/srep09796
Schuld M, Killoran N (2019) Quantum machine learning in feature hilbert spaces. Phys Rev Lett 122(4):040504
Schuld M, Sinayskiy I, Petruccione F (2014a) An introduction to quantum machine learning. Contemp Phys 56(2):172–185. https://doi.org/10.1080/00107514.2014.964942
Schuld M, Sinayskiy I, Petruccione F (2014b) The quest for a quantum neural network. Quantum Inf Process 13(11):2567–2586. https://doi.org/10.1007/s11128-014-0809-8
Shor PW (1994) Algorithms for quantum computation: discrete logarithms and factoring. In: Proceedings 35th Annual symposium on foundations of computer science. IEEE Comput. Soc. Press. https://doi.org/10.1109/sfcs.1994.365700
Sim S, Johnson PD, Aspuru-Guzik A (2019) Expressibility and entangling capability of parameterized quantum circuits for hybrid quantum-classical algorithms. Adv Quantum Technol 2(12):1900070. https://doi.org/10.1002/qute.201900070
Spall JC (2001) Spsa community. URL: https://www.jhuapl.edu/SPSA/
Stárek R, Mičuda M, Straka I, Nováková M, Dušek M, Ježek M, Fiurášek J, Filip R (2020) Experimental quantum decoherence control by dark states of the environment. New J Phys 22(9):093058. https://doi.org/10.1088/1367-2630/abb47d
Tang E (2019) Quantum-inspired classical algorithms for principal component analysis and supervised clustering. arXiv:1811.00414
Van Rijsbergen CJ (2004) The geometry of information retrieval. Cambridge University Press, Cambridge
Wang D, Higgott O, Brierley S (2019) Accelerated variational quantum eigensolver. Phys Rev Lett. https://doi.org/10.1103/physrevlett.122.140504
Wille R, Van Meter R, Naveh Y (2019) Ibm’s qiskit tool chain: working with and developing for real quantum computers. In: 2019 design, automation test in Europe conference exhibition (DATE), pp 1234–1240. https://doi.org/10.23919/DATE.2019.8715261
Willsch D, Willsch M, De Raedt H, Michielsen K (2020) Support vector machines on the d-wave quantum annealer. Comput Phys Commun 248:107006. https://doi.org/10.1016/j.cpc.2019.107006
Zhao Z, Lai H (2012) A cognitive engine based on case-based reasoning quantum genetic algorithm. In: 2012 IEEE 14th international conference on communication technology. IEEE. https://doi.org/10.1109/icct.2012.6511219
Zhao Z, Fitzsimons JK, Rebentrost P, Dunjko V, Fitzsimons JF (2021) Smooth input preparation for quantum and quantum-inspired machine learning. Quantum Mach Intell 3(1):1–6
Zhu L, Tang HL, Barron GS, Calderon-Vargas FA, Mayhall NJ, Barnes E, Economou SE (2020) An adaptive quantum approximate optimization algorithm for solving combinatorial problems on a quantum computer. arXiv:2005.10258
Acknowledgements
The authors greatly thank the IBMQ team, mainly Steve Wood. P.A. thanks Jennifer Ramírez Molino, the Qibo team, Adrian Perez-Salinas and Guillermo Alonso Alonso de Linaje for his support and comments on the manuscript.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflicts of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Appendix: A variational quantum classifier
To date, two dominant categories allow to design quantum classifiers. Although almost all are inspired by the classical classifiers (kernel or neural networks) (Abdiansah and Wardoyo 2015), there is a new category of classifiers that respond to the current era of quantum computing (NISQ); hybrid and variational classifiers.
1.1 The Ansatz
The Ansatz design inherited from previous works (Atchade-Adelomou et al. 2020c; Atchade-Adelomou et al. 2020b; Sim et al. 2019). The way to load the data into the Ansatz is inspired by (Pérez-Salinas et al. 2021) where the data (variable x) is entered using the weights and biases scheme. In this case, the single-qubit gate that serves as the building block for all Ansatz is given by (A1) similar to neural networks.
Being \(\theta \) the vector of the parameters and \(R_{x}\) and \(R_{y}\) the unit gates of qubits used to create the Ansatz. To complement the experimentation scenario, it would be necessary to add the CNOT gate and the CRZ, which are the gates that help to achieve entanglement as seen in Figs. 13, 14 and 15.
The variational quantum classifier structure (Figs. 16 and 17) is based on layers of trainable circuit blocks \( L \left( i \right) = \prod _{i,j}^{}U \left( i,j \right) \) and data coding, as shown in (3) for 8 dimensional or in (A1) for 2 dimensional data size. Additionally, the entanglement can be achieved using the CRZ or CNOT gates.
The number of parameters to optimize the classifier is given by (A2).
In this case, with n the number of qubits, \(n = 3\) , L the number of layers (blocks), in the experiment, it is a variable data and d which is the dimension of the problem. In other words, d varies with the choice of Ansatz and whether or not entanglement is applied. In the case of the entanglements in Fig. 14, the d would be summed 1 (CRZ gate has one parameter), which equates to Eq. (A3).
1.2 Fidelity cost function
The similarity function follows the same strategy as the re-uploading and path; nevertheless, the Ansatz is different. It uses the definition of quantum fidelity associated with several qubits and maximizes said average fidelity between the test state and the final state corresponding to its class. Equation (A4) (Pérez-Salinas et al. 2020) defines the cost function used.
with
where \(\rho _{q}\) is the reduced density matrix of the qubit to be measured, M is the total number of training point, C is the total number of the classes, \(\vec{x}_{ \mu }\) are the training points and \(\vec{ \alpha }= \left( \alpha _{1}, \ldots , \alpha _{C} \right) \) are introduced as class weights to be optimized together with \(\vec{ \theta } \), \( \vec{ \omega ,}\) are the parameters and Q the numbers of the qubits. Counting on \(Y_{c} \left( \vec{x}_{ \mu } \right) \) as the fidelity vector for a perfect classification. This cost function (A4) is weighted and averaged over all the qubit that form this classifier. In order to complete the hybrid system, it is used for the classical part, the following minimization methods above cited: L-BFGS-B (Byrd et al. 1995), COBYLA (community The SciPy. Cobyla 2021) and SPSA (Spall James 2001).
Appendix B: The qCBR’s details
The operation of the retrieve (prediction) block is given by a new case (schedule). In this experimentation, the schedule that best adapts to the latest case to be solved is recovered with the predict method, which is executed at a time O(log(MN)). It worth saying that, due to the SWP descriptions, a possible schedule change, a stage of understanding or interpretation is necessary, since an adequate resolution of the new schedule cannot be carried out if it is not understood with some completeness. This stage of understanding is a simple decision algorithm with minimal intelligence.
Once having the predicted solution, the synthesis block creates a new solution (proposed solution) by combining recovered solutions. To do this, the algorithm is divided into two main lines (Fig. 4). A line that determines an acceptable degree of error (after a probabilistic study) that the predicted solution can be considered the proposed solution. The second branch is in charge of improving the expected solution towards a better-proposed solution. To do this, the Initial_point associated with the retrieved schedule is retrieved from the case memory, and the Variational Quantum Eigensolver is executed with very few shots, (k shots). The idea here is to refine the new schedule’s similarity with the recovered one. Operating the VQE with Initial_point provides the algorithm with parameter values through the initial point as a starting point for searching for the minimum eigenvalue (similarity between the two times) when the new time’s solution point is believed to be close to a matter of the recovered schedule. This is how the Re-use block works. These operations have a complexity of \(O(klog(N)+log(NM))\). Where N is the number of social workers, M is the number of patients and k is the number of shots.
The algorithm’s processes to review the proposed solution are seen below the Re-use block in Fig. 4. It is essential to classify the best possible solution for the proposed prototype. The best possible solution is calculated with the VQE with the maximum resolution and depth (for the variational part). Once the solution is obtained, it is compared with the proposed solution and said solution with its characteristics is added to the new schedule before storing it (see Figs. 8 and 9). The computational complexity of the Revise is determined by \(O(log(N)+ICA))\). In this work, access to data (states) is determined by O(log(MN)) due to the characteristics of the inner products and superpositions.
One of the most critical blocks in this work is to Retain. This block is the heart of the CBR because it is the classifier and because it is the block that allows us to conclude that it has been learned from the previous cases. Not all instances (schedules) are saved in this job, leading to the excessively slow classifier. Therefore, in this part of the algorithm, the best cases (timetables) that summarize all the essential information are retained.
The Retain process begins with the treatment of schedules, searching for the algorithm’s best efficiency, which is a challenge to solve in this block. In the case of SWP, the patient visits hours have a margin range of 30 min. Therefore, if one schedule starts at 9:00, the next could begin at 9:30, leading to a dataset with overlap between schedules if many schedules have similar time ranges spread over different days of the week. In the case of non-linearity of the data, an almost perfect classifier with an average accuracy more significant than \( 80 \% \) would be needed to be combined with a data processing system and a decision tree.
In this work, we contemplate both scenarios. First, get an excellent classifier and apply data processing techniques to help a poor classifier. Using the standard classifier, ICA (Pratt and Wiley 1978) is applied to the original data to reduce the effects of the degree of overlap (Fig. 18) without losing the fundamental characteristics of the data. Figure 19 summarizes the processes and operations applied to reduce the overlapping effect observed in the generation of SWP schedules. The complexity of this operation is noted as O(ICA). The PCA is then used to reduce the data dimension from 8 to 2 and apply it to the designed variational classifier with the complexity equal to O(PCA). Once the best time is determined, we retain the knowledge acquired at the time of the case’s resolution.
Rights and permissions
Springer Nature or its licensor 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.
About this article
Cite this article
Adelomou, P.A., Fauli, D.C., Ribé, E.G. et al. Quantum case-based reasoning (qCBR). Artif Intell Rev 56, 2639–2665 (2023). https://doi.org/10.1007/s10462-022-10238-w
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10462-022-10238-w