Mixed quantum classical neural network, prediction method and related device

By mixing quantum classical neural networks, using classical neural networks for feature extraction and dimensionality reduction, combined with the quantum state and entanglement characteristics of quantum computing, the problems of slow prediction speed and high cost in the existing technology are solved, and efficient and economical prediction is achieved.

CN120387478APending Publication Date: 2025-07-29ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410125171.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

In the data prediction based on time series, the classic prediction model operates slowly and is costly, while the full quantum prediction model is too expensive, making it difficult to achieve efficient and economical prediction.

Method used

A hybrid quantum classical neural network is used to extract and reduce the feature by using classical neural networks, and the quantum state and quantum entanglement characteristics of quantum computing capture the nonlinear relationship of hidden features, and the final prediction is made through classical neural networks to reduce quantum resource occupation.

Benefits of technology

It improves prediction efficiency, reduces the cost of quantum resources, and achieves efficient and economical prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120387478A_ABST
    Figure CN120387478A_ABST
Patent Text Reader

Abstract

The invention discloses a hybrid quantum classical neural network, a prediction method and a related device, a classical neural network before the quantum neural network is used for extracting a first hidden feature of input target data, and the quantum neural network is used for performing feature extraction on the first hidden feature to obtain a second hidden feature. The classic neural network after the quantum neural network is used for performing prediction according to the second hidden feature, and the target data is time series data formed by data determining or influencing a plurality of time nodes of the feature of the prediction object before the to-be-predicted time point. According to the embodiment of the invention, efficient and economical prediction can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of quantum computing, and particularly relates to a hybrid quantum-classical neural network, a prediction method, and related devices. Background Art

[0002] Data prediction based on time series utilizes the data that has been generated for the prediction object at multiple time nodes to predict the prediction result at a certain future time or a certain time point, and the prediction result is used to guide production and life. Exemplarily, if the prediction object is photovoltaic power, the obtained prediction result is the photovoltaic power at a certain future moment. For the prediction result, photovoltaic power generation enterprises can initiate corresponding plans to ensure the safe, stable, and economic operation of the power system.

[0003] Since the prediction result is used to guide production and life, it is required that the prediction speed is fast and the prediction accuracy is high. However, when using classical prediction models for prediction, as the amount of data increases, limited by the computing power of classical computing, the operation speed is slow, resulting in low prediction efficiency. However, quantum computing resources are relatively expensive. If all quantum resources are used for prediction, the prediction cost will be relatively high. Summary of the Invention

[0004] The purpose of this application is to provide a hybrid quantum-classical neural network, a prediction method, and related devices, aiming to achieve efficient and economical prediction.

[0005] An embodiment of this application provides a hybrid quantum-classical neural network. The hybrid quantum-classical neural network includes a quantum neural network connected in series between multiple classical neural networks. The classical neural network before the quantum neural network is used to extract the first hidden feature of the input target data. The quantum neural network is used to extract features from the first hidden feature to obtain a second hidden feature. The classical neural network after the quantum neural network is used to make a prediction based on the second hidden feature. The target data is time series data composed of data at multiple time nodes before the time point to be predicted for the target feature, and the target feature is what determines or affects the prediction object.

[0006] Optionally, the number of qubits in the quantum neural network is the number of elements in the first hidden feature.

[0007] Optionally, the quantum neural network includes an encoding layer. The encoding layer includes quantum rotation gates acting on each qubit. The rotation angle of the quantum rotation gate is determined by the encoded first hidden feature, the trained scaling parameter, and the bias parameter.

[0008] Optionally, the rotation angle of the quantum rotation gate is the result obtained by performing four arithmetic operations on the encoded first hidden feature, the trained scaling parameter, and the bias parameter.

[0009] Optionally, the rotation angle of the quantum rotation gate is:

[0010] θ i = ω i c i + b i

