Quantum neural network clustering method and terminal based on Grover search algorithm

Through the Grover search algorithm and quantum superposition parallel computing similarity, the problem of traditional neural network clustering method consumes a lot of computing resources in large-scale high-dimensional data processing is solved, fast training and efficient clustering are achieved, and data clustering is improved. timeliness.

CN118643358BInactive Publication Date: 2024-12-20厦门工学院 +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411117528.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional neural network clustering analysis methods consume a lot of computing resources when processing large-scale high-dimensional data and lack timeliness.

Method used

Using the quantum neural network clustering method based on the Grover search algorithm, the similarity is calculated in parallel by converting the sample data and initial neuron weights into quantum states, quantum superposition and entanglement are used to calculate the similarity in parallel, and the weights are iteratively updated through the Grover search algorithm to construct the target Quantum neural network clustering model.

Benefits of technology

It realizes rapid training of neural network clustering model, solves the problem of computing resource consumption during large-scale data processing, has exponential acceleration effect, and improves the timeliness of data clustering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643358B_ABST
    Figure CN118643358B_ABST
Patent Text Reader

Abstract

The quantum neural network clustering method and terminal based on the Grover search algorithm disclosed in the present invention convert sample data and initial neuron weights into sample quantum states and weight quantum states, thereby calculating the similarity between the two through quantum exchange test operations and quantum amplitude estimation, so that the sample data and the initial neuron weights can use quantum superposition to estimate the similarity in parallel. Then, the index label set of the winning neuron weight is determined based on the similarity and the Grover search algorithm, and the initial neuron weight is iteratively updated based on the index label set until the maximum number of iterations is reached. Finally, the target quantum neural network clustering model is used to perform cluster analysis on the input data. The present invention uses quantum superposition, quantum entanglement and quantum Grover search algorithm to realize similarity quantization and extraction of index label sets, which accelerates the training process of the neural network clustering model, makes data clustering have a certain timeliness, and better meets the use requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of quantum machine learning, and in particular to a quantum neural network clustering method and terminal based on a Grover search algorithm. Background Art

[0002] Cluster analysis methods are widely used in image segmentation, text semantic analysis, and biological information processing, and neural networks are an effective clustering method. They can learn feature maps suitable for data structure clustering from data without supervision, and can dynamically adjust neuron weights, with excellent adaptability and performance.

[0003] Quantum machine learning is the process of incorporating the physical properties of quantum mechanics into machine learning algorithms, using properties such as quantum superposition and entanglement to process multiple similar computing tasks in parallel. Compared to classical processes, quantum machine learning has great potential in reducing computing resources and improving the timeliness of algorithms.

[0004] With the advent of the information age, the data of classic neural network clustering analysis is usually large-scale and high-dimensional, and its completion often requires a lot of computing resources and time. Therefore, the traditional neural network clustering analysis method lacks certain timeliness. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a quantum neural network clustering method and terminal based on the Grover search algorithm, which can effectively improve the timeliness of the neural network mapping clustering method.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] Quantum neural network clustering method based on Grover search algorithm, including:

[0008] Acquire sample data and a plurality of initial neuron weights, and construct an initial quantum neural network clustering model according to the plurality of initial neuron weights; the sample data includes at least one of text data, audio data, video data or image data;

[0009] In the initial quantum neural network clustering model, the sample data is converted into a sample quantum state, and the multiple initial neuron weights are respectively converted into multiple weight quantum states;

[0010] Calculate the similarity between the sample quantum state and each of the weighted quantum states through a quantum exchange test operation and quantum amplitude estimation;

[0011] Determine the index label set of the winning neuron weight according to the similarity and the Grover search algorithm;

[0012] Iteratively updating the multiple initial neuron weights according to the index tag set, and returning to execute the step of obtaining sample data and multiple initial neuron weights until the number of iterations reaches a preset maximum number of iterations, thereby obtaining a target quantum neural network clustering model;

[0013] The target quantum neural network clustering model is used to perform cluster analysis on the input data.

[0014] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0015] A quantum neural network clustering terminal based on a Grover search algorithm comprises a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, each step in the quantum neural network clustering method based on the Grover search algorithm is implemented.

