A prediction method and device for a complex system, a storage medium and an electronic device

CN116484731BActive Publication Date: 2026-10-23ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310444744.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-21
Publication Date
2026-10-23
Estimated Expiration
2043-04-21

AI Technical Summary

Technical Problem

目前的复杂系统预测模型已经可以初步地对复杂系统进行预测,但现有的复杂系统预测神经网络由于缺少对局部细粒度特征和全局特征进行参数正交化的高效建模的能力,预测准确度较低

Benefits of technology

[0025]基于上述技术方案,对复杂系统中待预测时间节点前多个时间节点的待预测数据进行特征编码,得到编码矩阵;使用包括量子正交线路的神经网络处理编码矩阵,得到注意力矩阵;基于所述编码矩阵与所述注意力矩阵得到待预测时间节点的预测结果。由于用于处理编码矩阵的神经网络包括量子正交线路,得到的注意力矩阵能够体现出丰富的局部特征和全局特征,提升了复杂系统预测的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116484731B_ABST
    Figure CN116484731B_ABST
Patent Text Reader

Abstract

The application discloses a prediction method and device of a complex system, a storage medium and an electronic device, and relates to the technical field of quantum computing. The method comprises the following steps: performing feature coding on to-be-predicted data of a plurality of time nodes before a to-be-predicted time node in a complex system, to obtain an encoding matrix; processing the encoding matrix by using a neural network comprising a quantum orthogonal line, to obtain an attention matrix; and obtaining a prediction result of the to-be-predicted time node based on the encoding matrix and the attention matrix. The prediction accuracy of the complex system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of quantum computing technology, and in particular relates to a prediction method, apparatus, storage medium and electronic device for complex systems. Background Technology

[0002] A quantum computer is a physical device that performs high-speed mathematical and logical operations, stores and processes quantum information in accordance with the laws of quantum mechanics. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Because of its ability to process mathematical problems more efficiently than ordinary computers—for example, reducing the time to crack RSA keys from hundreds of years to hours—quantum computers have become a key technology under research.

[0003] In recent years, deep learning technology has continued to develop and has been widely applied in the field of complex system prediction. Current complex system prediction models can make preliminary predictions for complex systems, but existing complex system prediction neural networks have low prediction accuracy due to their lack of efficient modeling capabilities for parameter orthogonalization of local fine-grained features and global features. Summary of the Invention

[0004] The purpose of this application is to provide a prediction method, apparatus, storage medium, and electronic device for complex systems, aiming to improve the accuracy of predictions for complex systems.

[0005] To achieve the above objectives, a first aspect of the embodiments of this application provides a prediction method for complex systems, the method comprising:

[0006] Feature encoding is performed on the data to be predicted at multiple time points before the time point to be predicted in a complex system to obtain an encoding matrix;

[0007] The attention matrix is ​​obtained by processing the encoding matrix using a neural network that includes quantum orthogonal circuits;

[0008] The prediction result for the time node to be predicted is obtained based on the encoding matrix and the attention matrix.

[0009] Optionally, the neural network includes a first quantum orthogonal circuit and a second quantum orthogonal circuit, the first quantum orthogonal circuit including a one-dimensional data loader, and the second quantum orthogonal circuit including a quantum sequence data loader; the step of processing the encoding matrix using the neural network including the quantum orthogonal circuit to obtain the attention matrix includes:

[0010] The first quantum orthogonal circuit is used to process the encoding matrix to obtain a value vector, and the one-dimensional data loader is used to load the encoding matrix.

[0011] The value vector is processed using the second quantum orthogonal circuit to obtain an attention matrix, and the quantum sequence data loader is used to load the value vector, the conjugate of the value vector, and the norm of the value vector.

[0012] Optionally, both the first and second quantum orthogonal circuits further include orthogonal variable quantum circuits, and the circuit structure of the orthogonal variable quantum circuits includes at least one of the following: pyramid circuit, X-circuit, and butterfly circuit.

[0013] Optionally, the orthogonal variable quantum circuit, the one-dimensional data loader, and the quantum sequence data loader all include quantum orthogonal logic gates.

[0014] Optionally, the one-dimensional data loader includes an X gate that acts sequentially on one of the qubits and a quantum orthogonal logic gate that acts on two adjacent qubits.

[0015] Optionally, the quantum sequence data loader includes the one-dimensional data loader that operates sequentially on all qubits in the first register, a CNOT gate that operates on one qubit in each of the first and second registers, and the one-dimensional data loader that operates on all qubits in the second register.

[0016] Optionally, the quantum orthogonal logic gate includes an RBS gate, and the matrix form of the RBS gate is:

[0017]

[0018] θ is the rotation parameter of the RBS gate.

[0019] A second aspect of this application provides a prediction apparatus for a complex system, the apparatus comprising:

[0020] The encoding module is used to encode the features of the data to be predicted at multiple time points before the time point to be predicted in a complex system, and obtain the encoding matrix.

[0021] The data processing module is used to process the encoding matrix using a neural network including quantum orthogonal circuits to obtain the attention matrix;

[0022] The prediction module is used to obtain the prediction result of the time node to be predicted based on the encoding matrix and the attention matrix.