[0011] where θ i is the rotation angle of the i-th quantum rotation gate in the encoding layer, ω i is the i-th parameter in the scaling parameters; b i is the i-th parameter in the bias parameters; c i is the i-th element in the first hidden feature.

[0012] Optionally, the quantum neural network further includes a variational layer composed of at least one variational quantum circuit, and the variational quantum circuit is composed of RX gates, RY gates, RZ gates, and CNOT gates acting on each qubit.

[0013] Optionally, the classical neural network is a classical fully connected layer or a classical perceptron, and the quantum neural network is a quantum fully connected layer or a quantum perceptron.

[0014] Another embodiment of the present application provides a prediction method based on a hybrid quantum-classical neural network, and the method includes:

[0015] Obtain target data, where the target data is time series data composed of data generated at multiple time nodes before the time point to be predicted for the features that determine or affect the prediction object;

[0016] Input the target data into the hybrid quantum-classical neural network described in any one of the above, and obtain the prediction result of the prediction object at the time point to be predicted.

[0017] Another embodiment of the present application provides a prediction device based on a hybrid quantum-classical neural network, and the device includes:

[0018] A first obtaining module, configured to obtain target data, where the target data is time series data composed of data at multiple time nodes before the time point to be predicted for the target feature, and the target feature is what determines or affects the prediction object;

[0019] A second obtaining module, configured to input the target data into the hybrid quantum-classical neural network described in any one of the above, and obtain the prediction result of the prediction object at the time point to be predicted.

[0020] An embodiment of the present application provides a storage medium, in which a computer program is stored, and the computer program is configured to implement the hybrid quantum-classical neural network or prediction method described in any one of the above when running.

[0021] An embodiment of the present application provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to implement the hybrid quantum-classical neural network or prediction method described in any one of the above.

[0022] Compared with the prior art, the present application first uses a classical neural network to extract features from target data to obtain hidden features, realizing dimensionality reduction processing of the target data. Then, through the quantum superposition and quantum entanglement characteristics of quantum states in quantum computing, it efficiently captures the complex non-linear relationships between hidden features to obtain further hidden features. Finally, it uses a classical neural network for processing to obtain a prediction result. By performing dimensionality reduction processing through a classical neural network and then using relatively few qubits to extract the features of the data after dimensionality reduction, while improving the prediction efficiency, it reduces the occupation of quantum resources and realizes efficient and economical prediction. Description of the Drawings

[0023] Figure 1 It is a schematic structural diagram of a hybrid quantum-classical neural network provided by an embodiment of the present application;

[0024] Figure 2 It is a schematic structural diagram of a variational quantum circuit provided by an embodiment of the present application;

[0025] Figure 3 It is a schematic flow diagram of a prediction method based on a hybrid quantum-classical neural network provided by an embodiment of the present application;

[0026] Figure 4 It is a schematic structural diagram of a prediction device based on a hybrid quantum-classical neural network provided by an embodiment of the present application;

[0027] Figure 5 It is a block diagram of a computer device provided by an embodiment of the present application. Detailed Embodiments

[0028] The embodiments described below by referring to the drawings are exemplary and are only used to explain the present application, and cannot be construed as a limitation to the present application.

[0029] Figure 1Schematic diagram of a hybrid quantum-classical neural network provided for the application embodiment. The hybrid quantum-classical neural network includes a quantum neural network connected in series between multiple classical neural networks. The classical neural network before the quantum neural network is used to extract the first hidden feature of the input target data. The quantum neural network is used to perform feature extraction on the first hidden feature to obtain the second hidden feature. The classical neural network after the quantum neural network is used to make predictions based on the second hidden feature. The target data is time series data composed of data at multiple time nodes before the target time point of the target feature, and the target feature is what determines or affects the prediction object.

[0030] In the application embodiment, the classical neural network and the quantum neural network can be connected through a network, including but not limited to the Internet, enterprise intranet, local area network, mobile communication network and their combinations. The connection method can adopt wired, wireless communication links or fiber optic cables, etc.

