Quantum HVS graph KNN method based on pellets

By combining particle-sphere data reduction and hierarchical Veno diagram structures with quantum computing, the computational complexity problem of the classical KNN algorithm on high-dimensional datasets is solved, achieving efficient data compression and classification, and improving computational efficiency and resource utilization.

CN121256532APending Publication Date: 2026-01-02CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511327983.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-17
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

The classic KNN algorithm has high computational complexity when dealing with high-dimensional large datasets, which leads to a decrease in classification efficiency. Existing quantum computing schemes suffer from excessive resource consumption and poor scalability.

Method used

A particle-sphere dataset is generated using particle-sphere data reduction techniques. Combined with hierarchical Veno diagram structures and quantum computing, the quantum HVS graph KNN method is used for data compression and parallel computation to achieve fast search.

Benefits of technology

It significantly reduces the amount of data involved in classification calculations, accelerates similarity calculations through quantum parallel processing characteristics, reduces time complexity, achieves efficient classification, and alleviates the pressure on quantum bit resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121256532A_ABST
    Figure CN121256532A_ABST
Patent Text Reader

Abstract

The invention relates to a particle-ball-based quantum HVS graph KNN method, and belongs to the field of quantum calculation and machine learning. Aiming at the technical problems of low calculation efficiency and large resource consumption when a classical nearest neighbor algorithm is used for processing high-dimensional big data, the invention provides a hierarchical search scheme fusing granular ball reduction and quantum parallel calculation. The hierarchical search scheme comprises the following steps: generating a low-dimensional feature unit through a granular ball compression original data set; constructing a hierarchical Voronoi diagram structure to realize a coarse-to-fine search path; encoding data by adopting a quantum random access memory, and accelerating similarity calculation by utilizing a quantum exchange test circuit; and dynamically screening nearest neighbor nodes in combination with the priority queue. The method significantly improves the classification efficiency, effectively reduces the occupation of quantum bit resources, guarantees the classification precision, and provides technical support for the landing of quantum machine learning in industrial detection and other scenes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of quantum computing and machine learning, and relates to a quantum HVS graph KNN method based on granular balls. BACKGROUND

[0002] In the field of machine learning, the computing power and algorithm of a classical computer face double challenges. Although the traditional nearest neighbor (K-Nearest Neighbors, KNN) classification method can effectively complete data classification, its computing complexity significantly increases when facing massive data, resulting in a sharp decline in classification efficiency. Especially when processing high-dimensional large data sets, the distance between the target point and all sample points needs to be calculated, and the time complexity is as high as O(n 2 ).

[0003] At the same time, the breakthrough of quantum computing technology provides a new path to solve this problem. Quantum computers exhibit the potential to surpass classical computers in certain problems through the superposition, parallelism and entanglement characteristics of quantum states. However, the existing KNN improvement scheme based on quantum computing still has limitations: directly quantizing the classical algorithm requires storing all original data, resulting in excessive consumption of quantum bit resources; the complexity of quantum circuit construction increases exponentially with the data size, making it difficult to achieve efficient expansion.

[0004] The introduction of granular ball (Granular Ball) technology provides an innovative idea for data reduction. As shown in Figure 2 , by aggregating adjacent samples into hyper-spherical units, granular balls can significantly compress the data size while preserving the data distribution characteristics. Experiments show that the machine learning model based on granular balls can improve the computing efficiency by about 30%-50% under the premise of controllable precision loss. However, this technology has not been deeply combined with quantum computing, and its parallelization potential has not been fully released.

[0005] The emergence of hierarchical voronoi structure (Hierarchical Voronoi Structure, HVS) further optimizes the nearest neighbor search process. This structure constructs a topological network through multiple layers of seed points, realizing a "from coarse to fine" fast search strategy. Although the classical HVS graph can reduce the computing complexity to the order of O(log n), there are still computing bottlenecks in high-dimensional space construction and traversal.

[0006] In summary, there is an urgent need for an innovative solution that combines granular ball data reduction, quantum parallel computing and hierarchical graph search, to break through the efficiency barrier of classical KNN algorithm while ensuring classification accuracy. This has become a key breakthrough direction in this technical field.

[0007] Glossary:

[0008] Classic computing device: widely used in the field of quantum computing to refer to the computing device (such as computer with CPU / GPU architecture) that is not quantum computing system, which is clearly distinguished from quantum computing device.

[0009] Quantum computing device: refers to a physical device that realizes information processing based on the principles of quantum mechanics, including a quantum bit manipulation system, a low-temperature control unit, and a classical interface module. The "quantum computing device" is clearly listed as a standard term in the Chinese "Quantum Information Technology Terminology" (GB / T 38664-2020). SUMMARY

[0010] Therefore, the purpose of the present application is to provide a quantum HVS graph KNN method based on granules, which solves the technical problems of large amount of data involved in calculation and high algorithm time complexity in classic KNN.

[0011] To achieve the above purpose, the present application provides the following technical solutions:

[0012] The quantum HVS graph KNN method based on granules comprises the following steps:

[0013] S1: generating a granule data set M from a point data set D by a classic computing device;

[0014] S2: generating each layer seed point set Z of a hierarchical voronoi structure (HVS) graph according to the granule data set M by the classic computing device;

[0015] S3: obtaining each layer data set S and graph node data set V of the HVS graph according to the granule data set M and the seed point set Z based on a density data distribution strategy by the classic computing device;