[0023] A third aspect of this application provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps of the method described in any of the first aspects above when running.

[0024] A fourth aspect of this application 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 perform the steps of the method described in any of the first aspects above.

[0025] Based on the above technical solution, feature encoding is performed on the data of multiple time points preceding the time point to be predicted in a complex system to obtain an encoding matrix; the encoding matrix is ​​then processed using a neural network including quantum orthogonal circuits to obtain an attention matrix; and the prediction result for the time point to be predicted is obtained based on the encoding matrix and the attention matrix. Since the neural network used to process the encoding matrix includes quantum orthogonal circuits, the resulting attention matrix can reflect rich local and global features, thus improving the accuracy of predictions for complex systems. Attached Figure Description

[0026] Figure 1 Hardware structure block diagram of a computer terminal for a prediction method for a complex system provided in an embodiment of the present invention;

[0027] Figure 2 A flowchart illustrating a prediction method for a complex system provided in an embodiment of the present invention;

[0028] Figure 3 This is an exemplary schematic diagram of a one-dimensional data loader provided in an embodiment of the present invention;

[0029] Figure 4 This is an exemplary schematic diagram of a quantum sequence data loader provided in an embodiment of the present invention;

[0030] Figure 5-a is an exemplary schematic diagram of a pyramid route provided in an embodiment of the present invention;

[0031] Figure 5-b is an exemplary schematic diagram of an X-ray circuit provided by an embodiment of the present invention;

[0032] Figure 5-c is an exemplary schematic diagram of a butterfly circuit provided in an embodiment of the present invention;

[0033] Figure 6-a is an exemplary schematic diagram of a first quantum orthogonal circuit provided in an embodiment of the present invention;

[0034] Figure 6-b is an exemplary schematic diagram of a second quantum orthogonal circuit provided in an embodiment of the present invention;

[0035] Figure 7 A flowchart illustrating another method for predicting complex systems provided in an embodiment of the present invention;

[0036] Figure 8 This is a schematic diagram of the structure of a prediction device for a complex system provided in an embodiment of the present invention. Detailed Implementation

[0037] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0038] This invention first provides a prediction method for complex systems, which can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.

[0039] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a hardware structure block diagram of a computer terminal for a prediction method of a complex system provided in an embodiment of the present invention. (See diagram below.) Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0040] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the prediction method of the complex system in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0041] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0042] It's important to note that a true quantum computer has a hybrid structure, comprising two main parts: a classical computer responsible for performing classical computations and control, and a quantum device responsible for running quantum programs to achieve quantum computation. A quantum program is a sequence of instructions written in a quantum language such as QRunes that can run on a quantum computer, supporting operations on quantum logic gates and ultimately enabling quantum computing. Specifically, a quantum program is a sequence of instructions that operates on quantum logic gates according to a specific timing order.

[0043] In practical applications, due to limitations in the development of quantum device hardware, quantum computing simulations are often required to verify quantum algorithms, quantum applications, and so on. Quantum computing simulation is the process of simulating the execution of a quantum program corresponding to a specific problem using a virtual architecture (i.e., a quantum virtual machine) built with the resources of a regular computer. Typically, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program referred to in this embodiment of the invention is a program written in a classical language that represents qubits and their evolution, wherein qubits, quantum logic gates, etc., related to quantum computing all have corresponding classical code representations.

[0044] Quantum circuits, also known as quantum logic circuits, are a common manifestation of quantum programming and are the most widely used general-purpose quantum computing model. They represent circuits that operate on qubits under an abstract concept. They consist of qubits, circuits (timelines), and various quantum logic gates. Finally, the results are often read out through quantum measurement operations.

[0045] Unlike traditional circuits that use metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as being connected by time. That is, the state of a quantum bit evolves naturally over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated on.

[0046] A quantum program corresponds to a single quantum circuit. The quantum program described in this invention refers to this single quantum circuit, where the total number of qubits in the single quantum circuit is the same as the total number of qubits in the quantum program. This can be understood as follows: a quantum program can consist of a quantum circuit, measurement operations on the qubits within the quantum circuit, registers for storing measurement results, and control flow nodes (jump instructions). A single quantum circuit can contain dozens, hundreds, or even thousands of quantum logic gate operations. The execution of a quantum program is the process of executing all the quantum logic gates in a specific timing order. It should be noted that the timing order refers to the chronological sequence in which individual quantum logic gates are executed.

[0047] It's important to note that in classical computing, the most basic unit is the bit, and the most fundamental control mode is the logic gate. Circuit control can be achieved through combinations of logic gates. Similarly, the way to process qubits is through quantum logic gates. Quantum logic gates enable the evolution of quantum states and are the foundation of quantum circuits. Quantum logic gates include single-qubit gates, such as Hadamard gates (H-gates), Pauli-X gates (X-gates), Pauli-Y gates (Y-gates), Pauli-Z gates (Z-gates), RX gates, RY gates, RZ gates, etc.; and two-qubit or multi-qubit quantum logic gates, such as CNOT gates, CR gates, CZ gates, iSWAP gates, Tofoli gates, etc. Quantum logic gates are generally represented using unitary matrices, which are not only matrix forms but also operations and transformations. The effect of a quantum logic gate on a quantum state is generally calculated by left-multiplying the unitary matrix by the matrix corresponding to the right vector of the quantum state.