[0031] The classical neural network can be implemented through a classical processing system, and the quantum neural network can be implemented through a quantum processing system. The classical processing system is responsible for performing classical calculations and controls, and the quantum processing system is responsible for running quantum programs to implement quantum calculations. The classical processing system (quantum processing system) can include a classical processor (quantum processor) for processing classical data (quantum data) and a memory (memory) for storing classical data (quantum data). The classical data (quantum data) can be a boot file, an operating system image, and an application program (application program).

[0032] Any data or information stored or generated in the classical processing system (quantum processing system) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner. Similarly, any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0033] The classical processing system and the quantum processing system can be integrated in one device or distributed in two different devices. For example, the first device including the classical processing system runs a classical computer operating system, provides quantum application development tools and services on it, and also provides storage and network services required for quantum applications. The user develops quantum application programs through the quantum application development tools and services on it, and sends the quantum program to the second device including the quantum processing system through the network service on it. The second device runs a quantum computer operating system, parses the code of the quantum program through the quantum computer operating system, and compiles it into instructions that can be recognized and executed by the quantum computer measurement and control system. The quantum processor implements the quantum algorithm corresponding to the quantum program according to the instruction.

[0034] In a classical processing system based on silicon chips, the units of a classical processor are CMOS transistors. Such computing units are not restricted by time and coherence, that is, such computing units are not restricted by the usage duration and are available at any time. In addition, in a silicon chip, the number of such computing units is also sufficient. Currently, the number of computing units in a classical processor is in the thousands. The sufficiency of the number of computing units and the fixed computing logic available for CMOS transistors, such as AND logic. When performing operations with CMOS transistors, a large number of CMOS transistors are combined with limited logic functions to achieve the operation effect.

[0035] Different from such logic units in a classical processing system, the basic computing unit of a quantum processor in a quantum processing system is a qubit. The input of a qubit is restricted by coherence and also by the coherence time, that is, a qubit is restricted by the usage duration and is not available at any time. Making full use of qubits within their available usage duration is a key problem in quantum computing. In addition, the number of qubits in a quantum computer is one of the representative indicators of the performance of a quantum computer. Each qubit realizes the computing function through logic functions configured on demand. Given the limited number of qubits, while the logic functions in the field of quantum computing are diverse, such as 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. When performing quantum computing, it is necessary to combine a limited number of qubits with diverse combinations of logic functions to achieve the operation effect.

[0036] In the embodiments of the present application, the prediction object can be photovoltaic output power, power load, meteorology, typhoon, etc., and the time point to be predicted is a certain moment in the future. For different prediction objects, the target features used in prediction may be different. For power load, the target features that determine power load can be weather, season, the number of users within the coverage area, etc.; for predicting the intensity of a typhoon, the target features that affect the typhoon intensity are the longitude and latitude, air pressure, wind speed, etc. of the typhoon. Time series data is the real data that has been generated, including the data of one or more features at multiple time nodes. Taking meteorology as an example, when the target features are temperature, humidity, air pressure, wind speed, wind direction, precipitation, cloud cover, visibility, if the time node to be predicted is the meteorology on Friday, the data corresponding to the target features of each day in the previous week can be concatenated to obtain a time series data, or the data corresponding to the features at a specific time point of each day in the previous week can be concatenated to obtain the time series data, or it can be the meteorological data at 0:00, 4:00, 8:00, 12:00, 16:00, 20:00 on Thursday to predict the meteorology on Friday, or to predict the meteorology at 12:00 on Friday. The time series data can be the data after data preprocessing. Data preprocessing refers to cleaning the raw data corresponding to the target features, handling outliers and missing values, etc. For example, first, the missing values and outliers in the raw data can be identified and corresponding operations such as deletion, replacement, and correction can be performed on them. Another example is to illustrate with holiday information. For multiple time nodes before the time point to be predicted, the corresponding date can be represented by the number 0 for non-holiday and the number 1 for holiday, so as to normalize the holiday information into sequence elements represented by 0 or 1. Furthermore, on each data dimension, the data corresponding to the features can be normalized respectively, and each data obtained by the normalization process is used as a sequence element in the above time series data, thus constructing a time series sequence. In one implementation manner, time series processing methods such as lag difference and smoothing processing can also be performed according to actual processing requirements, so that the time series data can better adapt to the hybrid quantum-classical neural network. There can be multiple implementation manners for the specific methods of the above preprocessing, which are not specifically limited herein.