[0016] The beneficial effect of the present invention is that the sample data and the initial neuron weight are converted into the sample quantum state and the weight quantum state, so that the similarity between the sample data and the initial neuron weight is calculated by quantum exchange test operation and quantum amplitude estimation, so that the sample data and the initial neuron weight can use quantum superposition to estimate the similarity between the sample data and the initial neuron weight in parallel. Then, by comparing the similarity with each other, the index label set of the winning neuron weight is determined by the Grover search algorithm, and the initial neuron weight is iteratively updated based on the index label set until the maximum number of iterations is reached. Finally, the input data is clustered based on the target quantum neural network clustering model obtained by iterative update. In the present invention, quantum superposition, quantum entanglement and quantum Grover search algorithm are used to realize the extraction of quantitative similarity and index label set, which accelerates the training process of the neural network clustering model, solves the problem that the self-organizing feature mapping network consumes a lot of computing resources when processing large-scale data samples, and compared with the traditional training method, the present invention has an exponential acceleration effect in the data dimension, so that data clustering has a certain timeliness and better meets the use requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A flowchart of a quantum neural network clustering method based on Grover search algorithm provided in an embodiment of the present invention;

[0018] Figure 2 A schematic diagram of register operations of a quantum neural network clustering method based on Grover search algorithm provided by an embodiment of the present invention;

[0019] Figure 3A schematic diagram of the structure of a quantum neural network clustering terminal based on the Grover search algorithm provided in an embodiment of the present invention;

[0020] Description of labels:

[0021] 100. A quantum neural network clustering terminal based on Grover search algorithm; 101. Memory; 102. Processor. DETAILED DESCRIPTION

[0022] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0023] An embodiment of the present invention provides a quantum neural network clustering method based on a Grover search algorithm, comprising:

[0024] Acquire sample data and a plurality of initial neuron weights, and construct an initial quantum neural network clustering model according to the plurality of initial neuron weights; the sample data includes at least one of text data, audio data, video data or image data;

[0025] In the initial quantum neural network clustering model, the sample data is converted into a sample quantum state, and the multiple initial neuron weights are respectively converted into multiple weight quantum states;

[0026] Calculate the similarity between the sample quantum state and each of the weighted quantum states through a quantum exchange test operation and quantum amplitude estimation;

[0027] Determine the index label set of the winning neuron weight according to the similarity and the Grover search algorithm;

[0028] Iteratively updating the multiple initial neuron weights according to the index tag set, and returning to execute the step of obtaining sample data and multiple initial neuron weights until the number of iterations reaches a preset maximum number of iterations, thereby obtaining a target quantum neural network clustering model;

[0029] The target quantum neural network clustering model is used to perform cluster analysis on the input data.

[0030] From the above description, it can be seen that the beneficial effect of the present invention is: converting sample data and initial neuron weights into sample quantum states and weight quantum states, thereby calculating the similarity between sample data and initial neuron weights through quantum exchange test operation and quantum amplitude estimation, so that sample data and initial neuron weights can use quantum superposition to estimate the similarity between sample data and initial neuron weights in parallel. Then, by comparing the similarities with each other, the index label set of the winning neuron weight is determined by the Grover search algorithm, and the initial neuron weight is iteratively updated based on the index label set until the maximum number of iterations is reached. Finally, the input data is clustered based on the target quantum neural network clustering model obtained by iterative update. In the present invention, quantum superposition, quantum entanglement and quantum Grover search algorithm are used to realize the extraction of quantitative similarity and index label set, which accelerates the training process of the neural network clustering model, solves the problem that the self-organizing feature mapping network consumes a lot of computing resources when processing large-scale data samples, and compared with traditional training methods, the present invention has an exponential acceleration effect in the data dimension, so that data clustering has a certain timeliness and better meets the use requirements.

[0031] Furthermore, the converting the sample data into a sample quantum state and converting the multiple initial neuron weights into multiple weight quantum states respectively include:

[0032] Initializing a quantum system in a Hilbert space and storing an index label of each of the initial neuron weights in a first register of the quantum system;

[0033] The sample data is encoded into the amplitude of the second register of the quantum system through a unitary operation, and the multiple initial neuron weights are encoded into the amplitude of the third register of the quantum system, so as to obtain a sample quantum state and multiple weight quantum states.