[0048] For example, the matrix corresponding to the right vector of the quantum state |0> is The matrix corresponding to the right vector of the quantum state |1> is

[0049] See Figure 2 , Figure 2 A flowchart illustrating a prediction method for a complex system provided in an embodiment of the present invention may include the following steps:

[0050] S201, perform feature encoding on the data to be predicted at multiple time points before the time point to be predicted in a complex system to obtain an encoding matrix;

[0051] Complex systems are characterized by nonlinearity, high volatility, and complexity, and can be categorized into transportation systems, meteorological systems, natural disaster systems, investment market systems, and so on.

[0052] The time node to be predicted is the time node that needs to be predicted. The time node can be a point in time or a period of time. The length of each time node and the time interval between each time node can be the same or different. The specific time node selection can be set according to the actual application. In this application embodiment, there is no specific limitation on the number and selection method of the first multiple time nodes.

[0053] The data to be predicted is obtained from complex systems and used to make predictions about complex systems. The type of data depends on the type of complex system and the variables to be predicted. For example, when predicting rainfall in a meteorological system, the data to be predicted can be hydrological data, topographic data, atmospheric circulation model data, etc.; when predicting temperature, it can be surface temperature data, evapotranspiration data, vegetation cover data, etc.

[0054] In this embodiment of the application, feature encoding is performed on the data to be predicted to obtain the encoding matrix of the data to be predicted.

[0055] The features refer to the attributes used to describe the data. For example, when predicting rainfall in a meteorological system, the features of the data can be temperature, humidity, wind force, etc.

[0056] Feature encoding refers to transforming raw data using a specific encoding method to obtain an encoding matrix that reflects the characteristics of the raw data. For example, each row of the encoding matrix can represent a sample, and each column can represent the value of a categorical variable. The encoding methods include binary encoding, one-hot encoding, and numerical encoding. Binary encoding converts data into binary form, with each feature representing a binary bit. One-hot encoding converts each discrete feature into a multi-dimensional vector, where each dimension indicates whether the feature has a certain value. Numerical encoding discretizes continuous features and maps each discrete value to an integer label.

[0057] For example, using one-hot encoding to encode the features of weather data for a given week, where the weather data is: Monday: Sunny; Tuesday: Cloudy; Wednesday: Overcast; Thursday: Light rain; Friday: Moderate rain; Saturday: Heavy rain; Sunday: Sunny, the weather conditions can be encoded into the following matrix:

[0058]

[0059] The code in the fourth row indicates that the weather on Thursday will be light rain.

[0060] In practical applications, the selection of data features and the method of feature encoding should be determined according to the specific circumstances, which will not be elaborated upon in this invention.

[0061] S202, using a neural network including quantum orthogonal circuits to process the encoding matrix to obtain the attention matrix;

[0062] A neural network is an algorithmic mathematical model that mimics the behavioral characteristics of animal neural networks to perform distributed parallel information processing. The basic unit in a neural network is the neuron, which consists of multiple inputs and one output. It can automatically learn and extract features from data to perform complex classification and regression tasks. Currently, neural networks are widely used in image recognition, natural language processing, speech recognition, recommendation systems, game intelligence, and other fields, and are among the most popular and powerful algorithms in machine learning technology today.

[0063] The quantum orthogonal circuit refers to a quantum circuit that includes quantum orthogonal logic gates. It can be a quantum loader that includes quantum orthogonal logic gates and a variable quantum circuit that does not include quantum orthogonal logic gates; it can also be a quantum loader that includes quantum orthogonal logic gates and a variable quantum circuit that does not include quantum orthogonal logic gates; or it can be a quantum loader that includes quantum orthogonal logic gates and a variable quantum circuit that includes quantum orthogonal logic gates.

[0064] An attention matrix is ​​a weighted vector representing the importance of different parts of the input data. In this embodiment, the attention matrix can be viewed as a weighted representation of different parts of the value vector, where the weight of each part reflects its importance to the prediction task. The value vector will be described below.

[0065] The neural network can be a quantum neural network or a hybrid neural network.

[0066] A quantum neural network is a type of neural network based on quantum computing, using qubits and quantum gates to perform computations between neurons and layers. Unlike traditional neural networks, the computation process in a quantum neural network is performed on a quantum computer, resulting in higher computational efficiency and processing power. It is currently widely used in the field of quantum machine learning. The basic components of a quantum neural network include qubits, quantum gates, quantum neurons, and quantum layers. A quantum neuron is the basic computational unit in a quantum neural network, composed of quantum gates and qubits, and is used to perform computational operations within the neural network. A quantum layer is a layer composed of multiple quantum neurons, used to implement forward and backward propagation in the neural network.

[0067] Hybrid neural networks are neural network models that combine classical neural networks with other machine learning techniques. The hybrid neural networks used in this application include classical neural circuits and quantum neural circuits, which can make full use of the advantages of classical computing and quantum computing, thereby improving the performance and accuracy of the entire model. The classical neural circuits and quantum neural circuits will be described below.