[0016] S4: calculating the similarity of a to-be-inserted graph node with the current layer neighbor node and one-hop graph node, and finding the minimum value of the similarity, to establish the intra-graph layer connection relationship between the to-be-inserted graph node and the node with the minimum value of the similarity by a quantum computing device;

[0017] S5: completing the inter-graph layer connection of the HVS graph according to the termination state of the layer data point by the quantum computing device;

[0018] S6: repeating S4 and S5 until the graph node data set V is traversed, and completing the construction of the multi-layer quantum HVS graph;

[0019] S7: calculating the minimum value of the distance between the test data point q and the current layer neighbor node and one-hop graph node from the top layer input by the quantum computing device for the test data point q to be classified;

[0020] S8: insert the node corresponding to the minimum distance into a priority queue with size k, and take the node as the entry node of the next layer, and continue the search of the next layer;

[0021] S9: repeat S7 and S8 until the multi-layer quantum HVS graph is traversed, and the search is completed;

[0022] S10: determine the k nearest neighbors (KNN) of the test data point q according to the priority queue obtained in S9, and classify the test data point q according to the categories of the k nearest neighbors.

[0023] Further, in S1, the granule data set M is generated from the point data set D, which is completed using classical calculation, and specifically includes the following steps:

[0024] S11: take the entire data set D as the initial granule, randomly select a point in the granule as the center, and select another farthest point of different classes as another center;

[0025] S12: determine whether the purity of each granule meets the threshold U, and continue to split the granule that does not meet the purity, and the classification rule is: calculate the distance between the remaining data points and the two center points, and divide the data points into the granule corresponding to the center point with the shortest distance;

[0026] S13: take the original center as the center in the newly generated granule, and select another farthest point of different classes as another center, and repeat S12 on this basis until the purity of all granules meets the threshold T, and the granule data set M is obtained. The data amount in the granule data set is denoted as n.

[0027] Further, in S2, the HVS graph seed point set Z is generated from the granule data set M, which is completed using classical calculation, and specifically includes the following steps:

[0028] S21: set the bottom layer of the HVS structure as the T layer, and the number of sub-codebooks in the bottom layer is 2 T , and the number of sub-codewords in each sub-codebook is L;

[0029] S22: based on the granule data set M, perform PCA rotation on the d-dimensional vector, and then uniformly divide the rotated vector into 2 T sub-vectors, and obtain L clustering centers in each sub-vector space by using k-means clustering, and take the L clustering centers as the sub-codewords of the sub-codebook ;

[0030] S23: take the Cartesian product of the sub-codewords of all sub-codebooks to obtain a code word, directly taking the code word as a bottom layer Voronoi diagram seed point set Z T ;

[0031] S24: generating an upper layer Z from bottom to top layer by layer t , calculating the mutual information of two sub-codebooks of 2 (t+1) sub-codebooks of the current t+1 layer Each time, a pair of sub-codebooks that have not been paired and have the maximum mutual information are selected for merging, and are merged into 2 t new sub-codebooks The parent-child relationship between the upper and lower layers is generated;

[0032] S25: In each merged sub-codebook, L 2 representative sub-code words are selected from L t possible combinations by weighted k-means or importance sampling;

[0033] S26: Taking the 2 t sub-codebooks to do Cartesian product again, 2 code words are obtained, that is, the t layer seed point set Z t ;

[0034] S27: repeating S24-S26 until the top layer seed point set Z

[0035] Further, in the S3, by determining the seed point to which each data point belongs to the particle ball data set M, the graph node set V is obtained by screening the seed point data set Z, and then based on the density and quantization error distribution, the data subset S is obtained which decreases layer by layer from top to bottom t (t=t0+1,...,2 T ), using classical calculation to complete, specifically including the following steps:

[0036] S31: for each data point x in the current layer data set S t , calculating the distance between x and all seed points in the current seed point set Z t , x is assigned to the nearest seed point;

[0037] S32: traversing all seed points in Z t : if there is at least one data point assigned to seed point v, mark v as "representative point", otherwise mark v as "empty Voronoi unit" and discard it;

[0038] S33: collecting all seed points marked as "representative point" to form a graph node set V t , the set V t is used for the construction of intra-layer edges and cross-layer edges in the subsequent layer;

[0039] S34: For each data point x∈D, calculate the quantization error Q between its Voronoi seed points at layer t. n (x) and its surrounding data density product

[0040] S35: For the data subset M that has been completed at level t: t , for all x∈M t according to Sort in descending order, take the first δ|M t | points are used as a subset M of the data in the next layer t+1. t+1 The remaining data points are judged to terminate at this layer, where δ∈(0,1) is a preset coefficient;

[0041] S36: Repeat S31-S35 until the bottom layer (layer T). Finally, set the graph node dataset V of the bottom layer (layer T+1) to the overall granular sphere dataset M, and finally obtain the dataset S and graph node dataset V of each layer.

[0042] Furthermore, in S4, the quantum HVS graph construction process involves determining the neighboring nodes of the insertion point, calculating the similarity between the inserted data point and its current layer neighboring nodes and their one-hop data points, and finding the minimum value. This is accomplished using quantum computing and specifically includes the following steps:

[0043] S41: Using the QRAM algorithm and angle encoding, encode the dataset V of each layer of graph nodes into quantum states, resulting in a dataset size of 2. k The data dimension is 'a', and the data range for each dimension is 'a'. in, Based on the maximum value of each dimension's data, address bits are designed, and a new register group 1 is added to store the address of the dataset, with a specific number of bits (k). Different dimensions share the same address bits. Based on data dimension 'a', 2a QRAM and angle encoding operations are performed. A new register group 2 is added to store QRAM-encoded data, and a new register group 3 is added to store angle-encoded data. For the sphere dataset M, the preparation of each data point is based on the numerical range of each dimension, setting the number of qubits required for the QRAM data bus to be 't'. a QRAM is used to store data on the data bus and to control the data on the address bit in parallel with the data on the data bus. Then, angle encoding is used to map the data on the data bus to the angles on the Bloch sphere. The specific steps of angle encoding are as follows: one quantum bit is used to store the angle, the data is stored in binary form on the data bus, the data bit is used as the control bit, and the value is taken from the high bit to the low bit. x starts from 0 and increments by 1. If the corresponding bit is 1, the rotation is controlled by a CRY gate. Once a fabrication is complete, the data bus is restored to |0> for use in the next fabrication.

[0044] S42: Define the graph node set V for each level of the graph. i ,i∈[0,T+1] and the intra-layer adjacency matrix J i For i∈[0,T+1], the set of points V to be included in the calculation is determined based on the data point set and adjacency matrix of each layer, combined with the neighbor nodes determined in the previous layer. ci (i∈[0,T+1]), insert the point and point set V through the address bit index in QRAM. ci The data bits are processed and encoded using the angle encoding in S41. The angle data is stored in the corresponding angle bits in register group 3. A new register group 4 is added as a control bit to control the insertion point and point set S. ci All points in register group 3 correspond to the angle qubits, which act on the Swap-test quantum circuit and store the similarity results in the corresponding qubits in register group 4.

[0045] S43: Use the iterative comparison quantum circuit to obtain the minimum value of the probability of measurement as 1 in the obtained similarity, which represents the two closest quantum states. Add register group 5 as the data qubits to participate in the comparison, and add register group 6 as the auxiliary bits required for participation in the comparison. Obtain the minimum value of the similarity calculated in S42 through the comparison circuit.

[0046] S44: When constructing the graph, the number of neighbors of a point is less than or equal to m. Based on the minimum similarity value obtained in S43, determine the nodes that should be connected to the insertion point in this layer, and then add them to the adjacency matrix J. i The element corresponding to the middle 1 represents the connection relationship between two points, and the graph connection relationship between each data point and the outside world shall not exceed m;

[0047] Furthermore, in step S5, the construction of connections between quantum HVS layers is completed using quantum computing, specifically including the following steps:

[0048] S51: Define the adjacency matrix R between each layer. i For each seed point u in the t-th layer, determine its nearest data point x' in the Voronoi cell;

[0049] S52: Perform a termination check on data point x': If it does not terminate, find the parent seed point of the merged relationship in S24, determine the seed point of layer t+1 that needs to establish a connection relationship with the seed point in this layer, and add it to the adjacency matrix R. i The element corresponding to the middle 1 represents the connection relationship between two points; if it terminates, its seed point u is directly connected to the base data point x', and in the adjacency matrix R i The element with a center 0 represents the connection between two points.

[0050] Furthermore, in step S6, steps S4 and S5 are repeated until the entire graph node dataset V is traversed, completing the construction of the multi-layer granular quantum HVS graph. This is accomplished using quantum computing and specifically includes the following steps:

[0051] S61: Starting from the top level, the insertion point performs two steps, S44 and S52, at each level to build the graph connection relationship until the insertion point reaches the bottom level, thus completing the insertion of that point.

[0052] S62: Perform the insertion operation on each node in the graph node dataset V at each level according to S61. During the insertion process, construct new graph connectivity relationships, i.e., update the adjacency matrix J at each level. i ,i∈[0,T+1] and R i ,i∈[0,T], until all points in the graph node dataset V have been inserted.

[0053] Furthermore, in S7, the quantum HVS graph search operation involves inputting a test data point q from the top layer and calculating the minimum distance between q and the one-hop data points of the current layer's neighboring nodes. This is accomplished using quantum computing and specifically includes the following steps:

[0054] S71: Starting from the top layer of the quantum HVS graph, use the same methods as S41, S42 and S43 to encode the test data point q using QRAM and angle encoding, calculate the similarity between the test data point and its current layer neighbor nodes and its one-hop nodes, and find the graph node in the layer that is closest to the test data point q by iterative quantum comparison circuit.

[0055] Furthermore, in step S8, the minimum value obtained in the current layer is inserted into a priority queue of size k, and the nearest node in the current layer is used as the entry node for the next layer to continue the search for the next layer. This specifically includes the following steps:

[0056] S81: Get the seed point that is closest to the test data point in the current layer in S71, and insert the point into a priority queue Q of size k. The priority queue takes the larger distance as the higher priority, that is, when popping an element from the queue, the value with the larger distance will be popped first.

[0057] S82: Take the seed point that is closest to the test data point in the current layer in S71 as the entry node of the test data point in the next layer, use the similarity in S42 to find the nearest seed point in the next layer, and let the test data point enter the next layer to continue the search.