[0037] Hidden features are features in the input data that cannot be directly observed but can affect the prediction results. Hidden features are obtained by capturing different abstract features in the input data. In the embodiments of this application, hidden layer features generally refer to the outputs of quantum neural networks or classical neural networks. Quantum neural networks or classical neural networks gradually generate more abstract and representative features by performing a series of transformations and feature extractions on the input data. The dimension of the output hidden features depends on specific problems, network structures, etc. The hidden features output by the classical neural network before the quantum neural network are the first hidden features, and the hidden features output by the quantum neural network are the second hidden features. In a neural network, after the input data is calculated through each layer, a set of features will be obtained. These features reflect some important attributes or representations of the input data, and these features can be understood as different levels of representations extracted from the input data. Generally, shallow features capture lower-level features such as edges and textures, while deep features can capture higher-level and more semantically rich features such as the shape and parts of an object. Feature extraction refers to the process of selecting and extracting the most discriminative and informative features from data for describing and representing the data. The goal of feature extraction is to simplify and improve the subsequent data analysis and model construction processes by reducing the dimension of the data and retaining key information. In this application, the first hidden feature and the second hidden feature are obtained by processing the input data according to the above principles.

[0038] The classical neural network after the quantum neural network further processes the second hidden feature and outputs the prediction result. There is a relationship between the output of this classical neural network and the number of time nodes and predicted variables included in the time node to be predicted. Exemplarily, if there is only 1 predicted time node and only 1 predicted variable, the output result is 1; if there are 3 predicted time nodes and only 1 predicted variable, the output result is 3; if there are 2 predicted time nodes and 2 predicted variables, the output result is 4. It should be noted that the number of layers of the classical neural networks before and after the quantum neural network can be different because the dimensions of the input data and the output data are different, and the number of neurons in the two classical neural networks is also different.

[0039] In this application, first, a classical neural network is used to perform feature extraction on the target data to obtain hidden features, realizing dimensionality reduction processing of the target data. Then, through the quantum superposition and quantum entanglement characteristics of the quantum state of quantum computing, complex non-linear relationships between hidden features are efficiently captured to obtain further hidden features. Finally, a classical neural network is used for processing to obtain the prediction result. By performing dimensionality reduction processing through a classical neural network and then using relatively few qubits to implement feature extraction of the dimensionality-reduced data, while improving the prediction efficiency, the occupation of quantum resources is reduced, realizing efficient and economical prediction.

[0040] In some embodiments of the present application, the number of qubits in the quantum neural network is the number of elements in the first hidden feature.

[0041] The number of qubits in the quantum neural network is determined by the output result of the previous classical neural network, rather than by the dimension of the time series data. It will not increase with the increase in the dimension of the time series data. This can reduce the increase in quantum computing resources due to the increase in data volume. Since quantum computing resources are relatively expensive, when the data volume increases significantly, corresponding predictions can be achieved with little or no increase in cost, thus obtaining the desired results. There is a mutual constraint between the quantum neural network and the previous classical neural network. When the number of qubits supported by the quantum neural network is determined, the number of elements in the first hidden feature output by the corresponding classical neural network will not exceed the number of qubits. The relationship between the dimension of the input data and the dimension of the output result of the classical neural network determines the structure of the classical neural network. The number of qubits in the quantum neural network determines the number of elements in the output result of the quantum neural network, and thus determines the dimension of the input data of the classical neural network after it. The number of required prediction results determines the quantity of the output data of this classical neural network.