[0068] S203, Based on the encoding matrix and the attention matrix, the prediction result of the time node to be predicted is obtained.

[0069] In one implementation, the encoding matrix and attention matrix can be added and standardized, and the result can be input into a fully connected network for processing to obtain the output of the fully connected network. Then, the output of the fully connected network is added to the input of the fully connected network and standardized, and the prediction result of the time node to be predicted is obtained based on the result of addition and standardization.

[0070] This implementation can also be based on a quantum fully connected network, which is based on quantum circuits.

[0071] The embodiments of this application use a neural network including quantum orthogonal circuits to process the encoding matrix, which can achieve efficient modeling of data features of different dimensions and their interactions. Compared with existing complex system prediction neural networks, the prediction accuracy is greatly improved.

[0072] In the embodiments of this application, the weight matrix exhibits orthogonality and nonlinear modeling capability in the first and second quantum orthogonal circuits, which helps to improve the accuracy of prediction of complex systems, avoid the gradient vanishing phenomenon, and at the same time reduce the number of model parameters and improve the calculation speed.

[0073] In one embodiment of this application, the neural network can be a quantum neural network, comprising a first quantum orthogonal circuit and a second quantum orthogonal circuit. The first quantum orthogonal circuit includes a one-dimensional data loader, and the second quantum orthogonal circuit includes a quantum sequence data loader. The step of processing the encoding matrix using the neural network including the quantum orthogonal circuit to obtain the attention matrix includes:

[0074] The first quantum orthogonal circuit is used to process the encoding matrix to obtain a value vector, and the one-dimensional data loader is used to load the encoding matrix.

[0075] The value vector is processed using the second quantum orthogonal circuit to obtain an attention matrix, and the quantum sequence data loader is used to load the value vector, the conjugate of the value vector, and the norm of the value vector.

[0076] A value vector is a vector used to represent a feature of a portion of input data. In the prediction of complex systems, the features of each time step in the data to be predicted are represented as a value vector, and these vectors are then used to predict future data.

[0077] In the field of quantum computing, the conjugate number refers to the vector obtained by complex conjugating a vector. The vector describing a quantum state is called a state vector, which is divided into a left vector and a right vector, as described in this application. When discussing the same problem, if the descriptions of the left and right vectors within parentheses are identical, then these two vectors are transposes and conjugates of each other; that is, these two vectors are each other's conjugate numbers.

[0078] In quantum computing, a norm is used to measure the magnitude of a quantum state, usually denoted as "||X||". Norms include various types such as the L-P norm, L0 norm, L1 norm, and L2 norm. This embodiment of the invention uses the L1 norm, which is defined as follows:

[0079]

[0080] Where X represents a vector, n is the dimension of this vector, and x i Let represent the i-th element of this vector. The L1 norm can be represented as the sum of the absolute values ​​of the non-zero elements in vector x. The L1 norm can measure the difference between two vectors, such as absolute error, and can also be used to control the complexity of a model and prevent overfitting.

[0081] The first and second quantum orthogonal circuits, the one-dimensional data loader, and the quantum sequence data loader will be described below.

[0082] In another embodiment of this application, the neural network may be a hybrid neural network, which includes a first hybrid neural network and a second hybrid neural network.

[0083] The first hybrid neural network includes a first quantum orthogonal circuit and a first classical circuit, and the second hybrid neural network includes a second classical circuit and a third quantum orthogonal circuit.

[0084] In one implementation, the hybrid neural network is a first hybrid neural network, and the step of processing the encoding matrix with a neural network including quantum orthogonal circuits to obtain the attention matrix includes:

[0085] The encoding matrix is ​​processed using the first quantum orthogonal circuit to obtain the value vector of the quantum state;

[0086] The value vector is converted into a binary format that can be read by the first classical circuit;

[0087] The value vector is processed using the first classical circuit to obtain the attention matrix.

[0088] The step of converting the value vector of the quantum state into a binary format that can be read by a first classical circuit includes converting each element in the value vector of the quantum state into a binary number, and then arranging these binary numbers in order. For example, the value vector [01011011] can be represented as 01011011 in binary form.

[0089] The first classical circuit includes a first matrix multiplication layer, a ReLU activation layer, and a pooling layer. The first matrix multiplication layer performs an orthogonal transformation on the encoding matrix; the ReLU activation layer performs a nonlinear transformation on the transformed feature vector, introducing a nonlinear factor; the pooling layer downsamples the nonlinearly transformed feature vector, reducing the dimension of the feature vector to obtain a value vector.

[0090] In another implementation, the hybrid neural network is a second hybrid neural network, and the process of processing the encoding matrix with a neural network including quantum orthogonal circuits to obtain the attention matrix includes:

[0091] The second classic line processing encoding matrix is ​​used to obtain the value vector;

[0092] The value vector is processed using the third quantum orthogonal circuit to obtain the attention matrix.

