Auxiliary processing method, device, equipment and system for quantum machine learning
By introducing classical computers to quantum machine learning tasks, nonlinear processing problems in quantum machine learning are solved, classification performance is improved and quantum circuit depth is reduced, and more efficient quantum neural network learning is achieved.
Patent Information
- Application Number
- CN202410104419.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-24
- Publication Date
- 2025-07-25
Smart Images

Figure CN120373486A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of quantum technology, and in particular, to an auxiliary processing method, device, equipment, and system for quantum machine learning. Background Art
[0002] Inspired by classical machine learning, quantum machine learning has gradually evolved by combining the parallel computing of qubits and the characteristics of quantum entanglement.
[0003] In related technologies, quantum machine learning tasks are executed through parameterized quantum circuits. By loading classical data as the initial quantum state of the qubits included in a parameterized quantum circuit (PQC), the quantum gates in the parameterized quantum circuit act on the qubits to implement a series of unitary operations, completing the complete quantum part in the quantum machine learning task. Finally, by measuring the probability distribution of a certain observable, a statistical model is generated based on the probability distribution of the observable, thereby obtaining the output result of the quantum machine learning task.
[0004] However, limited by the linear unitary operations in the parameterized quantum circuit, it is difficult to implement non-linear processing in the intermediate process of executing quantum machine learning tasks, which is not conducive to improving the classification performance of quantum machine learning methods. Summary of the Invention
[0005] The embodiments of the present application provide an auxiliary processing method, device, equipment, and system for quantum machine learning. The technical solutions provided by the embodiments of the present application are as follows:
[0006] According to one aspect of the embodiments of the present application, an auxiliary processing method for quantum machine learning is provided. The method includes:
[0007] Obtain the unitary result generated during the execution of a quantum machine learning task, where the unitary result is obtained by measuring the first qubits in the first parameterized quantum circuit used in the quantum machine learning task, and the first parameterized quantum circuit is used to perform unitary operations on the initial quantum state of the first qubits;
[0008] Perform non-linear processing on the unitary result to obtain a non-linear processing result, where the non-linear processing result is used to characterize the activation result of the unitary result;
[0009] According to the non-linear processing result, indicate the initial quantum state of the second qubits to the second parameterized quantum circuit used in the quantum machine learning task. The second parameterized quantum circuit is used to perform unitary operations on the initial quantum state of the second qubits, and the initial quantum state of the second qubits is determined by encoding the non-linear processing result.
[0010] According to one aspect of the embodiments of the present application, a method for assisting in quantum machine learning is provided. The method includes:
[0011] A classical computer obtains a unitary result generated during the execution of a quantum machine learning task. The unitary result is obtained by measuring a first qubit in a first parameterized quantum circuit used in the quantum machine learning task. The first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit;
[0012] The classical computer performs non-linear processing on the unitary result to obtain a non-linear processing result;
[0013] A quantum computer encodes according to the non-linear processing result to determine the initial quantum state of a second qubit in a second parameterized quantum circuit used in the quantum machine learning task. The second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit.
[0014] According to one aspect of the embodiments of the present application, a device for assisting in quantum machine learning is provided. The device includes:
[0015] A result acquisition module for obtaining a unitary result generated during the execution of a quantum machine learning task. The unitary result is obtained by measuring a first qubit in a first parameterized quantum circuit used in the quantum machine learning task. The first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit;
[0016] A result processing module for performing non-linear processing on the unitary result to obtain a non-linear processing result;
[0017] A result indication module for indicating, according to the non-linear processing result, the initial quantum state of a second qubit to a second parameterized quantum circuit used in the quantum machine learning task. The second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit. The initial quantum state of the second qubit is determined by encoding the non-linear processing result.
[0018] According to one aspect of the embodiments of the present application, a computer device is provided. The computer device includes a processor and a memory. A computer program is stored in the memory and is loaded and executed by the processor to implement the method for assisting in quantum machine learning as described above.
[0019] According to one aspect of the embodiments of the present application, there is provided a computer-readable storage medium, in which a computer program is stored, and the computer program is loaded and executed by a processor to implement the auxiliary processing method of quantum machine learning as described above.
[0020] According to one aspect of the embodiments of the present application, there is provided a computer program product, which includes a computer program stored in a computer-readable storage medium, and a processor reads and executes the computer program from the computer-readable storage medium to implement the auxiliary processing method of quantum machine learning as described above.
[0021] According to one aspect of the embodiments of the present application, there is provided an auxiliary processing system for quantum machine learning, the system includes a classical computer and a quantum computer;
[0022] The classical computer is configured to obtain a unitary result generated during the execution of a quantum machine learning task, where the unitary result is obtained by measuring a first qubit in a first parameterized quantum circuit used in the quantum machine learning task, and the first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit;
[0023] The classical computer is further configured to perform a non-linear process on the unitary result to obtain a non-linear processing result;
[0024] The quantum computer is configured to perform encoding according to the non-linear processing result to determine the initial quantum state of a second qubit in a second parameterized quantum circuit used in the quantum machine learning task, and the second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit.
[0025] The technical solutions provided by the embodiments of the present application may include the following beneficial effects:
[0026] During the execution of a quantum machine learning task, multiple parameterized quantum circuits are used. For an intermediate parameterized quantum circuit among the multiple parameterized quantum circuits, by measuring the output quantum state of the qubits included in the intermediate parameterized quantum circuit, the unitary result corresponding to the parameterized quantum circuit can be obtained. By importing the unitary result into a classical computer and performing a classical non-linear process on the unitary result using the classical computer, an activation operation on the unitary result is realized; subsequently, the non-linear processing result obtained by the classical non-linear operation can indicate the initial quantum state of the qubits in the parameterized quantum circuit to be executed next.
[0027] The classical computer can complete the non - linear processing of the unitary result with only a small computational overhead. Introducing reliable non - linear processing in the intermediate process of performing quantum machine learning tasks is equivalent to introducing the activation manipulation designed between two hidden layers in classical machine learning in a quantum neural network, which helps to improve the perception ability and processing ability of the quantum neural network for input data.
[0028] Compared with the quantum machine learning methods provided in the related art, under the same consumption of quantum computing hardware resources, the method provided in the embodiments of the present application helps to significantly improve the classification performance of quantum machine learning; under the condition of the same classification performance of quantum machine learning, it helps to reduce the depth of the quantum circuit and reduce the overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments.
[0030] Figure 1 It is a schematic diagram of the system architecture provided by an exemplary embodiment of the present application;
[0031] Figure 2 It is a schematic diagram of a standard quantum neural network provided in the related art;
[0032] Figure 3 It is a schematic diagram of a dissipative quantum neural network provided in the related art;
[0033] Figure 4 It is a schematic diagram of a convolutional quantum neural network provided in the related art;
[0034] Figure 5 It is a schematic diagram of a quantum activation function in a parameterized quantum circuit provided in the related art;
[0035] Figure 6 It is a schematic diagram of the inventive concept of the present solution;
[0036] Figure 7 It is a flowchart of an auxiliary processing method for quantum machine learning provided by an exemplary embodiment of the present application;
[0037] Figure 8 It is a schematic diagram of a non - linear processing process provided by an exemplary embodiment of the present application;
[0038] Figure 9 It is a schematic diagram of a neural network provided by an exemplary embodiment of the present application;
[0039] Figure 10 It is a schematic diagram of data re - import provided by an exemplary embodiment of the present application;
[0040] Figure 11 It is a schematic diagram of the training effect of the quantum classifier provided by an exemplary embodiment of the present application;
[0041] Figure 12 It is a schematic diagram of the training process provided by an exemplary embodiment of the present application;
[0042] Figure 13 It is a schematic diagram of the corresponding relationship between the step size and the loss function value provided by the parity data experiment process;
[0043] Figures 14 - 16 It is a schematic diagram of the corresponding relationship between the step size and the confidence provided by the parity data experiment process;
[0044] Figure 17 、 18 It is a schematic diagram of the corresponding relationship between the step size and the loss function value provided by the MNIST data experiment process;
[0045] Figure 19 、 20 It is a schematic diagram of the corresponding relationship between the step size and the fidelity provided by the MNIST data experiment process;
[0046] Figure 21 It is a block diagram of the auxiliary processing device of quantum machine learning provided by another exemplary embodiment of the present application;
[0047] Figure 22 It is a structural block diagram of the computer device provided by an exemplary embodiment of the present application. Detailed implementation manners
[0048] To make the objectives, technical solutions, and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0049] First, before introducing the technical solutions of the present application, some terms involved in the present application will be explained.
[0050] Quantum bit: It is the basic unit of quantum computing. Different from classical computers that use 0 and 1 as the basic units of binary. Quantum computing can process 0 and 1 simultaneously, and the system can be in a linear superposition state of 0 and 1: |ψ> = α|0> + β|1>, where α and β respectively represent the complex probability amplitudes of the system in 0 and 1.
[0051] Quantum Machine Learning: It is a method that uses the principles and technologies of quantum computing to solve machine learning problems. It combines the characteristics of quantum mechanics and the principles of machine learning algorithms, aiming to accelerate and improve traditional machine learning tasks by leveraging the parallel computing of qubits and the characteristics of quantum entanglement. The goal of quantum machine learning is to improve the performance and efficiency of machine learning tasks such as pattern recognition, classification, and clustering by taking advantage of the strengths of quantum computing, such as quantum parallelism and the high-dimensional representation ability of quantum states. By using quantum algorithms and quantum optimization methods, quantum machine learning can demonstrate more powerful computing and learning capabilities when dealing with large-scale data and complex problems.
[0052] Parameterized Quantum Circuit: It is a representation of a quantum universal computer, referring to a quantum circuit that contains parameterized quantum gates. A parameterized quantum gate is a quantum gate with variable free parameters.
[0053] Quantum-Classical Hybrid Computing: It is a computing paradigm that uses parameterized quantum circuits to calculate corresponding physical quantities or loss functions and combines traditional classical optimizers to adjust the variational parameters of the quantum circuit. It can maximize the advantages of quantum computing and is believed to be one of the important directions with the potential to prove quantum supremacy.
[0054] Quantum Computing Expectation Value: It refers to measuring a certain physical quantity in quantum computing and calculating its average value in a given quantum state. In quantum mechanics, physical quantities are represented by corresponding operators, while quantum states are described by wave functions or density matrices.
[0055] Artificial Intelligence (AI): It is to use a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, a theory, method, technology, and application system that can perceive the environment, acquire knowledge, and use knowledge to obtain the best results.
[0056] Machine Learning (ML): It is an interdisciplinary subject involving multiple fields such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent, and its applications cover all fields of artificial intelligence.
[0057] Deep Learning (DL): It is a research direction in machine learning. Deep learning is to learn the internal laws and representation levels of sample data, and the information obtained in these learning processes is used to interpret data such as text, pictures, and sounds. The ultimate goal of deep learning is to enable machines to have the ability of analysis and learning like humans and be able to recognize data such as text, pictures, and sounds.
[0058] In recent years, there have been many studies on quantum algorithms and circuits for quantum neural networks. In a classical environment, neural networks provide powerful solutions for various machine learning tasks, and in many cases, they can overcome obstacles that cannot be overcome by traditional computing. Therefore, in order to develop quantum algorithms comparable to classical frontiers, it is natural to try to apply neural networks to the quantum environment.
[0059] Most quantum neural networks are feed-forward neural networks, abbreviated as quantum feed-forward networks. Similar to classical neural networks, a layer of quantum neural networks in the quantum neural network structure includes qubits that receive input data, process the input data to obtain output data, and use the output data as the input data for another layer of quantum neural networks. The other layer of quantum neural networks processes the input data to obtain output data; the previous two steps are repeated, and the final path leads to the qubits included in the last quantum neural network. In the quantum neural network structure, the widths of different quantum neural network layers do not have to be the same. That is, the number of qubits included in different quantum neural network layers can be the same or different. In addition, the types and numbers of quantum gates in the parameterized quantum circuits corresponding to different quantum neural network layers do not have to be the same.
[0060] Using quantum feed-forward networks, deep neural networks can be efficiently executed and trained. A deep neural network is essentially a network with multiple hidden layers. The above-mentioned hidden layers can be implemented by parameterized quantum circuits. Quantum neural networks use fan-out unitary operators, and each operator only acts on its corresponding input data. Therefore, only two layers of the quantum neural network are used at any given time. In other words, no unitary operator acts on the entire quantum neural network at the same time, which means that the number of qubits required in a quantum neural network layer depends on the input data of that quantum neural network layer. Quantum computers are known for their ability to run multiple iterations in a short time. Therefore, the efficiency of quantum neural networks only depends on the number of qubits included in the quantum neural network layer, rather than the depth of the quantum neural network.
[0061] Figure 1 It is a schematic diagram of the system architecture provided by an exemplary embodiment of the present application.
[0062] The auxiliary processing system for quantum machine learning provided by the present application includes a quantum computer 10 and a classical computer 20. Among them, the quantum computer includes multiple parameterized quantum circuits. The multiple parameterized quantum circuits are executed serially. As Figure 1The quantum computer includes a parameterized quantum circuit 12 and a parameterized quantum circuit 13 with adjacent execution timings. The classical computer 20 is used to play a role in data-assisted processing during the process of the quantum computer 10 executing a quantum machine learning task. Specifically, the classical computer is used to perform classical non-linear processing on the unitary result generated by the parameterized quantum circuit 12, and based on the processed non-linear processing result, act on the parameterized quantum circuit 13. Through this method, non-linear activation processing is achieved during the intermediate execution process of the quantum machine learning task.
[0063] The application scenarios of this method include at least one of the following: training multiple parameterized quantum circuits based on a specific quantum machine learning task; actually executing a specific quantum machine learning task through multiple parameterized quantum circuits.
[0064] Among them, the quantum machine learning tasks include but are not limited to the following scenarios: 1. Quantum chemistry simulation: such as calculating the chemical energy of a molecule, predicting low-energy pathways of split substances, etc. through the method provided in this application. 2. Quantum physics calculation: such as solving the ground state and excited state in a many-body system through the method provided in this application. 3. Solving mathematical problems: such as solving high-dimensional variational equations and differential equations through the method provided in this application. 4. Quantum communication network: such as predicting orthogonal quantum states and non-orthogonal quantum states through the method provided in this application, and applying the prediction results to the design of devices such as structured quantum repeaters and quantum receivers. 5. Quantum metrology: such as determining the optimization direction for quantum sensing and quantum imaging through the method provided in this application, so as to improve quantum sensing devices and quantum imaging devices to achieve higher-precision quantum measurements.
[0065] Next, a brief introduction to several quantum neural networks in related technologies will be given.
[0066] Figure 2 is a schematic diagram of a standard quantum neural network provided in related technologies.
[0067] As Figure 2 shown, the quantum gates in the parameterized quantum circuit 210 act on qubits, changing the states of the qubits. Finally, the qubits in each parameterized quantum circuit (including 210) are measured through the measurement circuit 220 to obtain the prediction result of the quantum neural network. As Figure 2 shown, each qubit in the standard quantum neural network is not discarded during the execution of the parameterized quantum circuit; and no new qubits are added during the execution of the parameterized quantum circuit.
[0068] Figure 3 is a schematic diagram of a dissipative quantum neural network provided in related technologies.
[0069] Dissipative quantum neural networks generalize classical feedforward networks. As Figure 3 shown, each node in a dissipative quantum neural network corresponds to a qubit, and the lines connecting the qubits represent unitary operations. The dissipativity of a dissipative quantum neural network stems from the fact that the qubits (such as 310) included in each layer of the quantum neural network are discarded after propagating forward to the (new) qubits in the next layer.
[0070] Figure 4 is a schematic diagram of a convolutional quantum neural network provided in the related art.
[0071] Figure 4 shows the structure of a quantum convolutional neural network (QCNN). In each layer of the quantum convolutional neural network, the dimension of the input data for the next layer is reduced by measuring the qubits in that layer, while retaining the relevant features of the measured qubits. Similar to a classical convolutional neural network (CNN), the QCNN also has network layers such as convolutional layers, pooling layers, and fully connected layers. The difference between the QCNN and the CNN is that the QCNN uses qubits as input and processing units and uses quantum gate operations to perform convolutional and pooling operations. In the QCNN, the convolutional operation is implemented through the action of quantum gates. Quantum gates can transform the state quantities of the input qubits, achieving an operation equivalent to feature extraction in a classical convolutional neural network. The extracted features are reduced in dimension and key information is extracted through pooling operations. Finally, the fully connected layer in the QCNN maps these features to the output layer for classification or other tasks.
[0072] Referring to the above several quantum neural networks, it is not difficult to find that in the related art, the qubits are operated through the quantum gates in the parameterized quantum circuit, and the quantum states of the qubits are changed to implement operations such as feature extraction, pooling, and normalization processing in the classical neural network. Since quantum mechanics is linear (for example, quantum operations are related to matrix operations), the operations implemented in the parameterized quantum circuit are all linear operations.
[0073] The expressive power of classical neural networks largely comes from non-linear activation functions and dissipative dynamics, while quantum mechanics is obviously linear, and the unitary evolution provided by quantum gates is reversible and non-dissipative. Quantum neural networks in related technologies ignore these problems and only construct parameterized quantum circuits. Parameterized quantum circuits can only perform linear unitary operations. By adjusting the free parameters in these parameterized quantum circuits during the training process, these parameterized quantum circuits can be made to perform quantum machine learning tasks. Since parameterized quantum circuits neither use the hierarchical structure of neural networks nor non-linear activation functions, the quantum neural networks provided in related technologies have little resemblance to artificial neural networks in classical computing or biological neural networks in nature.
[0074] Since quantum evolution describes probabilistic observation results by linear operations, non-linear activation functions do not directly correspond to the mathematical structures in quantum mechanics. Ideas in related technologies for quantum mechanical forms aiming to mimic perceptron activation functions include: using special measurement methods to measure parameterized quantum circuits, constructing non-linear quantum operators (constructing quantum activation functions), etc.
[0075] Figure 5 It is a schematic diagram of a quantum activation function in a parameterized quantum circuit provided in related technologies.
[0076] Such as Figure 5 shown, a quantum activation function 1 and a quantum activation function 2 are introduced into the parameterized quantum circuit. The quantum state of qubits is acted on by the quantum activation function to mimic the perceptron in a classical neural network.
[0077] For another example, at least one reference qubit is introduced into the parameterized quantum circuit, and non-linear operations are realized in the parameterized quantum circuit through the reference qubit. However, on the one hand, adding new qubits to the parameterized quantum circuit will increase the complexity of the system, and on the other hand, there are still controversies regarding the reliability and stability of obtaining non-linear processing through special measurements of reference qubits.
[0078] Figure 6 It is a schematic diagram of the inventive concept of this solution.
[0079] In the embodiments of this application, non-linear processing is completed through the intermediate process of classical computer-aided quantum machine learning. For a quantum neural network layer in the quantum neural network structure, after the first parameterized quantum circuit corresponding to this quantum neural network layer is executed, the output quantum state of the qubits in the first parameterized quantum circuit is measured to obtain a unitary result.
[0080] Subsequently, a classical computer is used to perform non-linear processing on the unitary result, and based on the non-linear processing result obtained from the non-linear processing, the initial quantum state of the qubits in the next parameterized quantum circuit (such as Figure 5 the second parameterized quantum circuit in
[0081] Performing classical non-linear processing by a classical computer only requires a small computational overhead to achieve non-linear processing of the unitary result, realizes the activation of the processing result generated by the intermediate layer of the quantum neural network, introduces non-linear processing in the intermediate process of quantum machine learning, and improves the perception ability and learning accuracy of the quantum neural network. Compared with the quantum machine learning methods provided in the related art, under the same consumption of quantum computing hardware resources, the method provided by the embodiments of the present application helps to significantly improve the classification performance of quantum machine learning, and helps to achieve the good effect of reducing the depth of the quantum circuit under the condition of the same quantum machine learning classification performance.
[0082] Figure 7 FIG. is a flowchart of an auxiliary processing method for quantum machine learning provided by an exemplary embodiment of the present application. This method can be executed by a classical computer. The method may include the following steps (710-730):
[0083] Step 710, obtaining a unitary result generated during the execution of a quantum machine learning task, where the unitary result is obtained by measuring the first qubit in the first parameterized quantum circuit used in the quantum machine learning task, and the first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit.
[0084] In some embodiments, a quantum machine learning task refers to a machine learning task participated by a quantum computer. As introduced above, a quantum machine learning task is executed through a quantum neural network structure. Specifically, a series of processes are performed on the initial data of the quantum machine learning task through the quantum neural network structure, and the prediction result of the quantum machine learning task is determined by measuring the output quantum state of the qubits.
[0085] Optionally, the types of quantum machine learning tasks include, but are not limited to, at least one of the following: image processing, text recognition, graphic recognition, medical record analysis, stock price prediction, molecular property prediction, biological experiment result prediction, and collision trajectory calculation in high-energy physics experiments, etc. The specific type of the quantum machine learning task is set according to actual needs and is not set in this application. The embodiments of the present application can be applied to a hybrid quantum-classical machine learning model.
[0086] The parameters of the parametric quantum circuit that include the parameters of quantum gates with adjustable parameters are also called parametric quantum gates. During the training process of quantum machine learning tasks, by adjusting the free parameters of the parametric quantum gates, multiple parametric quantum circuits can adaptively complete the above-mentioned specific quantum machine learning tasks. The parametric quantum circuit is also called a quantum neural network layer, a variational quantum circuit (VQC), etc. In the embodiments of the present application, a parametric quantum circuit corresponds to a quantum neural network layer in the quantum neural network structure. Generally, a quantum neural network includes multiple quantum neural network layers.
[0087] Optionally, the parametric quantum circuit includes at least one qubit and multiple quantum gates. Among them, a qubit is also called a quantum bit. The quantum gate acts on the qubit to change the quantum state of the qubit. Exemplarily, there is a sequential execution order among multiple quantum gates. For a certain qubit included in the parametric quantum circuit, the qubit corresponds to at least one quantum gate, and the at least one quantum gate acts on the qubit in sequence according to the execution order, causing the qubit to rotate, thereby changing the quantum state of the qubit. The types of quantum gates include at least one of the following: single-bit rotation Y gate, Z gate, two-bit rotation controlled Z gate, etc. For different quantum machine learning tasks,
[0088] Optionally, the types of quantum gates can be divided into parametric quantum gates and non-parametric quantum gates. Among them, the parametric quantum gate has free parameters, and the non-parametric quantum gate does not include variable free parameters.
[0089] Exemplarily, the free parameter refers to the phase parameter θ of the parametric quantum gate. During the training process of quantum machine learning tasks, the free parameters can be adjusted so that the adjusted free parameters are more suitable for this type of quantum machine learning task.
[0090] In one example, the parametric quantum circuit can be expressed as:
[0091]
[0092] Among them, represents the action effect of the parametric quantum gate, σ ∈ {σ x , σ y , σ z} is one of the Pauli matrices, W i represents the action effect of the non-parametric quantum gate, L represents the total number of quantum gates included in the parametric quantum circuit, and θ is used to characterize the free parameters included in the parametric quantum circuit.
[0093] In the process of performing a quantum machine learning task, a quantum computer prepares the initial quantum state of qubits in a parameterized quantum circuit based on the initial data of the quantum machine learning task (e.g., encodes according to the initial data to determine the initial quantum state of each qubit in the parameterized quantum circuit). Subsequently, the quantum gates in the parameterized quantum circuit act on the qubits, that is, perform a unitary operation on the qubits in the parameterized quantum circuit, causing the quantum state of the qubits to change. After all the quantum gates in the parameterized quantum circuit have acted on the qubits, the quantum state of the qubits is the output state. Measuring the output state of the qubits can obtain the unitary result of the parameterized quantum circuit.
[0094] Generally, the unitary result is represented in the form of a wave function or a density matrix. Optionally, the unitary result includes the qubit string obtained by measuring the output quantum state of the qubits in the measurement basis.
[0095] In the embodiments provided in the present application, multiple parameterized quantum circuits are used to participate in the execution process of the quantum machine learning task. The execution process of the quantum machine learning task can be a process of training a quantum neural network or a process of actually applying the quantum neural network to complete classification prediction in a specific field.
[0096] Optionally, the multiple parameterized quantum circuits are executed serially, that is, after one parameterized quantum circuit finishes execution, another parameterized quantum circuit among the multiple parameterized quantum circuits starts to execute. That is, the quantum neural network belongs to a feedforward network, such as a deep network.
[0097] Exemplarily, for two parameterized quantum circuits with adjacent execution timings, the initial quantum state of the qubits in the latter parameterized quantum circuit (i.e., the second parameterized quantum circuit) is related to the output quantum state of the qubits in the former parameterized quantum circuit (i.e., the first parameterized quantum circuit). In the solution provided in the embodiments of the present application, after one parameterized quantum circuit finishes execution, a classical computer needs to perform a non-linear process on the unitary result of the parameterized quantum circuit. For specific details, please refer to the following embodiments.
[0098] In the embodiments provided in the present application, in order to achieve reliable non-linear processing in quantum machine learning, a classical non-linear auxiliary framework is introduced. The classical non-linear auxiliary framework is implemented by a classical computer. After one parameterized quantum circuit finishes execution, the output quantum state of the qubits in the parameterized quantum circuit is measured to obtain the unitary result. The classical computer performs a classical non-linear process on the unitary result to obtain a non-linear processing result, and determines the initial quantum state of the qubits in the next parameterized quantum circuit according to the non-linear processing result, realizing the classical non-linear activation process. For specific details of this part, please refer to the following embodiments.
[0099] In some embodiments, the first parameterized quantum circuit refers to one of multiple parameterized quantum circuits used in a quantum machine learning task. Optionally, the execution timing of the first parameterized quantum circuit is earlier than at least one other parameterized quantum circuit among the multiple parameterized quantum circuits. For example, the first parameterized quantum circuit is the quantum circuit with the earliest execution order among the multiple parameterized quantum circuits. For another example, the first parameterized quantum circuit is the quantum circuit with the second latest execution order among the multiple parameterized quantum circuits.
[0100] The first qubit refers to the qubit in the first parameterized quantum circuit. Optionally, the first qubit includes all the qubits in the first parameterized quantum circuit. Optionally, the first qubit includes the qubits that contribute to the quantum machine learning task. For example, for a certain quantum machine learning task that only needs to determine the probability distribution of the operator x, the qubits corresponding to the operator x are the first qubits, and only the qubits of the operator x need to be measured. It should be noted that the type of the first qubit is set according to actual needs and is not set in this application. That is, in the process of measuring the parameterized quantum circuit, the output quantum states of the qubits within a local range can be measured to reduce the data processing pressure in the process of processing the quantum machine learning task, or the output quantum states of all the qubits in the first parameterized quantum circuit can be measured.
[0101] The unitary result is determined by measuring the first qubit in the first parameterized quantum circuit. Optionally, the unitary result belongs to classical data, and the unitary result is used to characterize the probability distribution of the output quantum state of the first qubit, where classical data refers to the data represented by classical bits, that is, classical data is binary data. For example, 00101010001 is classical data.
[0102] Optionally, the unitary result is represented by a qubit string, and the unitary result includes at least one sub-result. Exemplarily, different sub-results respectively correspond to one qubit. A qubit string is a number composed of 0 and 1, which is classical data obtained by measuring the qubits in the parameterized quantum circuit.
[0103] Exemplarily, the up and down of the spin configuration of the unitary result on the measurement basis are respectively represented by 0 and 1, and one measurement result corresponds to a bit string. For example, the measurement of the first parameterized quantum circuit is decomposed according to the Pauli String and measured item by item. A Pauli string refers to a term composed of the direct product of multiple Pauli operators at different lattice points. A Pauli string belongs to the qubit string.
[0104] Step 720, perform non-linear processing on the unitary result to obtain a non-linear processing result, and the non-linear processing result is used to characterize the activation result of the unitary result.
[0105] In some embodiments, the non-linear processing of the unitary result is classical non-linear processing, that is, the non-linear processing performed by a classical computer on classical data. The non-linear processing is used to activate the unitary result, and the non-linear processing result obtained by performing non-linear processing on the unitary result has better classification perception ability.
[0106] Optionally, the non-linear processing is to perform non-linear processing on the unitary result through an activation function. That is, a classical activation function is used to perform non-linear processing on the unitary result. Exemplarily, the types of activation functions include but are not limited to at least one of the following: Rectified Linear Unit (ReLU) function, Sigmoid function, etc.
[0107] Optionally, a multi-layer perceptron constructed by a neural network performs non-linear processing on the unitary result. Exemplarily, the neural network refers to the neural network in the architecture of the variational quantum-neural network hybrid eigenvector. For the structure of the neural network, please refer to the following embodiments.
[0108] In some embodiments, the non-linear processing result refers to the energy expectation value after non-linear processing of the output quantum state of the first qubit in the first parametric quantum circuit. The classical computer performs a non-linear transformation on the unitary result to obtain the non-linear result of the unitary result. The non-linear processing result has better feature perception ability than the unitary result, which helps to improve the expression ability of quantum machine learning tasks and the classification ability of quantum machine learning algorithms.
[0109] Step 730: According to the non-linear processing result, the initial quantum state of the second qubit indicated by the second parametric quantum circuit used in the quantum machine learning task is set. The second parametric quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit, and the initial quantum state of the second qubit is determined by encoding intermediate data.
[0110] In some embodiments, the second parametric quantum circuit is one of the multiple parametric quantum circuits used in performing the quantum machine learning task. Optionally, the execution timing of the second parametric quantum circuit lags behind the execution timing of the first parametric quantum circuit.
[0111] Optionally, the execution timing of the second parametric quantum circuit is adjacent to the execution timing of the first parametric quantum circuit. That is, after the quantum computer executes the first parametric quantum circuit, it executes the second parametric quantum circuit. In this case, the first parametric quantum circuit and the second parametric quantum circuit are equivalent to two adjacent hidden layers in a quantum neural network.
[0112] The initial quantum states of the qubits included in the second parameterized quantum circuit are related to the unitary result obtained by measuring the first qubit included in the first parameterized quantum circuit. Optionally, the number of qubits included in the first parameterized quantum circuit is equal to the number of qubits included in the first parameterized quantum circuit, and the initial quantum states of the respective qubits in the second parameterized quantum circuit can be determined according to the unitary result. Exemplarily, after encoding the non-linear processing result obtained after processing the unitary result as in step 720, the initial quantum states of the qubits in the second parameterized quantum circuit can be obtained.
[0113] Exemplarily, the process of encoding the non-linear processing result is completed in a quantum computer, such as implemented by an encoding quantum circuit in the quantum computer. The encoding quantum circuit includes at least one quantum gate. After the qubits are rotated by the quantum gates in the encoding quantum circuit, the initial quantum states of the qubits in the second parameterized quantum circuit are prepared. That is, the initial quantum states of the respective second qubits in the second parameterized quantum circuit are prepared by the encoding quantum circuit based on the non-linear processing result. In other words, the non-linear processing result in the form of classical data is converted into a quantum form by the encoding quantum circuit, so that the second parameterized quantum circuit can continue the subsequent steps in the quantum neural network according to the non-linear processing result in the quantum form.
[0114] Optionally, the encoding quantum circuit can be understood as the part with the earliest execution timing in the second parameterized quantum circuit, that is, the encoding quantum circuit is connected to the second parameterized quantum circuit. The classical computer transmits the non-linear processing result to the encoding quantum circuit. After the initial quantum states of the qubits are prepared by the encoding quantum circuit based on the non-linear processing result, the quantum gates included in the second parameterized quantum circuit act on the qubits according to a preset timing.
[0115] In some embodiments, the second parameterized quantum circuit is similar to the first parameterized quantum circuit and includes qubits and quantum gates. The second qubit refers to the qubit included in the second parameterized quantum circuit. Optionally, the second qubit refers to the qubit used to implement quantum machine learning in the second parameterized quantum circuit. Exemplarily, the total number of second qubits is equal to the total number of first qubits.
[0116] Optionally, the type of the initial quantum state of the qubit includes at least one of the following: all-0 state, uniform superposition state, Hartree-Fock state, etc. The initial quantum state is also called the input quantum state, trial state, etc. In the embodiments of the present application, the initial quantum state of the second qubit depends on the non-linear processing result.
[0117] In one example, after the execution of the first parameterized quantum circuit is completed, the classical computer obtains the unitary result obtained by measuring the output quantum state of the qubits in the parameterized quantum circuit, and the unitary result is represented by a qubit string. Subsequently, the classical computer performs non-linear processing based on the unitary result to activate the unitary result and obtain a non-linear processing result. The classical computer transmits the non-linear processing result to the quantum computer, enabling the quantum computer to perform encoding according to the non-linear processing result, that is, to prepare the initial quantum state of the second qubit according to the non-linear processing result.
[0118] Subsequently, the quantum computer executes the second parameterized quantum circuit. The quantum gates in the second parameterized quantum circuit act on the second qubits in the second parameterized quantum circuit, changing the quantum states of the second qubits. By measuring the output quantum states of the qubits in the second parameterized quantum circuit, the unitary result generated by the second parameterized quantum circuit is obtained.
[0119] In this example, the classical computer refers to a computer designed according to the von Neumann principle and is used to operate on classical bits. The quantum computer refers to a computer designed based on quantum mechanics and is used to operate on qubits. The parameterized quantum circuit refers to the hardware circuit used to implement the quantum computer. Since the solution provided in the embodiments of this application involves more than one parameterized quantum circuit, a quantum computer is used as the execution entity for the part of quantum computing involved in quantum machine learning. The process of the quantum computer executing the parameterized quantum circuit is actually the process of the quantum gates in the parameterized quantum circuit acting on the qubits.
[0120] In the embodiments provided in this application, the first parameterized quantum circuit is any one of the multiple parameterized quantum circuits used to implement the quantum machine learning task except for the parameterized quantum circuit with the latest execution order. During the execution of the quantum machine learning task, there can be multiple first parameterized quantum circuits or only one first parameterized quantum circuit. Exemplarily, the first parameterized quantum circuit refers to the parameterized quantum circuit with the earliest execution order.
[0121] Exemplarily, the first parameterized quantum circuit includes all parameterized quantum circuits except the one with the latest execution order. In this case, assuming that a total of n parameterized quantum circuits are required to execute the quantum machine learning task, there are n - 1 first parameterized quantum circuits. It is not difficult to understand that in this case, the first parameterized quantum circuit and the classical non-linear framework provided by the classical computer form a hidden layer in the quantum neural network. By adding the classical non-linear framework, the activation operation of the intermediate results generated by the parameterized quantum circuit is completed, making up for the defect that it is difficult to implement non-linear activation functions in the parameterized quantum circuit, and helping to improve the classification and induction ability of quantum machine learning.
[0122] In the case where there is more than one first parameterized quantum circuit in the quantum machine learning task, the method for the classical computer to perform non-linear processing on the unitary results obtained by measuring the qubits in different first parameterized quantum circuits can be the same or different. For specific details, please refer to the following embodiments.
[0123] Non-linear basis functions are crucial in classical machine learning. Classical machine learning usually uses a large number of activation functions to create a complex model to achieve high-precision learning. Quantum neural networks operate in a coherent manner on quantum states. Since quantum states usually have a mixture of classical correlation and quantum correlation, in the solution provided in this application, the quantum computer in the hybrid quantum-classical model acts on qubits based on the quantum correlation of the quantum state using quantum gates, and the classical computer in the hybrid quantum-classical model performs classical non-linear operations on the unitary results obtained by processing the parameterized quantum vectors in the intermediate layer based on the classical correlation of the quantum state, which helps to improve the ability of the quantum neural network model in the related art to represent quantum-related distributions.
[0124] In summary, in the execution process of the quantum machine learning task, multiple parameterized quantum circuits are used. For the intermediate parameterized quantum circuits among the multiple parameterized quantum circuits, by measuring the output quantum states of the qubits included in the intermediate parameterized quantum circuit, the unitary result corresponding to the parameterized quantum circuit can be obtained. By importing the unitary result into the classical computer and using the classical computer to perform classical non-linear processing on the unitary result, the activation operation of the unitary result is realized; subsequently, the non-linear processing result obtained by the classical non-linear operation can indicate the initial quantum state of the qubits in the parameterized quantum circuit to be executed next.
[0125] The non - linear processing completed by a classical computer can complete the non - linear processing of the unitary result with only a small computational overhead. Introducing reliable non - linear processing in the intermediate process of performing a quantum machine learning task is equivalent to introducing the activation manipulation designed between two hidden layers in classical machine learning in a quantum neural network, which helps to improve the perception ability and processing ability of the quantum neural network for input data.
[0126] Compared with the quantum machine learning methods provided in the related art, under the same consumption of quantum computing hardware resources, the method provided by the embodiments of the present application helps to significantly improve the classification performance of quantum machine learning; under the same quantum machine learning classification performance, it helps to reduce the depth of the quantum circuit and reduce the overhead.
[0127] Next, the process of obtaining the unitary result will be introduced and illustrated through several embodiments.
[0128] Step 710, obtaining the unitary result generated during the execution of the quantum machine learning task, may include the following sub - steps (not shown in the accompanying drawings of the specification), and these sub - steps are executed by a classical computer.
[0129] Sub - step 713, obtaining the measurement result obtained by measuring the output quantum state of the first qubit.
[0130] In some embodiments, after the first parameterized quantum circuit performs a unitary operation on the first qubit, the quantum computer measures the output quantum state of the first qubit in the first parameterized quantum circuit. That is, the above - mentioned measurement result is obtained. Exemplarily, the quantum computer includes a measurement circuit, and the measurement of each first qubit is completed through the measurement circuit.
[0131] Optionally, the first qubit refers to all the qubits included in the first parameterized quantum circuit, and the first qubit can also be part of the qubits included in the first parameterized quantum circuit. For example, the first qubit is a single qubit or a pair of qubits.
[0132] In some embodiments, the measurement result is used to characterize the energy expectation value. The energy expectation value of the Hamiltonian of the quantum system in the output quantum state of the first qubit is the sum of the energy expectation values of multiple Pauli strings obtained by decomposing the Hamiltonian. Optionally, the first qubit includes a sign qubit and other first qubits except the sign qubit. The sign qubit is also called the sign bit. By setting the first parameterized quantum circuit, the observation result of the sign qubit can be located at the zeroth position in the measurement result, and the measurement basis of the sign qubit is determined according to the corresponding Pauli operator in the Pauli string. The measurement bases of other first qubits are all the same. Measuring on the measurement bases of each first qubit obtains the above - mentioned measurement result.
[0133] In one example, in the measurement circuit of a quantum computer, the measurement of other first qubits is controlled by a sign qubit. Specifically, the sign qubit determines the measurement of other first qubits through a control quantum gate. The control quantum gate includes: control-X / Y / Z gates, where X / Y / Z are determined by Pauli operators on other qubits.
[0134] Exemplarily, the sign bit is measured on the measurement basis corresponding to the Pauli operator, and all other first qubits are measured based on the measurement basis Z.
[0135] Sub-step 716, perform an average estimation on the measurement result to obtain a unitary result.
[0136] The average estimation of the measurement result can be achieved through the following formula:
[0137]
[0138] where O k is a Hermitian operator, represents the density matrix corresponding to the quantum circuit, that is, the measurement result. U(θ) represents the first parameterized quantum circuit, and K represents the total number of first qubits.
[0139] By measuring some qubits in the parameterized quantum circuit, it helps to reduce the measurement pressure and at the same time reduce the data processing pressure in the quantum machine learning process. After obtaining the unitary result, the classical computer performs a non-linear processing on the unitary result, and this process can be represented by the following formula:
[0140]
[0141] where, represents the unitary result, represents the non-unitary result obtained after non-linear processing. For the specific process of non-linear processing, please refer to the next embodiment.
[0142] Next, the non-linear operation process will be introduced and illustrated through several embodiments.
[0143] In some embodiments, step 720, perform non-linear processing on the unitary result to obtain a non-linear processing result, which may include the following sub-steps (723 - 726, not shown in the accompanying drawings of the specification), and the execution subject of these sub-steps is a classical computer.
[0144] Sub-step 723, perform a non-linear transformation on the unitary result based on a non-linear processing operator, to obtain a non-unitary result, and the non-linear processing operator is used to process data in the form of classical bits.
[0145] In some embodiments, a non-linear processing operator is used to characterize the implementation method of non-linear processing. Optionally, the non-linear processing operator is an activation function that performs non-linear processing on the unitary result. Optionally, the non-linear processing operator represents a neural network used to perform non-linear processing on the unitary result. For the specific form of the non-linear processing operator, please refer to the following text.
[0146] Classical bits are also known as 01 bits. Classical data consists of data in the form of at least one classical bit. The unitary result obtained by measuring the output state of the first qubit in the first parameterized quantum circuit belongs to classical data. In one example, a classical computer inputs the unitary result into a non-linear processing operator to obtain a non-unitary result.
[0147] The non-unitary result is obtained by a classical computer performing non-linear processing on the unitary result. That is, the non-unitary result refers to the unitary result after non-linear transformation. Compared with the unitary result, the non-unitary result has a stronger ability to perceive features involved in quantum machine learning tasks.
[0148] Regarding the difference between the unitary result and the non-unitary result, it can be understood through the relationship between the unitary matrix and the non-unitary matrix. A unitary matrix is a matrix that satisfies . All directly allowed evolution processes in quantum mechanics can be described by a unitary matrix. Where U is a unitary matrix (Unitary Matrix), also known as a unitary matrix, a unimodular matrix, etc., is the conjugate transpose of U. In addition, a matrix that does not satisfy the above conditions is non-unitary. The non-unitary result can be represented as a non-unitary matrix. Compared with the unitary result, the non-unitary result has stronger expressive power and a faster ground state projection effect.
[0149] Optionally, there is a corresponding relationship between the unitary result and the non-unitary result in terms of content. Exemplarily, the unitary result includes p sub-results, and the non-unitary result includes q sub-results, where p and q are positive integers and q is less than or equal to p. For example, for the sub-result i included in the unitary result, the classical computer performs non-linear processing on the sub-result i through a non-linear processing operator to obtain the sub-result i' in the non-unitary result.
[0150] In some embodiments, in the case where there are more than one parameterized quantum circuits among multiple parameterized quantum circuits, the non-linear processing operators for processing different first parameterized quantum circuits can be the same or different.
[0151] Sub-step 727, perform Hamiltonian calculation based on the non-unitary result to obtain a non-linear processing result.
[0152] In some embodiments, the non-linear processing result is a Hamiltonian calculated based on the non-unitary result. The Hamiltonian can generally be decomposed into a sum of a set of Pauli strings, which is used to characterize the total energy in a quantum system.
[0153] In one example, the non-unitary result can be calculated by the following formula:
[0154]
[0155] where f φ (s) is a non-linear processing operator, the qubit string s represents the unitary result corresponding to the first parameterized quantum circuit, and n represents the total number of first qubits included in the first parameterized quantum circuit. In the case where the non-linear processing operator includes variable parameters, φ represents the parameters in the non-linear processing operator (such as the parameters in a neural network), for example, the weights and biases corresponding to each neuron in the neural network. |s> and <s| respectively represent the left ket and right ket of the qubit string, and |s><s| refers to a diagonal matrix with the qubit string s as the diagonal element, represents the non-unitary result obtained after non-linear operation by the non-linear processing operator.
[0156] The non-linear processing result can be represented by the following formula:
[0157]
[0158] where |ψ> = U(θ)|0> represents the unitary result obtained by measuring the first qubit after unitary transformation of the initial state of the first qubit by the first parameterized linear network U(θ), and θ represents the free parameter in the parameterized quantum gate, represents the non-unitary result obtained by non-linearly processing the unitary result by the non-linear processing operator, represents the non-linear processing result.
[0159] A classical computer uses a non-linear operator to non-linearly process the unitary result corresponding to a parameterized quantum circuit, and calculates the corresponding Hamiltonian based on the non-unitary result obtained after non-linear processing, to obtain the input number of another parameterized quantum circuit. By this method, a classical non-linear processing process is added during the execution of a quantum machine learning task, realizing the activation of the unitary result generated by the parameterized quantum circuit, which helps to improve the feature perception ability of quantum machine learning.
[0160] The following introduces and illustrates the non-linear processing of the unitary result by a classical computer through several embodiments.
[0161] In some embodiments, the unitary result includes a plurality of sub-results, and each sub-result respectively corresponds to the measurement result of a first qubit in the first parameterized quantum circuit.
[0162] As can be seen from the above, the unitary result is represented by a qubit string, the sub-result corresponds to a qubit string, and the sub-result is represented in the form of a classical qubit. Optionally, each sub-result in the unitary result corresponds to the output quantum state of a first qubit. That is, a sub-result is obtained by observing the output quantum state of a qubit.
[0163] Sub-step 723, performing a non-linear transformation on the unitary result through a non-linear processing operator to obtain a non-unitary result, including: for the first part of the plurality of sub-results, performing classical non-linear processing on the first part of the sub-results through the non-linear processing operator to obtain a non-unitary result.
[0164] In some embodiments, the first part of the sub-results includes at least one sub-result of the plurality of sub-results.
[0165] Optionally, the classical computer performs non-linear processing on each sub-result in the first part of the sub-results respectively through the non-linear processing operator to obtain a non-unitary result. For example, the non-linear processing operator is an activation function, and the classical computer takes each sub-result in the first part of the sub-results as the input of the activation function respectively, obtains the corresponding activation result, and takes the activation result corresponding to each sub-result in the first part of the sub-results as the non-unitary result.
[0166] Optionally, the classical computer performs non-linear processing on all the sub-results included in the first part of the sub-results respectively through the non-linear processing operator to obtain a non-unitary result. For example, the non-linear processing operator is implemented through a neural network. The neural network includes a plurality of neural network layers. The classical computer takes the respective sub-results in the first part of the sub-results as the values on the neurons of the input layer in the plurality of neural network layers respectively, and calculates the values on the neurons of the input layer based on the weights and biases between the neurons in at least one neural network layer, and finally obtains a non-unitary result.
[0167] Sub-step 726, performing Hamiltonian calculation based on the non-unitary result to obtain a non-linear processing result, including: performing Hamiltonian calculation based on the non-unitary result and the second part of the sub-results among the plurality of sub-results to obtain a non-linear processing result. The second part of the sub-results does not overlap with the first part of the sub-results. The measurement basis of the first qubit corresponding to the second part of the sub-results is determined according to the Pauli operator, and the measurement bases of the first qubits corresponding to the first part of the sub-results are all the same.
[0168] In some embodiments, the unitary result can be divided into a first partial sub-result and a second partial sub-result. The first partial sub-result and the second partial sub-result do not include sub-results with the same meaning, and combining the first partial sub-result and the second partial sub-result can obtain the complete unitary result. Optionally, the second partial sub-result is in the zeroth position in the unitary result.
[0169] Optionally, the second partial sub-result is obtained by measuring the output quantum state of the sign qubit. For the specific content of the sign qubit, please refer to the above embodiments.
[0170] Optionally, the measurement basis corresponding to the sign qubit is different from the measurement bases corresponding to other first qubits. For example, in a certain Pauli string including a first Pauli operator, a second Pauli operator, and a third Pauli operator, if the sign qubit corresponds to the measurement basis of the first Pauli operator, then the measurement bases of other first qubits are all the measurement basis of the first Pauli operator. Exemplarily, the first Pauli operator is any one of the Pauli X operator, the Pauli Y operator, and the Pauli Z operator, the second Pauli operator is different from the first Pauli operator, and the third Pauli operator is different from the first Pauli operator.
[0171] Optionally, the first qubits corresponding to the sub-results included in the first partial sub-result and the sub-results included in the second partial sub-result have different roles in the first parameterized quantum circuit. Optionally, for the second sub-result in the second partial sub-result, the first qubit corresponding to the second sub-result belongs to the observation and control qubit, that is, the sign qubit; for the first sub-result in the first partial sub-result, the first qubit corresponding to the first sub-result belongs to the execution qubit, where the second sub-result refers to each sub-result included in the second partial sub-result, and the first sub-result refers to each sub-result included in the first partial sub-result. The control quantum gate acts on the first qubit corresponding to the second sub-result to determine the measurement circuit for measuring the first qubit corresponding to the first sub-result.
[0172] In one example, assume that the unitary result includes n sub-results, where n is a positive integer greater than 1. Then the second partial sub-result includes 1 second sub-result, and the first partial sub-result includes n - 1 first sub-results. That is, the first parameterized quantum circuit includes 1 observation and control qubit and n - 1 execution qubits. Since the first qubits corresponding to the second sub-result and the first sub-result have different roles in the first parameterized vector, during the process of non-linearly processing the unitary result, there is no need to use a non-linear processing operator to non-linearly process the second partial sub-result.
[0173] In one example, during the actual execution of the quantum machine learning task, the non-linear processing result is calculated by the following formula:
[0174]
[0175] Among them, represents the non-linear processing result, s0 represents 1 second sub-result included in the second part of sub-results, s 1:n-1 represents n-1 sub-results included in the first part of sub-results, and f() represents the non-linear processing operator.
[0176] Figure 8 is a schematic diagram of the non-linear processing process provided by an exemplary embodiment of the present application.
[0177] In some embodiments, the classical computer processes the unitary result through a neural network. Specifically, the non-linear processing result of the first part of sub-results included in the unitary result is determined through the neural network to obtain a non-unitary result, and then the Hamiltonian value of the Pauli string included in the unitary result is calculated based on the non-unitary result to obtain the non-linear processing result.
[0178] Optionally, the first part of sub-results includes k Pauli strings. The k Pauli strings are respectively subjected to non-linear processing through the non-linear processing operator to obtain k non-unitary sub-results; and the energy expectation values of the k Pauli strings are respectively determined based on the k non-unitary sub-results, and finally the energy expectation values of the k Pauli strings are added together to obtain the energy expectation value of the Hamiltonian, that is, the non-linear processing result, where k is a positive integer.
[0179] In the middle process of performing the quantum machine learning task, the output quantum state of the qubits included in the middle parameterized quantum circuit (i.e., the first parameterized quantum circuit) is measured, and the classical computer processes the measured unitary result to obtain intermediate data, which is equivalent to performing non-linear processing between two adjacent hidden layers in the quantum neural network, helping to improve the classification perception ability of the quantum neural network. In addition, by splitting the quantum machine learning task into multiple parameterized quantum circuits and performing intermediate measurements between the multiple parameterized quantum circuits, the intermediate unitary result obtained by observation can be non-linearly processed, making the influence mode between the multiple parameterized quantum circuits more flexible and variable, which helps to attempt to improve the performance of the quantum neural network on this basis.
[0180] In some embodiments, the non-linear processing is completed through a non-linear processing operator, and the non-linear processing operator includes at least one of the following: saturation activation function, non-saturation activation function, neural network. The left and right derivative limits of the saturation activation function both tend to 0, and the neural network includes parameters for non-linearly processing the non-linear processing result.
[0181] Optionally, the saturation activation function includes the Sigmoid function, and the Sigmoid function can be represented by the following formula:
[0182]
[0183] Among them, x represents the unitary result, and f b () represents a non-linear processing operator. Exemplarily, x refers to the second partial result in the unitary result.
[0184] Optionally, for an activation function whose left derivative limit does not tend to 0 or right derivative limit does not tend to 0 among non-saturating activation functions, non-saturating activation functions include the Relu function, and the Relu function can be expressed by the following formula:
[0185]
[0186] Among them, x represents the unitary result. Exemplarily, x refers to the first partial result in the unitary result.
[0187] Figure 9 is a schematic diagram of a neural network provided by an exemplary embodiment of the present application.
[0188] As Figure 9 shown, the neural network includes multiple neurons. There are connections between multiple neurons. For any two interconnected neurons, the weight between the two neurons is recorded on the connection line between the two neurons, and the neuron also includes the bias of the neuron. That is to say, the neural network is composed of neurons and the parameters of the neural network, and the parameters of the neural network include the weights between neurons and the biases on neurons.
[0189] Optionally, the parameters of the neural network are obtained by pre-training the neural network, and the parameters of the neural network can also be jointly trained and adjusted with the free parameters in the parameterized quantum circuit during the process of the quantum machine learning task.
[0190] In one example, the auxiliary processing method for non-linear quantum machine learning includes the following steps: The following steps are executed by a classical computer.
[0191] Step A10, obtain the unitary result generated during the execution of the quantum machine learning task. Optionally, the classical computer obtains the measurement result obtained by measuring the output quantum state of the first qubit; perform an average estimation on the measurement result to obtain the unitary result.
[0192] Optionally, the unitary result includes multiple partial results, and each partial result respectively corresponds to the measurement result of a first qubit in the first parameterized quantum circuit.
[0193] Step A20, for the first partial results among the multiple partial results, perform classical non-linear processing on the first partial results through a non-linear processing operator to obtain a non-unitary result.
[0194] Optionally, the classical computer divides the unitary result into a first partial sub-result and a second partial sub-result. Among them, the first qubit corresponding to the second partial sub-result is used to observe and control the first qubit corresponding to the first partial sub-result in the first parameterized quantum circuit.
[0195] Exemplarily, the classical non-linear processing of the first partial sub-result by the non-linear processing operator to obtain a non-unitary result can be achieved in the following several ways.
[0196] Method 1: The non-linear processing operator is the Sigmoid function. The classical computer uses the Sigmoid function to process each sub-result included in the first partial sub-result to obtain a non-unitary result.
[0197] Method 2: The non-linear processing operator is the ReLU function. The classical computer uses the ReLU function to process each sub-result included in the first partial sub-result to obtain a non-unitary result.
[0198] Method 3: The non-linear processing algorithm represents a neural network. The classical computer inputs each sub-result included in the first partial sub-result into the input layer of the neural network and obtains a non-unitary result from the output layer of the neural network. It should be noted that the "quantum neural network" in the embodiments of the present application is implemented through a parameterized quantum circuit, and the "neural network" refers to the neural network in a classical computer.
[0199] In one example, multiple parameterized quantum circuits are used in the process of performing a quantum machine learning task, and there is more than one parameterized quantum circuit that can be used as the first parameterized quantum circuit. Optionally, for the unitary results respectively measured from multiple first parameterized quantum circuits, the non-linear processing methods corresponding to each unitary result can be the same. For example, for each parameterized quantum circuit in multiple first parameterized quantum circuits, the Sigmoid function is used to perform non-linear processing on its unitary result.
[0200] Optionally, for the unitary results respectively measured from multiple first parameterized quantum circuits, there are at least two unitary results that are non-linearly processed using different non-linear processing methods. That is, the non-linear processing operators corresponding to the two unitary results are different.
[0201] Considering that a neural network can achieve more accurate non-linear activation, but the parameters of the neural network included in the neural network need to be obtained through training, so the neural network and the activation function can be selectively used alternately to perform non-linear processing on the unitary results respectively corresponding to multiple first parameterized quantum circuits.
[0202] For example, there are 6 first parameterized quantum circuits in multiple parameterized quantum circuits, namely parameterized quantum circuit 1, parameterized quantum circuit 2, parameterized quantum circuit 3, parameterized quantum circuit 4, parameterized quantum circuit 5, and parameterized quantum circuit 6. A neural network is used to perform non-linear processing on the unitary results corresponding to parameterized quantum circuit 1 and parameterized quantum circuit 4 respectively, and the Sigmoid function is used to perform non-linear processing on the unitary results corresponding to parameterized quantum circuit 2, parameterized quantum circuit 3, parameterized quantum circuit 5, and parameterized quantum circuit 6 respectively. In this example, the neural networks used to perform non-linear processing on the unitary results corresponding to parameterized quantum circuit 1 and parameterized quantum circuit 4 respectively can be the same or different.
[0203] The differences in neural networks include the following situations: different structures of neural networks (such as the number of neurons in the neural network and the different connections between neurons), the same structure of neural networks, and different parameters of the neural networks included in the neural network, etc.
[0204] For another example, there are 3 first parameterized quantum circuits in multiple parameterized quantum circuits, namely parameterized quantum circuit 1, parameterized quantum circuit 2, and parameterized quantum circuit 3; among them, the execution order of parameterized quantum circuit 3 is the latest. The Sigmoid function is used to perform non-linear processing on the unitary results corresponding to parameterized quantum circuit 1 and parameterized quantum circuit 2 respectively, and a neural network is used to perform non-linear processing on the unitary result corresponding to parameterized quantum circuit 3.
[0205] By this method, non-linear processing based on neural networks and non-linear processing based on activation functions are interspersed during the execution of quantum machine learning tasks. While ensuring good non-linear processing effects of neural networks, it helps to reduce the pressure on the neural networks corresponding to each first quantum parameterized circuit during training, reduce variables, so as to quickly find the best optimization direction of the parameters of each neural network during the training process, thereby helping to shorten the training cycle and improve the training efficiency for quantum machine learning tasks.
[0206] Step A30: Calculate the Hamiltonian based on the non-unitary result and the second part of the sub-results among the multiple sub-results to obtain the non-linear processing result.
[0207] Optionally, the calculation formula for the non-linear processing result is as follows:
[0208]
[0209] For the meanings of the various parameters in this formula, please refer to the above embodiments.
[0210] Step A40: Calculate the Hamiltonian based on the non-unitary result to obtain the non-linear processing result.
[0211] Step A50: According to the non-linear processing result, the second parameterized quantum circuit used in the quantum machine learning task indicates the initial quantum state of the second qubit.
[0212] Optionally, the classical computer transmits the non-linear processing result to the second parameterized quantum circuit in the quantum computer. Before the quantum computer executes the second parameterized quantum circuit, the non-linear processing result is encoded by the encoding quantum circuit to obtain the initial quantum state of the second qubit.
[0213] By performing non-linear processing on the unitary result in this embodiment, the activation operation of the unitary result is realized, which helps to improve the classification ability of the quantum neural network when processing quantum machine learning tasks.
[0214] In some embodiments, such as Figure 7 The auxiliary processing method of quantum machine learning shown further includes: Step 735, the classical computer indicates the initial quantum state of the auxiliary qubit to the second parameterized quantum circuit according to the initial data of the quantum machine learning task, and there is a cascading influence between the quantum state of the auxiliary qubit and the quantum state of the second qubit.
[0215] In some embodiments, the initial data of the quantum machine learning task refers to the qubit corresponding to the parameterized quantum circuit with the earliest execution time sequence among multiple parameterized qubits. For example, during the training process of the quantum machine learning task, the initial data of the quantum machine learning task refers to the training data. Another example is that during the actual execution of the quantum machine learning task, the initial data of the quantum machine learning task refers to the data to be processed provided by the user.
[0216] In some embodiments, the second parameterized quantum circuit includes a second qubit and an auxiliary qubit. Optionally, the auxiliary qubit is a qubit introduced to overcome the non-clonability of the quantum state. Since the quantum state of the qubit cannot be re-prepared, determining the initial quantum state of the auxiliary data through the initial data is equivalent to importing the quantum state of the qubit in other parameterized quantum circuits into the second parameterized quantum circuit. In this way, the limitation that the quantum state of the qubit cannot be cloned is overcome, and the effect of the mutual influence between the quantum states of the qubits in different parameterized quantum circuits is simulated.
[0217] The second parameterized quantum circuit includes at least one auxiliary qubit, and the total number of auxiliary qubits is proportional to the initial data of the quantum machine learning task. Exemplarily, the initial quantum state of the auxiliary qubit is related to the initial data. The initial data of the quantum machine learning task is the input data of the quantum circuit with the earliest execution time sequence among the multiple parameterized quantum circuits participating in the quantum machine learning task.
[0218] In some embodiments, there is an interaction between the quantum state of the auxiliary qubit and the quantum state of the second qubit in the second quantum circuit, that is, there is quantum entanglement between the auxiliary qubit and the second qubit. By providing initial data to the second quantum circuit, it helps to improve the learning and expressive ability of the parameterized quantum circuit.
[0219] Taking a single qubit as an example, a single qubit only provides a simple superposition of two quanta, and a single-qubit gate acting on a single qubit can rotate the single qubit on the Bloch sphere. In principle, a single qubit can provide sufficient computing power to construct a universal quantum classifier. In order to construct a quantum classifier on a single qubit, when a classical computer provides initial data to the second parameterized quantum circuit, the quantum state of the second qubit is affected by the auxiliary qubit, that is, the initial data is re-imported.
[0220] The following introduces and illustrates the data re-import process through several examples. This example includes the following steps, and the execution subject of this example is a classical computer.
[0221] Step B10, obtain the unitary result generated during the execution of the quantum machine learning task.
[0222] Step B20, perform non-linear processing on the unitary result to obtain a non-linear processing result, and the non-linear processing result is used to characterize the activation result of the unitary result.
[0223] For the specific introduction of steps B10 and B20, please refer to the above embodiments and will not be elaborated here.
[0224] Step B30, according to the non-linear processing result, indicate the initial quantum state of the second qubit to the second parameterized quantum circuit used in the quantum machine learning task.
[0225] Optionally, the qubits in the initial quantum state of the second qubit include the second qubit and the auxiliary qubit, where the auxiliary qubit is used to affect the quantum state of the second qubit and only measure the quantum state of the second qubit.
[0226] Optionally, the classical qubit transmits intermediate data to the second parameterized quantum circuit, and the quantum computer encodes the intermediate data using an encoding method to obtain the initial quantum state of the second qubit.
[0227] Step B40, according to the initial data of the quantum machine learning task, indicate the initial quantum state of the auxiliary qubit to the second parameterized quantum circuit, and there is a cascading effect between the quantum state of the auxiliary qubit and the quantum state of the second qubit
[0228] Optionally, the classical qubit transmits initial data to the second parameterized quantum circuit, and the quantum computer encodes the initial data using the same encoding method as the intermediate data to obtain the initial quantum state of at least one auxiliary qubit.
[0229] It should be noted that there is no limitation on the execution order between step B30 and step B40, and the classical computer can synchronously transmit the initial data and the intermediate data to the quantum computer.
[0230] During the training process of the quantum machine learning task, the qubits in the parameterized quantum circuit are organized into a series of data re-uploads and single-qubit processing units by re-importing the initial data multiple times; among them, the auxiliary qubits are equivalent to the data re-upload units, and the single-qubit processing units correspond to the second qubits. For example, the single-qubit processing unit refers to the second qubit included in the parameterized quantum circuit with the latest execution timing among multiple parameterized quantum circuits. In addition, the data re-upload and measurement can adapt to multiple dimensions in the input and multiple categories in the output to conform to a general quantum classifier.
[0231] In some embodiments, after the classical computer device performs nonlinear processing on the unitary result to obtain a nonlinear processing result, the classical computer provides the nonlinear processing result and the initial data of the quantum machine learning task to the quantum computer, and the quantum computer encodes the nonlinear processing result and the initial data of the quantum machine learning task to obtain at least one unitary matrix, and determines the initial quantum states of the second qubit and the auxiliary qubit based on the above at least one unitary matrix.
[0232] Optionally, the encoding method used to encode the nonlinear processing result is the same as the encoding method used to encode the initial data of the quantum machine learning task. A qubit can be represented by the state |0>, |1> or a normalized complex linear superposition of the two. In principle, all classical data can be effectively encoded into qubits: a classical bit string of length n can be easily encoded onto n qubits. However, the reverse is not true. Generally, the state of an n-qubit system requires 2 n -1 complex numbers. The encoding method used by the quantum computer in this application is a reversible encoding method. Quantum data can be naturally stored in a series of quantum states {|ψ j >} or stored in a series of unitary matrices {U j}.
[0233] In some embodiments, a coding quantum circuit is further included before the second parameterized quantum circuit. The coding quantum circuit is used to encode classical data into quantum data. The coding quantum circuit includes at least one rotation gate, which is used to implement the encoding method of quantum data. That is, |ψ can be directly implemented on the quantum circuit. j > = U j |0>. Optionally, the coded quantum circuit refers to the rotation gate that each second qubit needs to pass through before the quantum gates in the second parameterized quantum circuit are executed. After passing through the rotation gate, the quantum state of the second qubit is the initial quantum state.
[0234] Exemplarily, the encoding methods for encoding classical data include but are not limited to at least one of the following: wave function encoding, dense angle code encoding, and qubit correlation encoding.
[0235] Among them, wave function encoding is a coding method based on the main idea of amplitude encoding that correlates classical data with the amplitude of the quantum state. Wave function encoding can be implemented by the following formula.
[0236]
[0237] Among them, x is classical data. In the embodiments of the present application, x is the result of non-linear vehicle processing or the initial data. N represents the bit data included in the classical data. |x> represents the encoded quantum data, that is, the initial quantum state of the second qubit, or the initial quantum state of the auxiliary qubit.
[0238] Dense angle code encoding is used to map the value of a classical bit into the rotation angle of a qubit. Dense angle code encoding can be implemented by the following formula.
[0239]
[0240] Among them, represents the tensor product. For the explanation of other parameters, please refer to the previous embodiment.
[0241] Qubit correlation encoding is used to associate the value of a classical bit with the quantum state of n qubits. For example, the classical input string (1100) is encoded into the quantum state of four qubits (|1100>).
[0242] It should be noted that the encoding method used by the quantum computer is set according to the specific type of the quantum machine learning task. Different encoding methods have different adaptability to different application scenarios. The encoding method is selected according to actual needs, and the present application does not limit it here.
[0243] Figure 10 is a schematic diagram of data re-import provided by an exemplary embodiment of the present application.
[0244] As Figure 10 shown, during the execution of a quantum machine learning task, N parameterized quantum circuits are required. The initial data of the quantum machine learning task serves as the input data for the first parameterized quantum circuit among the N parameterized quantum circuits ( Figure 10 the parameterized quantum circuit 1 therein). After measuring the first qubit in the parameterized quantum circuit 1 to obtain a unitary result, the classical computer performs a non-linear process on the unitary result to obtain a non-linear processing result, which is used to be transmitted to the parameterized quantum circuit 2 (the next parameterized quantum circuit 2 to be executed after the parameterized quantum circuit 1). In addition, the classical computer also transmits the initial data to the parameterized quantum circuit 2 to achieve re-import of the data.
[0245] Figure 11 FIG. is a schematic diagram showing the training effect of a quantum classifier provided by an exemplary embodiment of the present application.
[0246] By repeatedly importing the initial data in at least one parameterized quantum circuit, the classification ability of single-qubit quantum bit classification is continuously improved as the training process progresses.
[0247] During the training process of the quantum machine learning task, it also includes a process of adjusting the free parameters of the quantum gates with adjustable parameters in the parameterized quantum circuit. The following introduces and illustrates this part of the content through several embodiments.
[0248] As can be seen from the above embodiments, multiple parameterized quantum circuits are involved in the quantum machine learning task. In the training scenario of the quantum machine learning task, as Figure 7 shown, the method further includes the following steps (not shown in the accompanying drawings of the specification), and the execution subject of the following steps is the classical computer.
[0249] Step 740, obtaining a prediction result obtained by measuring the third qubit in the third parameterized quantum circuit, where the third parameterized quantum circuit refers to the parameterized quantum circuit with the latest execution timing among the multiple parameterized quantum circuits, and the prediction result is used to characterize the predicted classification of the initial data of the quantum machine learning task.
[0250] In some embodiments, the third parameterized quantum circuit is the last parameterized quantum circuit to be executed among a plurality of parameterized quantum circuits. Optionally, the classical computer obtains the prediction result obtained by measuring the third qubit in the third parameterized quantum circuit. Exemplarily, the output quantum state of the qubit in the third parameterized quantum circuit is measured through an observation circuit in the quantum computer to obtain the unitary result generated by the third parameterized quantum circuit. The classical computer uses a neural network to perform nonlinear processing on the unitary result to obtain a nonlinear processing result; subsequently, the classical computer performs Hamiltonian calculation based on the nonlinear processing result to obtain a prediction result.
[0251] Step 750, determine the loss function value in the training process of the quantum machine learning task according to the prediction result and the label result, where the label result is used to characterize the reference classification of the initial data.
[0252] In some embodiments, the label result is the reference result corresponding to the initial data. Optionally, in the case where the quantum machine learning task is a classification task, the label result refers to the reference classification of the initial data. Optionally, in the case where the quantum machine learning task is molecular stability prediction, the label result refers to the known low-energy eigenstate of a certain molecule. The purpose of the training process of the quantum machine learning task is to make the prediction result obtained by processing the initial data through the quantum neural network close to the label result of the initial data. This enables the trained quantum neural network to have the ability to generate accurate prediction results based on new initial data.
[0253] Exemplarily, in the training process of the quantum machine learning task, the prediction results corresponding to different initial data are different, and the prediction result can be obtained by experimental instrument measurement, theoretical calculation, or retrieved from the training database. The present application does not limit the source of the prediction result.
[0254] Optionally, the loss function value is calculated by any one of the following formulas:
[0255]
[0256]
[0257] where y i is the prediction result generated by the quantum neural network for the training data (i.e., the initial data x i ), y i ′ is the label result of the initial data x i , and N represents the number of initial data included in the training batch.
[0258] Optionally, the parameters on the parameterized quantum circuit are subjected to gradient descent by a classical computer to minimize the loss function value, and finally the training of the quantum machine learning model is completed.
[0259] Step 760, determining a gradient optimization direction based on the loss function value, where the gradient optimization direction includes the optimization directions of free parameters in multiple parameterized quantum circuits, and the free parameters refer to the variable parameters of the parameterized quantum gates in the parameterized quantum circuits.
[0260] In some embodiments, an optimizer is set in the classical computer. The optimizer is used to determine the gradient optimization direction with the goal of reducing the energy expectation value of the Hamiltonian of the quantum system until the energy expectation value converges, so as to adjust the respective corresponding free parameters in multiple parameterized quantum circuits according to the gradient optimization direction, enabling the multiple parameterized quantum circuits to better extract features from the initial data and generate more accurate prediction results.
[0261] Step 770, adjusting at least one free parameter according to the optimization direction of the free parameter to obtain multiple updated parameterized quantum circuits, and the multiple updated parameterized quantum circuits are used to participate in the next round of training of the quantum machine learning task.
[0262] Optionally, the optimizer adjusts the free parameters based on parameter translation and backpropagation according to the loss function value. Subsequently, the classical computer instructs the adjusted free parameters to the quantum computer, so that the quantum computer applies the adjusted free parameters to each parameterized quantum circuit respectively to obtain multiple updated parameterized quantum circuits.
[0263] Step 780, when the loss function value reaches convergence, obtaining multiple trained parameterized quantum circuits. The multiple trained parameterized quantum circuits are used to solve actual quantum machine learning tasks.
[0264] In some embodiments, the non-linear processing is completed by a neural network, and the gradient optimization direction further includes the optimization direction of the parameters of the neural network. The method further includes: adjusting at least one parameter of the neural network according to the optimization direction of the parameters of the neural network to obtain multiple updated neural networks, and the updated neural networks are used to cooperate with the multiple updated parameterized quantum circuits to participate in the next round of training of the quantum machine learning task.
[0265] That is, during the training process, in addition to adjusting the free parameters in the parameterized quantum circuit, it is also necessary to adjust the parameters of the neural network in the neural network for non-linearly processing the unitary result.
[0266] In some embodiments, the neural network includes multiple neurons, and the parameters of the neural network include the weights between neurons and the biases corresponding to the neurons.
[0267] In one example, during the training process of a quantum machine learning task, one round of the training process is used to adjust the free parameters in m parameterized quantum circuits among multiple parameterized quantum circuits, where m is a positive integer. The free parameters in the other parameterized quantum circuits among the multiple parameterized quantum circuits except the parameterized quantum circuits are fixed during this round of the training process. By this means, it helps to improve the determination speed of the best optimization direction during the parameter optimization process and helps to shorten the training time.
[0268] In another example, during the training process of a quantum machine learning task, the free parameters and the parameters of the neural network are trained in different rounds. For example, the free parameters are trained first, and then the parameters of the neural network are trained.
[0269] Figure 12 It is a schematic diagram of the training process provided by an exemplary embodiment of the present application.
[0270] During the training process based on a quantum machine learning task, the training data is processed by multiple parameterized quantum circuits executed serially. Optionally, for the first parameterized quantum circuit and the second parameterized quantum circuit among the multiple parameterized quantum circuits, the unitary result generated by the first parameterized quantum circuit is used as the input data in the second parameterized quantum circuit only after being processed by classical non-linear assistance. After the last parameterized quantum circuit among the multiple parameterized quantum circuits finishes execution, measuring the third qubit in this parameterized quantum circuit can obtain the prediction result. Based on the label result of the training data and the prediction result, the loss function value is calculated, and gradient optimization and parameter offset are performed according to the loss function value to realize the update of the free parameters in the multiple parameterized quantum circuits and the update of the parameters of the neural network.
[0271] Since classical non-linear assistance is introduced during the execution of the multiple parameterized quantum circuits, by this means, it helps to improve the adaptability of the quantum neural network to the quantum machine learning task, helps to improve the classification performance of the quantum neural network, and achieves the good effect of reducing the depth of the quantum circuit under the condition of the same quantum machine learning classification performance.
[0272] The following introduces and illustrates an auxiliary processing method in quantum machine learning through an example. This method is executed by a classical computer and includes the following steps.
[0273] Step C10, obtaining the measurement result obtained by measuring the output quantum state of the first qubit; performing an average estimation on the measurement result to obtain a unitary result. The unitary result includes multiple sub-results, and each sub-result respectively corresponds to the measurement result of a first qubit in the first parameterized quantum circuit;
[0274] Step C20: For the first part of the multiple sub-results, perform classical non-linear processing on the first part of the sub-results using a non-linear processing operator to obtain a non-unitary result. Optionally, the non-linear processing operator includes at least one of the following: a saturation activation function, a non-saturation activation function, and a neural network. In the case of multiple first parameterized quantum circuits, the non-linear processing operators used to perform non-linear processing on the unitary results of the multiple first parameterized quantum circuits can be the same or different.
[0275] Step C30: Based on the non-unitary result and the second part of the multiple sub-results, perform a Hamiltonian calculation to obtain a non-linear processing result. Among them, the first quantum bits corresponding to the second part of the sub-results belong to sign qubits, which are used to observe and control the first quantum bits corresponding to the first part of the sub-results in the first parameterized quantum circuit.
[0276] Step C40: According to the initial data of the quantum machine learning task, indicate the initial quantum state of the auxiliary quantum bits to the second parameterized quantum circuit, and, according to the non-linear processing result, indicate the initial quantum state of the second quantum bits to the second parameterized quantum circuit. So that, through the encoding quantum circuit, the initial quantum state of the second quantum bits can be determined according to the non-linear processing result. After the intermediate processing result generated by the first parameterized quantum circuit is acted on by the non-linear processing operator, it is passed to the next parameterized quantum circuit. In addition, by re-importing the initial data in the second parameterized quantum circuit, more reference information is provided for the quantum neural network, which helps to improve the accuracy of the final prediction result.
[0277] Step C50: Determine a new first parameterized quantum circuit among the unexecuted parameterized quantum circuits, and repeat steps C10 - C40. Optionally, the above second parameterized quantum circuit will be used as the new first parameterized quantum circuit until the second parameterized quantum circuit is the parameterized quantum circuit with the latest execution time sequence among the multiple parameterized quantum circuits.
[0278] Step C60: Obtain the prediction result obtained by measuring the third quantum bits in the third parameterized quantum circuit. The third parameterized quantum circuit has the latest execution time sequence among the multiple parameterized quantum circuits, and the completion of the execution of the third parameterized quantum circuit marks the completion of the content related to quantum computing in the quantum machine learning task.
[0279] Step C70: Determine the loss function value of the quantum machine learning task during the training process according to the prediction result and the label result, where the label result is used to characterize the reference classification of the input data.
[0280] Step C80: Determine the gradient optimization direction based on the loss function value. Optionally, the gradient optimization direction includes the optimization directions of the free parameters in multiple parameterized quantum circuits and the parameters of the neural network.
[0281] Step C90: Adjust at least one free parameter according to the optimization direction of the free parameters to obtain multiple updated parameterized quantum circuits, and the multiple updated parameterized quantum circuits are used to participate in the next round of training of the quantum machine learning task.
[0282] Step C100: Adjust the parameters of the neural network according to the optimization direction of the parameters of the neural network to obtain multiple updated neural networks, and the updated neural networks are used to cooperate with the multiple updated parameterized quantum circuits to participate in the next round of training of the quantum machine learning task; when the loss function value reaches convergence, multiple trained parameterized quantum circuits are obtained.
[0283] It should be noted that when we perform relevant training on the quantum circuit, there are several dimensions of input that can be processed in batches. One is the input data and label data, and multiple values need to be included each time gradient training is performed, that is, batch training. The other is the parameters on the quantum circuit, which can be trained simultaneously in batches. In this way, when performing classical optimization, the just-in-time compilation technique can be used to greatly improve the training efficiency.
[0284] By introducing a classical non-linear architecture and repeated import of data into the traditional linear quantum machine learning scheme, the following effects are achieved: 1) significantly improving the classification performance of quantum machine learning under the same consumption of quantum computing hardware resources; 2) achieving the good effect of reducing the depth of the quantum circuit under the same quantum machine learning classification performance.
[0285] To test the experimental effect, we introduce two groups of data. One group is parity data, and the other group is MNIST (Modified National Institute of Standards and Technology) data.
[0286] 1) First, introduce the classification problem of Parity data, that is:
[0287]
[0288] In this group of data, the encoding from classical data to quantum data is very straightforward. For example, x = 0101 → |ψ> = |0101>.
[0289] Figure 13It is a schematic diagram showing the correspondence between the step size and the loss function value provided in the parity data experiment process. As Figure 13 shown, as the training step size changes, the loss function value of the training data continuously decreases. "qdepth" represents the number of quantum circuit modules included in each non-linear layer, and "Nnonlin" represents the total number of non-linear layers included. For quantum circuits of the same length, the more non-linear layers are included, the faster the loss function value decreases.
[0290] Figures 14 - 16 It is a schematic diagram showing the correspondence between the step size and the fidelity provided in the parity data experiment process. As Figures 14 - 16 shown, for quantum circuits of the same length, the more non-linear layers are included, the higher the fidelity.
[0291] 2) Introduce MNIST data
[0292] The MNIST database is a database containing a large number of handwritten digits and is commonly used to train various image processing systems. This database is also widely used for training and testing in the field of machine learning. It was created by recombining samples from the original dataset in the NIST (National Institute of Standards and Technology) database.
[0293] Figures 17 - 18 It is a schematic diagram showing the correspondence between the step size and the loss function value provided in the MNIST data experiment process.
[0294] Similar to Figure 13 in Figure 17 、 18 as the training step size changes, the loss function value of the training data continuously decreases. During the training process using MNIST data, for quantum circuits of the same length, the more non-linear layers are included, the faster the loss function value decreases.
[0295] Figure 19 、 20 It is a schematic diagram showing the correspondence between the step size and the fidelity provided in the MNIST data experiment process. For quantum circuits of the same length, the more non-linear layers are included, the higher the fidelity. This shows that the auxiliary processing method for quantum machine learning provided in this application enables the quantum neural network to obtain better training results during the training process by introducing non-linear processing operations (actually implemented through classical computers to prove non-linear processing layers).
[0296] The embodiment of this application also provides an auxiliary processing method for quantum machine learning, which can be completed through the interaction between a classical computer and a quantum computer. The method may include the following steps:
[0297] A classical computer obtains a unitary result generated during the execution of a quantum machine learning task, where the unitary result is obtained by measuring a first qubit in a first parameterized quantum circuit used in the quantum machine learning task, and the first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit.
[0298] The classical computer performs a non-linear process on the unitary result to obtain a non-linear processing result.
[0299] The quantum computer encodes according to the non-linear processing result to determine the initial quantum state of a second qubit in a second parameterized quantum circuit used in the quantum machine learning task, and the second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit.
[0300] In some embodiments, the classical computer performs a non-linear process on the unitary result to obtain a non-linear processing result, including: the classical computer performs a non-linear transformation on the unitary result based on a non-linear processing operator to obtain a non-unitary result, and the non-linear processing operator is used to process data in the form of classical bits; the classical computer performs a Hamiltonian calculation based on the non-unitary result to obtain the non-linear processing result.
[0301] In some embodiments, the unitary result includes multiple sub-results, and each sub-result respectively corresponds to the measurement result of a first qubit in the first parameterized quantum circuit; the classical computer performs a Hamiltonian calculation based on the non-unitary result to obtain a non-linear processing result, including: for a first part of the multiple sub-results, the classical computer performs a non-linear transformation on the first part of the sub-results through a non-linear processing operator to obtain a non-unitary result; the classical computer performs a Hamiltonian calculation based on the non-unitary result and a second part of the multiple sub-results to obtain a non-linear processing result, the second part of the sub-results does not overlap with the first part of the sub-results, the measurement bases of the first qubits corresponding to the first part of the sub-results are the same, and the measurement bases of the first qubits corresponding to the second part of the sub-results are determined according to Pauli operators.
[0302] In some embodiments, the non-linear process is completed through a non-linear processing operator, and the non-linear processing operator includes at least one of the following: a saturation activation function, a non-saturation activation function, a neural network, the left and right derivative limits of the saturation activation function both tend to 0, and the neural network includes parameters of the neural network, and the parameters of the neural network are used to perform a non-linear process on the unitary result.
[0303] In some embodiments, the classical computer is further configured to: according to the initial data of the quantum machine learning task, indicate the initial quantum state of an auxiliary qubit to the second parameterized quantum circuit, and there is a cascading effect between the quantum state of the auxiliary qubit and the quantum state of the second qubit.
[0304] In some embodiments, the method further includes: the quantum computer encodes the initial data to obtain the initial quantum state of the auxiliary qubits in the second parameterized quantum circuit, and the encoding method of the initial data is the same as that of the non-linear processing result.
[0305] In some embodiments, the quantum machine learning task involves multiple parameterized quantum circuits; the method further includes: the classical computer obtains the prediction result obtained by measuring the fourth qubit in the third parameterized quantum circuit, where the third parameterized quantum circuit refers to the parameterized quantum circuit with the latest execution timing among the multiple parameterized quantum circuits, and the prediction result is used to characterize the predicted classification of the initial data of the quantum machine learning task; the classical computer determines the loss function value in the training process of the quantum machine learning task according to the prediction result and the label result, where the label result is used to characterize the reference classification of the initial data; the classical computer determines the gradient optimization direction based on the loss function value, where the gradient optimization direction includes the optimization directions of the free parameters in the multiple parameterized quantum circuits, and the free parameters refer to the variable parameters of the parameterized quantum gates in the parameterized quantum circuits; the quantum computer adjusts at least one free parameter according to the optimization direction of the free parameters to obtain multiple updated parameterized quantum circuits, and the multiple updated parameterized quantum circuits are used to participate in the next round of training of the quantum machine learning task; the classical computer obtains multiple trained parameterized quantum circuits when the loss function value reaches convergence.
[0306] In some embodiments, the non-linear processing is completed by a neural network, and the gradient optimization direction further includes the optimization direction of the parameters of the neural network; the method further includes: the classical computer adjusts the parameters of the neural network according to the optimization direction of the parameters of the neural network to obtain multiple updated neural networks, and the updated neural networks are used to cooperate with the multiple updated parameterized quantum circuits to participate in the next round of training of the quantum machine learning task.
[0307] In some embodiments, the classical computer obtains the unitary result generated during the execution of the quantum machine learning task, including: the classical computer obtains the measurement result obtained by measuring the output quantum state of the first qubit; the classical computer performs an average estimation on the measurement result to obtain the unitary result.
[0308] The above are the embodiments of the interaction side of the present application. This embodiment corresponds to the above method embodiment and belongs to the same inventive concept. For the details not described in detail in the system embodiment, reference can be made to the method embodiment of the present application.
[0309] Figure 21The block diagram of an auxiliary processing device for quantum machine learning provided by an exemplary embodiment of the present application is shown. The device 2100 may include: a result acquisition module 2110, a result processing module 2120, and a result indication module 2130.
[0310] The result acquisition module 2110 is configured to acquire the unitary result generated during the execution of the quantum machine learning task, where the unitary result is obtained by measuring the first qubit in the first parameterized quantum circuit used in the quantum machine learning task, and the first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit.
[0311] The result processing module 2120 is configured to perform a non-linear processing on the unitary result to obtain a non-linear processing result.
[0312] The result indication module 2130 is configured to indicate the initial quantum state of the second qubit to the second parameterized quantum circuit used in the quantum machine learning task according to the non-linear processing result, where the second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit, and the initial quantum state of the second qubit is determined by encoding the non-linear processing result.
[0313] In some embodiments, the result processing module 2120 includes: a non-linear processing sub-module, configured to perform a non-linear transformation on the unitary result based on a non-linear processing operator to obtain a non-unitary result, where the non-linear processing operator is used to process data in the form of classical bits; a result calculation sub-module, configured to perform a Hamiltonian calculation based on the non-unitary result to obtain the non-linear processing result.
[0314] In some embodiments, the unitary result includes a plurality of sub-results, and each sub-result respectively corresponds to the measurement result of one of the first qubits in the first parameterized quantum circuit; the result calculation sub-module is configured to, for a first part of the plurality of sub-results, perform a non-linear transformation on the first part of the sub-results through the non-linear processing operator to obtain the non-unitary result; the performing a Hamiltonian calculation based on the non-unitary result to obtain the non-linear processing result includes: performing a Hamiltonian calculation based on the non-unitary result and a second part of the plurality of sub-results to obtain the non-linear processing result, where the second part of the sub-results does not overlap with the first part of the sub-results, the measurement bases of the first qubits corresponding to the first part of the sub-results are the same, and the measurement bases of the first qubits corresponding to the second part of the sub-results are determined according to the Pauli operator.
[0315] In some embodiments, the non-linear processing is completed by a non-linear processing operator, which includes at least one of the following: a saturation activation function, a non-saturation activation function, and a neural network. The left and right derivative limits of the saturation activation function both tend to 0. The neural network includes parameters of the neural network, and the parameters of the neural network are used to perform non-linear processing on the unitary result.
[0316] In some embodiments, the apparatus 2100 further includes: a re-input module, configured to, according to the initial data of the quantum machine learning task, indicate an initial quantum state of an auxiliary qubit to the second parameterized quantum circuit, and there is a cascading influence between the quantum state of the auxiliary qubit and the quantum state of the second qubit.
[0317] In some embodiments, the quantum machine learning task involves multiple parameterized quantum circuits. The apparatus 2100 further includes: a prediction acquisition module, configured to acquire a prediction result obtained by measuring a third qubit in a third parameterized quantum circuit, where the third parameterized quantum circuit refers to the parameterized quantum circuit with the latest execution timing among the multiple parameterized quantum circuits, and the prediction result is used to characterize the predicted classification of the initial data of the quantum machine learning task; a loss calculation module, configured to determine a loss function value of the quantum machine learning task during training according to the prediction result and a label result, where the label result is used to characterize the reference classification of the initial data; a direction determination module, configured to determine a gradient optimization direction based on the loss function value, where the gradient optimization direction includes an optimization direction of free parameters in the multiple parameterized quantum circuits, and the free parameters refer to variable parameters of parameterized quantum gates in the parameterized quantum circuits; a parameter adjustment module, configured to adjust at least one of the free parameters according to the optimization direction of the free parameters to obtain multiple updated parameterized quantum circuits, and the multiple updated parameterized quantum circuits are used to participate in the next round of training of the quantum machine learning task; a circuit determination module, configured to obtain multiple trained parameterized quantum circuits when the loss function value reaches convergence.
[0318] In some embodiments, the non-linear processing is completed by a neural network, and the gradient optimization direction further includes an optimization direction of the parameters of the neural network. The parameter adjustment module is further configured to adjust the parameters of the neural network according to the optimization direction of the parameters of the neural network to obtain an updated neural network, and the updated neural network is used to cooperate with the multiple updated parameterized quantum circuits to participate in the next round of training of the quantum machine learning task.
[0319] In some embodiments, the result acquisition module 2110 is configured to obtain a measurement result obtained by measuring the output quantum state of the first qubit; perform an average estimation on the measurement result to obtain the unitary result.
[0320] It should be noted that for the device provided in the above embodiments, when implementing its functions, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the content structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiments and the method embodiments belong to the same concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here. For the beneficial effects of the device provided in the above embodiments, please refer to the description of the method side embodiments and will not be elaborated here.
[0321] Figure 22 The block diagram of a computer device provided by an exemplary embodiment of the present application is shown. The computer device may be the classical computer introduced above.
[0322] Generally, the computer device 2200 includes a processor 2201 and a memory 2202.
[0323] The processor 2201 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 2201 may be implemented in at least one of the following hardware forms: DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 2201 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 2201 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 2201 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0324] The memory 2202 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 2202 may also include high-speed random access memory, as well as non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 2202 stores at least one program, and the at least one program is loaded and executed by the processor 2201 to implement the auxiliary processing method of quantum machine learning provided by the above method embodiments.
[0325] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is loaded and executed by a processor to implement the auxiliary processing method of quantum machine learning provided by the above method embodiments.
[0326] The computer-readable medium may include a computer storage medium and a communication medium. The computer storage medium includes volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. The computer storage medium includes RAM, ROM, EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technologies, DVD (Digital Video Disc) or other optical storage, magnetic tape cartridges, magnetic tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above several types.
[0327] An embodiment of the present application also provides a computer program product, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium, and the processor reads and executes the computer program from the computer-readable storage medium to implement the auxiliary processing method of quantum machine learning provided by the above method embodiments.
[0328] The embodiment of the present application further provides an auxiliary processing system for quantum machine learning. The system includes a classical computer and a quantum computer. Among them, the classical computer is used to obtain the unitary result generated during the execution of the quantum machine learning task. The unitary result is obtained by measuring the first qubit in the first parameterized quantum circuit used in the quantum machine learning task. The first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit. The classical computer is further used to perform a non-linear process on the unitary result to obtain a non-linear processing result. The quantum computer is used to encode according to the non-linear processing result to determine the initial quantum state of the second qubit in the second parameterized quantum circuit used in the quantum machine learning task. The second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit.
[0329] It should be understood that "a plurality of" mentioned herein refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. In addition, the step numbers described in this application only exemplarily show a possible execution sequence between steps. In some other embodiments, the above steps may not be executed in the order of the numbers. For example, two steps with different numbers are executed simultaneously, or two steps with different numbers are executed in the reverse order of the illustration. The embodiments of the present application do not limit this.
[0330] The above are only exemplary embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An auxiliary processing method for quantum machine learning, characterized in that The method includes: Obtaining a unitary result generated during the execution of a quantum machine learning task, where the unitary result is obtained by measuring a first qubit in a first parameterized quantum circuit used in the quantum machine learning task, and the first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit; Performing nonlinear processing on the unitary result to obtain a nonlinear processing result; According to the nonlinear processing result, indicating the initial quantum state of a second qubit to a second parameterized quantum circuit used in the quantum machine learning task, where the second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit, and the initial quantum state of the second qubit is determined by encoding the nonlinear processing result.
2. The method according to claim 1, wherein The performing nonlinear processing on the unitary result to obtain a nonlinear processing result includes: Performing a nonlinear transformation on the unitary result based on a nonlinear processing operator, where the nonlinear processing operator is used to process data in the form of classical bits, to obtain a non-unitary result; Performing Hamiltonian calculation based on the non-unitary result to obtain the nonlinear processing result.
3. The method according to claim 2, characterized in that, The unitary result includes a plurality of sub-results, and each sub-result respectively corresponds to the measurement result of one of the first qubits in the first parameterized quantum circuit; The performing a nonlinear transformation on the unitary result based on a nonlinear processing operator to obtain a non-unitary result includes: For a first part of the plurality of sub-results, performing a nonlinear transformation on the first part of the sub-results through the nonlinear processing operator to obtain the non-unitary result; The performing Hamiltonian calculation based on the non-unitary result to obtain the nonlinear processing result includes: Performing Hamiltonian calculation based on the non-unitary result and a second part of the plurality of sub-results to obtain the nonlinear processing result, where the second part of the sub-results does not overlap with the first part of the sub-results, the measurement bases of the first qubits corresponding to the first part of the sub-results are the same, and the measurement bases of the first qubits corresponding to the second part of the sub-results are determined according to Pauli operators.
4. The method according to claim 1, characterized in that, The nonlinear processing is completed through a nonlinear processing operator, and the nonlinear processing operator includes at least one of the following: a saturation activation function, a non-saturation activation function, a neural network. The left and right derivative limits of the saturation activation function both tend to 0, and the neural network includes parameters of the neural network, and the parameters of the neural network are used to perform nonlinear processing on the intermediate result.
5. The method according to claim 1, wherein The method further includes: According to the initial data of the quantum machine learning task, indicating the initial quantum state of an auxiliary qubit to the second parameterized quantum circuit, where there is a cascading influence between the quantum state of the auxiliary qubit and the quantum state of the second qubit.
6. The method according to claim 1, characterized in that, The quantum machine learning task involves a plurality of parameterized quantum circuits, and the method further includes: Obtain a prediction result obtained by measuring a third qubit in a third parameterized quantum circuit, where the third parameterized quantum circuit refers to the parameterized quantum circuit with the latest execution timing among the multiple parameterized quantum circuits, and the prediction result is used to characterize the predicted classification of the initial data of the quantum machine learning task; Determine the loss function value during the training process of the quantum machine learning task according to the prediction result and the label result, where the label result is used to characterize the reference classification of the initial data; Determine the gradient optimization direction based on the loss function value, where the gradient optimization direction includes the optimization direction of the free parameters in the multiple parameterized quantum circuits, and the free parameters refer to the variable parameters of the parameterized quantum gates in the parameterized quantum circuits; Adjust at least one of the free parameters according to the optimization direction of the free parameters to obtain multiple updated parameterized quantum circuits, and the multiple updated parameterized quantum circuits are used to participate in the next round of training of the quantum machine learning task; When the loss function value reaches convergence, obtain multiple trained parameterized quantum circuits.
7. The method according to claim 6, characterized in that, The non-linear processing is completed by a neural network, and the gradient optimization direction further includes the optimization direction of the parameters of the neural network. The method further includes: Adjust the parameters of the neural network according to the optimization direction of the parameters of the neural network to obtain an updated neural network, and the updated neural network is used to cooperate with the multiple updated parameterized quantum circuits to participate in the next round of training of the quantum machine learning task.
8. An auxiliary processing method for quantum machine learning, characterized in that, The method includes: A classical computer obtains a unitary result generated during the execution of a quantum machine learning task, where the unitary result is obtained by measuring a first qubit in a first parameterized quantum circuit used in the quantum machine learning task, and the first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit; The classical computer performs non-linear processing on the unitary result to obtain a non-linear processing result; The quantum computer encodes according to the non-linear processing result to determine the initial quantum state of a second qubit in a second parameterized quantum circuit used in the quantum machine learning task, and the second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit.
9. The method according to claim 8, wherein The classical computer performs non-linear processing on the unitary result to obtain a non-linear processing result, including: The classical computer performs a non-linear transformation on the unitary result based on a non-linear processing operator to obtain a non-unitary result, and the non-linear processing operator is used to process data in the form of classical bits; The classical computer performs a Hamiltonian calculation based on the non-unitary result to obtain the non-linear processing result.
10. The method according to claim 9, characterized in that, The unitary result includes multiple sub-results, and each sub-result respectively corresponds to the measurement result of one of the first qubits in the first parameterized quantum circuit; The classical computer performs a Hamiltonian calculation based on the non-unitary result to obtain the non-linear processing result, including: For the first part of the multiple sub-results, the classical computer performs a non-linear transformation on the first part of the sub-results through the non-linear processing operator to obtain the non-unitary result; The classical computer performs a Hamiltonian calculation based on the non-unitary result and the second part of the sub-results among the multiple sub-results to obtain the non-linear processing result. The second part of the sub-results does not overlap with the first part of the sub-results. The measurement bases of the first qubits corresponding to the first part of the sub-results are all the same, and the measurement bases of the first qubits corresponding to the second part of the sub-results are determined according to the Pauli operator.
11. The method according to claim 8, characterized in that, The non-linear processing is completed through a non-linear processing operator, and the non-linear processing operator includes at least one of the following: a saturation activation function, a non-saturation activation function, a neural network. The left and right derivative limits of the saturation activation function both tend to 0. The neural network includes the parameters of the neural network, and the parameters of the neural network are used to perform non-linear processing on the intermediate result.
12. The method according to claim 8, wherein The method further includes: The classical computer indicates the initial quantum state of the auxiliary qubit to the second parameterized quantum circuit according to the initial data of the quantum machine learning task, and there is a cascading influence between the quantum state of the auxiliary qubit and the quantum state of the second qubit.
13. The method according to claim 12, characterized in that, The method further includes: The quantum computer encodes the initial data to obtain the initial quantum state of the auxiliary qubit in the second parameterized quantum circuit, and the encoding method of the initial data is the same as the encoding method of the non-linear processing result.
14. The method according to claim 8, characterized in that, The quantum machine learning task involves multiple parameterized quantum circuits; the method further includes: The classical computer obtains the prediction result obtained by measuring the fourth qubit in the third parameterized quantum circuit. The third parameterized quantum circuit refers to the parameterized quantum circuit with the latest execution timing among the multiple parameterized quantum circuits, and the prediction result is used to characterize the predicted classification of the initial data of the quantum machine learning task; The classical computer determines the loss function value in the training process of the quantum machine learning task according to the prediction result and the label result, and the label result is used to characterize the reference classification of the initial data; The classical computer determines the gradient optimization direction based on the loss function value, where the gradient optimization direction includes the optimization direction of the free parameters in the multiple parameterized quantum circuits, and the free parameters refer to the variable parameters possessed by the parameterized quantum gates in the parameterized quantum circuits; The quantum computer adjusts at least one of the free parameters according to the optimization direction of the free parameters to obtain multiple updated parameterized quantum circuits, and the multiple updated parameterized quantum circuits are used to participate in the next round of training of the quantum machine learning task; The classical computer obtains multiple trained parameterized quantum circuits when the loss function value reaches convergence.
15. The method according to claim 14, characterized in that, The non-linear processing is completed through a neural network, and the gradient optimization direction further includes the optimization direction of the parameters of the neural network; the method further includes: The classical computer adjusts the parameters of the neural network according to the optimization direction of the parameters of the neural network, and obtains a plurality of updated neural networks, where the updated neural networks are used to participate in the next round of training of the quantum machine learning task in cooperation with the plurality of updated parameterized quantum circuits.
16. An auxiliary processing device for quantum machine learning, characterized in that The device includes: A result acquisition module, configured to acquire a unitary result generated during the execution of a quantum machine learning task, where the unitary result is obtained by measuring a first qubit in a first parameterized quantum circuit used in the quantum machine learning task, and the first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit; A result processing module, configured to perform non-linear processing on the unitary result to obtain a non-linear processing result; A result indication module, configured to indicate the initial quantum state of a second qubit to a second parameterized quantum circuit used in the quantum machine learning task according to the non-linear processing result, where the second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit, and the initial quantum state of the second qubit is determined by encoding the non-linear processing result.
17. A computer device, characterized in that, The computer device includes a processor and a memory, where a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the auxiliary processing method for quantum machine learning according to any one of claims 1 to 7.
18. A computer-readable storage medium, characterized in that, A computer program is stored in the storage medium, and the computer program is loaded and executed by a processor to implement the auxiliary processing method for quantum machine learning according to any one of claims 1 to 7.
19. A computer program product, characterized in that, The computer program product includes a computer program, the computer program is stored in a computer-readable storage medium, and the processor reads and executes the computer program from the computer-readable storage medium to implement the auxiliary processing for quantum machine learning according to any one of claims 1 to 7.
20. An auxiliary processing system for quantum machine learning, characterized in that, The system includes a classical computer and a quantum computer; The classical computer is configured to acquire a unitary result generated during the execution of a quantum machine learning task, where the unitary result is obtained by measuring a first qubit in a first parameterized quantum circuit used in the quantum machine learning task, and the first parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the first qubit; The classical computer is further configured to perform non-linear processing on the unitary result to obtain a non-linear processing result; The quantum computer is configured to perform encoding according to the non-linear processing result to determine the initial quantum state of a second qubit in a second parameterized quantum circuit used in the quantum machine learning task, where the second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit.
Citation Information
Cited By
Non-linear data generation and processing method based on light quantum and light quantum computer
CN121543754A