[0058] Furthermore, in step S9, steps S7 and S8 are repeated until the multi-layer graph structure is traversed to complete the search. Specifically, this includes the following steps:

[0059] S91: Let the inserted data points search from the highest level down layer by layer, repeating steps S71, S81 and S82, and insert the minimum similarity value of each layer into the priority queue. The same point can be inserted repeatedly, but the priority queue does not store duplicate values.

[0060] S92: Determine if the priority queue is full. If the priority queue is full before the search is completed, compare the newly inserted similarity with the maximum similarity in the priority queue. If the newly inserted similarity is greater, the priority queue is not changed. Otherwise, the maximum similarity is popped and a new similarity value is inserted.

[0061] Furthermore, in S10, the major category among the k neighbors of the inserted data point q is determined based on the priority queue obtained in S9, and the data point q is classified according to the major category. This specifically includes the following steps:

[0062] S101: Calculate the proportion of data types in priority queue Q, obtain the types in Q, and classify the test data point q into the types in Q.

[0063] The beneficial effects of this invention are as follows:

[0064] (1) The particle-sphere data reduction technique is adopted to compress the original high-dimensional dataset into a set of hypersphere units, which significantly reduces the amount of entity data involved in classification calculation. The particle-sphere achieves efficient attribute reduction while preserving the data distribution characteristics: combined with the parallel processing characteristics of quantum computing, data state preparation is realized through quantum random access memory and angle encoding, and quantum exchange test circuit is used to accelerate similarity calculation, which fundamentally breaks through the time complexity bottleneck of the classical KNN algorithm.

[0065] (2) The constructed multi-layer quantum HVS graph structure organizes the data space in layers through virtual seed points. The distribution of Vino seed points realizes the progressive search strategy of "from coarse to fine". Under the premise of ensuring classification accuracy, the cross-layer connection mechanism of graph nodes greatly reduces the invalid distance calculation and avoids the computational redundancy of traversing the entire data in the traditional method.

[0066] (3) By using a density-based data allocation strategy, the scale of data participating in computation at each level is dynamically controlled, effectively alleviating the pressure on qubit resources. Combined with a priority queue management mechanism, an optimal balance is established between qubit occupancy and computational accuracy, overcoming the inherent limitation of limited storage resources in quantum devices.

[0067] (4) Pioneeringly achieving deep integration of classical particle-sphere algorithm and quantum computing:

[0068] The classical computation phase completes data reduction and structure initialization.

[0069] Quantum computing accelerates core similarity comparison and graph traversal.

[0070] The quantum state similarity calculation circuit leverages the advantages of quantum parallelism while avoiding the resource explosion problem caused by full quantization, providing a scalable technical paradigm for quantum machine learning.

[0071] (5) This solution forms a complete technical closed loop and can be directly applied to fields that require efficient classification, such as image recognition, bioinformatics, and financial risk control, solving the core pain point of massive data processing in actual engineering scenarios.

[0072] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0073] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:

[0074] Figure 1 This is an overall flowchart of the method in the embodiments of the present invention;

[0075] Figure 2 This is a data graph after reducing the granular spherical properties of the data in this invention;

[0076] Figure 3 This is a virtual Voronoi seed point map generated from granular sphere data in this invention;

[0077] Figure 4 This is a distribution diagram of the middle layer data and graph node data in this invention;

[0078] Figure 5 This is a specific route diagram for preparing data for one dimension in this invention;

[0079] Figure 6 All data designed for this invention are processed into specific circuit diagrams at different angles;

[0080] Figure 7 This is a schematic diagram of the process for determining the similarity between two quantum states in an embodiment of the present invention.

[0081] Figure 8 This is a specific circuit diagram for comparing the size relationship of numbers in this invention;

[0082] Figure 9 This is a single-layer schematic diagram showing the connection relationship of the insertion point of the present invention in a certain layer of the construction graph;

[0083] Figure 10This is an overall schematic diagram of the connection relationship of the insertion points from the top to the bottom of the graph in this invention;

[0084] Figure 11 This is a schematic diagram of the priority queue structure defined in this invention;

[0085] Figure 12 This is a schematic diagram of the priority queue after graph search of the insertion point in an embodiment of the present invention. Detailed Implementation

[0086] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0087] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0088] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0089] Please see Figures 1-10 This is a quantum HVS graph KNN method based on spheres.

[0090] like Figure 1 As shown, this embodiment provides a particle-sphere-based quantum HVS graph KNN method, including the following steps:

[0091] S1: Obtain the complete dataset D and generate the sphere dataset M from dataset D;

[0092] Specifically, the generation process includes:

[0093] S11: Using the entire dataset D as the initial sphere, in this embodiment, the dataset D has 47 data points, including 25 red data points and 22 black data points. Randomly select a point in the sphere as the center, and select another point of the opposite class that is farthest away as another center.

[0094] S12: Determine whether the purity of the spheres meets the threshold of 0.6. If the spheres do not meet the purity requirement, continue to split them. The classification rule is: calculate the distance between the remaining data points and the two center points, and classify the data points into the spheres corresponding to the center points that are closest to them.

[0095] S13: Using the original center of the newly generated sphere as the center, and selecting another outlier point with the furthest distance as the other center, continue step S12 until the purity of all spheres meets the threshold of 0.6, resulting in a sphere dataset M. The number of data points in the sphere dataset is denoted as n, and the data dimension is denoted as d. In this implementation example, the sphere dataset M has 12 data points (n) and 8 dimensions, including 6 red spheres and 6 black spheres. The original dataset, after attribute reduction using spheres, is as follows: Figure 2 As shown.