[0093] The second classic circuit includes a second matrix multiplication layer, a Softmax layer, and a Dot-Product layer. The second matrix multiplication layer is used to perform orthogonal transformation on the value vector; the Softmax layer is used to normalize the transformed value vector to obtain the attention distribution; and the Dot-Product layer is used to perform a dot product operation between the value vector and the attention distribution to obtain the attention matrix.

[0094] The third quantum orthogonal circuit includes the quantum sequence data loader and the second orthogonal variable quantum circuit, wherein the quantum sequence data loader is used to load value vectors in binary format and encode the value vectors onto qubits.

[0095] It should be noted that the first classic line and the second classic line can be classic orthogonal lines or non-orthogonal classic lines. The above embodiment is only a preferred embodiment provided by the present invention. The present invention does not specifically limit the structure and data format conversion method of the first classic line and the second classic line, and can be set according to actual application.

[0096] In one embodiment of this application, both the first quantum orthogonal circuit and the second quantum orthogonal circuit further include an orthogonal variable quantum circuit, and the circuit structure of the orthogonal variable quantum circuit includes at least one of the following: pyramid circuit, X-circuit, and butterfly circuit.

[0097] Orthogonal variational quantum circuits (ORFs) are orthogonal, controllable, and adjustable quantum circuits. Their parameters can be optimized to perform tasks such as classification, regression, or clustering of input data. ORFs include a series of orthogonal quantum gates, such as Hadamard gates, TOFFOLI gates, and RBS gates. By adjusting the parameters of these gates, a highly adjustable and orthogonal quantum circuit can be constructed, enabling it to transform input data in different ways and achieve various tasks.

[0098] The pyramid, X, and butterfly routes will be described below.

[0099] The first orthogonal variable quantum circuit is located after the one-dimensional data loader and is used to perform variable quantum encoding on the encoding matrix. The circuit complexity of the first orthogonal variable quantum circuit is O(log(d)), and the trainable parameters are O(dlogd).

[0100] The second orthogonal variable quantum circuit is located after the quantum sequence data loader and is used to perform attention calculation on the value vector.

[0101] Taking an n x d value vector as an example, the attention calculation process is explained. First, the n x d value vector is input into a quantum sequence loader. The first and second registers in the quantum sequence loader are in a superposition state with a Hamming weight of 2. This superposition state includes n × d quantum states that satisfy the following condition: exactly one qubit in each of the first and second registers has a Hamming weight of 1. Then, attention calculation is performed on this superposition state using an orthogonal variable quantum circuit, filtering out all calculation results that satisfy the following condition: exactly one bit in the first n bits and exactly one bit in the last d bits has a Hamming weight of 1. Finally, all the filtered calculation results are combined into an n x d matrix, which is the attention matrix. For example, when the input value vector is 4 x 4, the Hamming weight of the 4th qubit in the first register is 1 and the others are 0, and the Hamming weight of the 3rd qubit in the second register is 1 and the others are 0. Then, the attention calculation result of "00010010" is the value in the fourth row and third column of the attention matrix. The quantum sequence loader, the first register, and the second register will be described below.

[0102] The first and second orthogonal variable quantum circuits mentioned above have logarithmic depth and a linear number of quantum orthogonal logic gates, which can maintain a high level of expressiveness and avoid gradient vanishing and gradient explosion.

[0103] Furthermore, the orthogonal variable quantum circuit, the one-dimensional data loader, and the quantum sequence data loader all include quantum orthogonal logic gates.

[0104] Quantum orthogonal logic gates are quantum gates that possess orthogonality and logical properties. In quantum computing, quantum gates are typically controllable quantum transformations that can transform and manipulate quantum states. Quantum orthogonal logic gates are not only controllable quantum transformations but also possess orthogonality and logical properties, enabling logical operations such as logical AND, OR, and NOT. Quantum orthogonal logic gates are usually composed of a series of orthogonal single-qubit and two-qubit gates. These gates can be constructed and optimized using quantum compiler techniques to implement different logical operations. All single-qubit and two-qubit gates in a quantum orthogonal logic gate are orthogonal, meaning there is no coupling or interference between them, allowing for highly controllable and stable logical operations in quantum computing. Furthermore, the orthogonality of quantum orthogonal logic gates helps reduce errors and interference in quantum computing, improving its accuracy and reliability.

[0105] In one embodiment of this application, the one-dimensional data loader includes an X gate that operates sequentially on one of the qubits and a quantum orthogonal logic gate that operates on two adjacent qubits.

[0106] See Figure 3 , Figure 3 This is an exemplary schematic diagram of a one-dimensional data loader provided in an embodiment of this application. Figure 3 The one-dimensional data loader shown includes four qubits in the initial state |0>. The quantum logic gate X acts on the first qubit, and the quantum orthogonal logic gates RBS(y1), RBS(y2), and RBS(y3) act on two adjacent qubits in sequence. y1, y2, and y3 are the parameters of the quantum orthogonal logic gates RBS(y1), RBS(y2), and RBS(y3), and the parameters y1, y2, and y3 are determined according to the data loading scheme.

[0107] The quantum orthogonal logic gate RBS will be described below.

