Temperature and humidity sensor data high-dimensional feature compression method based on quantum approximate optimization
Through quantum entanglement coding and quantum approximate optimization algorithm, combined with genetic algorithm and quantum gradient adaptive mutation, the problem of capturing nonlinear coupling relationships in temperature and humidity sensor data and feature selection in high-noise environments is solved, achieving efficient and robust feature compression.
Patent Information
- Application Number
- CN202510730948.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-09-12
AI Technical Summary
Existing technologies find it difficult to effectively capture the complex nonlinear coupling relationship between features in temperature and humidity sensor data, and their optimization performance is limited in high-noise environments. Traditional methods lack adaptability and goal orientation.
The temperature and humidity sensor data are mapped into quantum states through quantum entanglement coding, and a variational quantum circuit is constructed under the quantum approximate optimization algorithm. The circuit parameters are dynamically updated in combination with the genetic algorithm, and the quantum gradient-guided adaptive mutation operation is used to generate an optimized candidate feature subset.
It improves the modeling accuracy of nonlinear relationships in high-dimensional time series data, realizes adaptive feature selection in high-noise environments, avoids local optimality, and improves the efficiency and robustness of feature selection.
Smart Images

Figure CN120632401A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of quantum computing and sensor data processing, and in particular to a high-dimensional feature compression method for temperature and humidity sensor data based on quantum approximate optimization. Background Art
[0002] With the rapid development of the Internet of Things (IoT), temperature and humidity sensors have been widely used in fields such as environmental monitoring, industrial automation, and agricultural IoT. The high-dimensional time series data generated by these sensors typically contains multidimensional features such as temperature, humidity, and timestamps, providing rich input for data analysis and modeling. However, processing high-dimensional data faces challenges such as the curse of dimensionality, computational complexity, and redundant features, necessitating the urgent need for efficient feature selection and compression methods. Traditional feature selection methods, such as statistical correlation analysis, principal component analysis (PCA), and recursive feature elimination (RFE), achieve dimensionality reduction through linear or simple nonlinear transformations and are widely used in sensor data processing. Furthermore, machine learning-based feature selection methods, such as Lasso regression and decision tree feature importance evaluation, have further improved the accuracy of feature selection. In recent years, the rise of quantum computing has provided new perspectives for high-dimensional data processing. Quantum approximate optimization algorithms (QAOAs) have been increasingly explored for feature selection tasks due to their potential in combinatorial optimization problems. For example, feature mapping methods based on quantum amplitude coding can embed high-dimensional data into quantum states, exploiting quantum superposition and entanglement to capture complex relationships between features. However, these methods are still in the preliminary exploratory stage and have not yet formed a systematic feature selection framework. In particular, they have limited performance when dealing with the high noise and nonlinear characteristics of temperature and humidity sensor data.
[0003] Although the above-mentioned existing technologies have alleviated the challenges of high-dimensional data processing to a certain extent, they still have significant shortcomings, especially when processing time series data from temperature and humidity sensors. First, traditional methods, such as PCA and Lasso regression, mainly rely on linear or simple nonlinear assumptions, and it is difficult to effectively capture the complex nonlinear coupling relationship between features in temperature and humidity data, such as the interaction effect between temperature and humidity. Second, existing quantum feature selection methods usually use variational circuits with static parameter configurations, lacking adaptive adjustment to data noise and the importance of dynamic features, resulting in limited optimization performance in high-noise environments. In addition, traditional genetic algorithms rely on random crossover and mutation in feature selection, lack goal orientation, are prone to falling into local optimality, and have difficulty in efficiently exploring high-dimensional feature spaces. Summary of the Invention
[0004] The purpose of this section is to summarize some aspects of the embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the abstract and title of this application to avoid obscuring the purpose of this section, the abstract and the title of the invention, and such simplifications or omissions should not be used to limit the scope of the present invention.
[0005] In view of the above existing problems, the present invention is proposed. Therefore, the present invention provides a high-dimensional feature compression method for temperature and humidity sensor data based on quantum approximate optimization to solve the problems raised in the background technology.
[0006] To solve the above technical problems, the present invention provides the following technical solution: a high-dimensional feature compression method for temperature and humidity sensor data based on quantum approximate optimization, comprising:
[0007] Input the time series data matrix of the temperature and humidity sensor and perform quantum entanglement encoding to generate quantum states;
[0008] According to the quantum state, constructing a variational quantum circuit under a quantum approximate optimization algorithm, and dynamically updating the quantum circuit through a genetic algorithm to obtain an output quantum state;
[0009] Performing projection measurement on the output quantum state to generate a candidate feature subset, updating a population in a genetic algorithm through quantum interference, performing a dynamic crossover operation on the population to generate a new candidate feature subset;
[0010] The mutation probability is calculated using quantum gradient, and an adaptive mutation operation is performed on the new candidate feature subset to obtain an optimized candidate feature subset.
[0011] As a preferred solution of the high-dimensional feature compression method of temperature and humidity sensor data based on quantum approximation optimization described in the present invention, wherein: the input temperature and humidity sensor time series data matrix and quantum entanglement encoding are performed to generate quantum states, including:
[0012] Preprocess each sample eigenvalue of the time series data matrix;
[0013] Calculate dynamic adjustment parameters based on ambient noise level;
[0014] Map each sample eigenvalue to a quantum state.
[0015] As a preferred solution of the high-dimensional feature compression method of temperature and humidity sensor data based on quantum approximate optimization described in the present invention, the environmental noise level includes:
[0016] Calculate the variance of each eigenvalue of the time series data matrix;
[0017] The average of all sample feature variances is taken as the ambient noise variance to measure the ambient noise level.
[0018] As a preferred solution of the high-dimensional feature compression method of temperature and humidity sensor data based on quantum approximate optimization described in the present invention, wherein: mapping each sample eigenvalue into a quantum state includes:
[0019] Obtain the weight of each feature according to the square of each eigenvalue, and normalize the weight;
[0020] The normalized weights are multiplied by the corresponding quantum bit ground state and summed to generate the quantum state.
[0021] As a preferred solution of the high-dimensional feature compression method of temperature and humidity sensor data based on quantum approximate optimization described in the present invention, wherein: the construction of a variational quantum circuit under the quantum approximate optimization algorithm includes:
[0022] Each layer of the quantum circuit acts on the quantum state through a parameterized Hamiltonian;
[0023] The Hamiltonian consists of two parts. The first part is the weighted sum of the single-bit Pauli-Z operator of each quantum bit multiplied by the corresponding dynamic parameter, and the second part is the weighted sum of the product of the Pauli-Z operators of each pair of quantum bits multiplied by the corresponding dynamic parameter. The dynamic parameters are updated by the crossover and mutation operations of the genetic algorithm.
[0024] As a preferred solution of the method for high-dimensional feature compression of temperature and humidity sensor data based on quantum approximate optimization described in the present invention, the genetic algorithm includes:
[0025] Initialize the parameter set population;
[0026] Selecting a parent parameter set from the parameter set population;
[0027] Performing a two-point crossover operation on the parent parameter set to generate a child parameter set;
[0028] Performing normal distribution perturbation mutation on the offspring parameter set to generate a new parameter set, updating each layer in the quantum circuit to obtain an output quantum state, and updating the parameter set population.
[0029] As a preferred solution of the method for high-dimensional feature compression of temperature and humidity sensor data based on quantum approximate optimization described in the present invention, the quantum interference update includes:
[0030] Perform projection measurement on the output quantum state to obtain the probability distribution of the ground state of each quantum bit, and determine the candidate feature subset based on the probability threshold;
[0031] Convert the optimal offspring parameter set in the parameter set population into the corresponding quantum state;
[0032] Calculate the Jaccard similarity between the candidate feature subset and the optimal offspring parameter set;
[0033] Construct an interfering quantum state by performing a weighted summation of the output quantum state and the quantum state of the optimal offspring parameter set;
[0034] The interference quantum state is measured, and the candidate feature subset is updated to replace the worst individual in each parameter set population.
[0035] As a preferred solution of the high-dimensional feature compression method of temperature and humidity sensor data based on quantum approximate optimization described in the present invention, the dynamic crossover operation includes:
[0036] A fitness function of the candidate feature subset is created, where the fitness function is the mutual information between each feature in the candidate feature subset and the target variable.
[0037] As a preferred solution of the high-dimensional feature compression method of temperature and humidity sensor data based on quantum approximate optimization described in the present invention, the adaptive mutation operation includes:
[0038] Calculate the quantum gradient and decide whether each feature mutates based on the mutation probability, which is the absolute value of the gradient of each feature divided by the sum of the absolute values of the gradients of all features;
[0039] If a feature is selected for mutation, the gradient of the fitness with respect to the parameter corresponding to the feature is calculated, and the sign of the gradient is used to decide whether to remove the feature from the candidate feature subset or add it to the feature subset.
[0040] As a preferred solution of the method for high-dimensional feature compression of temperature and humidity sensor data based on quantum approximate optimization described in the present invention, it also includes:
[0041] The quantum gradient is obtained by a parameter shift rule;
[0042] The shift rule is to calculate, for each quantum circuit parameter, half the difference between the expected value of the Hamiltonian after increasing and decreasing the parameter by half pi.
[0043] Compared with the prior art, the invention has the following beneficial effects:
[0044] 1. By mapping the time series data of temperature and humidity sensors into quantum states through quantum entanglement coding, and using exponential decay factors to express the nonlinear coupling relationship between features, combined with quantum approximate optimization algorithms and quantum interference mechanisms, this method effectively captures the complex interaction effects between temperature and humidity features. Compared with the limitations of traditional methods that rely on linear or simple nonlinear assumptions, this method can improve the modeling accuracy of nonlinear relationships in high-dimensional time series data, thereby generating representative candidate feature subsets and optimizing subsequent data analysis and modeling performance;
[0045] 2. By dynamically adjusting the quantum coding parameters according to the environmental noise level and combining the genetic algorithm to dynamically optimize the parameters in the quantum variational circuit, adaptive feature selection of high-noise temperature and humidity sensor data is achieved; in addition, the adaptive mutation operation guided by the quantum gradient replaces the random mutation of the genetic algorithm, providing a goal-oriented optimization path to avoid falling into local optimality; compared with the static parameter configuration of existing quantum feature selection methods and the randomness of traditional genetic algorithms, the present invention can show higher optimization efficiency and robustness in high-noise environments, and is suitable for feature compression requirements in actual Internet of Things scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive effort. Among them:
[0047] Figure 1 This is an overall flow chart of a method for compressing high-dimensional features of temperature and humidity sensor data based on quantum approximate optimization according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the following detailed description of the specific embodiments of the present invention is given in conjunction with the accompanying drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in this field without creative work should fall within the scope of protection of the present invention.
[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0050] Secondly, the term "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in various places throughout this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive of other embodiments.
[0051] The present invention is described in detail with reference to schematic diagrams. For ease of illustration, cross-sectional views of device structures may be partially enlarged and not to scale when describing embodiments of the present invention. Furthermore, the schematic diagrams are merely illustrative and should not limit the scope of the present invention. Furthermore, in actual production, the three-dimensional dimensions of length, width, and depth should be included.
[0052] In the description of the present invention, it should be noted that the terms "upper, lower, inner, and outer" and other references to orientations or positional relationships are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first, second, or third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0053] In this disclosure, unless otherwise specified or limited, the terms "mounted," "connected," and "connected" should be interpreted broadly. For example, they may refer to fixed, removable, or integral connections. They may also refer to mechanical, electrical, or direct connections, indirect connections through an intermediary, or internal communication between two components. Those skilled in the art will understand the specific meanings of these terms in this disclosure.
[0054] Example 1
[0055] Reference Figure 1 , which is the first embodiment of the present invention, provides a high-dimensional feature compression method for temperature and humidity sensor data based on quantum approximate optimization, including:
[0056] S1, input the time series data matrix of the temperature and humidity sensor and perform quantum entanglement encoding to generate quantum state;
[0057] Specifically, by setting the sampling interval of the temperature and humidity sensor (or using an integrated temperature and humidity sensor, such as BME280) (e.g., collecting data once every 1 second), the time series data of temperature and humidity are respectively obtained, and the obtained time series data of temperature and humidity are expressed in matrix form;
[0058] Furthermore, input the temperature and humidity sensor time series data matrix Where N is the number of samples, D is the number of features, and each row of the time series data matrix is the characteristic value of a sample (e.g., temperature and humidity);
[0059] Specifically, Z-score standardization (zero mean, unit variance) is applied to each sample eigenvalue of the time series data matrix to ensure that the eigenvalues of the time series data matrix are on a uniform scale;
[0060] Specifically, the variance of each eigenvalue of the time series data matrix is calculated, which can be expressed as follows:
[0061]
[0062] in, Expressed as the variance of the kth feature, x ik represents the value of the i-th sample on the k-th feature, represents the mean of the kth feature;
[0063] Specifically, the average value of all sample feature variances is taken as the ambient noise variance to measure the ambient noise level, and the result is:
[0064]
[0065] Specifically, the dynamic adjustment parameters are calculated based on the ambient noise level to obtain:
[0066]
[0067] Among them, β represents the dynamic adjustment parameter;
[0068] It should be noted that designing dynamic adjustment parameters based on the ambient noise level can suppress the interference caused by ambient noise and is suitable for high-noise scenarios of temperature and humidity sensor data;
[0069] Specifically, the characteristic amplitude is calculated based on the square of each eigenvalue and the dynamic adjustment parameters to obtain the weight of each feature:
[0070]
[0071] Among them, a k Expressed as the weight of the kth feature;
[0072] It should be noted that if a quantum simulator is used, then a k Loaded into quantum registers for processing; if using real quantum hardware, processed through encoding gates of characteristic amplitudes;
[0073] Specifically, the weights are normalized, and then the normalized weights are multiplied by the corresponding quantum bit ground state and summed to generate the quantum state:
[0074]
[0075] Among them, |ψ i > is the quantum state, |k> is the kth quantum bit ground state (e.g., |0>, |1>,…, |D-1>), and it is required qubits represent D basis states, Indicates rounding up;
[0076] It should be noted that the natural entanglement properties of qubits are used to express the nonlinear correlation between temperature and humidity characteristics. For example, the interaction effect of temperature and humidity is reflected in the phase of the superposition state;
[0077] For example, assume that the temperature and humidity sensor data matrix X contains N = 100 samples, D = 4 features (e.g., temperature x i1 , humidity x i2 , timestamp x i3 , temperature change rate x i4 ); sample x i = [0.8, 0.6, 0.2, 0.4] (normalized values), representing temperature, humidity, timestamp, and temperature change rate, respectively; the environmental noise level is estimated as σ 2 =0.1,
[0078] Through the above formula, we get: Temperature characteristics: x i1 =0.8, weight Humidity characteristics: x i2 =0.6, weight Timestamp feature: x i3 =0.2, weight Temperature change rate characteristics: x i4 =0.4, weight
[0079] Normalization factor:
[0080] Quantum state:
[0081] Conclusion: Weights reflect the importance of features (e.g., timestamp x i3 The weight of the feature "timestamp" is the largest, indicating that the timestamp occupies a dominant position compared to other features. The relative size and phase relationship between the weights of the temperature and humidity features (0.0453 and 0.1834) encode their interaction. For example, temperature and humidity are negatively correlated in physical scenarios (such as high temperature and low humidity). The superposition of quantum states can further adjust the weights through subsequent quantum interference to enhance the expression of the relationship between temperature and humidity, thereby highlighting the specific coupling relationship between the two features (such as coordinated changes in the environment).
[0082] S2. Based on the quantum state, a variational quantum circuit is constructed under the quantum approximate optimization algorithm, and the quantum circuit is dynamically updated through the genetic algorithm to obtain the output quantum state;
[0083] Specifically, input the quantum state and establish the initial parameter set Construct a variational quantum circuit U(θ) under the L-layer quantum approximate optimization algorithm. Each layer of the variational quantum circuit acts on the quantum state through a parameterized Hamiltonian and is expressed as:
[0084]
[0085] in, is the continuous multiplication operation from the 1st layer to the Lth layer, indicating that the variational quantum circuit consists of L consecutive quantum operations; θ l Represented as the variational parameter of the lth layer, it is used to control the quantum operation intensity of each layer; The quantum evolution operator represents the lth layer acting on the i-th quantum state through the Hamiltonian and the variational parameter; H l Expressed as a Hamiltonian;
[0086] It should be noted that although more layers can increase the expressive power of variational quantum circuits, it will also increase the computational complexity and optimization difficulty of variational quantum circuits. Therefore, it is necessary to adjust the Hamiltonian to achieve the balance of the variational quantum circuit itself.
[0087] Specifically, the Hamiltonian can be further expressed as:
[0088]
[0089] in, Expressed as a single-qubit term, representing the independent contribution of each feature, α k (l) is the single-bit Pauli-Z operator Z for the k-th qubit in the l-th layer k Dynamic weight parameters of ; It is expressed as a two-qubit interaction term, which represents the coupling relationship between the features, γ km (l) is represented by the Pauli-Z operator Z for the kth and mth qubits in the lth layer k Z m Dynamic weight parameters of ;
[0090] Furthermore, the quantum circuit is dynamically updated through a genetic algorithm to obtain the output quantum state;
[0091] Specifically, the genetic algorithm calculation steps are as follows:
[0092] Based on the initial parameter set θ, P parameter sets are generated. Each parameter set includes the parameters corresponding to the Hamiltonian of each quantum bit (single bit) and each pair of quantum bits (double bit). The number of parameters of the Hamiltonian in this parameter set is
[0093] Select a parent parameter set from the parameter set population;
[0094] Specifically, the selection method is tournament selection, that is, k parameter sets are randomly selected from the population to form a tournament group, each parameter set contains α k (l) and γ km (l) Evaluate the fitness of each extracted parameter set and select the parameter set with the highest fitness from the k parameter sets as the parent parameter set. Repeat the above steps to select two parent parameter sets.
[0095] Perform a two-point crossover operation on the parent parameter set to generate the child parameter set;
[0096] Specifically, by selecting the parent parameter set (e.g., θ A and θ B ), decide whether to perform the crossover operation with a predetermined crossover probability (such as 0.7). If not, the parent parameter set is retained directly. If it is performed, two crossover points (such as p1 and p2) are randomly selected in the parent parameter set, and the two selected crossover points are divided into three sections, namely the front section: from the beginning to p1; the middle section: from p1+1 to p2; and the back section: from p2+1 to the end. Parameter exchange is performed, and the offspring parameter set θ is set C1 :The front and back segments come from θ A , the middle section comes from θ B ; Let the offspring parameter set θ C2 :The front and back segments come from θ B , the middle section comes from θ A ;
[0097] It should be noted that two-point crossover generates new parameter combinations by exchanging fragments of the parent parameter set, exploring the variational quantum circuit parameter space to optimize feature selection. In the temperature and humidity sensor data, the crossover operation combines the high-weight temperature parameter of one parent with the humidity interaction parameter of another parent to generate a parameter set that is more suitable for capturing nonlinear relationships.
[0098] Perform normal distribution perturbation mutation on the offspring parameter set to generate a new parameter set, update each layer in the quantum circuit, obtain the output quantum state, and update the parameter set population;
[0099] Specifically, the mutation operation is similar to the crossover operation. A predetermined mutation probability (such as 0.2) is used to determine whether to perform the mutation. If the mutation is performed, a random perturbation value that obeys the normal distribution (initial mean is 0, standard deviation is 0.1) is generated and added to the original α k (l) and γ km (l) Generate a new parameter set and obtain the output quantum state;
[0100] It should be noted that through genetic algorithms, the optimal offspring parameter set can be found, thereby updating the parameter set population and improving the efficiency and robustness of feature selection of temperature and humidity sensor data;
[0101] S3. Perform projection measurement on the output quantum state to generate a candidate feature subset, and update the population in the genetic algorithm through quantum interference, perform dynamic crossover operation on the population, and generate a new candidate feature subset;
[0102] Furthermore, a projection measurement is performed on the output quantum state to obtain the probability distribution of the ground state of each quantum bit, and a candidate feature subset is determined with a probability threshold of 0.5;
[0103] Specifically, the projection measurement is performed by a quantum simulator or quantum hardware and repeated multiple times (e.g., 1000 times) to obtain a statistically stable probability distribution;
[0104] Specifically, for each feature k, its probability P(k) is checked. If P(k) is greater than a predetermined probability (e.g., 0.5), the feature k is included in the candidate feature subset, which represents the feature recommended for the current quantum state.
[0105] Furthermore, the optimal offspring parameter set in the parameter set population is converted into the corresponding quantum state, for example, the optimal offspring parameter set Mapped to the corresponding quantum state, if (temperature and humidity), and D = 4, using two qubits, the quantum state is |11> (indicating that features 1 and 2 are selected at the same time);
[0106] Furthermore, the Jaccard similarity between the candidate feature subset and the optimal offspring parameter set is calculated:
[0107]
[0108] Among them, S q Represented as a candidate feature subset;
[0109] It should be noted that if the intersection and union are non-empty, the similarity range is [0, 1], and the larger the similarity value, the more similar the two sets are;
[0110] Furthermore, the phase angle is calculated based on the Jaccard similarity:
[0111]
[0112] Among them, the phase angle Used to control the relative weights of quantum states in quantum interference processes;
[0113] Furthermore, the interference quantum state is constructed, and the output quantum state is weightedly summed with the quantum state of the optimal offspring parameter set to obtain:
[0114]
[0115] in, is the phase factor, used to adjust |φ c >Contribution, |φ c > is represented as a classical quantum state, which is converted from the optimal descendant parameter set; |ψ out > is represented as the output quantum state;
[0116] Furthermore, the interference quantum state is measured, the candidate feature subset is updated, and the worst individual in each parameter set population is replaced;
[0117] Specifically, the interference quantum state is measured through the phase angle, if (similarity is 0), indicating interference enhancement |φ c >Contribution; (similarity is 1), indicating that interference offsets differences and strengthens common features;
[0118] It should be noted that replacing the worst individuals can ensure the gradual improvement of population quality and optimize the selection of feature subsets of temperature or humidity data, for example, giving priority to retaining temperature features and eliminating the redundancy of humidity features;
[0119] Furthermore, a fitness function of the candidate feature subset is created, where the fitness function is the mutual information between each feature in the candidate feature subset and the target variable;
[0120] Specifically, the fitness function F(S) is expressed as:
[0121]
[0122] Among them, I(Y;X k ) is represented as feature X in the candidate feature subset k The mutual information with the target variable Y is further calculated by the following formula:
[0123] I(Y;X k )=H(Y)-H(Y|X k )
[0124] Among them, H(Y|X k ) is expressed as conditional entropy, H(Y) is expressed as the entropy of the target variable Y;
[0125] It should be noted that in the temperature and humidity sensor data processing, the target variable may be the environmental state (such as "suitable" or "unsuitable"), and the feature is temperature or humidity. Mutual information can ensure that the temperature or humidity features that contribute most to the target variable information are preferentially selected, thereby improving the pertinence of the candidate feature subset;
[0126] S4. Using quantum gradient to calculate the mutation probability, perform adaptive mutation operation on the new candidate feature subset to obtain the optimized candidate feature subset;
[0127] Furthermore, the quantum gradient is calculated and obtained by the parameter shift rule;
[0128] The shift rule is to calculate, for each quantum circuit parameter, half the difference between the expectation value of the Hamiltonian at half pi after the parameter is increased and decreased:
[0129]
[0130] Where, C = -F(S), θ j Expressed as the dynamic weight parameter α in the Hamiltonian k (l) or γ km (l);
[0131] Specifically, θ j Increase Run the variational quantum circuit to generate a new output quantum state get θ j reduce Run the variational quantum circuit to generate a new output quantum state get Calculating half of the difference gives For all parameters θ j , repeat the above steps to generate the gradient vector
[0132] It should be noted that in the temperature and humidity data, the adaptive variation is guided by gradients to prioritize the adjustment of parameters that have a great impact on the quality of the candidate feature subsets, thereby improving the optimization efficiency;
[0133] Specifically, the mutation probability is used to determine whether each feature mutates. Each feature k usually corresponds to one or more parameters α k (l) or γ km (l), in order to simplify the calculation, it is assumed that the gradient of each feature k is determined by the corresponding α k The gradient representation of (l) is that if feature k involves multiple α k (l) or γ km (l), we can take the average value or the maximum absolute value to get the aggregate gradient of the feature:
[0134]
[0135] Among them, g k Expressed as the aggregate gradient of the kth feature;
[0136] Specifically, the sum G of the absolute values of all feature gradients is calculated, which is expressed as:
[0137]
[0138] Specifically, calculate the mutation probability P for each feature k mut (k):
[0139]
[0140] It should be noted that the mutation probability is based on the quantum gradient, and the temperature or humidity features that are sensitive to the objective function are preferentially selected for mutation to enhance the goal-oriented nature of the mutation operation;
[0141] Specifically, if a feature is selected for mutation, the gradient of the fitness with respect to the parameter corresponding to the feature is calculated, and the sign of the gradient is used to decide whether to remove the feature from the candidate feature subset or add it to the feature subset;
[0142] Specifically, calculate the gradient of the fitness function with respect to the parameter corresponding to feature k:
[0143]
[0144] Specifically, based on automatic differentiation estimation, we get:
[0145]
[0146] or
[0147]
[0148] Specifically, according to the above gradient formula, take the average gradient:
[0149]
[0150] Specifically, when It means increasing α k (l) It will reduce the fitness. Feature k contributes little to the current subset or introduces redundancy. Therefore, feature k needs to be removed from S. It means increasing α k (l) It will improve or maintain the fitness. Feature k helps to improve the quality of the candidate feature subset, so feature k is added to S. Whether it is removed or added, the candidate feature subset is updated.
[0151] It should be noted that the efficient calculation of quantum gradients through parameter shifting rules provides goal-orientedness for adaptive mutation, thereby optimizing the feature selection of temperature and humidity sensor data and improving the capture of nonlinear relationships and noise robustness.
[0152] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Furthermore, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present application may be implemented in various computer languages, for example, object-oriented programming language Java and interpreted scripting language JavaScript, etc.
[0153] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0154] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0156] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0157] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A high-dimensional feature compression method for temperature and humidity sensor data based on quantum approximate optimization, characterized by: include: Input the time series data matrix of the temperature and humidity sensor and perform quantum entanglement encoding to generate quantum states; According to the quantum state, constructing a variational quantum circuit under a quantum approximate optimization algorithm, and dynamically updating the quantum circuit through a genetic algorithm to obtain an output quantum state; Performing projection measurement on the output quantum state to generate a candidate feature subset, updating a population in a genetic algorithm through quantum interference, performing a dynamic crossover operation on the population to generate a new candidate feature subset; The mutation probability is calculated using quantum gradient, and an adaptive mutation operation is performed on the new candidate feature subset to obtain an optimized candidate feature subset.
2. The method for compressing high-dimensional features of temperature and humidity sensor data based on quantum approximate optimization according to claim 1, characterized in that: The input of the temperature and humidity sensor time series data matrix and the quantum entanglement encoding to generate a quantum state include: Preprocess each sample eigenvalue of the time series data matrix; Calculate dynamic adjustment parameters based on ambient noise level; Map each sample eigenvalue to a quantum state.
3. The method for compressing high-dimensional features of temperature and humidity sensor data based on quantum approximate optimization according to claim 2, characterized in that: The environmental noise level includes: Calculate the variance of each eigenvalue of the time series data matrix; The average of all sample feature variances is taken as the ambient noise variance to measure the ambient noise level.
4. The method for compressing high-dimensional features of temperature and humidity sensor data based on quantum approximate optimization according to claim 2, characterized in that: Mapping each sample eigenvalue to a quantum state includes: Obtain the weight of each feature according to the square of each eigenvalue, and normalize the weight; The normalized weights are multiplied by the corresponding quantum bit ground state and summed to generate the quantum state.
5. The method for compressing high-dimensional features of temperature and humidity sensor data based on quantum approximate optimization according to claim 1, characterized in that: The method of constructing a variational quantum circuit under a quantum approximate optimization algorithm includes: Each layer of the quantum circuit acts on the quantum state through a parameterized Hamiltonian; The Hamiltonian consists of two parts. The first part is the weighted sum of the single-bit Pauli-Z operator of each quantum bit multiplied by the corresponding dynamic parameter, and the second part is the weighted sum of the product of the Pauli-Z operators of each pair of quantum bits multiplied by the corresponding dynamic parameter. The dynamic parameters are updated by the crossover and mutation operations of the genetic algorithm.
6. The method for compressing high-dimensional features of temperature and humidity sensor data based on quantum approximate optimization according to claim 1, characterized in that: The genetic algorithm comprises: Initialize the parameter set population; Selecting a parent parameter set from the parameter set population; Performing a two-point crossover operation on the parent parameter set to generate a child parameter set; Performing normal distribution perturbation mutation on the offspring parameter set to generate a new parameter set, updating each layer in the quantum circuit to obtain an output quantum state, and updating the parameter set population.
7. The method for compressing high-dimensional features of temperature and humidity sensor data based on quantum approximate optimization according to claim 1, characterized in that: The quantum interference update includes: Perform projection measurement on the output quantum state to obtain the probability distribution of the ground state of each quantum bit, and determine the candidate feature subset based on the probability threshold; Convert the optimal offspring parameter set in the parameter set population into the corresponding quantum state; Calculate the Jaccard similarity between the candidate feature subset and the optimal offspring parameter set; Construct an interfering quantum state by performing a weighted summation of the output quantum state and the quantum state of the optimal offspring parameter set; The interference quantum state is measured, and the candidate feature subset is updated to replace the worst individual in each parameter set population.
8. The method for compressing high-dimensional features of temperature and humidity sensor data based on quantum approximate optimization according to claim 1, characterized in that: Dynamic crossover operations, including: A fitness function of the candidate feature subset is created, where the fitness function is the mutual information between each feature in the candidate feature subset and the target variable.
9. The method for compressing high-dimensional features of temperature and humidity sensor data based on quantum approximate optimization according to claim 1 or 8, characterized in that: The adaptive mutation operation includes: Calculate the quantum gradient and decide whether each feature mutates based on the mutation probability, which is the absolute value of the gradient of each feature divided by the sum of the absolute values of the gradients of all features; If a feature is selected for mutation, the gradient of the fitness with respect to the parameter corresponding to the feature is calculated, and the sign of the gradient is used to decide whether to remove the feature from the candidate feature subset or add it to the feature subset.
10. The method for compressing high-dimensional features of temperature and humidity sensor data based on quantum approximate optimization according to claim 9, characterized in that: Also includes: The quantum gradient is obtained by a parameter shift rule; The shift rule is to calculate, for each quantum circuit parameter, half the difference between the expected value of the Hamiltonian after increasing and decreasing the parameter by half pi.
Citation Information
Cited By
Drainage port dynamic management system based on quantum parameter optimization and air-ground collaborative awareness
CN120877142A
A quantum parameter optimization and air-ground collaborative perception dynamic management system for a drainage outlet
CN120877142B