[0096]

[0097] S2: Generate the seed point set Z for each layer of the HVS graph using the particle dataset M;

[0098] Specifically, the calculation process includes:

[0099] S21: The HVS structure has 3 layers at the bottom layer T, 8 subcodebooks at the bottom layer, and 2 subcodewords in each subcodebook;

[0100] S22: Based on the particle sphere dataset M, after performing PCA rotation on the 8-dimensional vector, the rotated vector is uniformly divided into 8 sub-vectors. In each sub-vector space, k-means clustering is used to obtain 2 cluster centers, and these cluster centers are used as sub-codebooks. Sub-code characters;

[0101] S23: Perform a Cartesian product of all subcodewords in the subcodebook to obtain 2. 8 Each codeword is used as the seed point set Z of the underlying Voronoi diagram. T=3 ;

[0102] S24: Generate the upper layer Z layer by layer from bottom to top. t Calculate the 2 of the 3rd layer 8 Mutual information between the two sub-codebooks of a single codebook Each time, select the pair of codebooks that are not yet paired and have the largest mutual information to merge, resulting in a total of 2. 2 A new subcodebook This creates a hierarchical parent-child relationship.

[0103] S25: Within each merged subcodebook, from 2 2 Two representative subcodewords are selected from the possible combinations using weighted k-means or importance sampling;

[0104] S26: 2 2 Perform a Cartesian product on the new subcodebook to get 2. 4 Each codeword, i.e., the set of seed points Z in the second layer. t=2 ;

[0105] S27: Repeat S24~S26 to generate the seed point set of the first layer. Three-layer virtual Voronoi seed point diagram as follows: Figure 3 As shown.

[0106] S3: By allocating the particle-sphere dataset M based on a density and quantization error allocation strategy, we obtain the HVS graph layer dataset S and graph node dataset V;

[0107] S31: For the top-level (level 2) dataset S t=2 For each data point x in the set, calculate its relationship with the current seed point set Z. t=2 Given the distances to all seed points, assign x to the nearest seed point.

[0108] S32: Traverse Z t=2 All seed points: If at least one data point is assigned to seed point v, then v is marked as "representative point"; otherwise, v is marked as "empty Voronoi cell" and discarded.

[0109] S33: Collect all seed points marked as "representative points" to form the graph node set V. t=2 The set V t=2 This is used for constructing subsequent inner edges within the same layer and cross-layer edges. The distribution of the second-layer dataset and the graph node dataset is as follows: Figure 4 As shown, the red and black dots represent the dataset, while the other colors represent the graph node dataset.

[0110] S34: For each data point x∈D, calculate the quantization error Q between its Voronoi seed points in the second layer. n (x) and its surrounding data density product

[0111] S35: For the completed second-level data subset M t=2, for all x∈M t=2 according to Sort in descending order, take the first 0.5|M t=2 | points are used as a subset M of data for the next layer (the 3rd layer). t=3 The remaining data points are considered to have terminated at this layer;

[0112] S36: Repeat S31-S35 to complete the bottom layer (3rd layer). Finally, set the graph node dataset V of the bottom layer (3+1st layer) to the overall granular sphere dataset M, and finally obtain the dataset S and graph node dataset V of each layer.

[0113] S4: Calculate the similarity between the graph node and its current layer neighbor node and its one-hop graph node, find the minimum value, and establish the intra-layer connection relationship between the insertion point and the minimum value point;

[0114] Specifically, the calculation and construction process includes:

[0115] S41: The particle-sphere dataset M is encoded into a quantum state using the QRAM algorithm and angle coding. The particle-sphere dataset M consists of 12 labeled data points with a dimension of 8 and a numerical range of [0, 10]. One class of labels is "red," and the other is "black." Address bits are designed, with a new register group 1 storing the dataset address (4 bits). Different dimensions share the same address bits. Based on the 8-dimensional data, a new register group 2 stores the QRAM-encoded data bits. For each data point in the particle-sphere dataset M, the preparation of each data point, based on the numerical range of each dimension, determines that the required QRAM data bus has 4 qubits. Therefore, the QRAM quantum circuit used in this example is as follows: Figure 5 As shown, the address registers |add1add0> have already passed through the H gate, and |m3m2m1m0> store four values ​​respectively. Then, register group 3 is added to store the angle-encoded data. Angle encoding is used to map the data on the data bus to the angles on the Bloch sphere, as shown below. Figure 6 As shown, the specific steps of angle encoding are as follows: Angle is stored using a single quantum bit. Data is stored in binary form on the data bus. The data bits are control bits, and values ​​are taken from the high bit to the low bit. x starts from 0 and increments by 1. If the corresponding bit is 1, a CRY gate is used to control the rotation. Once a fabrication is complete, the data bus is restored to |0> for use in the next fabrication.

