Quantum machine learning model construction and generation method
By constructing parameterized quantum state mapping functions and tunable quantum circuits, and combining variational autoencoders, Fourier embeddings, and sparse entanglement mechanisms, the adaptability and resource utilization of quantum machine learning models in diverse tasks are solved, achieving efficient quantum feature representation and stable model training.
Patent Information
- Application Number
- CN202511083637.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-12-02
AI Technical Summary
Existing quantum machine learning model construction methods lack systematic quantum state feature mapping strategies, making it difficult to adapt to diverse task requirements. There is a trade-off between modeling accuracy and quantum bit resource utilization. Furthermore, different quantum hardware platforms have poor adaptability to parameterized quantum circuits, which limits the model's portability and scalability.
By acquiring classical data feature sets, normalizing them, constructing parameterized quantum state mapping functions, combining tunable quantum circuits, employing variational autoencoders, Fourier embeddings, and sparse entanglement mechanisms, designing quantum loss functions, iteratively training the model through a quantum optimizer, and finally evaluating the model's generalization ability through a lightly perturbated validation set.
It improves the compactness and trainability of quantum feature representation, reduces resource consumption, enhances the modeling efficiency and scalability in high-dimensional tasks, strengthens robustness and generalization ability, and avoids gradient vanishing and training instability problems.
Smart Images