[0108] There are two data loading schemes. The following explanation uses an n x d column encoding matrix as an example to illustrate the two loading schemes and their corresponding parameter determination methods. Where x... i This represents the element in the i-th column.

[0109] In the first loading scheme, the one-dimensional data loader includes d qubits in the initial state |0> and d-1 quantum logic gates RBS(y1)~RBS(y1) that act sequentially on two adjacent qubits. d-1 ), where y1=x1+x d y2=x2+x d y3=x3+x d , ..., y d-1 =xd-1 +x d .

[0110] In the second loading scheme, the one-dimensional data loader includes d+1 qubits in the initial state |0> and d quantum logic gates RBS(y1)~RBS(y1) that act sequentially on two adjacent qubits. d ), where y1 = arc cos(x1), y2 = arc cos(x2sin) -1 (y1)),

[0111] y3=arc cos(x3sin -1 (y1)sin -1 (y2)), ...

[0113] y d =arc cos(x d-1 sin -1 (y1)sin- 1 (y2)...sin -1 (y d )).

[0114] A one-dimensional data loader constructs an orthogonal, controllable, and adjustable quantum circuit, using quantum orthogonal logic gates to load input data. Due to the parallel computing capabilities, higher precision, and stability of quantum computers, the one-dimensional data loader achieves faster loading speeds, higher accuracy, and greater reliability. The one-dimensional quantum data loader uses quantum orthogonal logic gates to load and process input data. The orthogonality, controllability, and adjustability of these gates allow the one-dimensional data loader to perform parallel computations undisturbed. It can be optimized and adjusted according to specific data loading requirements, further improving computational efficiency.

[0115] In one embodiment of this application, the quantum sequence data loader includes the one-dimensional data loader that operates sequentially on all qubits in the first register, a CNOT gate that operates on one qubit in each of the first and second registers, and the one-dimensional data loader that operates on all qubits in the second register.

[0116] See Figure 4 , Figure 4 This is an exemplary schematic diagram of a quantum sequence data loader provided in an embodiment of this application. Figure 4The quantum sequence data loader shown includes a first register at the top and a second register at the bottom. The first register includes four qubits in the initial state |0>. A one-dimensional data loader Load||X|| operates sequentially on all qubits in the first register to load the norm of each value vector into the qubits. The second register includes four qubits in the initial state |0>, and one-dimensional data loaders Load|X1>, Load<X2|, Load|X2>...Load<X n-1 |、Load|X n The CNOT gate operates sequentially on all qubits in the second register, loading the first, second-to-last, and last elements of each value vector, along with other elements and their conjugates, into the qubits. The CNOT gate operates sequentially on each qubit in the first register and the first qubit in the second register, between the two one-dimensional loaders used to load the corresponding elements and conjugates, controlling the phase flipping of adjacent one-dimensional data loaders. However, special handling is required for the first, second-to-last, and last elements of each value vector. The CNOT gate operates on each qubit in the first register and the first qubit in the second register, before the one-dimensional loaders used to load the first and last elements of each value vector, and no control is applied to the second-to-last element of each value vector.

[0117] A quantum sequence data loader is a quantum computing-based sequence data loader that utilizes the characteristic of quantum circuits to model time-series data, encodes the sequence data into quantum states, and inputs the sequence data into a neural network through quantum gate operations. Since the second register of the quantum sequence data loader includes the one-dimensional data loader, it possesses all the advantages of a one-dimensional data loader. Furthermore, time-series data has temporal continuity, requiring data input and processing step-by-step. Currently, quantum loaders for time-series data are generally implemented through loops. The quantum sequence data loader can leverage the characteristic of quantum circuits to model time-series data and achieve attention computation through subsequent orthogonal variable quantum circuits.

[0118] Furthermore, the quantum orthogonal logic gate includes the RBS gate, and the matrix form of the RBS gate is:

[0119]

[0120] θ is the rotation parameter of the RBS gate.

[0121] The Reconfigurable Beam Splitter (RBS) gate is an orthogonal reconfigurable beam splitter gate. By adjusting its internal structural parameters, its splitting method and ratio can be changed to achieve different quantum computing tasks while maintaining the orthogonality of the quantum states. As a quantum orthogonal logic gate, the RBS gate possesses all the advantages of quantum orthogonal logic gates. Furthermore, compared to other orthogonal logic gates, the RBS gate is simpler to implement and can be realized on various physical platforms such as linear optics, superconducting quantum computing, and ion traps.

[0122] As shown in Figures 5-a, 5-b, and 5-c, Figure 5-a is an exemplary schematic diagram of a pyramid circuit provided in an embodiment of this application, Figure 5-b is an exemplary schematic diagram of an X-circuit provided in an embodiment of this application, and Figure 5-c is an exemplary schematic diagram of a butterfly circuit provided in an embodiment of this application.

[0123] The pyramid circuit shown in Figure 5-a includes four qubits in the initial state |0>. The quantum orthogonal logic gates RBS(y1) to RBS(y6) are arranged in a pyramid shape, each acting on two adjacent qubits. y1 to y6 are the parameters of the quantum orthogonal logic gate X. The parameters y1 to y6 are initialization random parameters that need to be determined through training and optimization.