[0034] From the above description, it can be seen that by converting sample data and initial neuron weights into sample quantum states and weight quantum states, so as to facilitate the subsequent use of quantum superposition and quantum entanglement, the similarity between sample data and initial neuron weights is determined through parallel amplitude estimation, thereby improving the timeliness of the model in processing high-dimensional data.

[0035] Furthermore, the initialization of the quantum system in the Hilbert space is specifically as follows:

[0036] ;

[0037] Wherein, N represents the number of the initial neuron weights; n represents the index label of each initial neuron weight, and , represents the j-th register of the quantum system;

[0038] The unitary operation is specifically:

[0039] ;

[0040] ;

[0041] in, represents the Dirac symbol, Represents the initial neuron weight at time t a unitary operation on the amplitude encoded into a third register of the quantum system; Indicates that the sample data at time t a unitary operation on the amplitude encoded into a second register of the quantum system; l represents the weight of each initial neuron l elements, i Represents the first i elements, represents the lth element of the nth initial neuron weight at time t; Represents sample data at time t the i-th element of ; and ; D represents the dimension of sample data and initial neuron weights.

[0042] From the above description, it can be seen that in the quantum system, the first register is used to store the index label, and the second register and the third register are used to store the sample quantum state and the weight quantum state respectively. The unitary operation is to obtain the quantum state corresponding to the initial neuron weight and the sample data, so as to encode the initial neuron weight and the sample data into the amplitude of the corresponding register.

[0043] Further, the calculating the similarity between the sample quantum state and each of the weighted quantum states through quantum exchange test operation and quantum amplitude estimation includes:

[0044] Adding a fourth register in a first quantum state to the quantum system, and controlling the second register and the third register according to the fourth register to perform a quantum exchange test to determine the state operation of the second register, the third register and the fourth register;

[0045] A fifth register in a second quantum state is added to the quantum system, and the second register, the third register and the fourth register are controlled according to the fifth register and the state operation to perform quantum amplitude estimation to obtain the similarity between the sample quantum state and each of the weighted quantum states.

[0046] From the above description, it can be seen that the similarity information of the sample data and the initial neuron weight is associated with the amplitude of the quantum state through the quantum exchange test on the quantum system, and the similarity information stored on the amplitude is obtained by parallel execution of amplitude estimation, and the similarity information is stored in the fifth register to obtain the quantum state containing the similarity information. Subsequent mutual comparison and search are performed based on the quantum state containing the similarity information to speed up the data processing speed.

[0047] Furthermore, the operation of adding a fourth register in the first quantum state to the quantum system and controlling the second register and the third register to perform a quantum exchange test to determine the states of the second register, the third register and the fourth register according to the fourth register is specifically as follows:

[0048] A fourth register in a first quantum state is added to the quantum system, wherein the first quantum state is ;

[0049] Execute the H operator on the fourth register: ,in, and Indicates the right arrow. , ; and Indicates the left arrow. , ;

[0050] Control the second register and the third register to perform a quantum state exchange test according to the quantum state of the fourth register;

[0051] The H operator is executed again on the fourth register, and all operations for generating the current states of the second register, the third register, and the fourth register are marked as state operations.

[0052] From the above description, it can be seen that the auxiliary quantum bit is constructed by adding a fourth register, and the quantum state of the second register and the third register is exchanged through the quantum state of the auxiliary quantum bit, so that the two register states are entangled, and then the H operator is executed on the fourth register to measure the similarity between the two quantum states, so as to improve the processing speed of a large amount of high-dimensional data by this model. During the exchange test, the similarity of the two quantum states can be determined by the state operation of generating the current state of the register, but since the probability of similarity needs to be distinguished in the model clustering process, it is necessary to further refine the similarity result through amplitude estimation.

[0053] Furthermore, a fifth register in a second quantum state is added to the quantum system, and the second register, the third register, and the fourth register are controlled according to the fifth register and the state operation to perform quantum amplitude estimation to obtain the similarity between the sample quantum state and each of the weighted quantum states:

[0054] A fifth register in a second quantum state is added to the quantum system, and the second quantum state is ;