[0116] S42: Define the graph node set V for each level of the graph. i ,i∈[0,T+1] and the intra-layer adjacency matrix J i For i∈[0,T+1], the set of points V to be included in the calculation is determined based on the data point set and adjacency matrix of each layer, combined with the neighbor nodes determined in the previous layer. ci(i∈[0,T+1]), insert the point and point set V through the address bit index in QRAM. ci The data bits are then encoded using the angle encoding in S41, and the similarity between the insertion point and its neighboring nodes and their one-hop data points in that layer is obtained using the Swap-test. Figure 7 As shown, first, a new register |b> is added, then an H gate is used on register |b>, then register |b> is used as a control bit to perform a SWAP operation on the angle register, and finally an H gate is used on register |b> to store the similarity between the data and the cluster centers in register |b>.

[0117] S43: Use an iterative comparison quantum circuit to obtain the minimum probability of a measurement being 1 in the obtained similarity scores. The specific quantum circuit is as follows: Figure 8 As shown, when constructing the graph, the neighbors of a point are defined to be less than or equal to m, where |data_a0data_a1> and |data_b0data_b1> are data qubits participating in the comparison, and |h0h1> are auxiliary bits required for the comparison. V in S42... ci The minimum similarity between the line and the insertion point is obtained by comparing each pair of lines.

[0118] S44: Based on the minimum similarity value obtained in S43, determine the corresponding node that needs to establish a connection with the insertion point in this layer, and set the corresponding element to 1 in the adjacency matrix to represent the connection relationship between the two points;

[0119] S5: Complete the construction of connections between Quantum HVS layers;

[0120] Specifically, the steps and procedures include:

[0121] S51: Define the adjacency matrix R between each layer. i For each seed point u in the t-th layer, determine its nearest data point x' in the Voronoi cell;

[0122] S52: Perform a termination check on data point x': If it does not terminate, find the parent seed point of the merged relationship in S24, determine the seed point of layer t+1 that needs to establish a connection relationship with the seed point in this layer, and add it to the adjacency matrix R. i The element corresponding to the middle 1 represents the connection relationship between two points; if it terminates, its seed point u is directly connected to the base data point x', and in the adjacency matrix R i The element with a center 0 represents the connection between two points.

[0123] S6: Repeat steps S4 and S5 until the entire graph node dataset V has been traversed, completing the construction of the multi-layer granular quantum HVS graph;

[0124] Specifically, the steps and procedures include:

[0125] S61: Starting from the top level, steps S44 and S52 are executed at each level downwards to construct graph connectivity relationships until the insertion point reaches the bottom level, thus completing the insertion. In this implementation example, a single-level insertion example is... Figure 9 As shown, the black lines represent existing connections, while the solid blue lines represent new intra-layer connections created by the insertion point within this layer; the dashed blue lines represent new inter-layer connections created by the insertion point within this layer.

[0126] S62: Perform the insertion operation on each node in the graph node dataset V at each level according to S61. During the insertion process, construct new graph connectivity relationships, i.e., update the adjacency matrix J at each level. i ,i∈[0,T+1] and R i The process continues until all points in the graph node dataset V have been inserted. The construction process of the multi-layer quantum HVS graph in this implementation example is as follows: Figure 10 As shown;

[0127] S7: Quantum HVS graph search operation, starting from the top layer, inputs test data point q and calculates the minimum distance between q and the one-hop data point of the current layer's neighboring nodes;

[0128] Specifically, the single-layer search process includes:

[0129] S71: Starting from the top layer of the quantum HVS graph, using the same methods as S41, S42, and S43, the test data point q is encoded using QRAM and angles. The similarity between the test data point and its current layer neighbor nodes and their one-hop nodes is calculated. The graph node closest to the test data point q in that layer is then determined through an iterative quantum comparison circuit. The search process in the implementation example is similar. Figure 10 As shown.

[0130] S8: Insert the minimum value found in the current layer into a priority queue of size k, and make the nearest node in the current layer the entry node for the next layer, and continue the search work for the next layer.

[0131] Specifically, the iterative search process includes:

[0132] S81: Obtain the seed point in S71 that is closest to the test data point in the current layer, and insert this point into a priority queue Q of size k. The priority queue prioritizes points with larger distances, meaning that when popping an element from the queue, the element with the largest distance will be popped first. In this implementation example, the structure of the priority queue is as follows: Figure 11 As shown;

[0133] S82: Take the seed point that is closest to the test data point in the current layer in S71 as the entry node of the test data point in the next layer, use the similarity in S42 to find the nearest seed point in the next layer, and let the test data point enter the next layer to continue the search.

[0134] S9: Repeat steps S7 and S8 until the multi-layer graph structure has been traversed to complete the search.

[0135] Specifically, the design process includes:

[0136] S91: Let the inserted data points search from the highest level down layer by layer, repeating steps S71, S81 and S82, and insert the minimum similarity value of each layer into the priority queue. The same point can be inserted repeatedly, but the priority queue does not store duplicate values.

[0137] S92: Determine if the priority queue is full. If the priority queue is full before the search is completed, compare the newly inserted similarity with the maximum similarity in the priority queue. If the newly inserted similarity is greater, the priority queue is not changed. Otherwise, the maximum similarity is popped and a new similarity value is inserted.

[0138] S10: Determine the major category among the k neighbors of the inserted data point q based on the priority queue obtained in S9, and classify the data point q according to the major category;

[0139] Specifically, the steps and procedures include:

[0140] S101: The final priority queue in this implementation example is as follows: Figure 12 As shown, when K is 4, the proportion of data types in the priority queue Q is calculated, and the main type in Q is black. Therefore, after searching through the multi-layer granular quantum HVS graph, the type of the test point q is set to black, thus completing the final classification.