Figure CN121052401A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of quantum computing and machine learning technology, and specifically to a method for constructing and generating quantum machine learning models. Background Technology
[0002] With the rapid development of artificial intelligence technology, traditional machine learning algorithms have gradually revealed problems such as high computational resource consumption, long model training time, and limited generalization ability when processing large-scale, high-dimensional data. Quantum computing, due to its parallel computing capabilities and exponential speedup potential, is regarded as a key means to break through the bottlenecks of machine learning technology. In recent years, various quantum machine learning models, such as quantum support vector machines and quantum neural networks, have been proposed and have shown potential in tasks such as classification, clustering, and regression.
[0003] However, most existing quantum machine learning model building methods rely on manually adjusting the quantum circuit structure, lacking a systematic quantum state feature mapping strategy. This makes them difficult to adapt to diverse task requirements, and there is a trade-off between modeling accuracy and qubit resource utilization. Furthermore, different quantum hardware platforms have varying degrees of adaptability to parameterized quantum circuits, limiting the model's portability and scalability.
[0004] Therefore, how to combine classical data features with quantum state mapping mechanisms to efficiently construct quantum machine learning models suitable for multi-task environments has become a pressing technical problem in this field. Summary of the Invention
[0005] The purpose of this invention is to provide a method for constructing and generating quantum machine learning models to address the shortcomings of the prior art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for constructing and generating quantum machine learning models, comprising: S100. Obtain the classic data feature set D corresponding to the target task, and normalize the data features to obtain the standardized data matrix D′. S200. Construct a parameterized quantum state mapping function Φ based on the D′, wherein Φ is used to map classical data to quantum state space; S300. Based on the preset quantum circuit structure template, and in combination with Φ, generate the initial parameterized quantum circuit Qcircuit; S400. Select an appropriate quantum loss function L for the target task type and establish a quantum model training objective. S500: Iteratively train the parameters to be tuned in Qcircuit using a quantum optimizer, minimize the loss function L, and obtain the optimal quantum model Qmodel; S600. Evaluate the generalization ability of the Qmodel based on its prediction performance index. If it is greater than or equal to a set threshold, output the Qmodel; otherwise, return to step S300 and update the Φ or Qcircuit structure.
[0007] Preferably, S100 includes: S101. Select a subset of key features D1 that are related to the task semantics based on the task type, and rank the features of D1 by mutual information entropy method. S102. A variational autoencoder is introduced into the continuous features in D1 to reconstruct the latent variables, resulting in the nonlinear compressed feature representation D2. S103. Apply the unit spherical projection function to D2 and map it to the Hilbert space distribution range supported by the quantum state to construct a normalized data matrix D′ adapted to the initialization of the quantum circuit.
[0008] Preferably, S200 includes: S201. Based on the geometric distribution characteristics of each feature component in D′, a weighted Fourier embedding strategy is adopted to map them into a combination of parameterized periodic functions to construct the initial quantum feature expression Φ1. S202. Based on the gradient response strength of each feature to the target task loss function, dynamically adjust the amplitude and frequency weights of the corresponding Fourier basis functions. S203. The optimized Φ1 is input into the structurally tunable quantum coding circuit, and the feature rotation angle is controlled by a learnable parameter gate to achieve a nonlinear compression transformation from Φ1 to the final mapping function Φ.
[0009] Preferably, wherein S300 includes: S301. Determine the number of qubits n based on the dimension of Φ and its spectral characteristic density, and construct a logical bit grouping structure according to the characteristic sub-channels; S302. Select a circuit template based on a hierarchical tensor network structure, and stack parameterizable rotation gates and two-qubit entanglement gates in a preset order to form an initial variational coding layer. S303. Introduce a sparse coupling mechanism between channels, and configure adjustable coupling gates only between bits related to feature representation to compress the complexity of redundant lines. S304. Based on the periodic parameters in Φ, set the initial angle range of the revolving door.
[0010] Preferably, the S400 includes: S401. Automatically match the basic loss function structure according to the task type, and quantize its function form through the task label embedding mechanism; S402. Construct a measurable target observation subspace using a set of quantum observation operators, and construct an adjustable penalty term based on the statistical distribution of training samples to constrain measurement bias. S403. Introduce a quantum entropy regularization term to regulate the purity of the output state in order to suppress training instability caused by quantum state collapse. S404 integrates the fundamental loss, observation penalty, and entropy regularization to form a unified loss function L, which serves as the optimization objective for training quantum circuit parameters.
[0011] Preferably, the S500 includes: S501. Initialize all trainable gate parameters in the quantum circuit Qcircuit to frequency-domain perturbation type small-amplitude initial values; S502. An adaptive optimizer based on quantum natural gradient is used to update the derivatives of each parameter, wherein the gradient calculation is completed by measurement state fidelity difference. S503. Dynamically mask parameters whose update magnitude is less than a threshold based on the sensitivity of each parameter to the loss function during training. S504. When the objective function fails to improve after several consecutive training rounds, automatically roll back to the optimal historical parameters and restart with local perturbation.
[0012] Preferably, the S600 includes: S601. Construct an evaluation set containing a main validation set and a lightly perturbated validation set, wherein the lightly perturbated set is generated by introducing feature noise into the original samples; S602. Based on the probability distribution output by the Qmodel, the accuracy, output entropy, and KL divergence are calculated in the validation set as multidimensional performance indicators. S603. Define the stable responsivity of a quantum model by utilizing the rate of change of output entropy with input perturbation; S604. Combine the main task accuracy and stable response as generalization metrics. If either generalization metric is less than a set threshold, update the Φ or Qcircuit structure.
[0013] The technical effects and advantages provided by the present invention in the above technical solution are as follows: 1. The quantum machine learning model construction and generation method provided by this invention, based on deep feature transformation and quantum state mapping of classical data, combined with parameterized quantum circuits with tunable structures, achieves full-process optimization from data preprocessing, feature encoding, circuit design to model training and evaluation. By introducing variational autoencoder compression, Fourier embedding, and sparse entanglement mechanisms, it effectively improves the compactness and trainability of quantum feature representation, reduces quantum resource consumption and circuit depth, and improves the modeling efficiency and scalability in high-dimensional tasks.
[0014] 2. This invention significantly enhances the robustness and generalization ability of quantum models in complex real-world environments by constructing a lightly perturbed validation set and a multi-dimensional performance evaluation index system, and by introducing stable response and generalization judgment mechanisms. The entropy change analysis, natural gradient optimization, and structure rollback techniques employed effectively avoid problems such as gradient vanishing, slow convergence, and overfitting in quantum training, ensuring that the model possesses stronger predictive consistency and practical deployment value. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0016] Figure 1 This is a mind map of the method of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] For examples, please refer to Figure 1 As shown in this embodiment, a method for constructing and generating a quantum machine learning model includes: S100. Obtain the classic data feature set D corresponding to the target task, and normalize the data features to obtain the standardized data matrix D′. S200. Construct a parameterized quantum state mapping function Φ based on the D′, wherein Φ is used to map classical data to quantum state space; S300. Based on the preset quantum circuit structure template, and in combination with Φ, generate the initial parameterized quantum circuit Qcircuit; S400. Select an appropriate quantum loss function L for the target task type and establish a quantum model training objective. S500: Iteratively train the parameters to be tuned in Qcircuit using a quantum optimizer, minimize the loss function L, and obtain the optimal quantum model Qmodel; S600. Evaluate the generalization ability of the Qmodel based on its prediction performance index. If it is greater than or equal to a set threshold, output the Qmodel; otherwise, return to step S300 and update the Φ or Qcircuit structure.
[0019] In this embodiment, for a specific image recognition task, the classical data feature set D corresponding to the target task is first obtained. D contains original image descriptive features of multiple dimensions, such as texture information, edge gradients, and color histograms. Since the original features have high dimensionality and a lot of redundant information, directly mapping them to the quantum state space would lead to wasted computational resources and noise accumulation. Therefore, the following unconventional feature processing flow is adopted: Using the mutual information entropy analysis method, the statistical dependency between each feature dimension and the image category label is calculated, constructing a feature-label mutual information matrix. Features with mutual information values greater than a set threshold (e.g., 0.15) are selected to form a key feature subset D1, and then sorted in descending order according to their mutual information values. This process ensures that the retained features have significant discriminative power, eliminates low-relevance dimensions, and compresses the input space dimensions.
[0020] The feature subset D1 is input into a variational autoencoder (VAE) with a structure of "encoder-latent variables-decoder". The encoder part extracts a compressed latent representation z, which is a continuous latent space vector with a dimension typically much smaller than the original feature dimension (e.g., D1 is reduced from 64 dimensions to 16 dimensions). This latent variable vector is the compressed feature representation D2, preserving key information while enhancing robustness and non-linear expressive power.
[0021] Considering that the quantum state vectors must satisfy the unit normalization constraint, a spherical projection function is used to transform D2, specifically mapping each vector to the unit sphere using the following formula: ;in, ; Let represent the feature vector of the i-th sample, which is the latent variable vector formed after compression by a variational autoencoder (VAE). Representing vectors The L2 norm (also known as the Euclidean norm) of a vector is calculated by summing the squares of each dimension's components and then taking the square root. Indicates will A vector normalized to the unit sphere. That is, it has a length of 1 and a direction that is perpendicular to the sphere. Same. This vector can be securely mapped to quantum state input. j represents the vector dimension index, from 1 to m, representing each dimension feature.
[0022] The core purpose of this normalization operation is to normalize any non-zero vector. The vector is mapped to a unit vector (of length 1) to satisfy the normalization constraint of the quantum state (i.e., the magnitude of the quantum state is 1), so that it can be used later for quantum circuit input or quantum feature mapping. This process conforms to the basic specifications for state vectors in quantum machine learning.
[0023] The transformed normalized eigenvector D′ is distributed on the unit sphere of Hilbert space, which satisfies the state vector structure requirements for quantum circuit input and can be used for subsequent quantum state encoding and quantum circuit initialization.
[0024] The above implementation method ensures that the data has high information density, good geometric fit and controllable dimensionality before entering the quantum state mapping, providing a solid data foundation for the subsequent training of quantum machine learning models.
[0025] In this embodiment, for the construction process of the parameterized quantum state mapping function Φ described in step S200, the classical characteristic matrix D′ after normalization is selected as input, and the following unconventional steps are used to complete the generation of the quantum mapping function: First, we analyze the value range and spectral distribution characteristics of each feature in D′, and then analyze each feature component. Applying a weighted Fourier embedding strategy, we transform it into several sets of forms as follows: ;in For the k-th frequency component of the j-th dimension feature, , These are the trainable amplitude weights and phase shift parameters, respectively. This process generates an initial quantum feature combination Φ1, used to capture nonlinear structural information.
[0026] Based on the initial training phase, the target loss function L is related to the features. gradient The analysis quantifies the sensitivity of each feature dimension to the model output and adaptively adjusts its weights in the Fourier embedding accordingly. With frequency distribution This enables a dynamic control mechanism that enhances high-sensitivity features and suppresses low-sensitivity features, thereby improving feature mapping efficiency.
[0027] Using Φ1 as input, its state is encoded through a structurally tunable quantum circuit. A rotating gate (such as Ry(θ), Rz(ϕ)) controlled by learnable parameters is then used to map the Fourier transform features to the qubit states. This stage introduces a nonlinear activation effect, further compressing and transforming the features through fine-tuning of the gate parameters to form the final mapping function Φ.
[0028] To enhance the correlation information between features, multiple encoded qubits are connected through multi-scale entanglement gates (such as CNOT, CZ, etc.) to construct a multi-qubit entangled state with the ability to co-express local and global information. This entanglement structure is hierarchical to support the modeling needs of tasks at different scales.
[0029] Through the above steps, the constructed mapping function Φ not only retains the multi-frequency expression capability of the original features, but also integrates the nonlinear transformation and entanglement expression characteristics of quantum states, providing highly discriminative input quantum states for subsequent quantum machine learning models.
[0030] In this embodiment, to construct a parameterized quantum circuit Qcircuit, the present invention, based on the structural characteristics of the mapping function Φ, employs the following steps to complete the initial design and configuration of the quantum circuit: First, we analyze the characteristic dimension m of Φ output and its corresponding spectral density. If Φ contains a combination of m=16-dimensional periodic functions and the frequency domain distribution of each dimension signal has a large span, then we set n=6 physical qubits and use the "channel-dimension mapping" principle to divide Φ into 3 groups of logical channels, each occupying 2 bits, to process low-frequency, mid-frequency and high-frequency information respectively, thereby improving the hierarchical separation of quantum state representation.
[0031] A quantum circuit template is designed using a hierarchical tensor network structure (such as Tree Tensor Network or Multi-scale Entanglement Renormalization Ansatz), with each layer including a set of parameterized rotation gates (such as Ry(θ), Rz(ϕ)) and two-qubit entanglement gates (such as CNOT). This structure supports high-dimensional feature compression representation and has scalability and hierarchical awareness capabilities.
[0032] To control circuit depth and hardware noise propagation, the system analyzes the correlation matrix between the characteristic sub-channels of Φ, and only configures entanglement gates for channel bit pairs with mutual information higher than a threshold (e.g., 0.2), leaving the remaining paths empty to form a sparse connection graph. This mechanism reduces invalid parameter coupling, preserves efficient information channels, and lowers training difficulty and computational complexity.
[0033] Based on the frequency distribution of the periodic function in Φ, the initial angle parameter range of each rotating gate is dynamically set. For example, the initial range of rotation angle corresponding to high-frequency features is set to [−0.5π, 0.5π], and the range of low-frequency features is set to [−0.2π, 0.2π], in order to enhance the model's early convergence response capability to different frequency domain features and optimize the stability of circuit training.
[0034] Through the above design, the constructed initial quantum circuit Qcircuit can effectively carry and modulate quantum features from Φ, and has the advantages of compact structure, strong adaptability and high training efficiency, providing a high-quality parameter foundation for subsequent quantum learning tasks.
[0035] In this embodiment, to improve the adaptability and training stability of the quantum model to different tasks, the present invention selects and constructs a dedicated quantum loss function L for the target task type. The implementation process includes the following steps: Based on the application task type of the current quantum model, the corresponding basic loss function structure is automatically matched. For example, for binary classification tasks, the quantum cross-entropy loss is chosen as the basic form: ;in For label values, The probability output is obtained through quantum measurement, where N is the total number of training samples. The basic loss function represents the cross-entropy error between the predicted results of all samples and the true labels. Simultaneously, a label embedding mechanism is introduced to encode the label values as auxiliary inputs to the control gates in the quantum state, achieving coupling between task semantics and circuit structure.
[0036] Combining quantum measurement mechanisms, a set of observation operators is defined { }, such as Pauli-Z, Pauli-X, etc., are used to construct measurable output state projections. For example, the output probability is given by: This is obtained. Simultaneously, to control model measurement error, a penalty term based on the sample distribution is introduced: ;in Indicates the variance of the measurement fluctuation. The weighting coefficient is used to suppress quantum observation bias.
[0037] To avoid instability caused by quantum state collapse during training, quantum Von Neumann entropy is introduced as a regularization term: ; where ρ is the density matrix output by the quantum model, describing the state (mixed or pure state) of the quantum system; Tr is the trace operation, representing the sum of the diagonal elements of the matrix; Von Neumann entropy measures the uncertainty or mixing degree of a quantum state; The weight coefficients of the entropy regularization term are used to adjust its weight in the total loss function; R represents the entropy regularization term, used to constrain the purity of the output state, which helps improve the stability and generalization ability of model training. This regularization term encourages the model output to maintain a certain purity of quantum mixed states, thereby improving generalization ability.
[0038] Ultimately, the basic loss The observation penalty term P and the entropy regularization term R are fused to construct the total loss function: L = +P+R; This composite loss function not only accommodates the task objective expression but also provides quantum observation constraints and output state stability control, serving as a global optimization objective for subsequent quantum model training.
[0039] The quantum loss function L constructed using the above method can effectively match different task requirements, enhance the convergence and stability of model training, and improve the interpretability and practicality of the quantum model.
[0040] In this embodiment, to obtain the optimal-performing quantum model Qmodel after training, a quantum optimization process is performed on the gate parameters to be adjusted in the parameterized quantum circuit Qcircuit. This process employs a set of innovative training strategies, specifically including the following steps: To avoid getting stuck in an overly flat region of the loss function during the initial optimization phase, the initial parameters of all adjustable rotation gates (such as Ry(θ), Rz(ϕ)) are not set to 0 or constant, but instead a periodic function with Gaussian perturbation is introduced as an initialization strategy: ; where ω is the frequency coefficient and δ is the phase shift, ensuring strong ergodicity of the initial state. ϵ represents the initial value of a trainable parameter (such as a rotation angle) in the quantum circuit; ϵ is the perturbation amplitude coefficient, controlling the range of the initial value, usually a small amount (e.g., 0.01π to 0.05π); x represents the feature input or parameter index variable, determining the change of the initial value with position; a quantum natural gradient optimizer is used instead of the traditional Adam or SGD to match the non-Euclidean structure in the quantum parameter space. Gradient estimation is not performed through classical backpropagation, but rather using a quantum state-fidelity difference method. ; L represents the derivative (gradient) of the loss function L with respect to the parameter θ; L(θ+ϵ) represents the loss value calculated after adding perturbation ϵ to the parameter θ; L(θ−ϵ) represents the loss value after reducing perturbation ϵ in the parameter θ; ϵ represents a small perturbation amount used for numerical estimation of the gradient; and the update path of each parameter is corrected by the Fisher information matrix to make the optimization direction closer to the quantum information geometric manifold.
[0041] After each training round, the gradient magnitude of each parameter with respect to the change in the loss function is calculated. If the update magnitude of a parameter is lower than a preset threshold (such as 0.0004) for three consecutive rounds, the parameter is temporarily frozen to avoid redundant training, thereby reducing invalid gradient propagation and reducing quantum circuit fluctuations.
[0042] When the loss function does not decrease significantly (the decrease is less than 1%) in t consecutive training rounds (e.g., t=10), the system automatically calls the "historical best parameters" for rollback and adds a small perturbation ±η (e.g., η=0.01) to the current circuit parameters to locally jump out of the saddle point region and prevent the training from getting trapped in a local minimum or a trap state.
[0043] By combining the above strategies, the optimal quantum model Qmodel obtained through training has a fast convergence speed and strong generalization performance, and effectively avoids common problems such as gradient vanishing and training instability in quantum training.
[0044] In this embodiment, to effectively evaluate the generalization ability of the trained quantum model Qmodel, a multi-dimensional performance evaluation method is proposed, which combines perturbation robustness and output distribution change trend for analysis. Specifically, it includes the following steps: First, a main validation set, Vmain, is constructed based on the same distribution as the training set. The samples in this set are unmodified and used to evaluate the model's performance under standard input. Simultaneously, a small amount of noise is added to the original sample features using a Gaussian perturbation function. ;in The adjusted sample features are used, σ is the standard deviation, and the perturbation amplitude is controlled (e.g., set to 5% of the original feature mean) to generate a lightly perturbed validation set Vnoise, which is used to test the stability and generalization elasticity of the model.
[0045] Run Qmodel on two validation sets respectively and record its output probability distribution. For each sample, calculate the following performance metrics: Accuracy: The matching rate between the predicted result and the true label on Vmain; Output entropy: Calculated using the Shannon entropy formula. This measures the uncertainty of the model output. KL divergence (Kullback-Leibler Divergence): Measures the degree of deviation between the output distributions of Vmain and Vnoise. The formula is: ;in , represents the output probabilities of the main validation set and the perturbation validation set, respectively.
[0046] Calculate the change in model output entropy before and after a slight perturbation, using samples as the unit. The expression is: ; It represents the entropy of the output probability distribution of the model on the main validation set (i.e., the unperturbed input). It represents the entropy of the output probability distribution of the model on the lightly perturbed validation set.
[0047] The average entropy difference among all samples is defined as the stability response index Rs. The smaller Rs is, the less sensitive the model is to input perturbations, i.e., the better its robustness.
[0048] Accuracy and stable response are used together as evaluation criteria for generalization ability. If the accuracy is lower than a set threshold (e.g., 85%), or Rs is higher than the fluctuation tolerance (e.g., 0.3), the system automatically enters the model structure fine-tuning stage, and one of the following update strategies can be selected: Reconstructing the Φ mapping function: Adjusting the Fourier frequency combination of the feature mapping to improve the matching degree between features and quantum states; Optimize Qcircuit: Increase the depth of the entanglement layer or change the circuit coupling strategy to enhance the model's expressive power.
[0049] This method systematically evaluates the performance of quantum models from three aspects: structure, output, and perturbation response. It has a good basis for judging generalization ability and supports dynamic structure optimization, thereby enhancing the stability and practicality of the model under non-ideal input environments.
[0050] In this embodiment, a classical data feature set of the target task is obtained, and a standardized feature matrix is generated through operations such as feature selection, nonlinear compression, and spherical mapping. A parameterized quantum state mapping function is constructed based on this matrix, and an initial quantum circuit is generated by combining it with a preset circuit template. An appropriate quantum loss function is designed according to the task type, and the optimal quantum model is obtained through iterative training using a quantum natural gradient optimization strategy. Finally, the model's generalization ability is evaluated using a perturbation validation set and multi-dimensional indicators, and the mapping structure or circuit design is updated accordingly. This method integrates nonlinear feature processing, variational circuit design, entropy regularization, and stable response evaluation techniques, which can improve the expressive power, training stability, and generalization performance of the quantum model, making it suitable for quantum intelligent modeling applications in high-dimensional complex task environments.
[0051] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for constructing and generating quantum machine learning models, characterized in that: include: S100. Obtain the classic data feature set D corresponding to the target task, and normalize the data features to obtain the standardized data matrix D′. S200. Construct a parameterized quantum state mapping function Φ based on the D′, wherein Φ is used to map classical data to quantum state space; S300. Based on the preset quantum circuit structure template, and in combination with Φ, generate the initial parameterized quantum circuit Qcircuit; S400. Select an appropriate quantum loss function L for the target task type and establish a quantum model training objective. S500: Iteratively train the parameters to be tuned in Qcircuit using a quantum optimizer, minimize the loss function L, and obtain the optimal quantum model Qmodel; S600. Evaluate the generalization ability of the Qmodel based on its prediction performance index. If it is greater than or equal to a set threshold, output the Qmodel; otherwise, return to step S300 and update the Φ or Qcircuit structure.
2. The method for constructing and generating a quantum machine learning model according to claim 1, characterized in that: S100 includes: S101. Select a subset of key features D1 that are related to the task semantics based on the task type, and rank the features of D1 by mutual information entropy method. S102. A variational autoencoder is introduced into the continuous features in D1 to reconstruct the latent variables, resulting in the nonlinear compressed feature representation D2. S103. Apply the unit spherical projection function to D2 and map it to the Hilbert space distribution range supported by the quantum state to construct a normalized data matrix D′ adapted to the initialization of the quantum circuit.
3. The method for constructing and generating a quantum machine learning model according to claim 1, characterized in that: S200 includes: S201. Based on the geometric distribution characteristics of each feature component in D′, a weighted Fourier embedding strategy is adopted to map them into a combination of parameterized periodic functions to construct the initial quantum feature expression Φ1. S202. Based on the gradient response strength of each feature to the target task loss function, dynamically adjust the amplitude and frequency weights of the corresponding Fourier basis functions. S203. The optimized Φ1 is input into the structurally tunable quantum coding circuit, and the feature rotation angle is controlled by a learnable parameter gate to achieve a nonlinear compression transformation from Φ1 to the final mapping function Φ.
4. The method for constructing and generating a quantum machine learning model according to claim 1, characterized in that: The S300 includes: S301. Determine the number of qubits n based on the dimension of Φ and its spectral characteristic density, and construct a logical bit grouping structure according to the characteristic sub-channels; S302. Select a circuit template based on a hierarchical tensor network structure, and stack parameterizable rotation gates and two-qubit entanglement gates in a preset order to form an initial variational coding layer. S303. Introduce a sparse coupling mechanism between channels, and configure adjustable coupling gates only between bits related to feature representation to compress the complexity of redundant lines. S304. Based on the periodic parameters in Φ, set the initial angle range of the revolving door.
5. The method for constructing and generating a quantum machine learning model according to claim 1, characterized in that: The S400 includes: S401. Automatically match the basic loss function structure according to the task type, and quantize its function form through the task label embedding mechanism; S402. Construct a measurable target observation subspace using a set of quantum observation operators, and construct an adjustable penalty term based on the statistical distribution of training samples to constrain measurement bias. S403. Introduce a quantum entropy regularization term to regulate the purity of the output state in order to suppress training instability caused by quantum state collapse. S404 integrates the fundamental loss, observation penalty, and entropy regularization to form a unified loss function L, which serves as the optimization objective for training quantum circuit parameters.
6. The method for constructing and generating a quantum machine learning model according to claim 1, characterized in that: The S500 includes: S501. Initialize all trainable gate parameters in the quantum circuit Qcircuit to frequency-domain perturbation type small-amplitude initial values; S502. An adaptive optimizer based on quantum natural gradient is used to update the derivatives of each parameter, wherein the gradient calculation is completed by measurement state fidelity difference. S503. Dynamically mask parameters whose update magnitude is less than a threshold based on the sensitivity of each parameter to the loss function during training. S504. When the objective function fails to improve after several consecutive training rounds, automatically roll back to the optimal historical parameters and restart with local perturbation.
7. The method for constructing and generating a quantum machine learning model according to claim 1, characterized in that: The S600 includes: S601. Construct an evaluation set containing a main validation set and a lightly perturbed validation set, wherein the lightly perturbed set is generated by introducing feature noise into the original samples; S602. Based on the probability distribution output by the Qmodel, the accuracy, output entropy, and KL divergence are calculated in the validation set as multidimensional performance indicators. S603. Define the stable responsivity of a quantum model by utilizing the rate of change of output entropy with input perturbation; S604. Combine the main task accuracy and stable response as generalization metrics. If either generalization metric is less than a set threshold, update the Φ or Qcircuit structure.