[0055] After executing the H operator on the fifth register, the second register, the third register and the fourth register are controlled to perform a controlled operation based on the first register, the fifth register and the state operation, so that the relevant information of the similarity is stored in the fifth register:

[0056] ;

[0057] in, Indicates a controlled operation. Indicates status operation, represents the identity matrix operator, ;

[0058] An inverse Fourier transform is performed on the fifth register so that the quantum state of the fifth register is converted into the relevant information, and a Fourier transform is performed on the quantum state of the fifth register to obtain the similarity between the sample quantum state and each of the weight quantum states.

[0059] From the above description, it can be seen that the space required for the similarity between the sample data and the initial neuron weight is initialized by adding the fifth register, and the H operator is performed on the fifth register to generate a uniform superposition state. The first register and the fifth register are used as control registers, and the second register, the third register and the fourth register are controlled so that the similarity information can be stored in the fifth register. By performing an inverse Fourier transform on the fifth register, the estimated value of the similarity stored in the fifth register is read.

[0060] Furthermore, the index tag set for determining the winning neuron weight according to the similarity and the Grover search algorithm includes:

[0061] Adding a sixth register for storing a similarity threshold and a seventh register in a first quantum state to the quantum system;

[0062] Determine the weight quantum state whose similarity is greater than the similarity threshold according to the sixth register, the seventh register and the quantum comparator, and mark the weight quantum state as the winning neuron weight;

[0063] The index labels of the winning neuron weights are searched out based on the Grover search algorithm to obtain an index label set.

[0064] From the above description, it can be seen that by adding the sixth register and the seventh register to construct a quantum comparator, the winning neuron weight whose similarity is greater than the similarity threshold is determined, and then the index label of the winning neuron weight is accelerated by the Grover search algorithm to obtain the index label set. The Grover search algorithm can measure the quantum state and obtain the index of the target state with high probability. The Grover search algorithm is also called the quantum search algorithm, which uses quantum superposition and quantum parallelism to accelerate the search process.

[0065] Furthermore, the iterative updating of the multiple initial neuron weights according to the index tag set is specifically:

[0066] ;

[0067] in, represents the updated initial neuron weights, represents the learning rate, and , represents the initial neuron weight before updating, Represents sample data.

[0068] From the above description, it can be seen that the initial neuron weight is continuously updated iteratively based on the superior neuron weight with greater similarity, so that the neuron weight gradually approaches the sample data to obtain the neuron weight with the highest similarity to the sample data. In this way, the neuron weight is trained to the category corresponding to the sample data.

[0069] Furthermore, the clustering analysis of the input data by the target quantum neural network clustering model includes:

[0070] Converting a plurality of target neuron weights in the target quantum neural network clustering model into a plurality of clustering quantum states respectively, and converting the input data into input quantum states;

[0071] Calculating the cluster similarity between each of the cluster quantum states and the input quantum state through the quantum exchange test operation and the quantum amplitude estimation;

[0072] If the clustering similarity is greater than a preset value, the input data is marked as a category corresponding to the target neuron weight.

[0073] From the above description, it can be seen that since the target neuron weights in the target quantum neural network clustering model are updated after multiple iterations, their similarity with the sample data is the highest. Therefore, the higher the similarity between the input data and the target neuron weights, the higher the similarity, which indicates that the input data belongs to the category corresponding to the sample data, thereby realizing cluster analysis of the input data.

[0074] Another embodiment of the present invention provides a quantum neural network clustering terminal based on a Grover search algorithm, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements each step of the quantum neural network clustering method based on the Grover search algorithm when executing the computer program.

[0075] From the above description, it can be seen that the beneficial effect of the present invention is: converting sample data and initial neuron weights into sample quantum states and weight quantum states, thereby calculating the similarity between sample data and initial neuron weights through quantum exchange test operation and quantum amplitude estimation, so that sample data and initial neuron weights can use quantum superposition to estimate the similarity between sample data and initial neuron weights in parallel. Then, by comparing the similarities with each other, the index label set of the winning neuron weight is determined by the Grover search algorithm, and the initial neuron weight is iteratively updated based on the index label set until the maximum number of iterations is reached. Finally, the input data is clustered based on the target quantum neural network clustering model obtained by iterative update. In the present invention, quantum superposition, quantum entanglement and quantum Grover search algorithm are used to realize the extraction of quantitative similarity and index label set, which accelerates the training process of the neural network clustering model, solves the problem that the self-organizing feature mapping network consumes a lot of computing resources when processing large-scale data samples, and compared with traditional training methods, the present invention has an exponential acceleration effect in the data dimension, so that data clustering has a certain timeliness and better meets the use requirements.