[0141] Example 1: Real-time Detection System for Industrial Metal Surface Defects

[0142] 1.1 Technical Scenarios and Hardware Integration

[0143] On the automotive engine cylinder head production line, FLIR A700 industrial cameras capture images of the metal surface, and NVIDIA Jetson AGX Orin extracts 128-dimensional defect features. Since traditional detection algorithms cannot meet the real-time requirement of 30 frames per second on the production line, the system uses IBM superconducting quantum chips to build a particle compression model, and finally ABB pneumatic robotic arms perform the sorting action.

[0144] 1.2 Implementation of Technical Process

[0145] 1.2.1 Defect Feature Compression

[0146] After an industrial camera captures images of micron-level scratches on the cylinder head surface, the system initializes the complete dataset into a granular structure. By selecting normal texture feature points as the first center and locating the furthest aberrant scratch point as the second center, a splitting mechanism is activated when the granular purity falls below the industry standard threshold of 90%. This mechanism calculates the Euclidean distance between each feature point and the two centers and dynamically assigns it to the granular partition corresponding to the nearest center. This process iterates until the purity of all granular points meets the standard, ultimately generating a granular feature set with an 18x compression ratio. At this point, the original megapixel data is compressed into core feature units that can be quantized.

[0147] 1.2.2 Quantization Layer Construction

[0148] The quantum processor controls access to particle data via a two-bit address register and transmits texture feature values ​​via a four-bit data bus. After implementing angle encoding using a controlled rotation gate, the system constructs a three-layer hierarchical Venn diagram: the top-level nodes are responsible for classifying defects in large areas, the middle-level nodes resolve local texture anomalies, and the bottom-level nodes label microscopic feature units. Nodes within the same layer establish connections through quantum similarity calculations, while nodes across layers generate topological links based on parent-child relationships.

[0149] 1.2.3 Real-time Decision Making and Control

[0150] After the features of the workpiece to be inspected are input into the top layer of the quantum graph, the quantum exchange test circuit outputs the similarity value with neighboring nodes. The iterative comparator filters the minimum distance value and dynamically updates the priority queue. When the three nearest neighbors in the queue contain two scratch-type nodes, the system determines that the current workpiece has a scratch defect and triggers the pneumatic robotic arm to complete the removal action within fifty milliseconds.

[0151] 1.3 Technological Achievements

[0152] This solution compresses the single-frame detection time to 35 milliseconds, controls the quantum bit occupancy to 28, reduces the false detection rate to 0.8%, and improves efficiency by 17 times compared to the classic algorithm, meeting the needs of high-precision industrial assembly line operations.

[0153] Example 2: Dynamic Obstacle Recognition System for Autonomous Driving

[0154] 2.1 Technical Scenarios and Hardware Integration

[0155] The Velodyne VLS-128 lidar collects hundreds of thousands of point cloud data per second, NVIDIA DRIVE Orin performs principal component analysis for dimensionality reduction, Honeywell ion trap quantum module handles nearest neighbor search, and finally Bosch electronic steering system executes avoidance decisions, achieving millisecond-level response in complex road conditions.

[0156] 2.2 Implementation of Technical Process

[0157] 2.2.1 Point Cloud Feature Structuring

[0158] After the original 32-dimensional laser point cloud was reduced to an eight-dimensional feature space by principal component analysis, the underlying space was divided into eight sub-regions. K-means clustering was used to generate underlying feature points identifying vehicles, pedestrians, and trees, and these points were then merged based on mutual information from the sub-codebook to generate intermediate-level moving object nodes.

[0159] 2.2.2 Quantum Nearest Neighbor Search

[0160] Real-time point cloud data is loaded into the quantum processor via a six-bit address register, and the three-dimensional spatial coordinates are stored on a twelve-bit data bus. After the quantum state preparation circuit is activated, the system calculates the similarity between the current point cloud and the traffic light node, and measures a similarity value of 0.91.

[0161] 2.2.3 Dynamic Avoidance Decision

[0162] The system maintains a priority queue with a capacity of five to store nearest neighbor distance values. When the queue is full and a new distance value is less than the queue's maximum value, the element with the maximum distance is automatically popped and the new value is inserted. When three-fifths of the nearest neighbors are identified as moving vehicle nodes, the electronic steering system calculates the steering angle based on the ratio of the minimum distance to a safety threshold, triggering an emergency avoidance maneuver within twenty-six milliseconds.

[0163] 3. Actual performance

[0164] In urban road tests, the pedestrian crossing recognition accuracy reached 99.1%, the vehicle cutting-in decision delay was 26 milliseconds, and the construction area recognition rate was 97.3%, significantly improving the safety of L4 autonomous driving.