[0124] The X circuit shown in Figure 5-b includes four qubits in the initial state |0>. The quantum orthogonal logic gates RBS(y1) to RBS(y5) are arranged in an X-shape, each acting on two adjacent qubits. y1 to y5 are the parameters of the quantum orthogonal logic gate X. The parameters y1 to y5 are initialization random parameters that need to be determined through training and optimization.

[0125] The butterfly circuit shown in Figure 5-c includes 8 qubits in the initial state |0>, and quantum orthogonal logic gates RBS(y1) ~ RBS(y2). 12 The arrangement of the qubits is butterfly-shaped, with RBS(y1) to RBS(y4) acting on five consecutive qubits, RBS(y5) to RBS(y8) acting on three consecutive qubits, and RBS(y9) to RBS(y4) acting on three consecutive qubits. 12 ) are applied to two consecutive qubits respectively. y1~y 12 Let y1 be the parameter of quantum orthogonal logic gate X, and let y1 ~ y2 be the parameter of gate X. 12 To initialize random parameters, they need to be determined through training and optimization.

[0126] Optionally, based on the above embodiments, the first quantum orthogonal circuit further includes a first measurement layer, located after the first orthogonal variable quantum circuit, for measuring the value vector. The second quantum orthogonal circuit further includes a second measurement layer, located after the second orthogonal variable quantum circuit, for measuring the attention matrix.

[0127] Furthermore, as shown in Figures 6-a and 6-b, Figure 6-a is an exemplary schematic diagram of a first quantum orthogonal circuit provided in an embodiment of this application, where i can be 1, 2, 3...; Figure 6-b is an exemplary schematic diagram of a second quantum orthogonal circuit provided in an embodiment of this application, where Load|A i > refers to the norm of each value vector loaded, and Load|X> refers to the number of conjugates of each value vector loaded. The specific structures of the first and second quantum orthogonal circuits have been described in detail in the above embodiments and will not be repeated here.

[0128] like Figure 7 As shown, Figure 7 This is a flowchart illustrating a complex system prediction method provided in an embodiment of this application. The following is a summary of the process. Figure 7 Taking an example, the process of a complex system prediction method provided in this application embodiment will be further described.

[0129] First, feature encoding is performed on the data from multiple time points preceding the time point to be predicted in the complex system, resulting in an encoding matrix. Then, the encoding matrix is ​​input into a first quantum orthogonal circuit, which processes it to obtain a value vector. This value vector is then input into a second quantum orthogonal circuit, which processes the encoding matrix to obtain an attention matrix. Next, the encoding matrix and attention matrix are added together and standardized. The result is then input into a fully connected quantum network for processing, yielding the network's output. Finally, the output of the fully connected quantum network is added to its input and standardized. Based on the sum and standardization results, the prediction result for the time point to be predicted is obtained.

[0130] See Figure 8 , Figure 8 This is a schematic diagram of the structure of a prediction device for a complex system provided in an embodiment of the present invention. Figure 2 Corresponding to the process shown, the apparatus includes:

[0131] The encoding module 801 is used to perform feature encoding on the data to be predicted at multiple time points before the time point to be predicted in a complex system, so as to obtain an encoding matrix.

[0132] The data processing module 802 is used to process the encoding matrix using a neural network including quantum orthogonal circuits to obtain the attention matrix.

[0133] The prediction module 803 is used to obtain the prediction result of the time node to be predicted based on the encoding matrix and the attention matrix.

[0134] Optionally, the neural network includes a first quantum orthogonal circuit and a second quantum orthogonal circuit, wherein the first quantum orthogonal circuit includes a one-dimensional data loader and the second quantum orthogonal circuit includes a quantum sequence data loader.

[0135] Optional, the data processing module 802 is specifically used for:

[0136] The first quantum orthogonal circuit is used to process the encoding matrix to obtain a value vector, and the one-dimensional data loader is used to load the encoding matrix.

[0137] The value vector is processed using the second quantum orthogonal circuit to obtain an attention matrix, and the quantum sequence data loader is used to load the value vector, the conjugate of the value vector, and the norm of the value vector.

[0138] Optionally, both the first and second quantum orthogonal circuits further include orthogonal variable quantum circuits, and the circuit structure of the orthogonal variable quantum circuits includes at least one of the following: pyramid circuit, X-circuit, and butterfly circuit.

[0139] Optionally, the orthogonal variable quantum circuit, the one-dimensional data loader, and the quantum sequence data loader all include quantum orthogonal logic gates.

[0140] Optionally, the one-dimensional data loader includes an X gate that acts sequentially on one of the qubits and a quantum orthogonal logic gate that acts on two adjacent qubits.

[0141] Optionally, the quantum sequence data loader includes the one-dimensional data loader that operates sequentially on all qubits in the first register, a CNOT gate that operates on one qubit in each of the first and second registers, and the one-dimensional data loader that operates on all qubits in the second register.

[0142] Optionally, the quantum orthogonal logic gate includes an RBS gate, and the matrix form of the RBS gate is:

[0143]

[0144] θ is the rotation parameter of the RBS gate.

[0145] This invention also provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.