[0076] The embodiment of the present invention provides a quantum neural network clustering method and terminal based on the Grover search algorithm, which can be applied to the optimization training of the neural network clustering analysis model, can effectively improve the timeliness of the model training, and can meet the processing requirements of a large amount of high-dimensional data. The following is an explanation through a specific embodiment:

[0077] Please refer to Figure 1 to Figure 2 , Embodiment 1 of the present invention is:

[0078] like Figure 1 As shown, a quantum neural network clustering method based on Grover search algorithm includes:

[0079] S1. Obtain sample data and a plurality of initial neuron weights, and construct an initial quantum neural network clustering model according to the plurality of initial neuron weights.

[0080] In some embodiments, the sample data includes at least one of text data, audio data, video data or image data; D-dimensional sample data is obtained at time t and N D-dimensional initial neuron weights , based on N D-dimensional initial neuron weights Construct an initial quantum neural network clustering model.

[0081] S2. In the initial quantum neural network clustering model, the sample data is converted into a sample quantum state, and the multiple initial neuron weights are converted into multiple weight quantum states respectively.

[0082] Specifically, the step S2 includes:

[0083] S21, initializing a quantum system in a Hilbert space, and storing an index label of each of the initial neuron weights in a first register of the quantum system.

[0084] Among them, the quantum state of the first register is , the number of quantum bits required is , Express N Take the logarithm and round up.

[0085] The initialization of the quantum system in the Hilbert space is specifically as follows:

[0086] ;

[0087] Wherein, N represents the number of the initial neuron weights; n represents the index label of each initial neuron weight, and , represents the j-th register of the quantum system.

[0088] S22. Encode the sample data into the amplitude of the second register of the quantum system through a unitary operation, and encode the multiple initial neuron weights into the amplitude of the third register of the quantum system to obtain a sample quantum state and multiple weight quantum states.

[0089] The unitary operation is specifically:

[0090] ;

[0091] ;

[0092] in, Represents the initial neuron weight at time t a unitary operation on the amplitude encoded into a third register of the quantum system; Indicates that the sample data at time t a unitary operation on the amplitude encoded into a second register of the quantum system; represents the lth element of the nth initial neuron weight at time t; Represents sample data at time t the i-th element of ; and .

[0093] In some embodiments, the related quantum state between each initial neuron weight and the sample data can be obtained after the unitary operation of step S22. .in, represents the number of neurons in the self-organizing feature map, The index label representing each initial neuron weight, Represents the dimensions of sample data and initial neuron weights. Synchronize the related quantum states Encoded into the amplitude of a third register of the quantum system.

[0094] S3. Calculate the similarity between the sample quantum state and each of the weighted quantum states through quantum exchange test operation and quantum amplitude estimation.

[0095] Specifically, step S3 includes:

[0096] S31, adding a fourth register in a first quantum state to the quantum system, and controlling the second register and the third register according to the fourth register to perform a quantum exchange test to determine the state operation of the second register, the third register and the fourth register.

[0097] The step S31 is specifically as follows:

[0098] S311, adding a fourth register in a first quantum state to the quantum system, wherein the first quantum state is .

[0099] S312, executing the H operator on the fourth register: ,in, and Indicates the right arrow. , ; and Indicates the left arrow. , .

[0100] In some embodiments, the H operator is executed on the fourth register, so that the fourth register is in It should be noted that in actual physical systems and Represent different physical states respectively. For example, in a superconducting quantum bit, may represent the flow of current in one direction, while The flow of electric current in opposite directions.

[0101] S313: Control the second register and the third register to perform a quantum state exchange test according to the quantum state of the fourth register.

[0102] In some embodiments, if the quantum state of the fourth register is , then the quantum states of the second register and the third register are exchanged, otherwise no operation is performed on the second register and the third register. It should be noted that Figure 2 The S in represents the quantum state exchange operation.