[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A quantum HVS graph KNN method based on spheres, characterized in that: The method includes the following steps: S1: Performed by a classical computing device, the point dataset D is generated into a sphere dataset M; S2: Performed by the classical computing device, generating the seed point set Z for each layer of the Hierarchical Voronoi Structure (HVS) graph based on the sphere dataset M; S3: Executed by the classical computing device, based on the density data allocation strategy, according to the particle dataset M and the seed point set Z, the dataset S of each layer of the HVS graph and the graph node dataset V are obtained; S4: Executed by a quantum computing device, calculate the similarity between the graph node to be inserted and its current layer neighbor nodes and one-hop graph nodes, and find the minimum similarity value to establish an intra-layer connection relationship between the graph node to be inserted and the node with the minimum similarity value. S5: Executed by the quantum computing device, the inter-layer connections of the HVS graph are completed according to the termination state of the layer data points; S6: Repeat S4 and S5 until the graph node dataset V has been traversed, and the construction of the multi-layer quantum HVS graph is completed; S7: Executed by the quantum computing device, for the test data point q to be classified, starting from the top layer input, calculate the minimum distance between the test data point q and its current layer neighbor nodes and its one-hop graph nodes; S8: Insert the node corresponding to the minimum distance into a priority queue of size k, and use the node corresponding to the minimum distance as the entry node for the next layer to continue the search for the next layer; S9: Repeat S7 and S8 until the multi-layer quantum HVS graph has been traversed and the search is completed; S10: Based on the priority queue obtained in S9, determine the k nearest neighbors (K-Nearest Neighbors, KNN) of the test data point q, and classify the test data point q according to the categories of the k nearest neighbors.

2. The particle-sphere-based quantum HVS graph KNN method according to claim 1, characterized in that: S1 specifically includes: S11: Using the entire point dataset D as the initial sphere, randomly select a first center point in the initial sphere, and select the outlier point that is farthest from the first center point as the second center point; S12: Determine whether the purity of each sphere meets the preset purity threshold. If not, calculate the distance between the remaining data points and the first center point and the second center point, and divide the remaining data points into the spheres corresponding to the closer center points to achieve sphere splitting. S13: Repeat S12 for the newly generated spheres until the purity of all spheres meets the preset purity threshold, and obtain the sphere dataset M.

3. The quantum HVS graph KNN method based on spheres according to claim 1, characterized in that: S2 specifically includes: S21: Perform principal component analysis (PCA) rotation on the d-dimensional vector in the granular dataset M, and uniformly divide the rotated vector into multiple sub-vectors; S22: In each sub-vector space, k-means clustering is used to obtain L cluster centers, which are used as subcodewords of the subcodebook; S23: Perform Cartesian product operation on all subcodewords in the subcodebook to obtain codewords, which serve as the underlying seed point set; S24: Generate the upper-level seed point set layer by layer from bottom to top. By calculating the mutual information between the sub-codebooks of the current layer, select the pair of sub-codebooks with the largest mutual information and merge them to generate a new sub-codebook. S25: Select L representative subcodewords from the merged new subcodebook; S26: Perform a Cartesian product operation on the representative subcodewords of the new subcodebook to obtain the seed point set of the next layer; S27: Repeat S24 to S26 until the top-level seed point set is generated.

4. The quantum HVS graph KNN method based on spheres according to claim 1, characterized in that: S3 specifically includes: S31: For each data point in the current layer dataset, calculate its distance to all seed points in the current layer seed point set, and assign the data point to the nearest seed point. S32: Traverse all seed points in the current layer. If a seed point has at least one data point assigned, mark it as a representative point; otherwise, discard it. S33: Collect all seed points marked as representative points to form the graph node set of the current layer. S34: For each data point, calculate the product of the quantization error between its seed points and the data density around that data point; S35: Arrange the data points in descending order according to the product, take the first part of the data points as the data subset of the next layer, and terminate the remaining data points in this layer; S36: Repeat S31 to S35 layer by layer until all layers have been processed, and obtain the dataset S and graph node dataset V for each layer.

5. The quantum HVS graph KNN method based on spheres according to claim 1, characterized in that: S4 specifically includes: S41: The Quantum Random Access Memory (QRAM) algorithm and angle coding are used to encode the dataset V of each layer of graph nodes into a quantum state; S42: Apply the Swap-test quantum circuit to the quantum states corresponding to all points in the graph node to be inserted and the point set, and calculate the similarity. S43: Use iterative comparison quantum circuits to obtain the minimum value among the similarities.

6. The quantum HVS graph KNN method based on spheres according to claim 1, characterized in that: S5 specifically includes: S51: For each seed point u in the t-th layer, determine its nearest data point x' within its Voronoi cell; S52: Determine whether the nearest data point x' has terminated: If it has not terminated, find its parent seed point and establish a connection with the parent seed point at layer t-1; if it has terminated, connect the seed point u directly to the base data point x'.

7. The quantum HVS graph KNN method based on spheres according to claim 1, characterized in that: S7 is executed by the quantum computing device and specifically includes: The test data point q is encoded into a quantum state using the quantum random access memory (QRAM) algorithm and angle encoding. Calculate the similarity between the quantum state of the test data point q and the quantum states of its current layer neighbor nodes and its one-hop nodes; By iterating through the quantum comparison circuit, the graph node most similar to the test data point q is found, and the minimum distance is determined.

8. The quantum HVS graph KNN method based on spheres according to claim 1, characterized in that: S8 specifically includes: S81: Insert the graph node that is closest to the test data point q, as determined in S7, into the priority queue; S82: Use the nearest graph node as the entry node of the test data point q in the next layer to continue the search.

9. The particle-sphere-based quantum HVS graph KNN method according to claim 8, characterized in that: The priority queue prioritizes nodes with larger distances. When the priority queue is full, if the distance of a newly inserted node is less than the maximum distance in the queue, the node with the maximum distance will be popped and the new node will be inserted.