Assistive processing method and apparatus for quantum machine learning, device, and system
By introducing nonlinear processing of classical computers in quantum machine learning, the problem of linear operation limitation in parameterized quantum circuits is solved, the classification performance of quantum neural networks is improved and the depth of quantum circuits is reduced.
Patent Information
- Application Number
- PCT/CN2024/130737
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-24
- Filing Date
- 2024-11-08
- Publication Date
- 2025-07-31
AI Technical Summary
Existing quantum machine learning methods are limited by linear unitary operations in parameterized quantum lines, making it difficult to implement nonlinear processing, resulting in limited improvement in classification performance.
The unitary results generated in quantum machine learning tasks are nonlinearly processed through classical computers and imported into quantum computers to indicate the initial quantum state of the next parameterized quantum circuit, introduce classical nonlinear activation operations, and improve the perception ability of quantum neural networks.
The classification performance of quantum machine learning is significantly improved under the same quantum computing hardware resource consumption, and the quantum line depth is reduced and overhead is reduced.
Smart Images

Figure CN2024130737_31072025_PF_FP_ABST
Abstract
Description
Auxiliary processing methods, devices, equipment and systems for quantum machine learning
[0001] This application claims priority to Chinese patent application No. 202410104419.5, filed on January 24, 2024, entitled “Auxiliary processing methods, devices, equipment and systems for quantum machine learning”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] 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
[0003] Inspired by classical machine learning, quantum machine learning has gradually evolved by combining the parallel computing of quantum bits and the characteristics of quantum entanglement.
[0004] In related technologies, quantum machine learning tasks are performed through parameterized quantum circuits. Classical data is loaded into the initial quantum states of the qubits included in the parameterized quantum circuit (PQC). Quantum gates in the parameterized quantum circuit act on the qubits to perform a series of unitary operations, completing the complete quantum portion of the quantum machine learning task. Finally, the output of the quantum machine learning task is obtained by measuring the probability distribution of an observable quantity and generating a statistical model based on this probability distribution.
[0005] However, due to the limitations of linear unitary operations in parameterized quantum circuits, it is difficult to implement nonlinear 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.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a method, apparatus, device, and system for assisting processing of quantum machine learning. The technical solutions provided by the embodiments of the present application are as follows:
[0008] According to one aspect of an embodiment of the present application, a method for assisting processing of quantum machine learning is provided, the method being executed by a classical computer, the method comprising:
[0009] Obtaining a unitary result generated during execution of a quantum machine learning task, wherein 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 being used to perform a unitary operation on an initial quantum state of the first qubit;
[0010] Performing nonlinear processing on the unitary result to obtain a nonlinear processing result;
[0011] Based on the nonlinear processing result, an initial quantum state of a second quantum bit is indicated to a second parameterized quantum circuit used in the quantum machine learning task, wherein the second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second quantum bit, and the initial quantum state of the second quantum bit is determined by encoding the nonlinear processing result.
[0012] According to one aspect of an embodiment of the present application, a method for assisting processing of quantum machine learning is provided, the method comprising:
[0013] A classical computer obtains a unitary result generated during 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 an initial quantum state of the first qubit;
[0014] The classical computer performs nonlinear processing on the unitary result to obtain a nonlinear processing result;
[0015] The quantum computer encodes the nonlinear processing result and determines the initial quantum state of a second quantum bit 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 quantum bit.
[0016] According to one aspect of an embodiment of the present application, there is provided an auxiliary processing device for quantum machine learning, the device comprising:
[0017] a result acquisition module, configured to acquire a unitary result generated during the execution of a quantum machine learning task, wherein 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 an initial quantum state of the first qubit;
[0018] A result processing module, configured to perform nonlinear processing on the unitary result to obtain a nonlinear processing result;
[0019] a result indication module, configured to indicate, based on the nonlinear processing result, an initial quantum state of a second quantum bit to a second parameterized quantum circuit used in the quantum machine learning task, wherein the second parameterized quantum circuit is configured to perform a unitary operation on the initial quantum state of the second quantum bit, and the initial quantum state of the second quantum bit is determined by encoding the nonlinear processing result.
[0020] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein 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 as described above.
[0021] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the auxiliary processing method for quantum machine learning as described above.
[0022] According to one aspect of an embodiment of the present application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium, and a processor reading and executing the computer program from the computer-readable storage medium to implement the auxiliary processing method for quantum machine learning as described above.
[0023] According to one aspect of an embodiment of the present application, there is provided an auxiliary processing system for quantum machine learning, the system comprising a classical computer and a quantum computer;
[0024] The classical computer is used to obtain a unitary result generated during the execution of the quantum machine learning task, wherein the unitary result is obtained by measuring a first quantum bit 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 an initial quantum state of the first quantum bit;
[0025] The classical computer is further configured to perform nonlinear processing on the unitary result to obtain a nonlinear processing result;
[0026] The quantum computer is used to encode the nonlinear processing result, determine the initial quantum state of a second quantum bit 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 quantum bit.
[0027] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0028] The execution process of a quantum machine learning task utilizes at least two parameterized quantum circuits (including a first parameterized quantum circuit and a second parameterized quantum circuit). For an intermediate parameterized quantum circuit (e.g., the first parameterized quantum circuit) in the at least two parameterized quantum circuits, the output quantum state of the quantum bits included in the intermediate parameterized quantum circuit is measured to obtain a unitary result corresponding to the parameterized quantum circuit. This unitary result is then processed nonlinearly by importing it into a classical computer and performing a classical nonlinear operation on it. The nonlinear processing result obtained from the subsequent classical nonlinear operation can indicate the initial quantum state of the quantum bits in the parameterized quantum circuit to be executed (e.g., the second parameterized quantum circuit).
[0029] The nonlinear processing performed by classical computers consumes only a small computational overhead to complete the nonlinear processing of unitary results. Introducing reliable nonlinear processing in the intermediate process of executing quantum machine learning tasks is equivalent to introducing the activation operation designed between two hidden layers in classical machine learning into the quantum neural network, which helps to improve the quantum neural network's perception and processing capabilities of input data.
[0030] Compared with the quantum machine learning methods provided in related technologies, under the condition of the same quantum computing hardware resource consumption, 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 quantum machine learning classification performance, it helps to reduce the depth of quantum circuits and reduce overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] FIG1 is a schematic diagram of a system architecture provided by an exemplary embodiment of the present application;
[0032] FIG2 is a schematic diagram of a standard quantum neural network provided in the related art;
[0033] FIG3 is a schematic diagram of a dissipative quantum neural network provided in a related art;
[0034] FIG4 is a schematic diagram of a convolutional quantum neural network provided in a related art;
[0035] FIG5 is a schematic diagram of a quantum activation function in a parameterized quantum circuit provided in a related art;
[0036] FIG6 is a schematic diagram of the inventive concept of this solution;
[0037] FIG7 is a flowchart of an auxiliary processing method for quantum machine learning provided by an exemplary embodiment of the present application;
[0038] FIG8 is a schematic diagram of a nonlinear processing process provided by an exemplary embodiment of the present application;
[0039] FIG9 is a schematic diagram of a neural network provided by an exemplary embodiment of the present application;
[0040] FIG10 is a schematic diagram of data re-import provided by an exemplary embodiment of the present application;
[0041] FIG11 is a schematic diagram of the training effect of a quantum classifier provided by an exemplary embodiment of the present application;
[0042] FIG12 is a schematic diagram of a training process provided by an exemplary embodiment of the present application;
[0043] FIG13 is a schematic diagram showing the relationship between step size and loss function value provided by the parity data experiment process;
[0044] Figures 14-16 are schematic diagrams showing the relationship between step size and assurance provided by the parity data experiment process;
[0045] Figures 17 and 18 are diagrams showing the relationship between step size and loss function value provided by the MNIST (Modified National Institute of Standards and Technology) data experiment process;
[0046] Figures 19 and 20 are schematic diagrams of the corresponding relationship between step size and fidelity provided by the MNIST data experiment process;
[0047] FIG21 is a block diagram of an auxiliary processing device for quantum machine learning provided by another exemplary embodiment of the present application;
[0048] FIG22 is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0050] First, before introducing the technical solution of this application, some terms involved in this application are explained.
[0051] The qubit is the fundamental unit of quantum computing. Unlike classical computers, which use 0 and 1 as the basic units of binary, quantum computing can process both 0 and 1 simultaneously, allowing the system to be in a linear superposition of 0 and 1: |ψ> = α|0> + β|1>, where α and β represent the complex probability amplitudes of the system at 0 and 1, respectively.
[0052] Quantum machine learning is an approach that leverages the principles and techniques of quantum computing to solve machine learning problems. Combining the properties of quantum mechanics with the principles of machine learning algorithms, it aims to accelerate and improve traditional machine learning tasks by leveraging the parallel computing capabilities of qubits and the properties of quantum entanglement. Quantum machine learning aims to improve the performance and efficiency of machine learning tasks such as pattern recognition, classification, and clustering by leveraging the advantages of quantum computing, such as quantum parallelism and the high-dimensional representation of quantum states. By utilizing quantum algorithms and quantum optimization methods, quantum machine learning can demonstrate even greater computing power and learning capabilities when processing large amounts of data and complex problems.
[0053] A parameterized quantum circuit is a representation of a quantum universal computer and refers to a quantum circuit containing parameterized quantum gates. Parameterized quantum gates are quantum gates with variable free parameters.
[0054] Quantum-classical hybrid computing: It is a computational 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 quantum circuits. It can maximize the advantages of quantum computing and is believed to be one of the important directions with the potential to prove quantum advantage.
[0055] The expectation value of quantum computing refers to measuring a physical quantity in quantum computing and calculating its average value under 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.
[0056] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to achieve the best results.
[0057] Machine Learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI.
[0058] Deep learning (DL) is a research area within machine learning. Deep learning involves learning the inherent patterns and representational hierarchies of sample data. This information, acquired during the learning process, is used to interpret data such as text, images, and sounds. The ultimate goal of deep learning is to enable machines to acquire human-like analytical learning capabilities and recognize data such as text, images, and sounds.
[0059] In recent years, there has been a significant amount of research on quantum algorithms and circuits for quantum neural networks. In classical settings, neural networks offer powerful solutions to a wide range of machine learning tasks, in many cases overcoming obstacles that are insurmountable with conventional computing. Therefore, in order to develop quantum algorithms that rival the classical frontier, it's natural to attempt to apply neural networks to quantum environments.
[0060] Most quantum neural networks are feedforward neural networks, or quantum feedforward networks for short. Similar to classical neural networks, the qubits included in one quantum neural network layer receive input data, process this input data to generate output data, and use this output data as input data for another quantum neural network layer. This second quantum neural network layer processes the input data to generate output data; the first two steps are repeated, ultimately leading to the qubits included in the final quantum neural network layer. In a quantum neural network structure, the widths of different quantum neural network layers do not need to be the same. That is, the number of qubits included in different quantum neural network layers can be the same or different. Furthermore, the types and numbers of quantum gates in the parameterized quantum circuits corresponding to different quantum neural network layers do not need to be the same.
[0061] Quantum feedforward networks enable efficient execution and training of deep neural networks. A deep neural network is essentially a network with at least two hidden layers. These hidden layers can be implemented using parameterized quantum circuits. Quantum neural networks utilize fan-out unitary operators, each operating only 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 operates on the entire quantum neural network simultaneously, meaning that the number of qubits required in a quantum neural network layer depends on the input data for that layer. Quantum computers are known for their ability to run many iterations in a short period of time, so the efficiency of a quantum neural network depends solely on the number of qubits in each layer, not on its depth.
[0062] FIG1 is a schematic diagram of a system architecture provided by an exemplary embodiment of the present application.
[0063] The present application provides an auxiliary processing system for quantum machine learning, which includes a quantum computer 10 and a classical computer 20. The quantum computer includes at least two parameterized quantum circuits. At least two parameterized quantum circuits are executed serially. As shown in Figure 1, the quantum computer includes a parameterized quantum circuit 12 and a parameterized quantum circuit 13 whose execution sequence is adjacent. The classical computer 20 is used to play a role in data auxiliary processing during the process of the quantum computer 10 executing the quantum machine learning task. Specifically, the classical computer is used to perform classical nonlinear processing on the unitary result generated by the parameterized quantum circuit 12, and acts on the parameterized quantum circuit 13 based on the processed nonlinear processing result. In this way, nonlinear activation processing is achieved during the intermediate execution of the quantum machine learning task.
[0064] The application scenarios of this method include at least one of the following: training at least two parameterized quantum circuits based on a specific quantum machine learning task; and actually executing the specific quantum machine learning task through at least two parameterized quantum circuits.
[0065] Among them, quantum machine learning tasks include but are not limited to the following scenarios: 1. Quantum chemical simulation: such as calculating the chemical energy of molecules and predicting low-energy consumption pathways for separation into substances through the methods provided in this application. 2. Quantum physics calculations: such as solving the ground state and excited state in a multi-body system through the methods provided in this application. 3. Solving mathematical problems: such as solving high-dimensional variational equations and differential equations through the methods provided in this application. 4. Quantum communication network: such as predicting orthogonal quantum states and non-orthogonal quantum states through the methods provided in this application, and applying the prediction results to the design of structured quantum repeaters, quantum receivers and other devices. 5. Quantum metrology: such as determining the optimization direction of quantum sensing and quantum imaging through the methods provided in this application, so as to improve quantum sensing equipment and quantum imaging equipment and achieve higher-precision quantum measurements.
[0066] Below is a brief introduction to several quantum neural networks in related technologies.
[0067] FIG2 is a schematic diagram of a standard quantum neural network provided in the related art.
[0068] As shown in Figure 2, quantum gates in parameterized quantum circuit 210 act on qubits, changing their states. Finally, measurement circuit 220 measures the qubits in each parameterized quantum circuit (including 210) to obtain the quantum neural network's predictions. As shown in Figure 2, no qubit in a standard quantum neural network is discarded during the execution of the parameterized quantum circuit; furthermore, no new qubits are added during the execution of the parameterized quantum circuit.
[0069] FIG3 is a schematic diagram of a dissipative quantum neural network provided in a related art.
[0070] Dissipative quantum neural networks generalize classical feedforward networks. As shown in Figure 3, each node in a dissipative quantum neural network corresponds to a qubit, and the lines connecting the qubits represent unitary operations. The dissipative nature of dissipative quantum neural networks stems from the fact that the qubits (e.g., 310) included in each quantum neural network layer are discarded after propagating forward to the (new) qubits in the next layer.
[0071] FIG4 is a schematic diagram of a convolutional quantum neural network provided in a related art.
[0072] Figure 4 shows the structure of a quantum convolutional neural network (QCNN). In each layer of a QCNN, the qubits in that layer are measured to reduce the dimensionality of the input data for the next layer while preserving the relevant features of the measured qubits. Similar to a classical convolutional neural network (CNN), a QCNN also has network layers such as convolutional layers, pooling layers, and fully connected layers. The difference between a QCNN and a CNN is that the QCNN uses quantum bits (qubits) as input and processing units, and utilizes quantum gates for convolution and pooling operations. In a QCNN, convolution is implemented through the action of quantum gates. Quantum gates transform the state of the input qubits, achieving an operation equivalent to feature extraction in a classical convolutional neural network. The extracted features are then pooled to reduce their dimensionality and extract key information. Finally, the fully connected layers in the QCNN map these features to the output layer for classification or other tasks.
[0073] By referring to the aforementioned quantum neural networks, it's easy to see that in related technologies, quantum gates in parameterized quantum circuits are used to manipulate qubits, changing their quantum states to implement operations such as feature extraction, pooling, and normalization in classical neural networks. Because quantum mechanics is linear (for example, quantum operations are related to matrix operations), all operations implemented in parameterized quantum circuits are linear.
[0074] The expressive power of classical neural networks derives largely from nonlinear activation functions and dissipative dynamics, whereas quantum mechanics is distinctly linear, and the unitary evolution provided by quantum gates is reversible and non-dissipative. Quantum neural networks in related art ignore these issues and construct only parameterized quantum circuits, which are capable of only linear unitary operations. These circuits are trained to perform quantum machine learning tasks by adjusting the free parameters in these circuits through a training process. Because parameterized quantum circuits utilize neither the hierarchical structure of neural networks nor nonlinear activation functions, the quantum neural networks presented in related art bear little resemblance to artificial neural networks in classical computing or biological neural networks in nature.
[0075] Because quantum evolution describes probabilistic observations using linear operations, nonlinear activation functions do not directly correspond to the mathematical structures of quantum mechanics. Related technologies have attempted to mimic perceptron activation functions by using quantum mechanics formalisms, including using specialized measurement methods to parameterize quantum circuits and constructing nonlinear quantum operators (which in turn construct quantum activation functions).
[0076] FIG5 is a schematic diagram of a quantum activation function in a parameterized quantum circuit provided in a related art.
[0077] As shown in Figure 5, quantum activation function 1 and quantum activation function 2 are introduced into the parameterized quantum circuit. The quantum activation function acts on the quantum state of the quantum bit to simulate the perceptron in the classical neural network.
[0078] Another example is the introduction of at least one reference qubit into a parameterized quantum circuit, which can be used to implement nonlinear operations within the parameterized quantum circuit. However, adding new qubits to a parameterized quantum circuit increases the complexity of the system, while the reliability and stability of implementing nonlinear operations using special measurements obtained with reference qubits remain controversial.
[0079] FIG6 is a schematic diagram of the inventive concept of this solution.
[0080] In an embodiment of the present application, nonlinear processing is accomplished through an intermediate process of classical computer-assisted quantum machine learning. For a quantum neural network layer in a quantum neural network structure, after the execution of a first parameterized quantum circuit corresponding to the quantum neural network layer, the output quantum state of the qubits in the first parameterized quantum circuit is measured to obtain a unitary result.
[0081] The unitary result is then nonlinearly processed using a classical computer, and the nonlinear processing result obtained based on the nonlinear processing indicates the initial quantum state of the quantum bit in the next parameterized quantum circuit (such as the second parameterized quantum circuit in Figure 5).
[0082] Classical computers only need to consume a small amount of computing overhead to perform classical nonlinear processing on unitary results, which can activate the processing results generated by the intermediate layer of the quantum neural network. Nonlinear processing is introduced in the intermediate process of quantum machine learning, which 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 condition of the same quantum computing hardware resource consumption, the method provided in the embodiment 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 quantum circuits under the condition of equivalent quantum machine learning classification performance.
[0083] FIG7 is a flowchart of an auxiliary processing method for quantum machine learning provided by an exemplary embodiment of the present application. The method can be executed by a classical computer. The method may include at least one of the following steps (710-730):
[0084] Step 710: Obtain a unitary result generated during the execution of the quantum machine learning task, where the unitary result is obtained by measuring a first quantum bit 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 an initial quantum state of the first quantum bit.
[0085] In some embodiments, a quantum machine learning task refers to a machine learning task performed by a quantum computer. As described above, quantum machine learning tasks are executed using a quantum neural network structure. Specifically, the quantum neural network structure performs a series of processing on the initial data of the quantum machine learning task and determines the predicted result of the quantum machine learning task by measuring the output quantum state of the qubits.
[0086] In some embodiments, 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. The specific types of quantum machine learning tasks are determined based on actual needs and are not specified herein. Embodiments of this application can be applied to hybrid quantum-classical machine learning models.
[0087] In some embodiments, unitary operations are an important concept in quantum mechanics. They refer to operations in quantum computing and quantum information processing that preserve the canonical inner product of a quantum state. Specifically, unitary operations are linear transformations that can be represented by unitary matrices. In quantum mechanics, unitary operations correspond to physical operations that do not change the state of a quantum system, such as rotations, scaling, or phase shifts.
[0088] The parameterized quantum circuit includes parameters of quantum gates with adjustable parameters, also known as parameterized quantum gates. During the training process of the quantum machine learning task, by adjusting the free parameters of the parameterized quantum gate, at least two parameterized quantum circuits are adaptively completed to complete the above-mentioned specific quantum machine learning task. Parameterized quantum circuits are also called quantum neural network layers, variational quantum circuits (VQC), etc. In an embodiment of the present application, a parameterized quantum circuit corresponds to a quantum neural network layer in a quantum neural network structure, and a quantum neural network typically includes at least two quantum neural network layers.
[0089] In some embodiments, a parameterized quantum circuit includes at least one quantum bit and at least two quantum gates. A quantum bit is also referred to as a qubit. A quantum gate acts on a quantum bit to change the quantum state of the quantum bit. Exemplarily, there is a sequential execution order between the at least two quantum gates. For a quantum bit included in the parameterized quantum circuit, the quantum bit corresponds to at least one quantum gate, which acts on the quantum bit in sequence according to the execution order, causing the quantum bit to rotate, thereby changing the quantum state of the quantum bit. The types of quantum gates include at least one of the following: a single-bit rotation Y gate, a Z gate, a dual-bit rotation-controlled Z gate, etc.
[0090] In some embodiments, the types of quantum gates can be divided into parameterized quantum gates and non-parametric quantum gates, wherein parameterized quantum gates have free parameters, while non-parametric quantum gates do not include variable free parameters.
[0091] For example, the free parameter is the phase parameter θ of the parameterized quantum gate. During the training process of the quantum machine learning task, the free parameter can be adjusted to make the adjusted free parameter more suitable for the quantum machine learning task.
[0092] In some embodiments, a parameterized quantum circuit can be represented as:
[0093] in, represents the effect of the parameterized quantum gate, σ∈{σ x ,σ y ,σ z} is one of the Pauli matrices, W i represents the effect of the non-parametric quantum gate, L represents the total number of quantum gates included in the parameterized quantum circuit, and θ is used to characterize the free parameters included in the parameterized quantum circuit.
[0094] When performing a quantum machine learning task, the quantum computer prepares the initial quantum state of the qubits in the parameterized quantum circuit based on the initial data of the quantum machine learning task (e.g., encoding the initial data to determine the initial quantum state of each qubit in the parameterized quantum circuit). The quantum gates in the parameterized quantum circuit then act on the qubits, performing unitary operations 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 act on the qubits, the quantum state of the qubit is the output state. Measuring the output state of the qubit can yield a unitary result for the parameterized quantum circuit.
[0095] Typically, the unitary result is represented in the form of a wave function or a density matrix. In some embodiments, the unitary result includes a qubit string obtained by measuring the output quantum state of the qubit in a measurement basis.
[0096] In the embodiments provided herein, at least two parameterized quantum circuits are used to perform a quantum machine learning task. This task can be the process of training a quantum neural network or the process of actually applying the quantum neural network to perform classification predictions in a specific domain.
[0097] In some embodiments, the at least two parameterized quantum circuits are executed serially, that is, after one parameterized quantum circuit is executed, another parameterized quantum circuit in the at least two parameterized quantum circuits is executed. In other words, the quantum neural network is a feedforward network, such as a deep network.
[0098] For example, for two parameterized quantum circuits executed sequentially, the initial quantum state of the qubits in the second parameterized quantum circuit (i.e., the second parameterized quantum circuit) is related to the output quantum state of the qubits in the first parameterized quantum circuit (i.e., the first parameterized quantum circuit). In the solution provided in the embodiments of this application, after a parameterized quantum circuit is executed, a classical computer is required to perform nonlinear processing on the unitary result of the parameterized quantum circuit. Please refer to the embodiments below for details.
[0099] In the embodiments provided in this application, in order to achieve reliable nonlinear processing in quantum machine learning, a classical nonlinear auxiliary framework is introduced. The classical nonlinear auxiliary framework is implemented by a classical computer. After a parameterized quantum circuit is executed, the output quantum state of the quantum bit in the parameterized quantum circuit is measured to obtain a unitary result. The unitary result is subjected to classical nonlinear processing by a classical computer to obtain a nonlinear processing result. The initial quantum state of the quantum bit of the next parameterized quantum circuit is determined based on the nonlinear processing result, thereby realizing a classical nonlinear activation process. For the specific content of this part, please refer to the embodiments below.
[0100] In some embodiments, the first parameterized quantum circuit is one of at least two parameterized quantum circuits used in a quantum machine learning task. In some embodiments, the execution sequence of the first parameterized quantum circuit is earlier than that of at least one other parameterized quantum circuit in the at least two parameterized quantum circuits. For example, the first parameterized quantum circuit is the quantum circuit with the earliest execution sequence among the at least two parameterized quantum circuits. In another example, the first parameterized quantum circuit is the quantum circuit with the second-to-last execution sequence among the at least two parameterized quantum circuits.
[0101] The first qubit refers to a qubit in the first parameterized quantum circuit. In some embodiments, the first qubit includes all qubits in the first parameterized quantum circuit. In some embodiments, the first qubit includes qubits that contribute to the quantum machine learning task. For example, if a quantum machine learning task only needs to determine the probability distribution of operator x, then the qubit corresponding to operator x is the first qubit, and only the qubit of operator x needs to be measured. It should be noted that the type of the first qubit is set according to actual needs, and this application does not set it here. That is, in the process of measuring the parameterized quantum circuit, the output quantum state of the qubits in the local range can be measured to reduce the data processing pressure in the process of processing the quantum machine learning task, and the output quantum state of all qubits in the first parameterized quantum circuit can be measured.
[0102] A unitary result is determined by measuring a first qubit in a first parameterized quantum circuit. In some embodiments, the unitary result is classical data, which characterizes the probability distribution of the output quantum state of the first qubit. Classical data refers to data represented by classical bits, i.e., binary data. For example, 00101010001 is classical data.
[0103] In some embodiments, a unitary result is represented by a qubit string, which includes at least one sub-result. For example, each sub-result corresponds to a qubit. A qubit string is a number consisting of 0s and 1s, representing classical data obtained by measuring qubits in a parameterized quantum circuit.
[0104] For example, the upper and lower spin configurations of the unitary result on the measurement basis are represented by 0 and 1, respectively, and each measurement result corresponds to a bit string. For example, the measurement of the first parameterized quantum circuit is performed item by item according to the Pauli string decomposition. A Pauli string is a term consisting of the direct product of at least two Pauli operators at different lattice points. A Pauli string is a qubit string.
[0105] Step 720: Perform nonlinear processing on the unitary result to obtain a nonlinear processing result.
[0106] In some embodiments, the nonlinear processing result is used to characterize the activation result of the unitary result. In some embodiments, the nonlinear processing performed on the unitary result is classical nonlinear processing, i.e., nonlinear processing performed on classical data by a classical computer. The nonlinear processing is used to activate the unitary result, and the nonlinear processing result obtained by performing nonlinear processing on the unitary result has better classification perception capabilities.
[0107] In some embodiments, nonlinear processing is a processing method different from linear processing. Exemplarily, nonlinear processing is nonlinear processing of the unitary result using an activation function. That is, nonlinear processing of the unitary result is performed using a classical activation function. Exemplarily, the type of activation function includes, but is not limited to, at least one of the following: a rectified linear unit (ReLU) function, a sigmoid function, and the like.
[0108] In some embodiments, the unitary result is nonlinearly processed by a multilayer perceptron constructed using a neural network. Exemplarily, the neural network is a neural network in the architecture of a variational quantum-neural network hybrid eigenvalue detector. For details about the structure of the neural network, please refer to the following embodiments.
[0109] In some embodiments, the nonlinear processing result refers to the energy expectation value of the output quantum state of the first qubit in the first parameter quantization circuit after nonlinear processing. A classical computer achieves a nonlinear result on the unitary result by performing a nonlinear transformation on the unitary result. The nonlinear processing result has better feature perception than the unitary result, thereby helping to improve the expressiveness of quantum machine learning tasks and enhance the classification capabilities of quantum machine learning algorithms.
[0110] Step 730: Based on the nonlinear processing result, indicate the initial quantum state of the second quantum bit to 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 quantum bit. The initial quantum state of the second quantum bit is determined by encoding the nonlinear processing result.
[0111] In some embodiments, the second parameterized quantum circuit is one of at least two parameterized quantum circuits used in executing a quantum machine learning task. In some embodiments, the execution timing of the second parameterized quantum circuit lags behind the execution timing of the first parameterized quantum circuit.
[0112] In some embodiments, the execution sequence of the second parameterized quantum circuit is adjacent to the execution sequence of the first parameterized quantum circuit. That is, the quantum computer executes the second parameterized quantum circuit after executing the first parameterized quantum circuit. In this case, the first parameterized quantum circuit and the second parameterized quantum circuit are equivalent to two adjacent hidden layers in a quantum neural network.
[0113] The initial quantum state of the qubits included in the second parameterized quantum circuit is related to a unitary result obtained by measuring the first qubit included in the first parameterized quantum circuit. In some embodiments, 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 state of each qubit in the second parameterized quantum circuit can be determined based on the unitary result. Exemplarily, the initial quantum state of the qubits in the second parameterized quantum circuit can be obtained by encoding the nonlinear processing result obtained after performing the unitary result processing as in step 720.
[0114] Exemplarily, the process of encoding the nonlinear processing results is performed in a quantum computer, for example, by an encoding quantum circuit within the quantum computer, which includes at least one quantum gate. After the quantum bit rotates through the quantum gate in the encoding quantum circuit, the initial quantum state of the quantum bit in the second parameterized quantum circuit is prepared. In other words, the initial quantum state of each second quantum bit in the second parameterized quantum circuit is prepared based on the nonlinear processing results by the encoding quantum circuit. In other words, the nonlinear processing results in classical data form are converted into quantum form by the encoding quantum circuit, allowing the second parameterized quantum circuit to continue subsequent steps in the quantum neural network based on the nonlinear processing results in this quantum form.
[0115] In some embodiments, the encoding quantum circuit can be understood as the earliest executed portion of the second parameterized quantum circuit, i.e., the encoding quantum circuit is connected to the second parameterized quantum circuit. A classical computer transmits the nonlinear processing results to the encoding quantum circuit. After the encoding quantum circuit prepares the initial quantum state of the qubit based on the nonlinear processing results, the quantum gates included in the second parameterized quantum circuit act on the qubit according to a preset timing.
[0116] 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 a qubit included in the second parameterized quantum circuit. In some embodiments, the second qubit refers to a qubit used to implement quantum machine learning in the second parameterized quantum circuit. Exemplarily, the total number of the second qubits is equal to the total number of the first qubits.
[0117] In some embodiments, the type of the initial quantum state of the qubit includes at least one of the following: an all-zero state, a uniform superposition state, and a Hartree-Fock state. The initial quantum state is also referred to as an input quantum state, a trial state, etc. In the embodiments of the present application, the initial quantum state of the second qubit depends on the result of the nonlinear processing.
[0118] In some embodiments, after the first parameterized quantum circuit completes execution, the classical computer obtains a unitary result obtained by measuring the output quantum state of the qubit in the parameterized quantum circuit. The unitary result is represented by a qubit string. Subsequently, the classical computer performs nonlinear processing based on the unitary result to activate the unitary result and obtain a nonlinear processing result. The classical computer transmits the nonlinear processing result to the quantum computer, causing the quantum computer to encode based on the nonlinear processing result, that is, to prepare the initial quantum state of the second qubit based on the nonlinear processing result.
[0119] Subsequently, the quantum computer executes the second parameterized quantum circuit, and the quantum gate in the second parameterized quantum circuit acts on the second quantum bit in the second parameterized quantum circuit, changing the quantum state of the second quantum bit. By measuring the output quantum state of the quantum bit in the second parameterized quantum circuit, the unitary result produced by the second parameterized quantum circuit is obtained.
[0120] In this example, a classical computer refers to a computer designed according to the von Neumann principle, which is used to operate on classical bits. A quantum computer refers to a computer designed based on quantum mechanics, which is used to operate on quantum bits. A parameterized quantum circuit refers to the hardware circuit used to implement a quantum computer. Since the solutions provided in the embodiments of this application involve more than one parameterized quantum circuit, a quantum computer is used as the executor of the quantum computing portion of quantum machine learning. The process of a quantum computer executing a parameterized quantum circuit is actually the process of the quantum gates in the parameterized quantum circuit acting on quantum bits.
[0121] In the embodiments provided herein, a first parameterized quantum circuit is any parameterized quantum circuit among at least two parameterized quantum circuits used to implement a quantum machine learning task, except for the parameterized quantum circuit with the latest execution order. During the execution of a quantum machine learning task, there may be at least two first parameterized quantum circuits, or there may be only one first parameterized quantum circuit. For example, the first parameterized quantum circuit is the parameterized quantum circuit with the earliest execution order.
[0122] For example, the first parameterized quantum circuit includes all parameterized quantum circuits except the parameterized quantum circuit with the latest execution order. In this case, assuming that 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 nonlinear architecture provided by the classical computer constitute a hidden layer in the quantum neural network. By adding the classical nonlinear architecture to complete the activation operation of the intermediate results generated by the parameterized quantum circuit, the defect of the difficulty in implementing nonlinear activation functions in the parameterized quantum circuit is compensated, which helps to improve the classification and induction capabilities of quantum machine learning.
[0123] When the quantum machine learning task includes more than one first-parameterized quantum circuit, the method for performing nonlinear processing on the unitary results obtained by measuring the quantum bits in different first-parameterized quantum circuits by a classical computer can be the same or different. Please refer to the embodiments below for details.
[0124] Nonlinear basis functions are crucial in classical machine learning. Classical machine learning typically uses a large number of activation functions to create a complex model to achieve high-precision learning. Quantum neural networks operate on quantum states in a coherent manner. Since quantum states typically have a mixture of classical and quantum correlations, in the solution provided in this application, a quantum computer in a hybrid quantum-classical model uses quantum gates to act on quantum bits based on the quantum correlations of quantum states, and a classical computer in a hybrid quantum-classical model performs classical nonlinear operations on the unitary results obtained by processing the parameterized quantum vectors in the intermediate layer based on the classical correlations of quantum states, which helps to improve the ability of quantum neural network models in related technologies to represent quantum correlation distributions.
[0125] In summary, the execution process of a quantum machine learning task utilizes at least two parameterized quantum circuits. By measuring the output quantum state of the qubits included in an intermediate parameterized quantum circuit, a unitary result corresponding to the parameterized quantum circuit can be obtained. This unitary result is then activated by importing it into a classical computer and performing classical nonlinear processing on it. The nonlinear processing result obtained from the subsequent classical nonlinear operation can indicate the initial quantum state of the qubits in the parameterized quantum circuit to be executed.
[0126] The nonlinear processing performed by classical computers consumes only a small computational overhead to complete the nonlinear processing of unitary results. Introducing reliable nonlinear processing in the intermediate process of executing quantum machine learning tasks is equivalent to introducing the activation operation designed between two hidden layers in classical machine learning into the quantum neural network, which helps to improve the quantum neural network's perception and processing capabilities of input data.
[0127] Compared with the quantum machine learning methods provided in related technologies, under the condition of the same quantum computing hardware resource consumption, 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 quantum machine learning classification performance, it helps to reduce the depth of quantum circuits and reduce overhead.
[0128] The following describes the process of obtaining the unitary result through several embodiments.
[0129] Step 710, obtaining a unitary result generated during the execution of the quantum machine learning task, may include at least one of the following sub-steps (not shown in the drawings of the specification), which are executed by a classical computer.
[0130] Sub-step 713: Obtain a measurement result of the output quantum state of the first quantum bit.
[0131] 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 aforementioned measurement result is obtained. Exemplarily, the quantum computer includes a measurement circuit, and the measurement circuit is used to perform the measurement of each first qubit.
[0132] In some embodiments, the first qubit refers to all qubits included in the first parameterized quantum circuit. The first qubit may also be a portion of the qubits included in the first parameterized quantum circuit. For example, the first qubit is a single qubit or a pair of qubits.
[0133] 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 at the output quantum state of the first quantum bit is the sum of the energy expectation values of at least two Pauli strings obtained by decomposing the Hamiltonian. In some embodiments, the first quantum bit includes a sign quantum bit and other first quantum bits other than the sign quantum bit. The symbol quantum bit is also called a sign bit. By setting the first parameterized quantum circuit, the observation result of the sign quantum bit can be located at the zeroth position in the measurement result, and the measurement basis corresponding to the sign quantum bit is determined according to the corresponding Pauli operator in the Pauli string. The measurement basis of other first quantum bits is the same. Measurement is performed on the measurement basis of each first quantum bit to obtain the above measurement result.
[0134] In some embodiments, in a measurement circuit within a quantum computer, the measurement of other first qubits is controlled by the sign qubit. Specifically, the sign qubit determines the measurement of other first qubits via a control quantum gate. The control quantum gate includes a control-X / Y / Z gate, where X / Y / Z is determined by the Pauli operators on the other qubits.
[0135] Exemplarily, the sign bit is measured on the measurement basis corresponding to the Pauli operator, and the other first quantum bits are measured based on the measurement basis Z.
[0136] Sub-step 716, averaging the estimated measurement results to obtain a unitary result.
[0137] The average estimate of the measurement results can be achieved by the following formula:
[0138] Among them, 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 the first quantum bits.
[0139] By measuring some of the qubits in the parameterized quantum circuit, it helps to reduce the measurement pressure and the data processing pressure in the quantum machine learning process. After obtaining the unitary result, the classical computer performs nonlinear processing on the unitary result. This process can be expressed by the following formula:
[0140] in, represents the unitary result, represents the non-unitary result obtained after nonlinear processing. For the specific process of nonlinear processing, please refer to the next embodiment.
[0141] The technical solution provided in the embodiments of this application uses a classical computer to obtain the output quantum state of the first qubit and then averages the measurement results to obtain a unitary result. Therefore, the unitary result obtained after averaging is more accurate, which helps ensure the efficiency of subsequent quantum machine learning tasks.
[0142] The nonlinear operation process is described below through several embodiments.
[0143] In some embodiments, step 720, nonlinearly processing the unitary result to obtain the nonlinear processing result, may include at least one of the following sub-steps (723-726, not shown in the drawings of the specification), and the execution subject of these sub-steps is a classical computer.
[0144] Sub-step 723 , performing a nonlinear transformation on the unitary result based on a nonlinear processing operator to obtain a non-unitary result, wherein the nonlinear processing operator is used to process data in a classical bit form.
[0145] In some embodiments, a nonlinear processing operator is used to represent a method for implementing nonlinear processing. In some embodiments, the nonlinear processing operator is an activation function that performs nonlinear processing on the unitary result. In some embodiments, the nonlinear processing operator represents a neural network that performs nonlinear processing on the unitary result. For details on the specific form of the nonlinear processing operator, please refer to the following.
[0146] A classical bit is also called a 01 bit. 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 is classical data. In some embodiments, a classical computer inputs the unitary result into a nonlinear processing operator to obtain a nonunitary result.
[0147] Non-unitary results are obtained by nonlinearly processing unitary results using a classical computer. In other words, non-unitary results refer to unitary results after nonlinear transformation. Compared with non-unitary results, non-unitary results have a stronger ability to perceive the features involved in quantum machine learning tasks.
[0148] The difference between unitary results and non-unitary results can be understood through the relationship between unitary matrices and non-unitary matrices. A unitary matrix is a matrix that satisfies All the evolution processes directly allowed by quantum mechanics can be described by unitary matrices. Where U is the unitary matrix, also known as the unitary matrix, unitary matrix, etc. is the conjugate transpose of U. Additionally, a matrix that does not satisfy the above conditions is non-unitarity. The non-unitarity result can be represented as a non-unitarity matrix. Compared with the unitarity result, the non-unitarity result has stronger expression ability and faster ground state projection effect.
[0149] In some embodiments, there is a corresponding relationship between the unitarity result and the non-unitarity result in terms of content. Exemplarily, the unitarity result includes p sub-results, and the non-unitarity 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 unitarity result, a 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-unitarity result.
[0150] In some embodiments, when there are more than one parameterized quantum circuits among at least two parameterized quantum circuits, the non-linear processing operators for processing different first parameterized quantum circuits can be the same or different.
[0151] Sub-step 726, perform Hamiltonian calculation based on the non-unitarity 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-unitarity result. The Hamiltonian is a physical quantity used to describe the total energy of a system. Exemplarily, the Hamiltonian can usually 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 some embodiments, the non-unitarity result can be calculated by the following formula:
[0154] where f φ (s) is the non-linear processing operator, the qubit string s represents the unitarity result corresponding to the first parameterized quantum circuit, and n represents the total number of first qubits included in the first parameterized quantum circuit. When 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 vector and right vector of the qubit string, and |s><s| refers to a diagonal matrix with the qubit string s as the diagonal element, represents the non-unitarity result obtained after non-linear operation through the non-linear processing operator.
[0155] The non-linear processing result can be represented by the following formula:
[0156] Wherein, |ψ>=U(θ)|0> represents the unitary result obtained by measuring the first quantum bit after performing a unitary transformation on the initial state of the first quantum bit through the first parameterized linear network U(θ), and θ represents the free parameter in the parameterized quantum gate. represents the non-unitary result obtained by nonlinear processing of the unitary result by the nonlinear processing operator, Indicates the result of nonlinear processing.
[0157] A classical computer uses nonlinear operators to perform nonlinear processing on the unitary results corresponding to a parameterized quantum circuit. Based on the nonlinearly processed nonunitary results, the corresponding Hamiltonian is calculated to obtain the input number of another parameterized quantum circuit. This method adds classical nonlinear processing to the execution of quantum machine learning tasks, activating the unitary results produced by the parameterized quantum circuit and helping to improve the feature perception capabilities of quantum machine learning.
[0158] The following describes several embodiments of nonlinear processing of unitary results by a classical computer.
[0159] In some embodiments, the unitary result includes at least two sub-results, each sub-result corresponding to a measurement result of a first quantum bit in the first parameterized quantum circuit.
[0160] As can be seen from the above, a unitary result is represented by a qubit string, and a subresult corresponds to a qubit string, and the subresult is represented in the form of classical qubits. In some embodiments, each subresult in the unitary result corresponds to the output quantum state of a first qubit. In other words, a subresult is obtained by observing the output quantum state of a qubit.
[0161] Sub-step 723, performing a nonlinear transformation on the unitary result by a nonlinear processing operator to obtain a non-unitary result, including: for a first part of the at least two sub-results, performing classical nonlinear processing on the first part of the sub-results by a nonlinear processing operator to obtain a non-unitary result.
[0162] In some embodiments, the first part of sub-results includes at least one sub-result of the at least two sub-results. For example, the first part of sub-results may include one or more sub-results.
[0163] In some embodiments, the classical computer performs nonlinear processing on each sub-result in the first portion of sub-results using a nonlinear processing operator to obtain a non-unitary result. For example, the nonlinear processing operator is an activation function. The classical computer uses each sub-result in the first portion of sub-results as an input to the activation function to obtain a corresponding activation result, and uses the activation result corresponding to each sub-result in the first portion of sub-results as the non-unitary result.
[0164] In some embodiments, a classical computer performs nonlinear processing on all sub-results included in the first partial sub-result using a nonlinear processing operator to obtain a non-unitary result. For example, the nonlinear processing operator is implemented using a neural network. The neural network includes at least two neural network layers. The classical computer uses each sub-result in the first partial sub-result as a value on a neuron in an input layer of the at least two neural network layers, and calculates the value on the neuron in the input layer based on the weights and biases between the neurons in at least one neural network layer, ultimately obtaining a non-unitary result.
[0165] Sub-step 726, performing Hamiltonian calculation based on the non-unitary result to obtain a nonlinear processing result, including: performing Hamiltonian calculation based on the non-unitary result and a second partial sub-result of the at least two sub-results to obtain a nonlinear processing result, the second partial sub-result does not overlap with the first partial sub-result, and the measurement basis of the first quantum bit corresponding to the second partial sub-result is determined according to the Pauli operator, and the measurement basis of the first quantum bit corresponding to the first partial sub-result is the same.
[0166] 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 the first partial sub-result and the second partial sub-result are combined to obtain a complete unitary result. In some embodiments, the second partial sub-result is at the zeroth position in the unitary result.
[0167] In some embodiments, the second parton result is obtained by measuring the output quantum state of the symbol qubit. For details about the symbol qubit, please refer to the above embodiments.
[0168] In some embodiments, the measurement basis in quantum refers to the specific basis on which a quantum system is measured in quantum mechanics. In quantum mechanics, the measurement basis (also called basis vectors or eigenstates) is a set of orthogonal and normalized vectors that can be used to construct the state space of the system. These vectors correspond to the eigenvalues of observable quantities and are used to describe the possible states of the system when measured. The choice of measurement basis depends on the physical system under consideration and the required measurement. For example, under the computational basis, the measurement of a single quantum bit can be characterized by a Pauli matrix or other self-adjoint operators.
[0169] In some embodiments, the measurement basis corresponding to the sign qubit is different from the measurement basis corresponding to the other first qubits. For example, if a Pauli string includes a first Pauli operator, a second Pauli operator, and a third Pauli operator, and the sign qubit corresponds to the measurement basis of the first Pauli operator, then the measurement basis of the other first qubits is 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.
[0170] In some embodiments, the first qubits corresponding to the subresults included in the first partial subresult and the subresults included in the second partial subresult, respectively, have different roles in the first parameterized quantum circuit. In some embodiments, for the second subresult in the second partial subresult, the first qubit corresponding to the second subresult is an observation and control qubit, also known as a sign qubit; for the first subresult in the first partial subresult, the first qubit corresponding to the first subresult is an execution qubit. The second subresult refers to every subresult included in the second partial subresult, and the first subresult refers to every subresult included in the first partial subresult. A control quantum gate acts on the first qubit corresponding to the second subresult, determining the measurement circuit for measuring the first qubit corresponding to the first subresult.
[0171] In some embodiments, assuming that the unitary result includes n sub-results, where n is a positive integer greater than 1, the second partial sub-result includes one second sub-result, and the first partial sub-result includes n-1 first sub-results. That is, the first parameterized quantum circuit includes one observation and control qubit and n-1 execution qubits. Because the first qubit corresponding to the second sub-result and the first qubit corresponding to the first sub-result have different functions in the first parameterized vector, it is not necessary to use a nonlinear processing operator to perform nonlinear processing on the second partial sub-result during nonlinear processing of the unitary result.
[0172] In some embodiments, the nonlinear processing result is calculated by the following formula during the actual execution of the quantum machine learning task:
[0173] in, Represents the nonlinear processing result, s0 represents the second sub-result included in the second part of the sub-result, s 1:n-1 represents the n-1 sub-results included in the first part of the sub-results, and f() represents a nonlinear processing operator.
[0174] FIG8 is a schematic diagram of a nonlinear processing process provided by an exemplary embodiment of the present application.
[0175] In some embodiments, a classical computer processes the unitary result through a neural network. Specifically, the nonlinear processing result of the first partial result 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 a nonlinear processing result.
[0176] In some embodiments, the first partial sub-result includes k Pauli strings, and the k Pauli strings are nonlinearly processed respectively by a nonlinear processing operator to obtain k non-unitary sub-results; and based on the k non-unitary sub-results, the energy expectation values of the k Pauli strings are determined respectively, 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 nonlinear processing result, where k is a positive integer.
[0177] During the execution of a quantum machine learning task, the output quantum state of the quantum bits included in the intermediate parameterized quantum circuit (i.e., the first parameterized quantum circuit) is measured, and the unitary result obtained from the measurement is processed on a classical computer to obtain a nonlinear processing result. This is equivalent to performing nonlinear processing between two adjacent hidden layers in the quantum neural network, which helps to improve the classification perception ability of the quantum neural network. In addition, by dividing the quantum machine learning task into at least two parameterized quantum circuits and performing intermediate measurements between the at least two parameterized quantum circuits, the observed intermediate unitary result can be nonlinearly processed, making the influence between the at least two parameterized quantum circuits more flexible and varied, which helps to improve the performance of the quantum neural network on this basis.
[0178] The technical solution provided in the embodiment of the present application performs a nonlinear transformation on the first part of the quantum result through a nonlinear processing algorithm to obtain a non-unitary result. The Hamiltonian is calculated based on the non-unitary result and the second part of the quantum result to obtain a nonlinear processing result. Considering that the quantum bits corresponding to the first part of the quantum result and the second part of the quantum result are different, the first quantum bit corresponding to the second part of the quantum result belongs to the observation and control quantum bit, that is, the symbol quantum bit, and does not need to undergo nonlinear changes. Therefore, by distinguishing the first part of the quantum result from the second part of the quantum result, the amount of data processing required to perform nonlinear transformations can be reduced, thereby improving the performance of the quantum neural network.
[0179] In some embodiments, nonlinear processing is performed by a nonlinear processing operator, and the nonlinear processing operator includes at least one of the following: a saturated activation function, a non-saturated activation function, and a neural network. The left and right derivative limits of the saturated activation function both tend to 0, and the neural network includes parameters for performing nonlinear processing on the nonlinear processing results.
[0180] In some embodiments, the saturation activation function includes a Sigmoid function, which can be expressed by the following formula:
[0181] Among them, x represents the unitary result, f b () represents a nonlinear processing operator. For example, x refers to the second partial result in the unitary result.
[0182] In some embodiments, the non-saturated activation function has a left derivative limit that does not tend to 0, or an activation function whose right derivative limit does not tend to 0. The non-saturated activation function includes a ReLU function, which can be expressed by the following formula:
[0183] Wherein, x represents a unitary result. Exemplarily, x refers to the first partial result in the unitary result.
[0184] FIG9 is a schematic diagram of a neural network provided by an exemplary embodiment of the present application.
[0185] As shown in Figure 9, a neural network includes at least two neurons. There is a connection between at least two neurons. For any two connected neurons, the line between the two neurons records the weight between the two neurons, and the neurons also include the bias of the neurons. In other words, a neural network consists of neurons and neural network parameters. The neural network parameters include the weights between neurons and the biases on neurons.
[0186] In some embodiments, the parameters of the neural network are obtained by pre-training the neural network. The parameters of the neural network can also be trained and adjusted together with the free parameters in the parameterized quantum circuit during the quantum machine learning task.
[0187] In some embodiments, the auxiliary processing method for nonlinear quantum machine learning includes the following steps: the following steps are performed by a classical computer.
[0188] Step A10: Obtain a unitary result generated during the execution of the quantum machine learning task. In some embodiments, a classical computer obtains a measurement result of an output quantum state of the first qubit; and averages and estimates the measurement results to obtain a unitary result.
[0189] In some embodiments, the unitary result includes at least two sub-results, each sub-result corresponding to a measurement result of a first quantum bit in the first parameterized quantum circuit.
[0190] Step A20: For a first part of the at least two sub-results, perform classical nonlinear processing on the first part of the sub-results by using a nonlinear processing operator to obtain a non-unitary result.
[0191] In some embodiments, the classical computer divides the unitary result into a first part quantum result and a second part quantum result, wherein the first quantum bit corresponding to the second part quantum result is used to observe and control the first quantum bit corresponding to the first part quantum result in a first parameterized quantum circuit.
[0192] Exemplarily, performing classical nonlinear processing on the first part of the sub-result by a nonlinear processing operator to obtain a non-unitary result can be achieved in the following ways.
[0193] Method 1: The nonlinear processing operator is a Sigmoid function. A classical computer uses the Sigmoid function to process each sub-result included in the first part of the sub-results to obtain a non-unitary result.
[0194] Method 2: The nonlinear processing operator is the ReLU function. The classical computer uses the ReLU function to process the sub-results included in the first part of the sub-results to obtain a non-unitary result.
[0195] Method 3: A nonlinear processing algorithm represents a neural network. A classical computer inputs each sub-result included in the first part of the sub-results 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 this application is implemented via parameterized quantum circuits, and the "neural network" refers to a neural network in a classical computer.
[0196] In some embodiments, at least two parameterized quantum circuits are used during the execution of a quantum machine learning task, where more than one parameterized quantum circuit can serve as a first parameterized quantum circuit. In some embodiments, the nonlinear processing methods corresponding to the unitary results measured from the at least two first parameterized quantum circuits can be identical. For example, a sigmoid function is used to perform nonlinear processing on the unitary results of each of the at least two first parameterized quantum circuits.
[0197] In some embodiments, at least two of the unitary results obtained by measuring at least two first parameterized quantum circuits are nonlinearly processed using different nonlinear processing methods. That is, the two unitary results correspond to different nonlinear processing operators.
[0198] Considering that neural networks can achieve more accurate nonlinear activation, but the parameters of the neural network included in the neural network need to be obtained through training, it is possible to choose to use neural networks and activation functions interspersed to perform nonlinear processing on the unitary results corresponding to at least two first parameterized quantum circuits.
[0199] For example, at least two parameterized quantum circuits include a total of six first 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 nonlinear processing on the unitary results corresponding to parameterized quantum circuit 1 and parameterized quantum circuit 4, respectively. A sigmoid function is used to perform nonlinear 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 nonlinear processing on the unitary results corresponding to parameterized quantum circuit 1 and parameterized quantum circuit 4, respectively, can be the same or different.
[0200] Different neural networks include the following situations: different structures of the neural networks (such as the number of neurons in the neural network, the different connections between neurons), the same structure of the neural networks, different parameters of the neural networks included in the neural networks, etc.
[0201] For another example, at least two parameterized quantum circuits include three first parameterized quantum circuits, namely parameterized quantum circuit 1, parameterized quantum circuit 2, and parameterized quantum circuit 3; among them, parameterized quantum circuit 3 is executed last, and the Sigmoid function is used to perform nonlinear processing on the unitary results corresponding to parameterized quantum circuit 1 and parameterized quantum circuit 2, respectively, and the neural network is used to perform nonlinear processing on the unitary result corresponding to parameterized quantum circuit 3.
[0202] Through this method, nonlinear processing based on neural networks and nonlinear processing based on activation functions are interspersed during the execution of quantum machine learning tasks. While ensuring good nonlinear processing effects of the neural network, it helps to reduce the pressure of training the neural networks corresponding to each first quantum parameterized circuit, and reduce the variable amount so that the best optimization direction of the parameters of each neural network can be found as soon as possible during the training process, thereby helping to shorten the training cycle and improve the efficiency of training for quantum machine learning tasks.
[0203] Step A30: Perform Hamiltonian calculation based on the non-unitary result and the second part of the sub-results in the at least two sub-results to obtain a nonlinear processing result.
[0204] In some embodiments, the calculation formula of the nonlinear processing result is as follows:
[0205] Please refer to the above examples for the meaning of each parameter in the formula.
[0206] Step A40: Perform Hamiltonian calculation based on the non-unitary result to obtain a nonlinear processing result.
[0207] Step A50: Instructing the second parameterized quantum circuit used in the quantum machine learning task, based on the nonlinear processing result, on the initial quantum state of the second quantum bit.
[0208] In some embodiments, the classical computer transmits the nonlinear processing result to a second parameterized quantum circuit in the quantum computer. Before the quantum computer executes the second parameterized quantum circuit, the nonlinear processing result is encoded through the encoding quantum circuit to obtain the initial quantum state of the second quantum bit.
[0209] By performing nonlinear processing on the unitary result in this embodiment, an activation operation on the unitary result is achieved, which helps to improve the classification ability of the quantum neural network when processing quantum machine learning tasks.
[0210] The technical solutions provided in the embodiments of this application include various forms of nonlinear processing operators, such as at least one of the following: a saturated activation function, a nonsaturated activation function, and a neural network. This demonstrates the diversity and flexibility of methods for implementing nonlinear processing. Different nonlinear processing algorithms can be selected based on different needs, thereby improving the efficiency of assisting quantum machine learning.
[0211] In some embodiments, the auxiliary processing method for quantum machine learning shown in Figure 7 also includes: step 735, the classical computer indicates the initial quantum state of the auxiliary quantum bit to the second parameterized quantum circuit based on the initial data of the quantum machine learning task, and the quantum state of the auxiliary quantum bit and the quantum state of the second quantum bit have an impact on each other in the second parameterized quantum circuit.
[0212] In some embodiments, the initial data for a quantum machine learning task refers to the qubit corresponding to the parameterized quantum circuit with the earliest execution time among at least two parameterized qubits. For example, during the training process of a quantum machine learning task, the initial data for the quantum machine learning task refers to the training data. For another example, during the actual execution of a quantum machine learning task, the initial data for the quantum machine learning task refers to the data to be processed provided by the user.
[0213] In some embodiments, the second parameterized quantum circuit includes a second qubit and an auxiliary qubit. In some embodiments, the auxiliary qubit is introduced to overcome the non-cloning property of quantum states. Because the quantum state of a qubit cannot be recreated, determining the initial quantum state of the auxiliary data using the initial data is equivalent to importing the quantum state of qubits in other parameterized quantum circuits into the second parameterized quantum circuit. This overcomes the limitation that the quantum state of qubits cannot be cloned and simulates the mutual influence between the quantum states of qubits in different parameterized quantum circuits.
[0214] 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 among the at least two parameterized quantum circuits participating in the quantum machine learning task.
[0215] In some embodiments, the quantum state of the auxiliary qubit and the quantum state of the second qubit interact in the second parameterized quantum circuit, i.e., quantum entanglement exists between the auxiliary qubit and the second qubit. Providing initial data to the second parameterized quantum circuit helps improve the learning and expression capabilities of the parameterized quantum circuit.
[0216] Taking a single qubit as an example, a single qubit provides only a simple superposition of two qubits. A single-qubit gate acting on a single qubit can cause it to rotate on the Bloch sphere. In principle, a single qubit can provide sufficient computing power to construct a universal quantum classifier. To build a quantum classifier on a single qubit, a classical computer provides initial data to the second parameterized quantum circuit and then uses an auxiliary qubit to influence the quantum state of the second qubit, effectively re-importing the initial data.
[0217] The following examples illustrate the data re-import process. These examples include at least one of the following steps and are executed on a classic computer.
[0218] Step B10: Obtain the unitary result generated during the execution of the quantum machine learning task.
[0219] Step B20: Perform nonlinear processing on the unitary result to obtain a nonlinear processing result.
[0220] For detailed description of steps B10 and B20, please refer to the above embodiment, which will not be described in detail here.
[0221] Step B30: Instructing the second parameterized quantum circuit used in the quantum machine learning task, based on the nonlinear processing result, on the initial quantum state of the second quantum bit.
[0222] In some embodiments, the qubits in the initial quantum state of the second qubit include the second qubit and an auxiliary qubit, wherein the auxiliary qubit is used to affect the quantum state of the second qubit and only measure the quantum state of the second qubit.
[0223] In some embodiments, the classical quantum bit transmits the nonlinear processing result to the second parameterized quantum circuit, and the quantum computer encodes the nonlinear processing result using a coding method to obtain the initial quantum state of the second quantum bit.
[0224] Step B40: Indicate the initial quantum state of the auxiliary quantum bit to the second parameterized quantum circuit based on the initial data of the quantum machine learning task. The quantum state of the auxiliary quantum bit and the quantum state of the second quantum bit have a mutual influence in the second parameterized quantum circuit.
[0225] In some embodiments, a classical quantum bit transmits initial data to a second parameterized quantum circuit, and the quantum computer encodes the initial data using the same encoding method as the nonlinear processing result to obtain an initial quantum state of at least one auxiliary quantum bit.
[0226] It should be noted that there is no restriction on the execution order between step B30 and step B40, and the classical computer can synchronously transmit the initial data and the nonlinear processing results to the quantum computer.
[0227] During the training process of quantum machine learning tasks, multiple re-imports of initial data help organize the qubits in the parameterized quantum circuit into a series of data re-uploads and single-bit processing units. The auxiliary qubits are equivalent to the data re-upload units, and the single-bit processing units correspond to the second qubits. For example, the single-bit processing unit refers to the second qubit included in the parameterized quantum circuit with the latest execution time among at least two parameterized quantum circuits. Furthermore, data re-uploads and measurements can accommodate at least two dimensions in the input and at least two categories in the output, conforming to a universal quantum classifier.
[0228] In some embodiments, after a classical computer device performs nonlinear processing on a unitary result to obtain a nonlinear processing result, the classical computer provides the nonlinear processing result and initial data of the quantum machine learning task to a second parameterized quantum circuit for transmission to the quantum computer. 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 the initial quantum states of the second quantum bit and the auxiliary quantum bit are determined based on the at least one unitary matrix.
[0229] In some embodiments, the encoding method used to encode the results of the nonlinear processing is the same as the encoding method used to encode the initial data of the quantum machine learning task. A quantum bit can be represented by the state |0>, |1>, or a normalized complex linear superposition of the two. In principle, all classical data can be efficiently encoded into quantum bits: a classical bit string of length n can be easily encoded into n quantum bits. However, the reverse is not true. Generally, the state of an n-qubit system requires 2n -1 complex number. 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}middle.
[0230] In some embodiments, a coding quantization circuit is further included before the second parameterized quantum circuit. The coding quantization circuit is used to encode classical data into quantum data. The coding quantization circuit includes at least one rotating 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 In some embodiments, the encoded quantum circuit refers to a rotation gate that each second quantum bit needs to pass through before the quantum gate in the second parameterized quantum circuit is executed. After passing through the rotation gate, the quantum state of the second quantum bit is the initial quantum state.
[0231] Exemplarily, the encoding method for encoding classical data includes but is not limited to at least one of the following: wave function encoding, dense angle code encoding, and quantum bit correlation encoding.
[0232] Wave function coding is a coding method based on the principle of amplitude coding, which associates classical data with quantum state amplitudes. Wave function coding can be implemented using the following formula.
[0233] Wherein, x is classical data. In the embodiment of the present application, x is the result of nonlinear processing, or the initial data, N represents the bit data included in the classical data, and |x> represents the encoded quantum data, that is, the initial quantum state of the second quantum bit, or the initial quantum state of the auxiliary quantum bit.
[0234] Dense angle coding is used to map the numerical value of a classical bit to the rotation angle of a quantum bit. Dense angle coding can be implemented using the following formula.
[0235] in, Represents the tensor product. For explanations of other parameters, please refer to the previous example.
[0236] 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>).
[0237] It should be noted that the encoding method used by quantum computers is set according to the specific type of quantum machine learning task. Different encoding methods have different adaptability to different application scenarios. The encoding method is selected according to actual needs and is not limited in this application.
[0238] FIG10 is a schematic diagram of data re-import provided by an exemplary embodiment of the present application.
[0239] As shown in Figure 10, the execution of a quantum machine learning task requires N parameterized quantum circuits. The initial data for the quantum machine learning task serves as the input data for the first parameterized quantum circuit (parameterized quantum circuit 1 in Figure 10) of these N parameterized quantum circuits. After measuring the first qubit in parameterized quantum circuit 1 to obtain a unitary result, the classical computer performs nonlinear processing on this unitary result to obtain a nonlinear processing result. This nonlinear processing result is then transmitted to parameterized quantum circuit 2 (after parameterized quantum circuit 1, parameterized quantum circuit 2 is executed next). Furthermore, the classical computer also transmits the initial data to parameterized quantum circuit 2, enabling data re-import.
[0240] FIG11 is a schematic diagram of the training effect of a quantum classifier provided by an exemplary embodiment of the present application.
[0241] By repeatedly importing initial data into at least one parameterized quantum circuit, the classification capability of single-bit quantum bit classification is continuously improved during the training process.
[0242] The training process of quantum machine learning tasks also includes adjusting the free parameters of quantum gates with adjustable parameters in quantized parameter circuits. This part is introduced and explained through several embodiments below.
[0243] As can be seen from the above examples, quantum machine learning tasks involve at least two parameterized quantum circuits. In the training scenario of quantum machine learning tasks, the method shown in Figure 7 also includes at least one of the following steps (not shown in the accompanying drawings), which are performed by a classical computer.
[0244] Step 740: Obtain a prediction result obtained by measuring the third quantum bit 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 at least two parameterized quantum circuits. The prediction result is used to characterize the prediction classification of the initial data of the quantum machine learning task.
[0245] In some embodiments, the third parameterized quantum circuit is the last parameterized quantum circuit executed among the at least two parameterized quantum circuits. In some embodiments, a classical computer obtains a prediction result obtained by measuring a third qubit in the third parameterized quantum circuit. Exemplarily, an observation circuit in the quantum computer measures the output quantum state of the qubit in the third parameterized quantum circuit to obtain a unitary result generated by the third parameterized quantum circuit. The classical computer performs nonlinear processing on the unitary result using a neural network to obtain a nonlinear processing result; the classical computer then performs Hamiltonian calculations based on the nonlinear processing result to obtain a prediction result.
[0246] Step 750: Determine the loss function value of the quantum machine learning task during the training process based on the prediction results and the labeling results. The labeling results are used to characterize the reference classification of the initial data.
[0247] In some embodiments, the label result is a reference result corresponding to the initial data. In some embodiments, when the quantum machine learning task is a classification task, the label result refers to the reference classification of the initial data. In some embodiments, when the quantum machine learning task is molecular stability prediction, the label result refers to the known low-energy eigenstate of a molecule. The purpose of the quantum machine learning task training process is to ensure that the prediction result obtained by processing the initial data through the quantum neural network is close to the label result of the initial data. This enables the trained quantum neural network to produce accurate prediction results based on new initial data.
[0248] For example, during the training process of a quantum machine learning task, different initial data correspond to different prediction results. The prediction results can be obtained through experimental instrument measurement, theoretical calculation, or from a training database. This application does not limit the source of the prediction results.
[0249] In some embodiments, the loss function value is calculated by any of the following formulas:
[0250] Among them, y i For the training data (that is, the initial data x i ), the prediction result generated by the quantum neural network, y i ′ is the initial data x i The label results are as follows, and N represents the number of initial data included in the training batch.
[0251] In some embodiments, a classical computer is used to perform gradient descent on the parameters on the parameterized quantum circuit to minimize the loss function value, ultimately completing the training of the quantum machine learning model.
[0252] Step 760: Determine a gradient optimization direction based on the loss function value. The gradient optimization direction includes optimization directions of at least two free parameters in the parameterized quantum circuit. The free parameters refer to variable parameters of the parameterized quantum gates in the parameterized quantum circuit.
[0253] In some embodiments, a classical computer is provided with an optimizer configured to determine a gradient optimization direction with the goal of reducing the energy expectation value of the quantum system's Hamiltonian until the energy expectation value converges, thereby adjusting the corresponding free parameters in at least two parameterized quantum circuits according to the gradient optimization direction. This allows the at least two parameterized quantum circuits to better extract features from initial data and more accurately generate prediction results.
[0254] Step 770: Adjust at least one free parameter according to the optimization direction of the free parameter to obtain at least two updated parameterized quantum circuits. The at least two updated parameterized quantum circuits are used to participate in the next round of training of the quantum machine learning task.
[0255] In some embodiments, the optimizer adjusts the free parameters based on the loss function value based on parameter translation and backpropagation. The classical computer then indicates the adjusted free parameters to the quantum computer, causing the quantum computer to apply the adjusted free parameters to each parameterized quantum circuit, thereby obtaining at least two updated parameterized quantum circuits.
[0256] Step 780: When the loss function value reaches convergence, at least two trained parameterized quantum circuits are obtained. The at least two trained parameterized quantum circuits are used to solve practical quantum machine learning tasks.
[0257] In some embodiments, nonlinear processing is performed through a neural network, and the gradient optimization direction also includes the optimization direction of the parameters of the neural network. The method also includes: adjusting the parameters of at least one neural network according to the optimization direction of the parameters of the neural network to obtain at least two updated neural networks, and the updated neural networks are used to cooperate with the at least two updated parameterized quantum circuits to participate in the next round of training of the quantum machine learning task.
[0258] 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 used to perform nonlinear processing on the unitary results.
[0259] In some embodiments, the neural network includes at least two neurons, and the parameters of the neural network include weights between neurons and biases corresponding to the neurons.
[0260] In some embodiments, during the training process of a quantum machine learning task, one round of training is used to adjust the free parameters of m parameterized quantum circuits in at least two parameterized quantum circuits, where m is a positive integer. The free parameters of the other parameterized quantum circuits in the at least two parameterized quantum circuits except the parameterized quantum circuit are fixed during this round of training. This method helps to improve the speed of determining the optimal optimization direction during parameter optimization and helps to shorten training time.
[0261] In another example, during the training of a quantum machine learning task, free parameters and neural network parameters are trained in different rounds. For example, free parameters are trained first, followed by neural network parameters.
[0262] FIG12 is a schematic diagram of a training process provided by an exemplary embodiment of the present application.
[0263] During a training process based on a quantum machine learning task, training data is processed via at least two parameterized quantum circuits executed serially. In some embodiments, for a first parameterized quantum circuit and a second parameterized quantum circuit in the at least two parameterized quantum circuits, the unitary result generated by the first parameterized quantum circuit undergoes classical nonlinear auxiliary processing before being used as input data in the second parameterized quantum circuit. After the last parameterized quantum circuit in the at least two parameterized quantum circuits is executed, a prediction result is obtained by measuring the third qubit in the parameterized quantum circuit. A loss function value is calculated based on the label results and the prediction results of the training data, and gradient optimization and parameter offset are performed based on the loss function value to update the free parameters in the at least two parameterized quantum circuits and the parameters of the neural network.
[0264] Since classical nonlinear assistance is introduced in the execution process of at least two parameterized quantum circuits, this method helps to improve the adaptability of quantum neural networks to quantum machine learning tasks, helps to improve the classification performance of quantum neural networks, and achieves the good effect of reducing the depth of quantum circuits while achieving the same quantum machine learning classification performance.
[0265] The technical solution provided in the embodiments of this application uses prediction results and labeling results to determine the loss function value of the quantum machine learning task during training. Based on the loss function value, the gradient optimization direction is determined to optimize the free parameters in the parameterized quantum circuit. Furthermore, the trained parameterized quantum circuit is obtained, conditional on the convergence of the loss function. This approach improves the training efficiency of the parameterized quantum circuit and achieves better training results.
[0266] Furthermore, in addition to optimizing the free parameters in the parameterized quantum circuit, the parameters of the neural network are also optimized, enabling the neural network to have good classification performance, thereby improving the efficiency and effectiveness of the neural network in assisting quantum machine learning.
[0267] The following example illustrates the auxiliary processing method used in quantum machine learning. This method, executed by a classical computer, includes the following steps.
[0268] Step C10: Obtain a measurement result of the output quantum state of the first qubit; average and estimate the measurement results to obtain a unitary result. The unitary result includes at least two sub-results, each sub-result corresponding to a measurement result of a first qubit in the first parameterized quantum circuit.
[0269] Step C20: Performing classical nonlinear processing on a first portion of the at least two sub-results using a nonlinear processing operator to obtain a non-unitary result. In some embodiments, the nonlinear processing operator includes at least one of the following: a saturating activation function, a non-saturating activation function, and a neural network. When there are at least two first parameterized quantum circuits, the nonlinear processing operators used to perform nonlinear processing on the unitary results of the at least two first parameterized quantum circuits can be the same or different.
[0270] Step C30: Perform Hamiltonian calculation based on the non-unitary result and the second parton result of the at least two parton results to obtain a nonlinear processing result. The first qubit corresponding to the second parton result is a sign qubit used to observe and control the first qubit corresponding to the first parton result in the first parameterized quantum circuit.
[0271] In step C40, based on the initial data of the quantum machine learning task, the initial quantum state of the auxiliary qubit is indicated to the second parameterized quantum circuit. Furthermore, based on the nonlinear processing result, the initial quantum state of the second qubit is indicated to the second parameterized quantum circuit. This allows the encoding quantum circuit to determine the initial quantum state of the second qubit based on the nonlinear processing result. This allows the intermediate processing result generated by the first parameterized quantum circuit to be passed to the next parameterized quantum circuit after being processed by the nonlinear processing operator. Furthermore, by re-importing the initial data into the second parameterized quantum circuit, the quantum neural network is provided with more reference information, which helps improve the accuracy of the final prediction result.
[0272] In step C50, a new first parameterized quantum circuit is determined from the unexecuted parameterized quantum circuits, and steps C10-C40 are repeated. In some embodiments, the second parameterized quantum circuit is used as the new first parameterized quantum circuit until the second parameterized quantum circuit is the last executed parameterized quantum circuit among the at least two parameterized quantum circuits.
[0273] Step C60: Obtain a prediction result obtained by measuring the third qubit in the third parameterized quantum circuit. The third parameterized quantum circuit is executed last among the at least two parameterized quantum circuits. Completion of the third parameterized quantum circuit indicates the completion of the quantum computing-related aspects of the quantum machine learning task.
[0274] Step C70: Determine the loss function value of the quantum machine learning task during the training process based on the prediction results and the labeling results. The labeling results are used to characterize the reference classification of the input data.
[0275] Step C80: Determine a gradient optimization direction based on the loss function value. In some embodiments, the gradient optimization direction includes optimization directions of free parameters in at least two parameterized quantum circuits and optimization directions of parameters of the neural network.
[0276] Step C90: Adjust at least one free parameter according to the optimization direction of the free parameter to obtain at least two updated parameterized quantum circuits. The at least two updated parameterized quantum circuits are used to participate in the next round of training of the quantum machine learning task.
[0277] Step C100: Adjust the parameters of the neural network according to the optimization direction of the parameters of the neural network to obtain at least two updated neural networks. The updated neural networks are used to collaborate with the at least two 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, at least two trained parameterized quantum circuits are obtained.
[0278] It's worth noting that when training on quantum circuits, several input dimensions can be processed in batches. One dimension is the input data and label data. Each gradient training run must include at least two values, which is called batch training. Another dimension is the parameters of the quantum circuit, which can be trained simultaneously in batches. This allows for the use of just-in-time compilation techniques during classical optimization, greatly improving training efficiency.
[0279] By introducing a classical nonlinear architecture into the traditional linear quantum machine learning solution and introducing repeated data import, we can achieve 1) significantly improve the classification performance of quantum machine learning while consuming the same quantum computing hardware resources, and 2) reduce the depth of quantum circuits while achieving the same quantum machine learning classification performance.
[0280] In order to test the experimental effect, we introduce two sets of data, one is parity data and the other is MNIST data.
[0281] 1) First, let’s introduce the classification problem of Parity data, that is,
[0282] Under this set of data, the encoding of classical data to quantum data is very direct, for example, x=0101→|ψ>=|0101>.
[0283] Figure 13 shows the relationship between step size and loss function value during the parity data experiment. As shown in Figure 13, the loss function value of the training data decreases with changing training step size. "qdepth" represents the number of quantum circuit modules contained in each nonlinear layer, and "Nnonlin" represents the total number of nonlinear layers. For quantum circuits of the same length, the more nonlinear layers they contain, the faster the loss function value decreases.
[0284] Figures 14-16 show the relationship between step size and assurance provided by the parity data experiment. As shown in Figures 14-16, for quantum circuits of the same length, the more nonlinear layers they contain, the higher the fidelity.
[0285] 2) Introducing MNIST data
[0286] The MNIST database is a large collection of handwritten digits, commonly used to train various image processing systems. It is also widely used for training and testing in machine learning. It was created by recombining samples from the original dataset in the NIST (National Institute of Standards and Technology) database.
[0287] Figures 17-18 are schematic diagrams showing the relationship between step size and loss function value provided by the MNIST data experiment process.
[0288] Similar to Figure 13, the loss function value of the training data continues to decrease as the training step size changes in Figures 17 and 18. During training using MNIST data, for quantum circuits of the same length, the more nonlinear layers they contain, the faster the loss function value decreases.
[0289] Figures 19 and 20 are schematic diagrams showing the relationship between step size and fidelity provided by the MNIST data experiment process. For quantum circuits of the same length, the more nonlinear layers they contain, the higher the fidelity. This demonstrates that the auxiliary processing method for quantum machine learning provided in this application, by introducing nonlinear processing operations (actually implemented through classical computer-generated nonlinear processing layers), enables quantum neural networks to obtain better training results during training.
[0290] This embodiment of the present 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 can include at least one of the following steps:
[0291] 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 quantum bit 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 an initial quantum state of the first quantum bit.
[0292] The classical computer performs nonlinear processing on the unitary result to obtain a nonlinear processing result.
[0293] The quantum computer encodes the nonlinear processing result and determines the initial quantum state of the second quantum bit in 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 quantum bit.
[0294] In some embodiments, the classical computer performs nonlinear processing on the unitary result to obtain a nonlinear processing result, including: the classical computer performs nonlinear transformation on the unitary result based on a nonlinear processing operator to obtain a non-unitary result, and the nonlinear processing operator is used to process data in classical bit form; the classical computer performs Hamiltonian calculation based on the non-unitary result to obtain a nonlinear processing result.
[0295] In some embodiments, the unitary result includes at least two sub-results, each sub-result corresponding to the measurement result of a first quantum bit in the first parameterized quantum circuit; the classical computer performs Hamiltonian calculation based on the non-unitary result to obtain a nonlinear processing result, including: for a first part of the at least two sub-results, the classical computer performs a nonlinear transformation on the first part of the quantum result through a nonlinear processing operator to obtain a non-unitary result; the classical computer performs Hamiltonian calculation based on the non-unitary result and the second part of the at least two sub-results to obtain a nonlinear processing result, the second part of the quantum result does not overlap with the first part of the quantum result, the measurement basis of the first quantum bit corresponding to the first part of the quantum result is the same, and the measurement basis of the first quantum bit corresponding to the second part of the quantum result is determined according to the Pauli operator.
[0296] In some embodiments, nonlinear processing is performed by a nonlinear processing operator, and the nonlinear processing operator includes at least one of the following: a saturated activation function, a non-saturated activation function, and a neural network, the left and right derivative limits of the saturated 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 unitary result.
[0297] In some embodiments, the classical computer is further used to: indicate the initial quantum state of the auxiliary quantum bit to the second parameterized quantum circuit based on the initial data of the quantum machine learning task, and the quantum state of the auxiliary quantum bit and the quantum state of the second quantum bit have an impact on each other in the second parameterized quantum circuit.
[0298] In some embodiments, the method further includes: encoding initial data by a quantum computer to obtain an initial quantum state of an auxiliary quantum bit in the second parameterized quantum circuit, wherein the encoding method of the initial data is the same as the encoding method of the nonlinear processing result.
[0299] In some embodiments, the quantum machine learning task is participated by at least two parameterized quantum circuits; the method further includes: a classical computer obtaining a prediction result obtained by measuring a fourth quantum bit 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 at least two 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 of the quantum machine learning task during the training process based on 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, wherein the gradient optimization direction includes the optimization direction of the free parameters in the at least two parameterized quantum circuits, where 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 at least two updated parameterized quantum circuits, and the at least two 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, the classical computer obtains at least two trained parameterized quantum circuits.
[0300] In some embodiments, nonlinear processing is performed through a neural network, and the gradient optimization direction also includes the optimization direction of the parameters of the neural network; the method also includes: a classical computer adjusts the parameters of the neural network according to the optimization direction of the parameters of the neural network to obtain at least two updated neural networks, and the updated neural networks are used to collaborate with the at least two updated parameterized quantum circuits to participate in the next round of training of the quantum machine learning task.
[0301] In some embodiments, a classical computer obtains a unitary result generated during the execution of a quantum machine learning task, including: the classical computer obtains a measurement result obtained by measuring the output quantum state of a first quantum bit; and the classical computer averages and estimates the measurement results to obtain a unitary result.
[0302] The above is an embodiment of the interactive side of the present application. This embodiment corresponds to the above method embodiment and belongs to the same inventive concept. For details not described in detail in the system embodiment, please refer to the method embodiment of the present application.
[0303] FIG21 shows a block diagram of an auxiliary processing device for quantum machine learning provided by an exemplary embodiment of the present application. The device 2100 may include: a result acquisition module 2110 , a result processing module 2120 , and a result indication module 2130 .
[0304] A result acquisition module 2110 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 quantum bit in a first parameterized quantum circuit used in the quantum machine learning task, and the first parameterized quantum circuit is configured to perform a unitary operation on an initial quantum state of the first quantum bit.
[0305] The result processing module 2120 is configured to perform nonlinear processing on the unitary result to obtain a nonlinear processing result.
[0306] A result indication module 2130 is configured to indicate, based on the nonlinear processing result, an initial quantum state of a second quantum bit to a second parameterized quantum circuit used in the quantum machine learning task, wherein the second parameterized quantum circuit is configured to perform a unitary operation on the initial quantum state of the second quantum bit, and the initial quantum state of the second quantum bit is determined by encoding the nonlinear processing result.
[0307] In some embodiments, the result processing module 2120 includes: a nonlinear processing submodule, used to perform a nonlinear transformation on the unitary result based on a nonlinear processing operator to obtain a non-unitary result, wherein the nonlinear processing operator is used to process data in classical bit form; and a result calculation submodule, used to perform Hamiltonian calculation based on the non-unitary result to obtain the nonlinear processing result.
[0308] In some embodiments, the unitary result includes at least two sub-results, each of which corresponds to the measurement result of one of the first quantum bits in the first parameterized quantum circuit; the result calculation submodule is used to perform a nonlinear transformation on the first partial sub-result of the at least two sub-results through the nonlinear processing operator to obtain the non-unitary result; 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 the second partial sub-result of the at least two sub-results to obtain the nonlinear processing result, the second partial sub-result does not overlap with the first partial sub-result, the measurement basis of the first quantum bit corresponding to the first partial sub-result is the same, and the measurement basis of the first quantum bit corresponding to the second partial sub-result is determined according to the Pauli operator.
[0309] In some embodiments, the nonlinear processing is performed by a nonlinear processing operator, and the nonlinear processing operator includes at least one of the following: a saturated activation function, a non-saturated activation function, and a neural network. The left and right derivative limits of the saturated 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 nonlinear processing on the unitary result.
[0310] In some embodiments, the apparatus 2100 further includes: a re-input module, configured to indicate an initial quantum state of an auxiliary quantum bit to the second parameterized quantum circuit based on the initial data of the quantum machine learning task, where the quantum state of the auxiliary quantum bit and the quantum state of the second quantum bit interact with each other in the second parameterized quantum circuit.
[0311] In some embodiments, the quantum machine learning task is participated by at least two parameterized quantum circuits, and the device 2100 further includes: a prediction acquisition module, used to obtain a prediction result obtained by measuring a third quantum bit in a third parameterized quantum circuit, wherein the third parameterized quantum circuit refers to the parameterized quantum circuit with the latest execution time among the at least two 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, used to determine the loss function value of the quantum machine learning task during the training process based on the prediction result and the label result, and the label result is used to characterize the reference classification of the initial data; direction A determination module is 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 at least two parameterized quantum circuits, where the free parameters are variable parameters of parameterized quantum gates in the parameterized quantum circuits. A parameter adjustment module is configured to adjust at least one of the free parameters according to the optimization direction of the free parameters to obtain at least two updated parameterized quantum circuits, where the at least two updated parameterized quantum circuits are used to participate in the next round of training for the quantum machine learning task. A circuit determination module is configured to obtain at least two trained parameterized quantum circuits when the loss function value reaches convergence.
[0312] In some embodiments, the nonlinear processing is performed through a neural network, the gradient optimization direction also includes the optimization direction of the parameters of the neural network, and the parameter adjustment module is further used 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 at least two updated parameterized quantum circuits to participate in the next round of training of the quantum machine learning task.
[0313] In some embodiments, the result acquisition module 2110 is used to obtain a measurement result obtained by measuring the output quantum state of the first quantum bit; and average and estimate the measurement result to obtain the unitary result.
[0314] It should be noted that the device provided in the above embodiment, when implementing its functions, only uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here. For the beneficial effects of the device provided in the above embodiment, please refer to the description of the method side embodiment, which will not be repeated here.
[0315] Figure 22 shows a block diagram of a computer device provided by an exemplary embodiment of the present application. The computer device may be the classical computer described above.
[0316] Typically, the computer device 2200 includes a processor 2201 and a memory 2202 .
[0317] The processor 2201 may include one or at least two processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 2201 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), or 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 awake state, also known as a 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), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 2201 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0318] The memory 2202 may include one or at least two computer-readable storage media, which may be tangible and non-transitory. The memory 2202 may also include a high-speed random access memory and a non-volatile memory, such as one or at least two disk storage devices or flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 2202 stores at least one program, which is loaded and executed by the processor 2201 to implement the auxiliary processing method for quantum machine learning provided by the above-mentioned method embodiments.
[0319] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The computer program is loaded and executed by a processor to implement the auxiliary processing method for quantum machine learning provided by the above-mentioned method embodiments.
[0320] The computer-readable medium may include computer storage media and communication media. Computer storage media include 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. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technology, DVD (Digital Video Disc) or other optical storage, tape cassettes, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage medium is not limited to the above-mentioned ones.
[0321] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor reads and executes the computer program from the computer-readable storage medium to implement the auxiliary processing method for quantum machine learning provided in the above-mentioned method embodiments.
[0322] An embodiment of the present application also provides an auxiliary processing system for quantum machine learning, the system comprising a classical computer and a quantum computer, wherein the classical computer is used to obtain a unitary result generated during the execution of a quantum machine learning task, wherein the unitary result is obtained by measuring a first quantum bit 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 quantum bit; the classical computer is further used to perform nonlinear processing on the unitary result to obtain a nonlinear processing result; the quantum computer is used to encode the nonlinear processing result and determine the initial quantum state of a second quantum bit 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 quantum bit.
[0323] It should be understood that the "at least two" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. In addition, the step numbers described in this article only exemplify a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application do not limit this.
[0324] The above description is merely an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. An auxiliary processing method for quantum machine learning, which is executed by a classical computer. 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 a non-linear process on the unitary result to obtain a non-linear processing result; According to the non-linear 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 non-linear processing result.
2. The method according to claim 1, wherein, The performing a non-linear process on the unitary result to obtain a non-linear processing result includes: Performing 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; Performing a Hamiltonian calculation based on the non-unitary result to obtain the non-linear processing result.
3. The method according to claim 2, wherein, The unitary result includes at least two 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 non-linear transformation on the unitary result based on a non-linear processing operator to obtain a non-unitary result includes: For a first part of the at least two sub-results, performing 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 at least two 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 Pauli operators.
4. The method according to any one of claims 1 to 3, wherein, 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. 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.
5. The method according to any one of claims 1 to 4, 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, and there is an interaction between the quantum state of the auxiliary qubit and the quantum state of the second qubit in the second parameterized quantum circuit.
6. The method according to any one of claims 1 to 5, wherein The quantum machine learning task involves at least two 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 at least two 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; Based on the loss function value, determine the gradient optimization direction, where the gradient optimization direction includes the optimization directions of the free parameters in the at least two parameterized quantum circuits, and the free parameters refer to the variable parameters of the parameterized quantum gates in the parameterized quantum circuits; According to the optimization directions of the free parameters, adjust at least one of the free parameters to obtain at least two updated parameterized quantum circuits, and the at least two 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 at least two trained parameterized quantum circuits.
7. The method according to claim 6, wherein, 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: According to the optimization direction of the parameters of the neural network, adjust the parameters of the neural network to obtain an updated neural network, and the updated neural network is used to cooperate with the at least two updated parameterized quantum circuits to participate in the next round of training of the quantum machine learning task.
8. The method according to any one of claims 1 to 7, wherein, The obtaining of the unitary result generated during the execution of the quantum machine learning task includes: Obtain the measurement result obtained by measuring the output quantum state of the first qubit; Average and estimate the measurement result to obtain the unitary result.
9. An auxiliary processing method for quantum machine learning, the method includes: A classical computer obtains 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; The classical computer performs non-linear processing on the unitary result to obtain a non-linear processing result; A quantum computer encodes 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, and the second parameterized quantum circuit is used to perform a unitary operation on the initial quantum state of the second qubit.
10. The method according to claim 9, 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, and obtains a non-unitary result, where 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.
11. The method according to claim 10, wherein, The unitary result includes at least two sub-results, and each of the sub-results respectively corresponds to the measurement result of one of the first qubits in the first parameterized quantum circuit; The classical computer performs Hamiltonian calculation based on the non-unitary result to obtain the non-linear processing result, including: For the first part of the at least two sub-results, the classical computer performs 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 Hamiltonian calculation based on the non-unitary result and the second part of the at least two 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 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.
12. The method according to any one of claims 9 to 11, wherein, The non-linear processing is completed by 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 unitary result.
13. The method according to any one of claims 9 to 12, 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. The quantum state of the auxiliary qubit has an interaction with the quantum state of the second qubit in the second parameterized quantum circuit.
14. The method according to claim 13, wherein, 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. The encoding method of the initial data is the same as the encoding method of the non-linear processing result.
15. The method according to any one of claims 9 to 14, wherein The quantum machine learning task involves at least two 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 at least two parameterized quantum circuits. 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. 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. Among them, the gradient optimization direction includes the optimization directions of the free parameters in the at least two parameterized quantum circuits. The free parameters refer to the variable parameters possessed by the parameterized quantum gates in the parameterized quantum circuit; The quantum computer adjusts at least one of the free parameters according to the optimization direction of the free parameters, to obtain at least two updated parameterized quantum circuits, and the at least two updated parameterized quantum circuits are used to participate in the next round of training of the quantum machine learning task; When the value of the loss function reaches convergence, the classical computer obtains at least two trained parameterized quantum circuits.
16. The method according to claim 15, wherein, 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 at least two updated neural networks, and the updated neural networks are used to cooperate with the at least two updated parameterized quantum circuits to participate in the next round of training of the quantum machine learning task.
17. The method according to any one of claims 9 to 16, wherein, 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 averages and estimates the measurement result to obtain the unitary result.
18. An auxiliary processing device for quantum machine learning, the device includes: A result acquisition module, 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; 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, according to the non-linear processing result, the initial quantum state of the second qubit to the 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 non-linear processing result.
19. A computer device, the computer device includes a processor and a memory, and 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 8.
20. 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 for quantum machine learning according to any one of claims 1 to 8.
21. 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 for quantum machine learning according to any one of claims 1 to 8.
22. An auxiliary processing system for quantum machine learning, the system includes a classical computer and a quantum computer; The classical computer is used to obtain 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; The classical computer is further configured to perform a non-linear process on the unitary result to obtain a non-linear processed result; The quantum computer is configured to encode the non-linear processed result, determine the initial quantum state of the second qubit in the 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.
Citation Information
Patent Citations
Quantum system capable of simulating any nonlinear activation function
CN112101518A
Parameterized quantum circuit construction method and quantum state system construction method
CN114565097A
A quantum data processing method and apparatus
CN114936646A
Quantum neural network training method, data processing method, device and medium
CN115374948A
Method for performing computation using a hybrid quantum-classical computing system, apparatus and computer program for carrying out said method
EP4300379A1
Cited By
Non-linear data generation and processing method based on light quantum and light quantum computer
CN120893592A
Non-linear data generation and processing method based on light quantum and light quantum computer
CN121543754A