[0042] In some embodiments of the present application, the quantum neural network includes an encoding layer, and the encoding layer includes quantum rotation gates acting on each qubit. The rotation angle of the quantum rotation gate is determined by the encoded first hidden feature, the trained scaling parameter, and the bias parameter.

[0043] The trained scaling parameter and bias parameter are obtained during the training of the hybrid quantum-classical neural network. At the beginning of the training, the initial values of the scaling parameter and the bias parameter can be randomly assigned, or screened within a certain range according to certain rules, etc. During the training, these two parameters are updated according to the training results. When the hybrid quantum-classical neural network is trained, the scaling parameter and the bias parameter are also trained, and the corresponding values are the values used during prediction. The scaling parameter is a parameter for scaling the first hidden feature, and the bias parameter is a parameter for biasing the first hidden feature by a certain amount. Determining the rotation angle of the quantum rotation gate in this way can make the quantum neural network insensitive to the deviation and scale of the output data of the previous classical neural network. If the targets in the dataset input to the quantum neural network have different ranges, the output data can be scaled. The expectation value of the Pauli Z observable on each qubit of the quantum neural network is used as the output of the quantum neural network, and the scaling parameter and the bias parameter are added for learning to make the output of the quantum neural network less sensitive to the deviation and scale of the dataset.

[0044] In some embodiments of the present application, the rotation angle of the quantum rotation gate is the result obtained by performing four arithmetic operations on the first hidden feature of the encoding, the trained scaling parameter, and the bias parameter.

[0045] In an embodiment of the present application, the multiplication and division operations can be performed on the first hidden feature by using the scaling parameter. Specifically, after performing operations such as taking the square root or exponential operation on the scaling parameter or the first hidden feature, the data after the operation can be subjected to multiplication and division operations, and the result of the multiplication and division operation can be subjected to addition and subtraction operations with the bias parameter to obtain the rotation angle.

[0046] In some embodiments of the present application, the rotation angle of the quantum rotation gate is:

[0047] θ i =ω i c i +b i

[0048] Where θ i is the rotation angle of the i-th quantum rotation gate in the encoding layer, ω i is the i-th parameter in the scaling parameter; b i is the i-th parameter in the bias parameter; c i is the i-th element in the first hidden feature.

[0049] In an embodiment of the present application, the rotation angle of each quantum rotation gate may be different. There is a corresponding relationship between the quantum rotation gate and the first hidden feature, the scaling parameter, and the bias parameter. When the element in the first hidden feature is determined, the rotation angle is determined accordingly.

[0050] In some embodiments of the present application, the quantum neural network further includes a variational layer composed of at least one variational quantum circuit, and the variational quantum circuit is composed of RX gates, RY gates, RZ gates acting on each qubit, and CNOT gates.

[0051] Taking the number of qubits in the quantum neural network as 3 as an example, a variational quantum circuit structure can be as Figure 2 shown, is the quantum state on the corresponding qubit obtained by encoding in the encoding layer. The variational quantum circuits are connected in series to obtain the variational layer. In the variational quantum circuit, starting from a quantum simulation with fully rotating X / Y / Z parameterized gates (RX gates, RY gates, and RZ gates) as connection weights, followed by a group of CNOT gates, these quantum logic gates are organized in a ring structure for information transfer of qubits to realize the evolution and entanglement of quantum information. In a quantum neural network, there are a total of 3n rotation angles, where n is the number of qubits.

[0052] In some embodiments of the present application, the classical neural network is a classical fully-connected layer or a classical perceptron, and the quantum neural network is a quantum fully-connected layer or a quantum perceptron.