[0103] S314: Execute the H operator again on the fourth register, and mark all operations for generating the current states of the second register, the third register, and the fourth register as state operations.

[0104] In some embodiments, the status operation is marked as .

[0105] S32, adding a fifth register in a second quantum state to the quantum system, and controlling the second register, the third register, and the fourth register according to the fifth register and the state operation to perform quantum amplitude estimation to obtain the similarity between the sample quantum state and each of the weighted quantum states.

[0106] The step S32 is specifically as follows:

[0107] S321, adding a fifth register in a second quantum state to the quantum system, wherein the second quantum state is .in, , is the error value.

[0108] In some embodiments, a fifth register in a second quantum state is added to initialize the sample data and the nth initial neuron weight The correlation between the similarity Required space.

[0109] S322, after executing the H operator on the fifth register, control the second register, the third register and the fourth register to perform a controlled operation based on the first register, the fifth register and the state operation, so that the relevant information of the similarity is stored in the fifth register:

[0110] ;

[0111] in, Indicates controlled operation, 2 s Indicates repeated execution 2 s Controlled operation, Indicates status operation, represents the identity matrix operator, .

[0112] In some embodiments, the H operator is executed on each particle in the fifth register to generate a uniform superposition state as a control register of the current quantum system.

[0113] S323, performing an inverse Fourier transform on the fifth register so that the quantum state of the fifth register is converted into the relevant information, and performing a Fourier transform on the quantum state of the fifth register to obtain the similarity between the sample quantum state and each of the weighted quantum states.

[0114] In some embodiments, step S323 is specifically: performing an inverse Fourier transform on the fifth register , so that the quantum state in the fifth register is converted into relevant information , and perform a Fourier transform on the quantum state of the fifth register At this time, the information stored in the fifth register is the sample data and the nth initial neuron weight The estimated value of the similarity between .

[0115] In some embodiments, the estimated value of the similarity stored in the fifth register can be specifically expressed as ,in, .

[0116] In some embodiments, after step S323, the method further includes:

[0117] S324, perform the inverse operation of all the operations in the above steps S2, S311, S312, S313 and S314, so as to deentangle the second to fourth registers from other registers, and discard the second to fourth registers to release the quantum space. It should be noted that the mathematical representation of the inverse operation in the quantum system is also a unitary matrix, which is usually the conjugate transpose of the matrix represented by the original operation.

[0118] It should be noted that Figure 2 S + The operation characterizes the inverse operation of the quantum swap operation S, H + The operation represents the inverse operation of the H operator, represents the inverse operation of encoding the initial neuron weight into the third register to obtain the weight quantum state, Characterizes the inverse operation of encoding the sample data into the second register to obtain the sample quantum state.

[0119] S4. Determine an index tag set of winning neuron weights according to the similarity and the Grover search algorithm.

[0120] Specifically, step S4 includes:

[0121] S41, adding a sixth register for storing a similarity threshold and a seventh register in a first quantum state to the quantum system.

[0122] In some embodiments, the similarity threshold set at time t is , and can be represented by U M Operation obtained.

[0123] S42, determining the weight quantum state whose similarity is greater than the similarity threshold according to the sixth register, the seventh register and the quantum comparator, and marking the weight quantum state as the winning neuron weight.

[0124] In some embodiments, the quantum comparator C is specifically:

[0125] ;

[0126] in, is an arbitrary constant.

[0127] S43, searching for the index labels of the winning neuron weights based on the Grover search algorithm to obtain an index label set.

[0128] In some embodiments, the index tag set for obtaining the winning neuron weight with a higher probability through the Grover search algorithm is , index tag set The index label in is the label of the winning neuron with high similarity to the sample data. .

[0129] It should be noted that Figure 2 The “ / ” on each register in indicates that there are multiple qubits in the register.

[0130] S5. Iteratively update the multiple initial neuron weights according to the index tag set, and return to execute step S1 until the number of iterations reaches a preset maximum number of iterations to obtain a target quantum neural network clustering model.

[0131] The iterative updating of the multiple initial neuron weights according to the index tag set is specifically as follows:

[0132] ;

[0133] in, represents the updated initial neuron weights, represents the learning rate, and , represents the initial neuron weight before updating, Represents sample data.