[0146] Specifically, in this embodiment, the storage medium can be configured to store a computer program for performing the following steps:

[0147] S1 involves feature encoding of the data to be predicted at multiple time points preceding the time point to be predicted in a complex system, resulting in an encoding matrix.

[0148] S2 uses a neural network including quantum orthogonal circuits to process the encoding matrix and obtain the attention matrix.

[0149] S3. Based on the encoding matrix and the attention matrix, the prediction result of the time node to be predicted is obtained.

[0150] Specifically, in this embodiment, the storage medium may include, but is not limited to, USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks, and other media capable of storing computer programs.

[0151] This invention also provides an electronic device, including a memory and a processor, characterized in that the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0152] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.

[0153] Specifically, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0154] S1 involves feature encoding of the data to be predicted at multiple time points preceding the time point to be predicted in a complex system, resulting in an encoding matrix.

[0155] S2 uses a neural network including quantum orthogonal circuits to process the encoding matrix and obtain the attention matrix.

[0156] S3. Based on the encoding matrix and the attention matrix, the prediction result of the time node to be predicted is obtained.

[0157] Specifically, the specific examples in this embodiment can be referred to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0158] The above description, based on the embodiments shown in the figures, details the structure, features, and effects of the present invention. The above description is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the figures. Any changes made in accordance with the concept of the present invention, or equivalent embodiments modified to have equivalent changes, that do not exceed the spirit covered by the specification and figures, should be within the protection scope of the present invention.

Claims

1. A prediction method for complex systems, characterized in that, The method includes: Feature encoding is performed on the data to be predicted at multiple time points before the time point to be predicted in a complex system to obtain an encoding matrix; The attention matrix is ​​obtained by processing the encoding matrix using a neural network that includes quantum orthogonal circuits; The prediction result of the time node to be predicted is obtained based on the encoding matrix and the attention matrix; The neural network includes a first quantum orthogonal circuit and a second quantum orthogonal circuit. The first quantum orthogonal circuit includes a one-dimensional data loader, and the second quantum orthogonal circuit includes a quantum sequence data loader. The process of using the neural network including the quantum orthogonal circuit to process the encoding matrix to obtain the attention matrix includes: The first quantum orthogonal circuit is used to process the encoding matrix to obtain a value vector, and the one-dimensional data loader is used to load the encoding matrix. The value vector is processed using the second quantum orthogonal circuit to obtain an attention matrix, and the quantum sequence data loader is used to load the value vector, the conjugate of the value vector, and the norm of the value vector; The one-dimensional data loader includes an X gate that operates sequentially on one of the qubits and a quantum orthogonal logic gate that operates on two adjacent qubits; the quantum sequence data loader includes the one-dimensional data loader that operates sequentially on all qubits in the first register, a CNOT gate that operates on one qubit in each of the first and second registers, and the one-dimensional data loader that operates on all qubits in the second register.

2. The method according to claim 1, characterized in that, Both the first and second quantum orthogonal circuits further include orthogonal variable quantum circuits, and the circuit structure of the orthogonal variable quantum circuits includes at least one of the following: pyramid circuit, X-circuit, and butterfly circuit.

3. The method according to claim 2, characterized in that, The orthogonal variable quantum circuit, the one-dimensional data loader, and the quantum sequence data loader all include quantum orthogonal logic gates.

4. The method according to any one of claims 3, characterized in that, The quantum orthogonal logic gate includes the RBS gate, and the matrix form of the RBS gate is as follows: ; θ is the rotation parameter of the RBS gate.

5. A prediction device for a complex system, characterized in that, The device includes: The encoding module is used to encode the features of the data to be predicted at multiple time points before the time point to be predicted in a complex system, and obtain the encoding matrix. The data processing module is used to process the encoding matrix using a neural network including quantum orthogonal circuits to obtain the attention matrix; The prediction module is used to obtain the prediction result of the time node to be predicted based on the encoding matrix and the attention matrix; The neural network includes a first quantum orthogonal circuit and a second quantum orthogonal circuit. The first quantum orthogonal circuit includes a one-dimensional data loader, and the second quantum orthogonal circuit includes a quantum sequence data loader. The process of using the neural network including the quantum orthogonal circuit to process the encoding matrix to obtain the attention matrix includes: The first quantum orthogonal circuit is used to process the encoding matrix to obtain a value vector, and the one-dimensional data loader is used to load the encoding matrix. The value vector is processed using the second quantum orthogonal circuit to obtain an attention matrix, and the quantum sequence data loader is used to load the value vector, the conjugate of the value vector, and the norm of the value vector; The one-dimensional data loader includes an X gate that operates sequentially on one of the qubits and a quantum orthogonal logic gate that operates on two adjacent qubits; the quantum sequence data loader includes the one-dimensional data loader that operates sequentially on all qubits in the first register, a CNOT gate that operates on one qubit in each of the first and second registers, and the one-dimensional data loader that operates on all qubits in the second register.

6. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 4 when it is run.

7. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Hybrid neural network training method, traffic flow prediction method, equipment and medium

    CN114742210A

  • Text classification method and device, electronic equipment and computer readable storage medium

    CN115964480A