[0053] The fully-connected layer can be used to extract the hidden features of the input data. Thus, through the stacked fully-connected layers, the neural network can gradually learn higher-level feature representations. Specifically, the classical fully-connected layer before the quantum neural network may include a preset number of feature channels. After the time series data is input into this fully-connected layer, the fully-connected layer can extract the hidden features of the input data and output the extracted hidden features, that is, the first hidden features, through the feature channels. Hyperparameters are the configuration parameters of the fully-connected layer and need to be manually set before training the hybrid quantum-classical neural network. By adjusting the hyperparameters, the training process and performance of the hybrid quantum-classical neural network can be optimized. Different fully-connected layers are set with different hyperparameters. For example, by adjusting the learning rate, the speed of weight update can be controlled, and the oscillation during training can be reduced. By adjusting the regularization strength, the risk of overfitting can be reduced. By selecting an appropriate activation function, the gradient propagation and the model convergence speed can be improved. It can be understood that the expression of the hidden features in the fully-connected layer is also affected by the setting of hyperparameters. For example, by reasonably setting the hyperparameters, the dimension of the output hidden features can be controlled. Multiple fully-connected layers constitute a perceptron. The quantum fully-connected layer uses quantum circuits to perform a fully-connected operation on classical data. It does not need to calculate multiplication and addition operations. It only needs to encode the data into a quantum state, perform an evolution operation on the quantum state, and measure to obtain the final fully-connected result. The complexity of this quantum operation can reach O(log(n)), thus greatly improving the computing efficiency.

[0054] During the training of the hybrid quantum-classical neural network, the parameters to be trained in the classical neural network and the quantum neural network are set separately, and the parameters are updated respectively based on the training results. The updates of the parameters are independent of each other. For example, the update of the parameters in the encoding layer of the quantum neural network is not restricted by the update of the parameters in the variational layer.

[0055] See Figure 3 , Figure 3 FIG. is a schematic flowchart of a prediction method based on a hybrid quantum-classical neural network provided by an embodiment of the present application, and may include the following steps:

[0056] S301: Obtain target data, where the target data is time series data composed of data at multiple time nodes before the time point to be predicted for the target feature, and the target feature is the one that determines or affects the prediction object;

[0057] S302: Input the target data into the hybrid quantum-classical neural network described in any one of the above, and obtain the prediction result of the prediction object at the time point to be predicted.

[0058] See Figure 4 , Figure 4 which is a schematic structural diagram of a prediction device provided by an embodiment of the present application. The device includes:

[0059] A first acquisition module 401, configured to acquire target data, where the target data is time-series data composed of data at multiple time nodes before the time point to be predicted for a target feature, and the target feature is a factor that determines or affects the prediction object;

[0060] A second acquisition module 402, configured to input the target data into the hybrid quantum-classical neural network described in any one of the above, and obtain a prediction result of the prediction object at the time point to be predicted.

[0061] Regarding the specific functions and effects achieved by the prediction method and prediction device based on the hybrid quantum-classical neural network, reference can be made to other embodiments of the present application for comparative explanation, which will not be elaborated here. Each module in the prediction device can be implemented in whole or in part by software, hardware, and their combination. The modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0062] Please refer to Figure 5 . An embodiment of the present application further provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to implement the hybrid quantum-classical neural network or the prediction method in any one of the above embodiments. Please refer to Figure 5 , and the computer device can be a classical computer. The electronic device can also be a quantum computer.

[0063] An embodiment of the present application further provides a storage medium, in which a computer program is stored, and the computer program is configured to implement the hybrid quantum-classical neural network or the prediction method in any one of the above embodiments when running.

[0064] An embodiment of the present application further provides a computer program product including instructions, and when the instructions are executed by a computer, the computer is caused to execute the hybrid quantum-classical neural network or the prediction method in any one of the above embodiments.

[0065] It can be understood that in various embodiments of the present application, the magnitudes of the serial numbers of the various processes do not mean the sequence of execution, and the execution sequence of the various processes should be determined according to their functions and internal logics, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0066] It is understood that the various embodiments described in the present application can be implemented alone or in combination, and the embodiments of the present application do not limit this.