[0134] In some embodiments, the initial neuron weights belonging to the index label set are obtained by Perform iterative updates. No iterative updates are performed for the initial neuron weights that do not belong to the index label set, that is, That is, only the weights of the winning neurons are iteratively updated.

[0135] In some embodiments, to ensure system convergence, the learning rate It gradually decreases with the increase of training time.

[0136] S6. Performing cluster analysis on the input data through the target quantum neural network clustering model.

[0137] Specifically, step S6 includes:

[0138] S61, converting a plurality of target neuron weights in the target quantum neural network clustering model into a plurality of clustering quantum states respectively, and converting the input data into input quantum states at the same time.

[0139] S62, calculating the cluster similarity between each of the cluster quantum states and the input quantum state through the quantum exchange test operation and the quantum amplitude estimation.

[0140] S63: If the clustering similarity is greater than a preset value, marking the input data as a category corresponding to the target neuron weight.

[0141] Please refer to Figure 3 , Embodiment 2 of the present invention is:

[0142] A quantum neural network clustering terminal 100 based on a Grover search algorithm includes a memory 101, a processor 102, and a computer program stored in the memory 101 and running on the processor 102. When the processor 102 executes the computer program, each step of a quantum neural network clustering method based on a Grover search algorithm in the first embodiment is implemented.

[0143] In summary, the quantum neural network clustering method and terminal based on the Grover search algorithm provided by the present invention, by converting sample data and initial neuron weights into corresponding quantum states, thereby constructing a quantum neural network clustering model based on quantum states, and optimizing and training the neural network clustering model in the form of quantum states. The present invention incorporates the physical properties of quantum into the neural network algorithm, thereby utilizing quantum superposition and quantum entanglement to parallelly realize the similarity estimation between the sample vector and the initial neuron weights in the neural network and the extraction of the winning neuron weights, thereby accelerating the training of the neural network. And through parallel amplitude estimation, the category determination of the sample data is accelerated, solving the problem that the self-organizing feature mapping network consumes a lot of computing resources when processing large-scale data samples. Compared with the traditional neural network training method, the present invention has exponential acceleration in the data dimension, so that the existing data clustering has a certain timeliness and better meets the use requirements.

[0144] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. Quantum neural network clustering method based on Grover search algorithm, It is characterized in that include: Acquire sample data and a plurality of initial neuron weights, and construct an initial quantum neural network clustering model according to the plurality of initial neuron weights; the sample data comprises at least one of text data, audio data, video data or image data; In the initial quantum neural network clustering model, the sample data is converted into a sample quantum state, and the multiple initial neuron weights are respectively converted into multiple weight quantum states; Calculate the similarity between the sample quantum state and each of the weighted quantum states through a quantum exchange test operation and quantum amplitude estimation; Determine the index label set of the winning neuron weight according to the similarity and the Grover search algorithm; Iteratively updating the multiple initial neuron weights according to the index tag set, and returning to execute the step of obtaining sample data and multiple initial neuron weights until the number of iterations reaches a preset maximum number of iterations, thereby obtaining a target quantum neural network clustering model; Performing cluster analysis on input data through the target quantum neural network clustering model; The converting the sample data into a sample quantum state and converting the multiple initial neuron weights into multiple weight quantum states respectively comprises: Initializing a quantum system in a Hilbert space and storing an index label of each of the initial neuron weights in a first register of the quantum system; Encoding the sample data into the amplitude of the second register of the quantum system through a unitary operation, and encoding the multiple initial neuron weights into the amplitude of the third register of the quantum system, to obtain a sample quantum state and multiple weight quantum states; The iterative updating of the multiple initial neuron weights according to the index tag set is specifically as follows: in, represents the updated nth initial neuron weight, η(t) represents the learning rate, and η(t)∈[0,1], represents the nth initial neuron weight before update, x (t) Represents the sample data at time t; The calculating the similarity between the sample quantum state and each of the weighted quantum states through quantum exchange test operation and quantum amplitude estimation comprises: Adding a fourth register in a first quantum state to the quantum system, and controlling the second register and the third register according to the fourth register to perform a quantum exchange test to determine the state operation of the second register, the third register and the fourth register; Adding a fifth register in a second quantum state to the quantum system, and controlling the second register, the third register, and the fourth register to perform quantum amplitude estimation according to the fifth register and the state operation to obtain the similarity between the sample quantum state and each weight quantum state; The operation of adding a fourth register in the first quantum state to the quantum system and controlling the second register and the third register to perform a quantum exchange test to determine the states of the second register, the third register and the fourth register according to the fourth register is specifically as follows: A fourth register in a first quantum state is added to the quantum system, wherein the first quantum state is |0>; Execute the H operator on the fourth register: Among them, |0> and |1> represent the state right vector, <0| and <1| represent the state vector, <0| = [1 0], <1| = [0 1]; Control the second register and the third register to perform a quantum state exchange test according to the quantum state of the fourth register; executing the H operator again on the fourth register, and marking all operations that generate the current states of the second register, the third register, and the fourth register as state operations; The fifth register in the second quantum state is added to the quantum system, and the second register, the third register and the fourth register are controlled according to the fifth register and the state operation to perform quantum amplitude estimation to obtain the similarity between the sample quantum state and each weight quantum state: A fifth register in a second quantum state is added to the quantum system, and the second quantum state is ∈ is the error value; After executing the H operator on the fifth register, the second register, the third register and the fourth register are controlled to perform a controlled operation based on the first register, the fifth register and the state operation, so that the relevant information of the similarity is stored in the fifth register: in, represents the controlled operation, s = 1, 2, ..., q, A n represents the state operation, I represents the identity matrix operator, D represents the dimension of sample data and initial neuron weights; An inverse Fourier transform is performed on the fifth register so that the quantum state of the fifth register is converted into the relevant information, and a Fourier transform is performed on the quantum state of the fifth register to obtain the similarity between the sample quantum state and each of the weight quantum states.

