Data processing method based on Feimann path integration and related device
By using the Feynman path integral method to encode and simulate evolution of data in a quantum virtual machine, the problems of quantum noise and limited resources are solved, and the efficiency and accuracy of the quantum kernel method are improved.
Patent Information
- Application Number
- CN202410915767.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-09-27
AI Technical Summary
Quantum noise is a problem on current noisy mesoscale quantum computers, which results in low accuracy in high-dimensional computing tasks. Quantum computing resources are limited and it is difficult to support the computing tasks of large-scale quantum kernel methods.
A data processing method based on Feynman path integral is used to encode the two data in the data set to be processed onto the qubits in the quantum circuit corresponding to the preset kernel function, and the encoded quantum circuit is processed based on Feynman path integral. Simulate the evolution to obtain the amplitude of the target quantum state, which is used to measure the quantum kernel inner product of the data in the Hilbert space for data processing.
It improves the operating efficiency of the quantum kernel method, avoids quantum noise problems, saves quantum computing resources, and achieves efficient data processing.
Smart Images

Figure CN118709799A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of quantum computing technology, and in particular to a data processing method based on Feynman path integral and a related device. Background Art
[0002] Kernel method is a commonly used technique in machine learning and statistics to deal with nonlinear problems and high-dimensional data. In kernel method, by mapping the original data to a high-dimensional feature space, the data in the high-dimensional space is made linearly separable or approximately linearly separable, so that linear classifiers or regressors can be used to solve nonlinear problems in the original data. The core idea of kernel method is to use kernel function, which is a function that measures the similarity of two samples. By calculating the inner product of the samples in the high-dimensional feature space, the similarity of the samples in the original space can be obtained, thereby realizing the linearization of nonlinear data.
[0003] Kernel functions can map low-dimensional data to high-dimensional space without explicitly calculating high-dimensional feature vectors, thus avoiding the complexity of high-dimensional calculations. Quantum computers are physical devices that follow the laws of quantum mechanics to perform high-speed mathematical and logical operations, store and process quantum information. Quantum computers have become a key technology under research because of their ability to process mathematical problems more efficiently than ordinary computers. Therefore, quantum kernel methods based on quantum computing are also developing rapidly in many fields.
[0004] However, current noisy intermediate-scale quantum (NISQ) computers have obvious quantum noise problems, and the accuracy of executing high-dimensional computing tasks is low; and existing quantum computing resources are very limited, and the number of quantum bits in quantum computers is small, making it difficult to support the computing tasks of large-scale quantum kernel methods. Summary of the invention
[0005] The purpose of the present invention is to provide a data processing method and related device based on Feynman path integral, aiming to use a quantum virtual machine to execute a quantum kernel algorithm and further process the data, thereby saving quantum computing resources and improving the operating efficiency of the quantum kernel method.
[0006] An embodiment of the present invention provides a data processing method based on Feynman path integral, which is applied to a quantum virtual machine. The method includes:
[0007] Encoding two data in the data set to be processed onto quantum bits in a quantum circuit corresponding to a preset kernel function;
[0008] The encoded quantum circuit is simulated and evolved based on the Feynman path integral to obtain the amplitude of the target quantum state; wherein the target quantum state is used to measure the quantum kernel inner product of the two encoded data in the Hilbert space;
[0009] The data in the to-be-processed data set are processed based on the similarity between the two data indicated by the amplitude of the target quantum state.
[0010] Optionally, the quantum circuit corresponding to the preset kernel function includes n quantum bits, and also includes a first coding layer and a second coding layer acting on the n quantum bits, and the two encoded data are first data and second data, wherein:
[0011] Parameters of a first group of quantum logic gates in the first coding layer are determined based on characteristic information of the first data, and parameters of a second group of quantum logic gates in the second coding layer are determined based on characteristic information of the second data; wherein the second coding layer is a conjugate transpose operation of the first coding layer.
[0012] Optionally, the first group of quantum logic gates includes n RY gates, each of which acts on a quantum bit, and the rotation angle of each RY gate is determined based on characteristic information of a dimension of the first data; the second group of quantum logic gates includes n Door, each of the The gate acts on a quantum bit respectively. The rotation angle of the door is determined based on feature information of one dimension of the second data.
[0013] Optionally, the first coding layer and the second coding layer further include: an H gate acting on each quantum bit respectively, and a CZ gate establishing a quantum entanglement relationship between the n quantum bits.
[0014] Optionally, the first data is X:={x1, x2, ..., x n}, the second data is Y:={y1,y2,…,y n}; Among them, the feature information x of each dimension n and n are all variables, and the method further comprises:
[0015] will be based on the variable x n and n The amplitude expression of the target quantum state is constructed as the mathematical form of the kernel function, and the quantum kernel inner product of any two data in the to-be-processed data set in the Hilbert space is calculated based on the mathematical form of the kernel function.
[0016] Optionally, the simulating evolution of the encoded quantum circuit based on the Feynman path integral to obtain the amplitude of the target quantum state includes:
[0017] Determine a directed acyclic graph corresponding to the encoded quantum circuit and a quantum state mapping relationship between each quantum logic gate in the quantum circuit;
[0018] Based on the initial state of the quantum circuit, the directed acyclic graph and the quantum state mapping relationship, the amplitude of the target quantum state is obtained by segmented simulation evolution.
[0019] Optionally, the initial state of the quantum circuit and the target quantum state are |0> n .
[0020] Optionally, before encoding two data in the to-be-processed data set onto quantum bits in a quantum circuit corresponding to a preset kernel function, the method further includes:
[0021] For each feature information dimension, multiple data in the to-be-processed data set are normalized to scale multiple feature information in each dimension to the interval [0, 2π].
[0022] Optionally, the processing of the data in the to-be-processed data set includes:
[0023] At least one of anomaly detection, data classification and linear regression is performed on the data in the to-be-processed data set.
[0024] Another embodiment of the present invention provides a data processing device based on Feynman path integral, which is applied to a quantum virtual machine. The device includes:
[0025] An encoding module, used for encoding two data in the data set to be processed onto quantum bits in a quantum circuit corresponding to a preset kernel function;
[0026] A calculation module, used for simulating the evolution of the encoded quantum circuit based on the Feynman path integral to obtain the amplitude of the target quantum state; wherein the target quantum state is used to measure the quantum kernel inner product of the two encoded data in the Hilbert space;
[0027] A processing module is used to process the data in the to-be-processed data set based on the similarity between the two data indicated by the amplitude of the target quantum state.
[0028] Yet another embodiment of the present invention provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the method described in any one of the above embodiments when running.
[0029] Yet another embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the method described in any one of the above embodiments.
[0030] Compared with the prior art, the present invention provides a data processing method and related device based on Feynman path integral, which are applied to quantum virtual machines. In this scheme, two data in the data set to be processed can be encoded into quantum bits in a quantum circuit corresponding to a preset kernel function, and then the encoded quantum circuit is simulated and evolved based on Feynman path integral to obtain the amplitude of the target quantum state; wherein the target quantum state is used to measure the quantum kernel inner product of the two encoded data in the Hilbert space; based on the similarity of the two data indicated by the amplitude of the target quantum state, the data in the data set to be processed is processed. This scheme uses a quantum virtual machine to calculate the similarity between data based on the Feynman path integral method, thereby improving the operating efficiency of the quantum kernel method, avoiding the quantum noise problem of the current quantum computer executing the quantum kernel method, and saving quantum computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A network block diagram of a data processing system based on Feynman path integral provided by an embodiment of the present invention;
[0032] Figure 2 A flowchart of a data processing method based on Feynman path integral provided by an embodiment of the present invention;
[0033] Figure 3 A structural diagram of a quantum circuit corresponding to a preset kernel function provided in an embodiment of the present invention;
[0034] Figure 4 A specific flow chart of amplitude calculation of a target quantum state provided by an embodiment of the present invention;
[0035] Figure 5 A structural diagram of another quantum circuit provided by an embodiment of the present invention;
[0036] Figure 6 A structural diagram of a data processing device based on Feynman path integral provided by an embodiment of the present invention;
[0037] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.
[0039] Figure 1 1 is a network block diagram of a data processing system based on Feynman path integral provided by an embodiment of the present invention. The data processing system based on Feynman path integral may include a network 110, a server 120, a wireless device 130, a client 140, a storage 150, a classical computing unit 160, a quantum computing unit 170, and may also include additional memories, classical processors, quantum processors, and other devices not shown.
[0040] The network 110 is a medium for providing communication links between various devices and computers connected together in a data processing system based on Feynman path integral, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks and combinations thereof. The connection method may be wired, wireless communication links or optical fiber cables, etc.
[0041] The server 120, the wireless device 130 and the client 140 are conventional data processing systems, which may contain data and applications or software tools for performing conventional computing processes. The client 140 may be a personal computer or a network computer, so the data may also be provided by the server 120. The wireless device 130 may be a smart phone, a tablet, a laptop, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as quantum bit parameters, quantum logic gate parameters, quantum circuits, quantum programs, etc.
[0042] The classical computing unit 160 (quantum computing unit 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 162 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application 163 (application 173). The application 163 (application 173) may be used to implement a quantum algorithm compiled by a data processing method based on Feynman path integral provided in an embodiment of the present invention.
[0043] Any data or information stored or generated in the classical computing unit 160 (quantum computing unit 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.
[0044] It should be noted that a true quantum computer is a hybrid structure, which includes at least Figure 1 There are two major parts in it: the classical computing unit 160, which is responsible for performing classical computing and control; the quantum computing unit 170, which is responsible for running quantum programs and thus realizing quantum computing.
[0045] The classical computing unit 160 and the quantum computing unit 170 may be integrated into one device or distributed in two different devices. For example, the first device including the classical computing unit 160 runs a classical computer operating system, on which quantum application development tools and services are provided, as well as storage and network services required for quantum applications. Users develop quantum programs through the quantum application development tools and services thereon, and send quantum programs to the second device including the quantum computing unit 170 through the network services thereon. The second device runs a quantum computer operating system, and the code of the quantum program is parsed and compiled into instructions that can be recognized and executed by the quantum processor 170 through the quantum computer operating system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.
[0046] The computing unit of the classic processor 161 in the classic computing unit 160 is a CMOS tube based on a silicon chip. This computing unit is not limited by time and coherence, that is, this computing unit is not limited by the length of use and can be used at any time. In addition, in the silicon chip, the number of such computing units is also sufficient. At present, the number of computing units in a classic processor 161 is tens of thousands. The number of computing units is sufficient and the computing logic that can be selected by the CMOS tube is fixed, such as: AND logic. When calculating with the help of CMOS tubes, a large number of CMOS tubes are combined with limited logic functions to achieve the calculation effect.
[0047] The basic computing unit of the quantum processor 171 in the quantum computing unit 170 is a quantum bit. The input of the quantum bit is limited by coherence and coherence time, that is, the quantum bit is limited by the duration of use and is not available at any time. Making full use of the quantum bit within the available duration of use of the quantum bit is a key problem in quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of the quantum computer. Each quantum bit realizes the computing function through the logical function configured on demand. In view of the limited number of quantum bits, the logical functions in the field of quantum computing are diverse, such as: Hadamard gate (Hadamard gate, H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate), Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, etc. In quantum computing, it is necessary to use limited quantum bits combined with a variety of logical function combinations to achieve the computing effect.
[0048] Based on these differences, the design of CMOS tubes by classical logic functions and the design of quantum bits by quantum logic functions are significantly and essentially different. The design of CMOS tubes by classical logic functions does not need to consider the individuality of CMOS tubes. For example, the representation of CMOS tubes in silicon chips is the individual identification, position, and usable life of each CMOS tube. Therefore, the classical algorithm composed of classical logic functions only expresses the operational relationship of the algorithm, but does not express the algorithm's dependence on individual CMOS tubes.
[0049] When quantum logic functions act on qubits, the individuality of qubits needs to be considered, such as the individual identification of the qubit in the quantum chip, its position, its relationship with surrounding qubits, and the usable time of each qubit. Therefore, the quantum algorithm composed of quantum logic functions not only expresses the computational relationship of the algorithm, but also expresses the algorithm's dependence on individual qubits.
[0050] Quantum chips can include quantum bits and channels for regulating quantum bits. Quantum logic gates are implemented through analog signals. Different combinations of analog signals are applied to quantum bits through channels for regulating quantum bits, thereby realizing quantum circuits with different functions and completing data processing. Therefore, the design of quantum logic functions acting on quantum bits (including the design of whether quantum bits are used or not and the design of the efficiency of each quantum bit) is the key to improving the computing performance of quantum computers, and special designs are required. This is also the uniqueness of quantum algorithms based on quantum logic functions, which is essentially and significantly different from classical algorithms based on classical logic functions. The above-mentioned design for quantum bits is a technical issue that ordinary computing devices do not need to consider or face.
[0051] Due to the obvious quantum noise problem on the current noisy medium-scale quantum computers, the calculation accuracy of high-dimensional computing tasks is low when executing quantum kernel algorithms. In addition, the existing quantum computing resources are very limited, and the number of quantum bits in quantum computers is small, which makes it difficult to support the large-scale computing tasks of quantum kernel methods. Based on this, the present invention proposes a data processing method based on Feynman path integral and related devices.
[0052] See also Figure 2 , Figure 2 A data processing method based on Feynman path integral provided in an embodiment of the present invention is applied to a quantum virtual machine, and the method comprises the following steps:
[0053] Step 201: Encode two data in the data set to be processed onto quantum bits in a quantum circuit corresponding to a preset kernel function.
[0054] Specifically, classical simulation of quantum circuits is crucial to better understand the operation and behavior of quantum computing. Such simulations enable researchers and developers to evaluate the complexity of new quantum algorithms and verify the effectiveness of quantum devices. Currently commonly used quantum circuit simulators can include full-amplitude quantum virtual machines, partial-amplitude quantum virtual machines, single-amplitude quantum virtual machines, tensor network quantum virtual machines, and quantum cloud virtual machines. It should be noted that different quantum virtual machines have different applicable scenarios. This solution is mainly to avoid the quantum noise problem when current quantum computers execute quantum kernel methods and save quantum computing resources, so there is no specific restriction on the selection of quantum virtual machines.
[0055] The quantum kernel method is a new method for measuring the direct distance between vectors corresponding to two samples, which can be used in anomaly detection, classification, regression and other schemes. Among them, the kernel function can map low-dimensional data to high-dimensional space, thereby allowing operations in high-dimensional space. Its purpose is to calculate the similarity of two data in the feature space through the inner product without explicitly calculating the eigenvector in the feature space, that is, it allows calculations in high-dimensional or infinite-dimensional feature space without explicitly knowing the eigenvector φ(x) corresponding to the data x and the value of φ(x′) corresponding to the data x′. On the other hand, different types of kernel functions can capture different types of similarity measures. For example, the linear kernel function uses the inner product to measure the linear relationship between data, while the Gaussian kernel function (RBF kernel function) can capture the nonlinear similarity between data. The type of kernel function in the embodiment of the present invention may depend on the specific application scenario.
[0056] Furthermore, in the solution provided in the embodiment of the present invention, the data set to be processed may include multiple data. After the quantum kernel distance between each two data is calculated by this solution, a classical machine learning algorithm can be used for prediction processing. For example, the data in the data set to be processed can be classified, clustered, and processed based on algorithms such as SVM (Support Vector Machine) and OCSVM (One Class SVM).
[0057] Feynman Path Integral is a computational method used in quantum mechanics and quantum field theory. It provides a method different from the traditional Schrödinger equation and Heisenberg matrix mechanics to describe quantum systems. The Feynman Path Integral method calculates the evolution of a quantum system by considering the sum of all possible paths. In the Feynman Path Integral method, the evolution of a quantum system from an initial state to a final state is described by calculating the sum of all possible paths from the initial state to the final state. Therefore, by constructing a quantum circuit corresponding to a preset kernel function and encoding two data in the data set to be processed onto the quantum bits in the quantum circuit, the distance between the two data in a high-dimensional Hilbert space can be calculated based on the Feynman Path Integral method, so as to facilitate various processing of the data in the data set to be processed.
[0058] In one embodiment, before encoding the two data in the to-be-processed data set onto the quantum bits in the quantum circuit corresponding to the preset kernel function, the method may further include:
[0059] For each feature information dimension, multiple data in the to-be-processed data set are normalized to scale multiple feature information in each dimension to the interval [0, 2π].
[0060] Specifically, the data in the data set to be processed may include multiple feature dimensions. For example, n-dimensional data may refer to data or a vector containing n types of feature information. Each feature information may be original feature information, or feature information after preprocessing the original feature information. The preprocessing method may include data cleaning, data completion, and data transformation, etc. Data transformation may include transformation methods such as standardization and normalization.
[0061] Taking the financial field as an example, suppose there are 10 12-dimensional data in the data set to be processed, representing 12 types of feature information such as stock prices, trading volumes, PE ratios, etc. of 10 companies, among which the above 12 types of feature information have been standardized in advance. Then, normalize them and scale the multiple feature information of each dimension to the interval [0,2π]. It can be understood as follows: first, the 12 feature information of the stock price feature dimension can be normalized, and the normalized feature information of each stock price dimension is a number in the interval [0,2π]; accordingly, the above processing is performed on the 12 feature information of each feature dimension in turn, and 10 data to be encoded can be obtained. Then, based on the angle encoding method, the above data can be quickly encoded into the rotation angles of multiple quantum bits.
[0062] As an implementation manner of an embodiment of the present invention, the quantum circuit corresponding to the preset kernel function includes n quantum bits, and also includes a first coding layer and a second coding layer acting on the n quantum bits, and the two encoded data are first data and second data, wherein:
[0063] Parameters of a first group of quantum logic gates in the first coding layer are determined based on characteristic information of the first data, and parameters of a second group of quantum logic gates in the second coding layer are determined based on characteristic information of the second data; wherein the second coding layer is a conjugate transpose operation of the first coding layer.
[0064] In a specific implementation, the first group of quantum logic gates may include n RY gates, each of which acts on a quantum bit, and the rotation angle of each of the RY gates is determined based on characteristic information of a dimension of the first data; the second group of quantum logic gates may include n Door, each of the The gate acts on a quantum bit respectively. The rotation angle of the door is determined based on feature information of one dimension of the second data.
[0065] Specifically, assume that the unitary matrix generated by a set of variables is denoted as U(θ), where θ:={θ1,θ2,...,θ m}, if you need to encode the features of a set of samples into the unitary matrix, that is, the variables x1,...,x m Normalize it to be within the range of [0,2π) and then encode it into the unitary matrix.
[0066] Then, for any two n-dimensional data X in the data set to be processed, n} and Y:={y1,y2,…,y n}, after the above normalization, they can be encoded into the rotation angle of the quantum bit in the quantum circuit, and then one of them is inverted to obtain U(X)U D (Y) quantum circuit. If the characteristic information of the two encoded data above is equal, then we can get U(X)U D (Y)=I. Further, if the quantum state of the quantum circuit changes from |0> n Start, then the final result is also |0> n , that is, the measurement is |0> n The probability of is 1. If the gap between the two data is larger, then |0> nThe farther the probability is from 1, since the probability of a quantum state is equal to the square of the amplitude of the quantum state, then corresponding to the quantum kernel method, the measured quantum state |0> n The amplitude can be used as a measure of the similarity between two data.
[0067] In one embodiment, the specific structure of the quantum circuit corresponding to the preset kernel function can be as follows: Figure 3 As shown, the two encoded data are first data X:={x1,x2,x3,x4} and second data Y:={y1,y2,y3,y4}, respectively. The quantum circuit may include 4 quantum bits, and the initial quantum state of each quantum bit is |0>. The first coding layer is used to encode the first data X, including 4 first groups of quantum logic gates, i.e., 4 RY gates. The rotation angle of each RY gate is determined based on the characteristic information of one dimension of the first data X. For example, the rotation angle of the RY gate acting on the first quantum bit is x1, i.e., the first RY gate is RY(x1).
[0068] Correspondingly, the second encoding layer for encoding the second data Y includes 4 second groups of quantum logic gates Door, each The rotation angle of the gate is determined based on the characteristic information of one dimension of the second data Y. In addition, the second coding layer is the conjugate transposition operation of the first coding layer. Furthermore, the second set of quantum logic gates The gate is the conjugate transpose operation of the first group of quantum logic gates RY gates.
[0069] In the quantum simulator scenario, the conjugate transpose operation can be implemented using the dagger(·) function in pyqpand, for example. The dagger(·) function is used to perform a conjugate transpose operation on a quantum gate. In quantum computing, a quantum gate can be represented as a matrix, and a conjugate transpose operation on a quantum gate can obtain the conjugate transpose matrix of the quantum gate.
[0070] As an implementation manner of an embodiment of the present invention, the first coding layer and the second coding layer may further include: an H gate acting on each quantum bit respectively, and a CZ gate establishing a quantum entanglement relationship between the n quantum bits.
[0071] Specifically, a quantum circuit is a collection of quantum gates used to operate information on quantum bits. When pre-designing the quantum circuit corresponding to the kernel function, the above-mentioned RY gate and gates, and different quantum gate combinations can be selected according to the needs of data and algorithms, such as H gates, RY gates ( gates) and controlled Z-gates provide the ability to create superposition states, angular rotations, and controlled phase flips, enabling the encoding of complex data structures such as financial data and the performance of highly parallel quantum computations.
[0072] like Figure 3 As shown, the first coding layer may also include an H gate acting on each quantum bit respectively, and two CZ gates that establish a quantum entanglement relationship between the four quantum bits, wherein the control bit of the first CZ gate is the first quantum bit, and the target bit is the fourth quantum bit; the control bit of the second CZ gate is the second quantum bit, and the target bit is the third quantum bit. In this scheme, there is no need to make specific restrictions on the number of CZ gates. For example, in another embodiment, the first coding layer may include four CZ gates, wherein the target bit of each CZ gate is the control bit of another CZ gate, thereby establishing a quantum entanglement relationship between the four quantum bits. Accordingly, the specific structure of the second coding layer is similar to that of the first coding layer, and will not be repeated here.
[0073] Step 202, simulating the evolution of the encoded quantum circuit based on the Feynman path integral to obtain the amplitude of the target quantum state;
[0074] The target quantum state is used to measure the quantum kernel inner product of the two encoded data in the Hilbert space.
[0075] Specifically, a Hilbert space is a complete inner product space, where every two elements have a well-defined inner product and satisfy the completeness condition. In quantum mechanics, a finite-dimensional Hilbert space can be represented as consisting of vectors, such as |0> and |1>, which can be combined to form any quantum state. The quantum kernel inner product is the inner product between two quantum states in the Hilbert space, and is often used to measure the similarity of two quantum states. For example, consider two quantum states |ψ> and The quantum kernel inner product of the two can be expressed as Where <·|·> represents the inner product in Hilbert space. Quantum kernel inner product can be used in machine learning tasks such as classification and regression to provide the algorithm with information about the relationship between data.
[0076] By using Feynman path integral, we can effectively get the result about a certain amplitude, thus getting the final target state|0> n The amplitude on the measured value is |0> n The probability of is used to measure the similarity between the two encoded data.
[0077] As an implementation method of the embodiment of the present invention, Figure 4As shown, the step 202 of simulating the evolution of the encoded quantum circuit based on the Feynman path integral to obtain the amplitude of the target quantum state may include the following steps:
[0078] Step 2021, determining a mapping relationship between a directed acyclic graph corresponding to the encoded quantum circuit and a quantum state of each quantum logic gate in the quantum circuit.
[0079] Step 2022: Based on the initial state of the quantum circuit, the directed acyclic graph, and the quantum state mapping relationship, simulate the evolution in segments to obtain the amplitude of the target quantum state.
[0080] In one embodiment, the initial state of the quantum circuit and the target quantum state can be |0> n .
[0081] Specifically, a quantum circuit can be understood as the product of multiple unitary matrices. Then, the different properties of the diagonal matrices and non-diagonal matrices in the multiple unitary matrices can be represented in the directed acyclic graph corresponding to the quantum circuit. Furthermore, the quantum state mapping relationship of each quantum logic gate in the quantum circuit can also be determined, and the mapping relationship represents the effect of the quantum logic gate on different inputs.
[0082] Then, the Feynman path integral method is introduced into the quantum circuit evolution, and based on the initial state of the quantum circuit|0> n , the directed acyclic graph and the quantum state mapping relationship are segmented and simulated to evolve the target quantum state|0> n Amplitude.
[0083] In this embodiment, it is only necessary to simulate the evolution to obtain the quantum state |0> n , so the above scheme can be executed using a single-amplitude quantum virtual machine. Compared with the full-vector simulation suitable for low bits and high depth, the single-amplitude quantum virtual machine generalizes the simulation of quantum circuits to an undirected graphical model and uses the variable elimination algorithm for calculation in the context of exact reasoning. The single-amplitude quantum virtual machine can simulate higher quantum bit circuit diagrams, and the simulation performance is high, and it will not increase exponentially with the number of quantum bits. However, as the circuit depth increases, the simulation performance drops sharply. At the same time, it is difficult to simulate multiple control gates, which is also its disadvantage. This virtual machine is suitable for high-bit and low-depth quantum circuit simulation, and is usually used to quickly simulate and obtain the amplitude results of a single quantum state.
[0084] As an implementation method of the embodiment of the present invention, the first data is X:={x1, x2, ..., x n}, the second data is Y:={y1,y2,…,y n}; Among them, the feature information x of each dimensionn and n are all variables, and the method further comprises:
[0085] will be based on the variable x n and n The amplitude expression of the target quantum state is constructed as the mathematical form of the kernel function, and the quantum kernel inner product of any two data in the to-be-processed data set in the Hilbert space is calculated based on the mathematical form of the kernel function.
[0086] For example, first Figure 5 The quantum circuit obtained by encoding is illustrated as an example, wherein the first data X and the second data Y are two-dimensional data, containing feature information of two dimensions, and can be encoded using a quantum circuit containing two quantum bits. In the Feynman path integral method, first, the initial state of the quantum circuit |00> is the node state of the corresponding node in the directed acyclic graph corresponding to the quantum circuit after passing through the first group of H gates. After passing through the first layer of CZ gate, the node status becomes …, and then through After the gate and the second layer CZ gate, the node status becomes:
[0087]
[0088] Then, after passing through two H gates, the amplitude of the target quantum state |00> is:
[0089]
[0090] Correspondingly, if the encoded quantum circuit is Figure 3 The quantum circuit shown in Figure 1 is simulated based on the Feynman path integral method, and the amplitude of the target quantum state |0000> can be obtained as:
[0091]
[0092] Furthermore, for quantum circuits corresponding to various preset kernel functions containing n quantum bits, based on the differences in pre-selected circuit structures, the measurement expression of the quantum kernel distance obtained by simulating evolution can be: and Etc., no specific limitation is made here.
[0093] Then, the above solution based on variable x n and nThe amplitude expression of the target quantum state is constructed as the mathematical form of the kernel function. Therefore, there is no need to use quantum computers and single-amplitude quantum virtual machines in the future. Based on the mathematical form of the kernel function, the quantum kernel inner product of any two data in the processed data set in the Hilbert space can be calculated respectively. This solution has higher computational efficiency. After obtaining the similarity of any two data in the processed data set, the data in the processed data set can be further processed by anomaly detection, data classification, linear regression and other processing methods.
[0094] Step 203: Process the data in the to-be-processed data set based on the similarity between the two data indicated by the amplitude of the target quantum state.
[0095] Specifically, the processing of the data in the to-be-processed data set may include:
[0096] At least one of anomaly detection, data classification and linear regression is performed on the data in the to-be-processed data set.
[0097] It can be seen that in the solution provided by the embodiment of the present invention, by using a quantum virtual machine, two data in the data set to be processed can be encoded into the quantum bits in the quantum circuit corresponding to the preset kernel function, and then the encoded quantum circuit is simulated and evolved based on the Feynman path integral to obtain the amplitude of the target quantum state; wherein the target quantum state is used to measure the quantum kernel inner product of the two encoded data in the Hilbert space; based on the similarity of the two data indicated by the amplitude of the target quantum state, the data in the data set to be processed is processed. This solution uses a quantum virtual machine to calculate the similarity between data based on the Feynman path integral method, thereby improving the operating efficiency of the quantum kernel method, avoiding the quantum noise problem of the current quantum computer executing the quantum kernel method, and saving quantum computing resources.
[0098] See also Figure 6 , Figure 6 A data processing device based on Feynman path integral provided in an embodiment of the present invention is applied to a quantum virtual machine. The device may include:
[0099] The encoding module 601 is used to encode two data in the data set to be processed onto quantum bits in a quantum circuit corresponding to a preset kernel function.
[0100] A calculation module 602 is used to simulate the evolution of the encoded quantum circuit based on the Feynman path integral to obtain the amplitude of the target quantum state;
[0101] The target quantum state is used to measure the quantum kernel inner product of the two encoded data in the Hilbert space.
[0102] The processing module 603 is used to process the data in the to-be-processed data set based on the similarity between the two data indicated by the amplitude of the target quantum state.
[0103] The specific functions and effects achieved by the data processing device based on Feynman path integral can be explained with reference to other embodiments of this specification, and will not be repeated here. Each module in the data processing device based on Feynman path integral can be implemented in whole or in part by software, hardware, and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0104] See also Figure 7 , the present specification also provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the data processing method based on Feynman path integral in any of the above embodiments when executing the computer program. Figure 7 , the computer device may be a classical computer. The computer device may also be a quantum computer.
[0105] The embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computer, the computer executes the data processing method based on Feynman path integral in any of the above embodiments.
[0106] The embodiments of this specification also provide a computer program product including instructions, which, when executed by a computer, enables the computer to execute the data processing method based on Feynman path integral in any of the above embodiments.
[0107] It should be understood that the specific examples in this specification are only intended to help those skilled in the art to better understand the implementation methods of this specification, rather than to limit the scope of the present invention.
[0108] It can be understood that in the various implementations of this specification, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation methods of this specification.
[0109] It can be understood that the various embodiments described in this specification can be implemented individually or in combination, and the embodiments of this specification are not limited to this.
[0110] Unless otherwise specified, all technical and scientific terms used in the embodiments of this specification have the same meaning as those generally understood by those skilled in the art of the technical field of this specification. The terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the scope of this specification. The term "and / or" used in this specification includes any and all combinations of one or more related listed items. The singular forms of "a", "above", and "the" used in the embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0111] It can be understood that the processor of the embodiment of this specification can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method implementation can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiment of this specification can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of this specification can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0112] It is understood that the memory in the embodiments of this specification may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasablePROM, EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0113] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this specification.
[0114] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method implementation methods and will not be repeated here.
[0115] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0117] In addition, each functional unit in each embodiment of the present specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0118] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0119] The above is only a specific implementation of this specification, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this specification, which should be included in the protection scope of this specification. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data processing method based on Feynman path integral, applied to quantum virtual machines, It is characterized in that The method comprises: Encoding two data in the data set to be processed onto quantum bits in a quantum circuit corresponding to a preset kernel function; The encoded quantum circuit is simulated and evolved based on the Feynman path integral to obtain the amplitude of the target quantum state; wherein the target quantum state is used to measure the quantum kernel inner product of the two encoded data in the Hilbert space; The data in the to-be-processed data set are processed based on the similarity between the two data indicated by the amplitude of the target quantum state.
2. The method according to claim 1, It is characterized in that The quantum circuit corresponding to the preset kernel function includes n quantum bits, and also includes a first coding layer and a second coding layer acting on the n quantum bits, and the two encoded data are first data and second data, wherein: Parameters of a first group of quantum logic gates in the first coding layer are determined based on characteristic information of the first data, and parameters of a second group of quantum logic gates in the second coding layer are determined based on characteristic information of the second data; wherein the second coding layer is a conjugate transpose operation of the first coding layer.
3. The method according to claim 2, It is characterized in that The first group of quantum logic gates includes n RY gates, each of which acts on a quantum bit, and the rotation angle of each RY gate is determined based on characteristic information of one dimension of the first data; the second group of quantum logic gates includes n Door, each of the The gate acts on a quantum bit respectively. The rotation angle of the door is determined based on feature information of one dimension of the second data.
4. The method according to claim 3, It is characterized in that The first coding layer and the second coding layer further include: an H gate acting on each quantum bit respectively, and a CZ gate establishing a quantum entanglement relationship between the n quantum bits.
5. The method according to claim 2, It is characterized in that The first data is X:={x 1 ,x 2 ,…,x n }, the second data is Y:={y 1 ,y 2 ,…,y n }; Among them, the feature information x of each dimension n and n are all variables, and the method further comprises: will be based on the variable x n and n The amplitude expression of the target quantum state is constructed as the mathematical form of the kernel function, and the quantum kernel inner product of any two data in the to-be-processed data set in the Hilbert space is calculated based on the mathematical form of the kernel function.
6. The method according to claim 1, It is characterized in that The simulating evolution of the encoded quantum circuit based on the Feynman path integral to obtain the amplitude of the target quantum state includes: Determine a directed acyclic graph corresponding to the encoded quantum circuit and a quantum state mapping relationship between each quantum logic gate in the quantum circuit; Based on the initial state of the quantum circuit, the directed acyclic graph and the quantum state mapping relationship, the amplitude of the target quantum state is obtained by segmented simulation evolution.
7. The method according to claim 6, It is characterized in that The initial state of the quantum circuit and the target quantum state are |0> n .
8. The method according to claim 1, It is characterized in that Before encoding the two data in the to-be-processed data set onto the quantum bits in the quantum circuit corresponding to the preset kernel function, the method further includes: For each feature information dimension, multiple data in the to-be-processed data set are normalized to scale multiple feature information in each dimension to the interval [0, 2π].
9. The method according to any one of claims 1 to 8, It is characterized in that The processing of the data in the to-be-processed data set includes: At least one of anomaly detection, data classification and linear regression is performed on the data in the to-be-processed data set.
10. A data processing device based on Feynman path integral, applied to quantum virtual machines, It is characterized in that The device comprises: An encoding module, used for encoding two data in the data set to be processed onto quantum bits in a quantum circuit corresponding to a preset kernel function; A calculation module, used for simulating the evolution of the encoded quantum circuit based on the Feynman path integral to obtain the amplitude of the target quantum state; wherein the target quantum state is used to measure the quantum kernel inner product of the two encoded data in the Hilbert space; A processing module is used to process the data in the to-be-processed data set based on the similarity between the two data indicated by the amplitude of the target quantum state.
11. A storage medium, It is characterized in that The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 9 when running.
12. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 9.