[0067] Unless otherwise specified, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those skilled in the technical field of the present application. The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the scope of the present application. The term "and / or" used in the present application includes any and all combinations of one or more of the related listed items. The singular forms "a", "above-mentioned", and "the" used in the embodiments of the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0068] It is understood that the processor in the embodiments of the present application can be an integrated circuit chip with the ability to process signals. In the implementation process, the steps of the above method embodiments can be completed by the integrated logic circuit in the hardware of the processor or instructions in the form of software. The above-mentioned processor can be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art 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. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.

[0069] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can 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.

[0070] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0071] 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 foregoing method embodiments and will not be elaborated herein.

[0072] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there can be other division methods. For example, 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 displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.

[0073] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0074] In addition, the functional units in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0075] When the above-mentioned 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 application, in essence, or the part that contributes to the prior art or 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 and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0076] As described above, the above are only specific embodiments of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims

1. A hybrid quantum-classical neural network, characterized in that, The hybrid quantum-classical neural network includes a quantum neural network connected in series between multiple classical neural networks. The classical neural network before the quantum neural network is used to extract the first hidden feature of the input target data. The quantum neural network is used to perform feature extraction on the first hidden feature to obtain a second hidden feature. The classical neural network after the quantum neural network is used to make a prediction based on the second hidden feature. The target data is time series data composed of data at multiple time nodes before the target time point of the target feature, and the target feature is what determines or affects the prediction object.

2. The hybrid quantum-classical neural network according to claim 1, wherein The number of qubits in the quantum neural network is the number of elements in the first hidden feature.

3. The hybrid quantum-classical neural network according to claim 1, wherein The quantum neural network includes an encoding layer, and the encoding layer includes quantum rotation gates acting on each qubit. The rotation angle of the quantum rotation gate is determined by the encoded first hidden feature, the trained scaling parameter, and the bias parameter.

4. The hybrid quantum-classical neural network according to claim 3, wherein The rotation angle of the quantum rotation gate is the result obtained by performing four arithmetic operations on the encoded first hidden feature, the trained scaling parameter, and the bias parameter.

5. The hybrid quantum classical neural network according to claim 4, characterized in that The rotation angle of the quantum rotation gate is: θ i = ω i c i + b i Among them, θ i is the rotation angle of the i-th quantum rotation gate in the encoding layer, ω i is the i-th parameter in the scaling parameter; b i is the i-th parameter in the bias parameter; c i is the i-th element in the first hidden feature.

6. The hybrid quantum-classical neural network according to claim 3, wherein The quantum neural network further includes a variational layer composed of at least one variational quantum circuit. The variational quantum circuit is composed of RX gates, RY gates, RZ gates, and CNOT gates acting on each qubit.

7. The hybrid quantum-classical neural network according to any one of claims 1-6, wherein the classical neural network is a classical fully connected layer or a classical perceptron, and the quantum neural network is a quantum fully connected layer or a quantum perceptron.

8. A prediction method based on a hybrid quantum-classical neural network, characterized in that, The method includes: Obtaining target data, wherein the target data is time series data composed of data at multiple time nodes before the target time point of the target feature, and the target feature is what determines or affects the prediction object; Inputting the target data into the hybrid quantum-classical neural network according to any one of claims 1-7 to obtain the prediction result of the prediction object at the target time point.

9. A prediction device based on a hybrid quantum-classical neural network, characterized in that: The device includes: A first obtaining module for obtaining target data, wherein the target data is time series data composed of data generated at multiple time nodes before the target time point of the feature that determines or affects the prediction object; A second obtaining module for inputting the target data into the hybrid quantum-classical neural network according to any one of claims 1-7 to obtain the prediction result of the prediction object at the target time point.

10. A storage medium, characterized in that, A computer program is stored in the storage medium, wherein the computer program is set to implement the hybrid quantum-classical neural network according to any one of claims 1 to 7 or the prediction method according to claim 8 when running.

11. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is set to run the computer program to implement the hybrid quantum-classical neural network according to any one of claims 1 to 7 or the prediction method according to claim 8.