Method and device for constructing quantum classifier based on neural operator
Through the combination of neural operators and shallow variable component quantum circuits, the problem of over-deep quantum classifier mapping lines under high-dimensional data is solved, and more efficient quantum classifier construction is achieved, improving computing efficiency and accuracy.
Patent Information
- Application Number
- CN202510638952.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-05-19
AI Technical Summary
When existing quantum classifiers process high-dimensional data, excessively deep mapping lines lead to noise accumulation, affecting computing efficiency and accuracy.
The method of combining neural operators and shallow variable component quantum circuits is adopted to convert the deeper mapping lines into a linear combination of a series of single-layer Pauli operators, and the mapping lines are approximateed by neural network operators, and the parameters are updated using gradient descent algorithms to build a quantum classifier.
It reduces the depth of quantum circuits, reduces mapping overhead, and improves the implementation efficiency and accuracy of quantum classifiers on noise-containing quantum devices.
Smart Images

Figure CN120542589A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the field of quantum technology, and more particularly, to a method and apparatus for constructing a quantum classifier based on a neural operator. Background Art
[0002] Quantum classifiers use superposition states of quantum bits to represent data and quantum gate operations to process and classify data. They can handle high-dimensional data to a certain extent, whereas traditional classical computing may require a large amount of resources. Due to the unique characteristics of quantum classifiers, they can be used to classify users based on their characteristics. When user characteristics are high-dimensional, the mapping of the feature vectors formed by these characteristics to quantum data may make the quantum circuit too deep, resulting in excessive noise accumulation, which affects the computational efficiency of the quantum classifier and the accuracy of user classification based on their characteristics. Summary of the Invention
[0003] This application describes a method and device for constructing a quantum classifier based on neural operators, which can solve the above technical problems.
[0004] According to a first aspect, a method for constructing a quantum classifier based on a neural operator is provided, the method comprising:
[0005] Constructing a mapping circuit for feature vectors in a training sample set, wherein the training sample set includes feature vectors formed by user features and corresponding user classification labels;
[0006] Constructing a neural network operator, which is a linear superposition of multiple Pauli operators, wherein the superposition coefficient is determined by a neural network parameter w, and the neural network parameter w is trained so that the neural network operator approximates the mapping line;
[0007] Constructing a quantum classifier using the neural network operator and the parameters of the variational quantum circuit that approximate the mapping circuit;
[0008] According to the user classification label, the parameters of the variational quantum circuit are iteratively updated using a phase shift rule and a gradient descent algorithm, thereby obtaining a quantum classifier for classifying users.
[0009] In some embodiments, the training of the neural network parameter w so that the neural network operator approaches the mapping line specifically includes:
[0010] Using the neural network operator and the mapping line Construct a first cost function, which reflects the neural network operator and the mapping line differences;
[0011] Taking the minimum function value of the first cost function as the goal, the parameter is determined by updating iteratively .
[0012] In some more specific embodiments, the first cost function is converted into a first partial derivative function, where the first partial derivative function is a partial derivative function of the first cost function with respect to the parameter w;
[0013] Determining the gradient information of the first partial derivative function using a Markov chain Monte Carlo random sampling method;
[0014] The parameter w is iteratively updated using a gradient descent algorithm using the gradient information of the first partial derivative function.
[0015] In some more specific embodiments, the method further comprises:
[0016] The parameters Including the first parameter and the second parameter , the neural network ,in, is the Pauli operator based on the input The first neural network part that outputs the quantum state probability amplitude is parameterized by the first parameter ; is the Pauli operator based on the input The second neural network part that outputs the quantum state phase, whose parameter is the second parameter .
[0017] In some more specific embodiments, the parameter is determined by updating iteratively with the goal of minimizing the function value of the first cost function. , specifically including:
[0018] The first cost function is converted into a first partial derivative function, wherein the first partial derivative function includes the first cost function with respect to the first parameter The partial derivative function and the second parameter The partial derivative function of
[0019] Determining the gradient information of the first partial derivative function using a Markov chain Monte Carlo random sampling method;
[0020] Using the gradient information of the first partial derivative function, the first parameter is iteratively updated through the gradient descent algorithm and the second parameter ;
[0021] According to the first parameter after multiple rounds of iteration and the second parameter , obtain the first neural network part and the second neural network part after training, and then obtain the neural network.
[0022] In some more specific embodiments, the iterative updating of the parameters of the variational quantum circuit using a phase shift rule and a gradient descent algorithm according to the user classification label specifically includes:
[0023] Inputting the feature vector into the quantum classifier to obtain a pre-classification label;
[0024] constructing a second cost function using the pre-classification label and the user classification label, wherein the second cost function reflects an error between the pre-classification label and the user classification label;
[0025] converting the second cost function into a second partial derivative function, where the second partial derivative function is a partial derivative function of the second cost function with respect to a parameter of the variational quantum circuit;
[0026] With the goal of minimizing the function value of the second cost function, using the phase shift rule, obtaining the gradient information of the second partial derivative function;
[0027] According to the gradient information of the second partial derivative function, the parameters of the variational quantum circuit are iteratively updated using a gradient descent algorithm.
[0028] In some more specific embodiments, the quantum classifier
[0029] , No. Pauli operator Hedi Pauli operator are all single-layer Pauli operators, are the parameters of the variational quantum circuit, The parameter is The quantum circuit, tr is the trace operation, is the observation operator, yes The conjugate transpose of is projected onto the ground state is the projection operator of , and • is the matrix multiplication operator.
[0030] According to a second aspect, a device for constructing a quantum classifier based on a neural operator is provided, the device comprising:
[0031] A first processing module is configured to construct a mapping circuit for feature vectors in a training sample set, wherein the training sample set includes feature vectors formed by user features and corresponding user classification labels;
[0032] A second processing module is configured to approximate the mapping circuit using a neural network operator, wherein the neural network operator is composed of a Pauli operator and a neural network, and construct a quantum classifier using the neural network operator that approximates the mapping circuit and parameters of the variational quantum circuit;
[0033] A third processing module is used to construct a quantum classifier using the neural network operator and the parameters of the variational quantum circuit that approximate the mapping circuit;
[0034] The fourth processing module is used to iteratively update the parameters of the variational quantum circuit according to the user classification label using a phase shift rule and a gradient descent algorithm, thereby obtaining a quantum classifier for classifying users.
[0035] In some embodiments, the second processing module is specifically configured to utilize the neural network operator and the mapping line Construct a first cost function, which reflects the neural network operator and the mapping line differences;
[0036] Taking the minimum function value of the first cost function as the goal, the parameter is determined by updating iteratively .
[0037] In some more specific embodiments, the second processing module is specifically configured to convert the first cost function into a first partial derivative function, wherein the first partial derivative function is a function of the first cost function with respect to the parameter The partial derivative function of
[0038] Determining the gradient information of the first partial derivative function using a Markov chain Monte Carlo random sampling method;
[0039] Using the gradient information of the first partial derivative function, the parameters are iteratively updated through the gradient descent algorithm. .
[0040] In some more specific embodiments, the parameter Including the first parameter and the second parameter , the neural network ,in, is the Pauli operator based on the input The first neural network part that outputs the quantum state probability amplitude is parameterized by the first parameter ; is the Pauli operator based on the input The second neural network part that outputs the quantum state phase, whose parameter is the second parameter .
[0041] In some more specific embodiments, the second processing module is specifically configured to convert the first cost function into a first partial derivative function, wherein the first partial derivative function includes the first cost function with respect to the first parameter The partial derivative function and the second parameter The partial derivative function of
[0042] Determining the gradient information of the first partial derivative function using a Markov chain Monte Carlo random sampling method;
[0043] Using the gradient information of the first partial derivative function, the first parameter is iteratively updated through the gradient descent algorithm and the second parameter ;
[0044] According to the first parameter after multiple rounds of iteration and the second parameter , obtain the first neural network part and the second neural network part after training, and then obtain the neural network.
[0045] In some more specific embodiments, the fourth processing module is specifically configured to input the feature vector into the quantum classifier to obtain a pre-classification label;
[0046] constructing a second cost function using the pre-classification label and the user classification label, wherein the second cost function reflects an error between the pre-classification label and the user classification label;
[0047] converting the second cost function into a second partial derivative function, where the second partial derivative function is a partial derivative function of the second cost function with respect to a parameter of the variational quantum circuit;
[0048] With the goal of minimizing the function value of the second cost function, using the phase shift rule, obtaining the gradient information of the second partial derivative function;
[0049] According to the gradient information of the second partial derivative function, the parameters of the variational quantum circuit are iteratively updated using a gradient descent algorithm.
[0050] In some more specific embodiments, the quantum classifier
[0051] , among which, Pauli operator Hedi Pauli operator are all single-layer Pauli operators, are the parameters of the variational quantum circuit, The parameter is The quantum circuit, tr is the trace operation, is the observation operator, yes The conjugate transpose of is projected onto the ground state is the projection operator of , and • is the matrix multiplication operator.
[0052] According to a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the method for constructing a quantum classifier based on a neural operator as described in the above technical solution is implemented.
[0053] According to a fourth aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the method for constructing a quantum classifier based on a neural operator as described in the above technical solution is implemented.
[0054] In the above-mentioned system and method provided in the embodiments of this specification, a quantum classifier for classifying users according to their characteristics is proposed. To address the problem that the mapping of quantum data due to multiple user characteristics may make the quantum circuit too deep, a method combining neural operators and shallow variational quantum circuits is used to convert the originally deeper mapping circuit into a linear combination of a series of single-layer Pauli operators, thereby reducing the mapping overhead and the circuit depth, making the quantum classifier easier to implement on recent noisy quantum devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0056] Figure 1 This is a flow chart of a method for constructing a quantum classifier based on a neural operator provided by the present invention; Figure 2 This is a flow chart of a method for constructing a quantum classifier based on a neural operator provided by the present invention; Figure 3 It is a structural schematic diagram of a device for constructing a quantum classifier based on a neural operator provided by the present invention. DETAILED DESCRIPTION
[0057] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0058] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0059] In the description of the embodiments of the present application, words such as "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of the present application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.
[0060] In the description of the embodiments of this application, the term "and / or" is merely a description of an association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent the following three situations: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "plurality" means two or more.
[0061] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly identifying the technical features being referred to. Thus, features specified as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "include," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0062] Quantum classifiers exploit properties such as quantum superposition and quantum entanglement, potentially handling certain types of problems more efficiently. Data is represented using the superposition state of qubits, and processed and classified using quantum gate operations. The superposition state of qubits allows quantum computers to process multiple inputs simultaneously, improving computational efficiency. Furthermore, quantum computing can handle high-dimensional data to a certain extent, while traditional classical computing may require significant resources. Current mappings from classical data to quantum data can make quantum circuits too deep, causing the model to accumulate excessive noise on today's medium-sized, noisy quantum devices, impacting computational efficiency and accuracy.
[0063] Existing technical solutions primarily implement quantum classifiers through the following steps: First, prepare qubits (a set of qubits) to represent input data and perform classification. The number of qubits depends on the feature dimensionality of the input data and the complexity of the classification task. Second, encode the classical data into qubits. This may involve mapping the feature vector into some representation in qubit space. Common encoding methods include amplitude mapping or rotation angle mapping. Third, design a quantum circuit containing a series of quantum gate operations to process and manipulate the quantum data. These gates may include single-bit gates, such as rotation gates, or two-bit gates, such as CNOT gates, to achieve feature transformation and data classification. Fourth, execute a quantum algorithm on the constructed quantum circuit, inputting the encoded quantum data into the circuit and processing and classifying it through quantum gate operations. Fifth, measure the output of the quantum circuit to determine the classification result of the input data. Based on the measurement results, the input data is assigned to the corresponding category. Sixth, train and optimize the quantum classifier to improve its classification performance and generalization ability. The parameters of the quantum circuit are adjusted isomorphically to optimize the classification cost function until convergence.
[0064] The quantum classifier constructed using the aforementioned method has limitations in data encoding. Encoding large-dimensional data requires a sufficient number of qubits and high-fidelity quantum gate operations, which directly increases the depth of the quantum circuit. Deeper quantum circuits are more susceptible to noise, which directly affects model performance.
[0065] Specifically, the problem to be solved by the present invention can be described as follows: Given a training data set , building a quantum classifier The training sample dataset here contains the feature vector formed by user features and the corresponding user classification labels.
[0066] Establish an optimization problem to minimize the empirical error of the quantum classifier:
[0067] is the parameter of the variational quantum circuit, As the cost function, cross entropy is selected as the cost function, then the cost function of this problem is , where the quantum classifier From the above, we can see that due to the mapping line With the eigenvector Previous methods have not considered the impact of reduced accuracy caused by the depth of the mapping line.
[0068] In order to solve the above problems, the present invention adopts Figure 1The construction method of quantum classifier based on neural operator is shown in FIG. Figure 1 As shown, according to the method of the present invention, for the training data set Each eigenvector in , using neural operators Approximate each eigenvector Among them, the neural operator Can be represented by multiple Pauli operators Through the linear superposition of superposition coefficients, the superposition coefficients By parameters By targeting each eigenvector Approximation of , we get the coefficients of the Pauli operator corresponding to each eigenvector , that is, the neural network operator that approximates the mapping circuit is obtained.
[0069] Then, we use the obtained neural operators and parameters of the variational quantum circuit to Construct a quantum classifier and iteratively update the parameters of the variational quantum circuit through the cost function , until the cost function converges to a value less than , or the number of iterations t is greater than the preset number of iterations M, the parameters of the variational quantum circuit are obtained , and finally a quantum classifier is obtained for classifying users.
[0070] The unitary transformation form constructed by approximation is used to represent a series of Pauli operators in the quantum system, thereby converting the originally deep mapping circuit into a linear combination of a series of single-layer Pauli operators, thereby reducing the mapping overhead and the circuit depth, and solving the problem that the mapping circuit will increase with the increase of the dimension of the eigenvector and the accuracy will be reduced due to the excessive depth of the mapping circuit.
[0071] Specific implementations of the above inventive concepts are described in detail below.
[0072] Figure 2 The figure is a flow chart of a method for constructing a quantum classifier based on a neural operator provided by the present invention, which includes the following steps:
[0073] 110. Construct a mapping circuit for the feature vectors in the training sample set, wherein the training sample set includes feature vectors formed by user features and corresponding user classification labels.
[0074] Specifically, the training samples is a set of N training samples. is the user’s feature vector, is the user's classification label.
[0075] Specifically, the feature vector It can be a vector formed based on user attribute features. In one embodiment, the training sample set is a sample set formed by user cases, where the feature vector is formed based on some physiological indicators or indications of the user, and the corresponding user classification label is the annotated label of the disease. More specifically, in a specific example, the training sample The Cleveland Heart Disease Dataset is a dataset derived from a real cardiology dataset. It contains a variety of health indicators and characteristics of heart disease and the corresponding diagnosis results of whether the disease occurs. , The label is used to correspond to the diagnosis result of whether the patient is sick.
[0076] For the characteristic vector of each sample, a quantum circuit encoding it is constructed using conventional means, namely the mapping circuit .
[0077] 120. Construct a neural network operator, which is a linear superposition of multiple Pauli operators. The superposition coefficient is determined by the neural network parameter w. By training the neural network parameter w, the neural network operator is made to approximate the mapping circuit.
[0078] Specifically, the neural network operator is constructed as a unitary transformation form ,in, is the Pauli operator or Pauli string, that is As we can see, the Pauli string contains some basic single-qubit gates in quantum computing, such as the Pauli X gate (corresponding to ), Pauli Y gate (corresponding to ) and the Pauli Z gate (corresponding to ), is the most basic combination of single-qubit gates. The parameter is , the input is As you can see, the neural network The output of is the linear superposition factor of the Pauli operator. That is, the output of the neural network is used to linearly superpose the Pauli operator to obtain the neural network operator .
[0079] In order to make the neural network operator constructed as above Approximation mapping line , we can construct a cost function to reflect the neural network operator and mapped lines Specifically, in one example, and mapped lines The mean square error is used as the first cost function , the specific form is:
[0080]
[0081] In order to obtain the parameters of the neural network operator that approximates the mapping circuit , we can take the minimization of the first cost function as the goal and adjust the parameters Perform update iterations to determine the final parameters The update iteration of the parameters can be performed using the gradient descent algorithm.
[0082] Specifically, the first cost function can be calculated About parameters The partial derivative equation is as follows:
[0083]
[0084] in, .
[0085] Therefore, the neural network can be divided into two parts, and the network parameters can also be divided into two parts accordingly. = . The first neural network part The parameters are , used to output the probability amplitude or amplitude of the quantum state. This part of the result determines the relative size of each component of the quantum state and affects the probability distribution of the final measurement result. The second neural network part The parameters are , used to output the phase of the quantum state, which is responsible for adjusting the relative phase relationship between the quantum states. The output result is a combination of the amplitude part and the phase part. In this case, the partial derivative function actually contains the first cost function relative to the parameter The partial derivative of , and the The partial derivative function of .
[0086] The neural network used above can be a transformer neural network, a recurrent neural network, a convolutional neural network, etc. The neural network used can be determined according to the actual scenario and is not specifically limited here.
[0087] Then, the metropolis-hasting Markov chain Monte Carlo sampling algorithm is used to About parameters The value of the partial derivative equation is estimated.
[0088] According to the obtained gradient information, the parameters are iteratively updated through the gradient descent algorithm , specifically including iterative updates , update formula , η is the learning rate, until the cost function Convergence, get parameters , thus getting an approximation Neural operators .
[0089] As can be seen above, by expressing the neural network operator as a linear superposition of Pauli operators, a single-layer Pauli operator is obtained, reducing the original mapping circuit depth to 1.
[0090] 130. Neural Network Operators Using Approximation Mapping Circuits and the parameters of the variational quantum circuit Build a quantum classifier.
[0091] 140. According to the user classification label, the phase shift rule and gradient descent algorithm are used to iteratively update the parameters of the variational quantum circuit to obtain a quantum classifier for classifying users.
[0092] The training samples Input the quantum classifier to obtain the pre-classification label, and use the pre-classification label and the user classification label to construct a second cost function. The second cost function reflects the error between the pre-classification label and the user classification label, and is used to improve the classification accuracy of the quantum classifier. In one example, the second cost function adopts the cross entropy form: .
[0093] On the other hand, the quantum classifier built based on the above neural network operator can be written as:
[0094] ,in and are all single-layer Pauli operators, are the parameters of the variational quantum circuit, The parameter is The quantum circuit, tr is the trace operation, is the observation operator. and All are single-layer Pauli operators, which reduce the original mapping line depth to It is reduced to 1. Considering that there may be cross terms in the Pauli string based on the Pauli basis, two single-layer Pauli operators are set.
[0095] No. Pauli operator Hedi Pauli operator are all single-layer Pauli operators, are the parameters of the variational quantum circuit, The parameter is The quantum circuit, tr is the trace operation, is the observation operator, yes The conjugate transpose of is projected onto the ground state is the projection operator of , and • is the matrix multiplication operator.
[0096] The parameters are adjusted by phaseshiftrule and gradient descent algorithm Update, the gradient information is as follows:
[0097]
[0098]
[0099] Repeat the above steps until the second cost function Converge and get the parameters of the variational quantum circuit , thus obtaining the quantum classifier for classifying users .
[0100] In the above method provided in the embodiments of this specification, a quantum classifier for classifying users according to user characteristics is proposed. To address the problem of excessively deep quantum circuits due to the multi-dimensionality of user characteristics, a method combining neural operators and shallow variational quantum circuits is used to convert the originally deeper mapping circuits into linear combinations of a series of single-layer Pauli operators, thereby reducing the mapping overhead and circuit depth, making the quantum classifier easier to implement on recent noisy quantum devices.
[0101] Figure 3 : This is a schematic diagram of a device for constructing a quantum classifier based on a neural operator provided by the present invention, the device comprising:
[0102] A first processing module is configured to construct a mapping circuit for feature vectors in a training sample set, wherein the training sample set includes feature vectors formed by user features and corresponding user classification labels;
[0103] A second processing module is configured to approximate the mapping circuit using a neural network operator, wherein the neural network operator is composed of a Pauli operator and a neural network, and construct a quantum classifier using the neural network operator that approximates the mapping circuit and the parameters of the variational quantum circuit;
[0104] A third processing module is used to construct a quantum classifier using the neural network operator of the approximate mapping circuit and the parameters of the variational quantum circuit;
[0105] The fourth processing module is used to iteratively update the parameters of the variational quantum circuit according to the user classification label using the phase shift rule and the gradient descent algorithm, thereby obtaining a quantum classifier for classifying users.
[0106] In some embodiments, the second processing module is specifically configured to utilize a neural network operator and mapped lines Construct the first cost function, which reflects the neural network operator and mapped lines differences;
[0107] Taking the minimum function value of the first cost function as the goal, the parameters are determined by updating iterations. .
[0108] In some more specific embodiments, the second processing module is specifically configured to convert the first cost function into a first partial derivative function, where the first partial derivative function is the first cost function with respect to the parameter The partial derivative function of
[0109] The gradient information of the first partial derivative function is determined using the Markov chain Monte Carlo random sampling method;
[0110] Using the gradient information of the first partial derivative function, the parameters are iteratively updated through the gradient descent algorithm .
[0111] In some more specific embodiments, the parameter Including the first parameter and the second parameter , neural network ,in, is the Pauli operator based on the input The first neural network part that outputs the quantum state probability amplitude is parameterized by the first parameter ; is the Pauli operator based on the input The second neural network part that outputs the quantum state phase, whose parameter is the second parameter .
[0112] In some more specific embodiments, the second processing module is specifically configured to convert the first cost function into a first partial derivative function, wherein the first partial derivative function includes the first cost function with respect to the first parameter The partial derivative function and the second parameter The partial derivative function of
[0113] The gradient information of the first partial derivative function is determined using the Markov chain Monte Carlo random sampling method;
[0114] Using the gradient information of the first partial derivative function, the first parameter is iteratively updated through the gradient descent algorithm and the second parameter ;
[0115] According to the first parameter after multiple rounds of iteration and the second parameter , obtain the trained first neural network part and the second neural network part, and then obtain the neural network.
[0116] In some more specific embodiments, the fourth processing module is specifically configured to input the feature vector into a quantum classifier to obtain a pre-classification label;
[0117] Constructing a second cost function using the pre-classification label and the user classification label, wherein the second cost function reflects the error between the pre-classification label and the user classification label;
[0118] Converting the second cost function into a second partial derivative function, where the second partial derivative function is a partial derivative function of the second cost function with respect to a parameter of the variational quantum circuit;
[0119] With the goal of minimizing the function value of the second cost function, the gradient information of the second partial derivative function is obtained by using the phase shift rule;
[0120] According to the gradient information of the second partial derivative function, the parameters of the variational quantum circuit are iteratively updated using the gradient descent algorithm.
[0121] In some more specific embodiments, the quantum classifier
[0122] ,in and are all single-layer Pauli operators, are the parameters of the variational quantum circuit, The parameter is The quantum circuit, tr is the trace operation, is the observation operator.
[0123] According to another embodiment, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the method for constructing a quantum classifier based on a neural operator as described in the above technical solution is implemented.
[0124] According to another embodiment, an electronic device is also provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the method for constructing a quantum classifier based on a neural operator as described in the above technical solution is implemented.
[0125] Those skilled in the art will appreciate that, in one or more of the above examples, the functions described herein may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0126] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of this application. It should be understood that the above description is only the specific implementation methods of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this application should be included in the scope of protection of this application.
Claims
1. A method for constructing a quantum classifier based on a neural operator, characterized in that: The method comprises: For the training sample set , wherein the training sample set includes a feature vector formed by user features and corresponding user classification labels; Construct a neural network operator, which is a linear superposition of multiple Pauli operators, and the superposition coefficient is obtained by parameter The neural network is determined by training the parameters of the neural network , so that the neural network operator approaches the mapping circuit; Constructing a quantum classifier using the neural network operator and the parameters of the variational quantum circuit that approximate the mapping circuit; According to the user classification label, the parameters of the variational quantum circuit are iteratively updated using a phase shift rule and a gradient descent algorithm, thereby obtaining a quantum classifier for classifying users.
2. The method according to claim 1, characterized in that The training of the neural network parameter w so that the neural network operator approaches the mapping line specifically includes: Using the neural network operator and the mapping line Construct a first cost function, which reflects the neural network operator and the mapping line differences; Taking the minimum function value of the first cost function as the goal, the parameter is determined by updating iteratively .
3. The method according to claim 2, characterized in that The goal is to minimize the function value of the first cost function, and to determine the parameter by updating iteratively. , specifically including: The first cost function is converted into a first partial derivative function, wherein the first partial derivative function is the first cost function with respect to the parameter The partial derivative function of Determining the gradient information of the first partial derivative function using a Markov chain Monte Carlo random sampling method; Using the gradient information of the first partial derivative function, the parameters are iteratively updated through the gradient descent algorithm. .
4. The method according to claim 2, wherein: The parameters Including the first parameter and the second parameter , the neural network ,in, is the Pauli operator based on the input The first neural network part that outputs the quantum state probability amplitude is parameterized by the first parameter ; is the Pauli operator based on the input The second neural network part that outputs the quantum state phase, whose parameter is the second parameter .
5. The method according to claim 4, characterized in that Taking the minimum function value of the first cost function as the goal, the parameter is determined by updating iteratively , specifically including: The first cost function is converted into a first partial derivative function, wherein the first partial derivative function includes the first cost function with respect to the first parameter The partial derivative function and the second parameter The partial derivative function of Determining the gradient information of the first partial derivative function using a Markov chain Monte Carlo random sampling method; Using the gradient information of the first partial derivative function, the first parameter is iteratively updated through the gradient descent algorithm and the second parameter ; According to the first parameter after multiple rounds of iteration and the second parameter , obtain the first neural network part and the second neural network part after training, and then obtain the neural network.
6. The method according to claim 1, characterized in that The iterative updating of the parameters of the variational quantum circuit using a phase shift rule and a gradient descent algorithm according to the user classification label specifically includes: Inputting the feature vector into the quantum classifier to obtain a pre-classification label; constructing a second cost function using the pre-classification label and the user classification label, wherein the second cost function reflects an error between the pre-classification label and the user classification label; converting the second cost function into a second partial derivative function, where the second partial derivative function is a partial derivative function of the second cost function with respect to a parameter of the variational quantum circuit; With the goal of minimizing the function value of the second cost function, using the phase shift rule, obtaining the gradient information of the second partial derivative function; According to the gradient information of the second partial derivative function, the parameters of the variational quantum circuit are iteratively updated using a gradient descent algorithm.
7. The method according to claim 1, wherein: The quantum classifier is expressed as Among them, Pauli operator Hedi Pauli operator are all single-layer Pauli operators, are the parameters of the variational quantum circuit, The parameter is The quantum circuit, tr is the trace operation, is the observation operator, yes The conjugate transpose of is projected onto the ground state is the projection operator of , and • is the matrix multiplication operator.
8. A device for constructing a quantum classifier based on a neural operator, characterized in that: The device comprises: A first processing module is configured to construct a mapping circuit for feature vectors in a training sample set, wherein the training sample set includes feature vectors formed by user features and corresponding user classification labels; A second processing module is configured to approximate the mapping circuit using a neural network operator, wherein the neural network operator is composed of a Pauli operator and a neural network, and construct a quantum classifier using the neural network operator that approximates the mapping circuit and parameters of the variational quantum circuit; A third processing module is used to construct a quantum classifier using the neural network operator and the parameters of the variational quantum circuit that approximate the mapping circuit; The fourth processing module is used to iteratively update the parameters of the variational quantum circuit according to the user classification label using a phase shift rule and a gradient descent algorithm, thereby obtaining a quantum classifier for classifying users.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the method for constructing a quantum classifier based on a neural operator according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the method for constructing a quantum classifier based on a neural operator according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Action recognition method, system and equipment based on skeleton coordinate points and medium
CN116343337A
Neural network-based eigenvalue solving method and equipment
CN116402154A
Skeleton scale difference feature extraction-oriented action recognition method, system and equipment and medium
CN117877119A
Method for constructing quantum echo state network model for aero-engine fault early-warning
WO2024077642A1