2. The method according to claim 1, It is characterized in that The initialization of the quantum system in the Hilbert space is specifically as follows: Wherein, N represents the number of the initial neuron weights; n represents the index label of each initial neuron weight, and n∈{0, 1, ..., N-1}, |> j represents the j-th register of the quantum system; The unitary operation is specifically: Among them, |> represents the Dirac symbol, Represents the initial neuron weight at time t a unitary operation on the amplitude encoded into a third register of the quantum system; Indicates that the sample data x at time t (t) A unitary operation on the amplitude encoded into the second register of the quantum system; l represents the lth element of each initial neuron weight, i represents the ith element of each sample data, represents the lth element of the nth initial neuron weight at time t; Represents the sample data x at time t (t) the i-th element of ; and l,i∈{0,1,…,D-1}.

3. The method according to claim 1, It is characterized in that The index tag set for determining the winning neuron weight according to the similarity and the Grover search algorithm includes: Adding a sixth register for storing a similarity threshold and a seventh register in a first quantum state to the quantum system; Determine the weight quantum state whose similarity is greater than the similarity threshold according to the sixth register, the seventh register and the quantum comparator, and mark the weight quantum state as the winning neuron weight; The index labels of the winning neuron weights are searched out based on the Grover search algorithm to obtain an index label set.

4. The method according to claim 1, It is characterized in that The clustering analysis of the input data by the target quantum neural network clustering model includes: Converting a plurality of target neuron weights in the target quantum neural network clustering model into a plurality of clustering quantum states respectively, and converting the input data into input quantum states; Calculating the cluster similarity between each of the cluster quantum states and the input quantum state through the quantum exchange test operation and the quantum amplitude estimation; If the clustering similarity is greater than a preset value, the input data is marked as a category corresponding to the target neuron weight.

5. A quantum neural network clustering terminal based on Grover search algorithm, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, It is characterized in that When the processor executes the computer program, each step of the quantum neural network clustering method based on the Grover search algorithm as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Quantum feedforward neural network construction method applied to facial expression recognition

    CN113128665A

  • Quantum density peak value clustering method based on quantum Grover search technology

    CN113743457A

  • Quantum amplitude estimation method and device, equipment and storage medium

    CN115577787A

  • Quantum convolutional neural network construction method and system based on quantum state amplitude transformation

    CN115828999A

  • Quantum neural network training method and data classification method

    CN116663643A