Efficient robustness classification method based on quantum particles and balls
By employing a quantum particle sphere classification method and utilizing a quantum simulator and angle encoding circuit to process high-dimensional data, the inefficiency of traditional methods is solved, achieving efficient and robust data classification suitable for large-scale and noise-sensitive data processing tasks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2026-02-02
- Publication Date
- 2026-05-15
AI Technical Summary
When processing large-scale, high-dimensional data, traditional classification methods are inefficient and cannot meet the high-efficiency requirements of modern big data processing. They are also not robust enough in noisy environments, and existing sub-classification schemes consume a lot of resources and have limited hardware adaptability.
A quantum particle-based classification method is adopted. Data preprocessing and dimensionality reduction are performed using a quantum simulator. The data is mapped to quantum states using a quantum angle encoding circuit. Similarity is calculated by combining a quantum kernel estimation circuit, candidate samples are screened and particles are generated. Weighted classification is performed by a quantum comparator and dynamic threshold adjustment.
It significantly improves data classification efficiency, enhances robustness in noisy environments, optimizes quantum resource utilization, is compatible with current quantum devices, and is suitable for large-scale, high-dimensional data scenarios such as medical image analysis and intelligent sensing.
Smart Images

Figure CN122045983A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of quantum computing and machine learning, and relates to an efficient and robust classification method based on quantum particles. Background Technology
[0002] In the fields of machine learning and data mining, classification methods are core technologies for handling tasks such as pattern recognition and data retrieval. Traditional classification methods face significant challenges when processing large-scale, high-dimensional data. For example, while the k-nearest neighbor algorithm is intuitive and requires no pre-training, its retrieval efficiency drops sharply as the data scale increases because it requires comparing each sample with a massive number of samples, making it difficult to meet the efficiency requirements of modern big data processing.
[0003] To improve processing efficiency, the particle-sphere computation method has been proposed, which reduces the actual processing scale by aggregating similar data. However, this method still relies on traditional distance metrics and struggles to effectively capture complex nonlinear relationships in high-dimensional data. Especially in noisy environments, its classification results often lack robustness and are easily affected by data interference.
[0004] Quantum computing, with its unique parallelism and quantum superposition properties, offers new possibilities for overcoming the performance bottlenecks of classical computing algorithms. Some existing quantum classification schemes attempt to improve computational efficiency using techniques such as quantum coding and quantum similarity calculation. However, these schemes generally suffer from problems such as excessive demand for quantum resources and limited hardware adaptability, making them difficult to deploy effectively on current mainstream noisy, medium-scale quantum devices.
[0005] Therefore, there is a significant gap in existing technologies: there is an urgent need for a classification method that can integrate the advantages of quantum computing with the characteristics of particle-sphere compression. This method needs to reduce quantum resource consumption, adapt to existing hardware conditions, enhance robustness in noisy environments, and effectively capture the nonlinear characteristics of high-dimensional data, thereby meeting the dual requirements of efficiency and reliability for large-scale data classification. Summary of the Invention
[0006] In view of this, the purpose of this invention is to provide an efficient and robust classification method based on quantum particles.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] An efficient and robust classification method based on quantum spheres, wherein the execution of the method depends on the quantum simulator default.qubit, which includes a quantum register, a quantum gate array, a quantum analog-to-digital converter (QADC), and a quantum comparator; The method includes the following steps: S1: Preprocess and reduce the dimensionality of the original dataset to obtain a low-dimensional dataset; S2: The classical eigenvalues of the low-dimensional dataset are mapped to quantum states by a quantum angle encoding circuit, wherein the quantum angle encoding circuit is implemented by a Pauli-Y rotating gate array; S3: Calculate the quantum similarity between the remaining samples and the benchmark samples using a quantum kernel estimation circuit. ,in Indicates sample s and z quantum similarity, and Samples s and z The quantum state; S4: The quantum comparator is used to filter a set of candidate samples with quantum similarity greater than or equal to a preset threshold; S5: Calculate the spheroid purity of the candidate sample set. ,in Number of samples in the primary category The total number of candidate samples; S6: Generate quantum spheres based on the purity of the spheres, and iteratively split the low-purity sample set; S7: Iteratively assign all samples to quantum spheres and output the final set of quantum spheres; S8: Calculate the Euclidean distance between the test sample and the center of each quantum particle sphere. ,in For the test sample feature vector, For the center of the grain, Represents the L2 norm; S9: Determine the test sample category based on the weighted average of the nearest neighbor particles.
[0009] Furthermore, the preprocessing and dimensionality reduction of the original dataset in S1 includes: Z-score normalization formula Standardize the data, among which The characteristic mean, The characteristic standard deviation; Missing values are filled with the mean of the feature column, and outliers are pruned. Linear Discriminant Analysis (LDA) was used for dimensionality reduction, and the target dimension after dimensionality reduction was: ,in This represents the number of categories.
[0010] Furthermore, the quantum angle encoding circuit in S2 is composed of a quantum feature mapping operator. Implementation, in which For the number of qubits, To normalize to The eigenvalues of the interval; The quantum state mapping is achieved by using the initial quantum state The input to the quantum angle encoding circuit is completed.
[0011] Furthermore, the quantum kernel estimation circuit in S3 is implemented through the following steps: The quantum state of the reference sample z Based on samples s Angle-encoded inverse operator Its function is to output quantum similarity.
[0012] Furthermore, the quantum comparator operation in S4 includes: Quantum similarity is converted into t-bit binary quantum states using a quantum analog-to-digital converter (QADC), where , For similarity accuracy; A cascaded CNOT gate and Pauli gate full quantum comparator is used for bit-level comparison; The similarity threshold is dynamically adjusted until the number of candidate samples meets the minimum sample number requirement.
[0013] Furthermore, the generation of quantum particle spheres in S6 includes: If the purity of the pellets P If the purity is greater than or equal to the purity threshold, quantum spheres are directly generated; like P If the sample size is less than the purity threshold, the sample set is split by category, and a subset with a sample size greater than or equal to the minimum sample size is retained.
[0014] Furthermore, the iterative sample allocation in S7 includes: Update the remaining sample set ,in S For the assigned sample set; If the number of remaining samples is less than the minimum number of samples, the remaining samples are merged into a single quantum ball.
[0015] Furthermore, the formula for calculating the weighting in S9 is as follows: ,in For particle purity, To normalize the similarity, For weight adjustment parameters; The test sample category is determined by the category with the largest sum of weighted weights.
[0016] The beneficial effects of this invention are as follows: (1) This invention significantly improves the overall efficiency of data classification by leveraging quantum parallelism. By mapping classical data to quantum states through quantum angle encoding, and using quantum kernel estimation circuits to calculate the similarity between samples in parallel, the time-consuming operation of comparing one by one in traditional methods is avoided. Quantum parallelism accelerates the similarity calculation and particle generation process, making it particularly suitable for large-scale high-dimensional data scenarios, such as medical image analysis or big data mining, and can significantly shorten processing time.
[0017] (2) This invention enhances robustness in noisy environments through a weighted classification mechanism. The technical solution integrates a weighted strategy that combines particle purity and similarity, effectively resisting the influence of data anomalies or interference. In the classification decision stage, the weight calculation of nearest neighbor particles comprehensively considers the purity factor and normalized similarity, making the classification results more stable and reliable, and suitable for noise-sensitive scenarios such as intelligent sensing.
[0018] (3) This invention optimizes quantum resource utilization and improves hardware adaptability. By simplifying quantum circuit design and combining it with dimensionality reduction techniques, the method does not rely on special devices such as quantum random access memory, effectively reducing the requirements for qubits and gate operations. This enables this invention to be adapted to current mainstream noisy intermediate-scale quantum devices (NISQ), solving the problem of high resource consumption in existing quantum schemes and providing a feasible path for practical industrial applications.
[0019] (4) This invention improves the efficiency of particle generation through a threshold screening mechanism. The technical solution introduces a quantum comparator and dynamic threshold adjustment, avoiding the sorting operation in traditional particle generation and reducing computational complexity. This design reduces time costs while ensuring the quality of the particle set, making it suitable for real-time or high-throughput data processing tasks.
[0020] 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
[0021] 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: Figure 1 This is an overall flowchart of the method in the embodiments of the present invention; Figure 2 This is the representation of the data on the Bloch sphere after the data is encoded by angle in this invention; Figure 3This is a schematic diagram of the quantum kernel similarity calculation in this invention; Figure 4 This is a detailed circuit diagram of the digital-to-analog converter to quantum comparator of the present invention; Figure 5 This is a schematic diagram of the generation of quantum spheres in this invention. Detailed Implementation
[0022] 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.
[0023] 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.
[0024] 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.
[0025] Please see Figures 1-5 This is an efficient and robust classification method based on quantum particles.
[0026] like Figure 1 As shown, this embodiment provides a method for generating high-efficiency pellets, including the following steps: S1: Preprocess the original dataset to obtain a standardized dataset; Specifically, the preprocessing process includes: S11: This example selects 16 labeled samples as the original dataset (N=16). Each sample has an initial feature dimension d=2, containing 2 categories (label 0 and label 1), with 10 samples of label 0 and 6 samples of label 1. The feature values range from [0,15]:
[0027]
[0028]
[0029] Z-score standardization was used to eliminate dimensional differences, and the mean of each feature dimension was calculated using the StandardScaler tool. and standard deviation Taking the first-dimensional feature as an example, the calculation is as follows: , The standardized formula is
[0030] The standardized value range of this dimension is: The second dimension feature is processed using the same logic; S12: Fill in the missing values of the standardized data. Assuming there are two missing values in the second dimension (index 5 and 12), the mean of the original second dimension data is calculated based on S11. First, fill the missing values with 7.8, then calculate the standardized value according to the standardization formula in S11: Finally, the standardized results of these two missing values were uniformly set to 0 to avoid quantum state mapping deviations caused by missing data in subsequent quantum encoding; outliers in the data were pruned, specifically the outlier of the second-dimensional feature (index 8, original value 16), based on the second-dimensional mean calculated by S11. Standard deviation First, calculate the reasonable range of the original data's mean ± 3 times the standard deviation: That is, the lower limit Upper limit The original value of 16 does not exceed the upper limit of 17.4, so no cropping is needed.
[0031] S13: Number of statistical data set categories =2, calculate the maximum dimension reduction dimension as -1=1, and then use linear discriminant analysis (LDA) for dimensionality reduction.
[0032] S2: Low-dimensional dataset quantum encoding preprocessing maps classical data to quantum states; Specifically, the quantum encoding process includes: S21: Perform MinMax normalization on the low-dimensional dataset. The normalization formula is as follows: ,in , The normalized feature value range is .
[0033] S22: Construct an angle encoding circuit. Since the target dimension is 1 after dimensionality reduction, the number of qubits... Constructing a quantum feature mapping operator in the form of tensor product ( (The normalized 1-dimensional eigenvalues); implemented through the Ry gate physical circuit of quantum gates, each Ry gate corresponds to 1 physical qubit, avoiding the superposition and interference of feature information.
[0034] S23: Convert classical data to a quantum state by calling the quantum register through the PennyLane framework, and set the initial quantum state.
[0035] Input angle encoding circuit, via After the action, it is converted into a quantum state corresponding to classical data. For example, normalized eigenvalues At that time, the quantum state is The conversion process is accomplished by manipulating the energy levels of the physical qubits through a quantum controller, and the results are stored in quantum register 1 in real time.
[0036] S3: Calculate the quantum similarity between the remaining samples and the benchmark samples; Specifically, the quantum similarity calculation process includes: S31: First, set the basic parameters for particle generation. According to the rules in claim 5, the initial value of the purity threshold is set to 0.8, the initial value of the minimum sample number is set to 5, the initial similarity threshold is set to 0.6, the minimum similarity threshold is set to 0.3, and the similarity accuracy of QADC digital-to-analog conversion is set. Set it to 0.001.
[0037] S32: Select a benchmark sample and initialize the remaining sample set. The original 16 samples, from One sample is randomly selected as the baseline sample. (In this embodiment, samples with index 7 and label 0 are extracted, and low-dimensional normalized feature values are used.) Then, the reference sample and the remaining samples are mapped to quantum states, and the reference sample is... Mapped to a quantum state in step S3 15 samples remaining Each is mapped to its corresponding quantum state via S3. Each quantum state is stored in an independent physical quantum register.
[0038] S33: Construct the quantum kernel estimation circuit, the circuit structure is as follows: Figure 2 As shown, the initial quantum state Called from the ground state unit of register 1, via generate Then, the Ry gate is manipulated by reverse microwave pulses to achieve sample processing. Angle-encoded inverse operator This forms a complete physical quantum circuit. Quantum similarity is obtained by estimating the circuit output through quantum kernels. The similarity value ranges from [0,1], and the closer the value is to 1, the higher the sample similarity.
[0039] S4: A set of candidate samples that meet the similarity requirements is obtained by screening using a quantum comparator; Specifically, the candidate sample set screening process includes: S41: The similarity information stored in the amplitude obtained in S54 is converted into an electrical signal by a quantum digital-to-analog converter (QADC), and then encoded into... Bit-binary quantum state; due to similarity accuracy , Next, the initial similarity threshold is converted to a binary quantum state. The initial similarity threshold of 0.8 is converted into a 10-bit binary quantum state according to the same encoding rules. The encoding result is stored in the threshold register of the quantum comparator to ensure consistency with the similarity encoding format.
[0040] S42: Performs quantum comparator operations, employing a 10-bit full quantum comparator circuit composed of 32 CNOT gates and 16 Pauli-X gates cascaded together. The gates are connected via superconducting transmission lines. The comparison order is from the most significant bit (MSB, 10th bit) to the least significant bit (LSB, 1st bit). Finally, it measures the quantum state of the auxiliary bit; if its output is in the |1 state... The state indicates that the similarity of the sample is greater than or equal to the threshold.
[0041] S43: In this example, 4 samples were selected that met the similarity threshold, which is less than the minimum sample size of 5. The similarity threshold was dynamically adjusted and the samples were re-selected, decreasing the similarity threshold to 0.55 in increments of 0.05. Steps S61-S64 were repeated, and the threshold was re-encoded as a binary quantum state. After another measurement, 6 samples were selected that met the sample size requirement, thus forming the final candidate sample set. ; S5: Calculate the particle purity of the candidate sample set; Specifically, the process of calculating particle purity includes: S51: Analyze the category labels of the candidate sample set and extract the candidate sample set. The category labels of the 6 samples were analyzed, and the number of samples with label 0 was 5, and the number of samples with label 1 was 1.
[0042] S52: Calculate particle purity and determine the main category. Label 0, according to formula Calculate purity, i.e. .
[0043] S6: Generate quantum spheres and iteratively split the low-purity sample set; Specifically, the process of quantum particle generation and splitting includes: S61: Determine if the purity of the pellets meets the standard; purity threshold. Candidate sample set purity The conditions for direct generation are met, and quantum particles are directly generated; to fully demonstrate the splitting logic, a preset purity threshold is assumed. (but It needs to be split.
[0044] S62: Split the candidate sample set by category. In this example, the sample set is obtained by splitting.
[0045] (Label 0, Sample indices 3, 5, 7, 9, 11) and subsample sets (Label 1, Sample Index 14); S63: Subsample set The largest number of samples If the sample size is 5, it will be discarded, and the subset will be retained. Its sample size The minimum sample size is 5, which meets the retention criteria. S7: Iterate through all samples and output the final set of quantum particles; Specifically, the sample iterative allocation and particle output process includes: S71: Update the remaining sample set, generating 5 samples from the spheres. Removed from the middle, after the update The number of samples is ; S72: Determine the number of remaining samples and iterate; the number of remaining samples... With a minimum sample size of 5, return to step S3 and repeat the process of selecting the baseline sample, calculating the quantum similarity, screening the candidate sample, calculating the purity, and generating the spheres. S73: Merge the remaining samples to generate spheres. In this example, after the 3rd iteration, the number of remaining samples is 3. The three samples are directly merged into a single quantum ball, and finally all generated quantum balls are output.
[0046] S8: Calculate the distance between the test sample and the center of each quantum particle, and screen the nearest neighbor particles; Specifically, the process of calculating the distance between the test sample and the center of the quantum particle and screening for nearest neighbor particles includes: S81: Obtain low-dimensional test samples after preprocessing and dimensionality reduction using the same process as S1. This ensures that the test samples are consistent with the data dimensions during the pellet generation stage; S82: The Euclidean distance is used to calculate the distance between the low-dimensional test sample and the center of each particle. The distance formula is as follows:
[0047] S83: Sort all the distances between the particles and the test sample, and select the particles with the highest similarity from smallest to largest distance. Nearest neighbor particles form a nearest neighbor particle set. ; S9: Calculate the weighted weight of each category in the nearest neighbor spheres to determine the category of the test sample and complete the classification; Specifically, the process of calculating the weighted average of neighboring particle categories and determining the test sample categories includes: S91: Convert the distance between the test sample and the center of the pellet into the original similarity and normalize it. The original similarity formula is:
[0048] ( (To avoid a denominator of 0), the normalization formula is:
[0049] If all original similarities are equal, then set them to 1.
[0050] S92: Calculate the overall weight based on particle purity, using the following formula:
[0051] in For particle purity, The weighting adjustment parameter is used to strengthen the decision weight of high-purity spheres; S93: Group the particles according to their main category and accumulate the comprehensive weight. Select the category with the largest total weight as the test sample category. If there is a tie, select the category with the highest average purity of the corresponding particles and output the final category label to complete the classification.
[0052] 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 highly efficient and robust classification method based on quantum spheres, characterized in that: The execution of the method depends on the quantum simulator default.qubit, which includes a quantum register, a quantum gate array, a quantum analog-to-digital converter (QADC), and a quantum comparator. The method includes the following steps: S1: Preprocess and reduce the dimensionality of the original dataset to obtain a low-dimensional dataset; S2: The classical eigenvalues of the low-dimensional dataset are mapped to quantum states by a quantum angle encoding circuit, wherein the quantum angle encoding circuit is implemented by a Pauli-Y rotating gate array; S3: Calculate the quantum similarity between the remaining samples and the benchmark samples using a quantum kernel estimation circuit. ,in Indicates sample s and z quantum similarity, and Samples s and z The quantum state; S4: The quantum comparator is used to filter a set of candidate samples with quantum similarity greater than or equal to a preset threshold; S5: Calculate the spheroid purity of the candidate sample set. ,in Number of samples in the primary category The total number of candidate samples; S6: Generate quantum spheres based on the purity of the spheres, and iteratively split the low-purity sample set; S7: Iteratively assign all samples to quantum spheres and output the final set of quantum spheres; S8: Calculate the Euclidean distance between the test sample and the center of each quantum particle sphere. ,in For the test sample feature vector, For the center of the grain, Represents the L2 norm; S9: Determine the test sample category based on the weighted average of the nearest neighbor particles.
2. The efficient and robust classification method based on quantum spheres according to claim 1, characterized in that: The preprocessing and dimensionality reduction of the original dataset in S1 includes: Z-score normalization formula Standardize the data, among which The characteristic mean, The characteristic standard deviation; Missing values are filled with the mean of the feature column, and outliers are pruned. Linear Discriminant Analysis (LDA) was used for dimensionality reduction, and the target dimension after dimensionality reduction was: ,in This represents the number of categories.
3. The efficient and robust classification method based on quantum spheres according to claim 1, characterized in that: The quantum angle encoding circuit in S2 is composed of a quantum feature mapping operator. Implementation, in which For the number of qubits, To normalize to The eigenvalues of the interval; The quantum state mapping is achieved by using the initial quantum state The input to the quantum angle encoding circuit is completed.
4. The efficient and robust classification method based on quantum spheres according to claim 1, characterized in that: The quantum kernel estimation circuit in S3 is implemented through the following steps: The quantum state of the reference sample z Based on samples s Angle-encoded inverse operator Its function is to output quantum similarity.
5. The efficient and robust classification method based on quantum spheres according to claim 1, characterized in that: The quantum comparator operation in S4 includes: Quantum similarity is converted into t-bit binary quantum states using a quantum analog-to-digital converter (QADC), where , For similarity accuracy; A cascaded CNOT gate and Pauli gate full quantum comparator is used for bit-level comparison; The similarity threshold is dynamically adjusted until the number of candidate samples meets the minimum sample number requirement.
6. The efficient and robust classification method based on quantum spheres according to claim 1, characterized in that: The generation of quantum spheres in S6 includes: If the purity of the pellets P If the purity is greater than or equal to the purity threshold, quantum spheres are directly generated; like P If the sample size is less than the purity threshold, the sample set is split by category, and a subset with a sample size greater than or equal to the minimum sample size is retained.
7. The efficient and robust classification method based on quantum spheres according to claim 1, characterized in that: The iterative sample allocation in S7 includes: Update the remaining sample set ,in S For the assigned sample set; If the number of remaining samples is less than the minimum number of samples, the remaining samples are merged into a single quantum ball.
8. The efficient and robust classification method based on quantum spheres according to claim 1, characterized in that: The formula for calculating the weighting in S9 is as follows: ,in For particle purity, To normalize the similarity, For weight adjustment parameters; The test sample category is determined by the category with the largest sum of weighted weights.