Time sequence prediction method, system and equipment based on amplitude coding and mixed quantum
By combining classical temporal features with quantum state preparation, amplitude encoding, and variable quantum convolutional networks, the problems of high-dimensional feature compression and insufficient global dependency capture are solved, achieving efficient temporal prediction and improving prediction accuracy and efficiency.
Patent Information
- Application Number
- CN202511784724.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-03
AI Technical Summary
Existing quantum computing methods suffer from problems such as insufficient high-dimensional feature compression, non-standard quantum encoding, and insufficient global dependency capture capability across time steps in time series prediction, resulting in information loss and low prediction accuracy.
Combining classical temporal features with quantum state preparation, amplitude encoding, and variable quantum convolutional networks, local temporal patterns are extracted through multi-scale convolutional kernels, followed by fully connected dimensionality reduction and normalization. Differentiable masking mechanisms are used to dynamically optimize the filling positions, forming amplitude-encoded quantum states that meet the requirements of quantum amplitude distribution. Quantum features are extracted and sparsified measurements are performed through variable quantum convolutional networks, achieving fusion regression prediction of quantum and classical features.
It significantly improves the accuracy and efficiency of time series prediction, makes full use of the high-dimensional representation capability of quantum states, reduces the consumption of computing resources, and improves the deployability and robustness of the model in edge and real-time application scenarios.
Smart Images

Figure CN121598338A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of time series prediction technology that integrates quantum computing and artificial intelligence. More specifically, this invention relates to a time series prediction method, system, and device based on amplitude encoding and hybrid quantum mechanics. Background Technology
[0002] With the continuous improvement of the intelligence level of power systems, accurate forecasting of electricity loads such as trams and rail transit has become a crucial link in achieving optimized energy dispatch and improving system stability. Traditional time-series forecasting methods mainly rely on classical statistical models, such as the Autoregressive Moving Average (ARMA) model and the Seasonally Differential Autoregressive Moving Average (SARIMA) model. These methods can achieve a certain level of accuracy in short-term load forecasting, but they have significant limitations when dealing with complex nonlinear relationships and high-dimensional time-series data, making it difficult to effectively capture the potential patterns of load changes.
[0003] In recent years, the introduction of quantum computing has provided new insights into time series prediction. The high-dimensional representation capabilities of quantum states, along with their quantum superposition and entanglement properties, give quantum computing a natural advantage in high-dimensional feature representation and global dependency capture. However, existing quantum machine learning methods still face some key challenges: quantum state encoding requires mapping classical features to quantum amplitudes, and insufficient or non-standardized dimensionality can lead to information loss; traditional dimensionality reduction and zero-padding methods typically fix the padding positions, failing to fully preserve feature information; and the ability of quantum convolutional networks to capture global dependencies across time steps during feature extraction still needs improvement. Summary of the Invention
[0004] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a time-series prediction method, system, and device based on amplitude coding and hybrid quantum mechanics. By combining classical time-series features with quantum state preparation, amplitude coding, and variable quantum convolutional networks, the method solves the problems of insufficient high-dimensional feature compression, quantum coding normalization, and cross-time-step global dependency capture capability.
[0005] To achieve the above objectives, the present invention provides the following technical solution: In a first aspect, this application provides a time series prediction method based on amplitude encoding and hybrid quantum mechanics. The method includes: inputting the time series data to be predicted into a pre-trained one-dimensional convolutional neural network; extracting local time patterns through multi-scale convolutional kernels to obtain a first feature; performing fully connected dimensionality reduction on the first feature and normalizing the dimensionality reduction result to generate a unit vector; if the dimensionality after dimensionality reduction is less than a preset number of qubits, zero-padding is performed and the padding position is dynamically optimized based on a differentiable mask mechanism to obtain a quantum state preparation vector; loading the quantum state preparation vector onto the corresponding number of qubits through amplitude encoding to form an amplitude-encoded quantum state that meets the quantum amplitude distribution requirements; extracting quantum features from the amplitude-encoded quantum state based on a variable quantum convolutional network to obtain a target quantum state after quantum convolution processing; performing sparsification measurement on the target quantum state to form a quantum feature vector, which is then fused with the first feature; performing regression prediction based on the fusion result to output the time series prediction result.
[0006] In one embodiment, the temporal data to be predicted is input into a pre-trained one-dimensional convolutional neural network, and local temporal patterns are extracted through multi-scale convolutional kernels to obtain the first feature. Specifically, the process involves: acquiring the temporal data sequence to be predicted and performing normalization preprocessing to obtain a standardized input data sequence; inputting the input data sequence into the input layer of the pre-trained one-dimensional convolutional neural network in chronological order to form an initial temporal tensor; performing feature extraction operations based on the initial temporal tensor using a one-dimensional convolutional group with multiple different kernel sizes, where each kernel size corresponds to a time scale, to extract local temporal patterns over different time spans; performing nonlinear activation processing on the convolutional outputs of each kernel size to obtain a multi-scale activation feature set; concatenating the multi-scale activation feature set along the channel dimension to obtain a fused multi-scale feature tensor; performing temporal pooling processing on the multi-scale feature tensor to obtain a temporal compressed feature vector; and performing a linear transformation on the temporal compressed feature vector to obtain the first feature.
[0007] In one embodiment, a fully connected dimensionality reduction is performed on the first feature, and the dimensionality reduction result is normalized to generate a unit vector. Specifically, a fully connected operation is performed on the first feature, and the fully connected operation linearly maps the first feature based on a preset dimensionality reduction matrix to obtain an intermediate dimensionality-reduced vector with compressed dimensions. A nonlinear activation process is performed on the intermediate dimensionality-reduced vector to form a dimensionality-reduced feature. The sum of squares of each component of the dimensionality-reduced feature is calculated, and its L2 norm is calculated based on the sum of squares. Based on the L2 norm, component-by-component normalization is performed on each component of the dimensionality-reduced feature to generate a unit vector.
[0008] In one embodiment, if the dimension after dimensionality reduction is insufficient for the preset number of qubits, zero-padding is performed and the padding position is dynamically optimized based on a differentiable masking mechanism to obtain a quantum state preparation vector. Specifically, this involves: obtaining a unit vector and determining the unit vector dimension required for the preset number of qubits; comparing the actual dimension of the unit vector with the unit vector dimension; if the actual dimension is less than the unit vector dimension, it is determined that the unit vector is dimensionally insufficient; in the case of dimension insufficiency, constructing a zero vector with a length equal to the difference between the unit vector dimension and the actual dimension, and using the zero vector as a candidate padding vector; constructing a differentiable masking mechanism and assigning learnable mask weights to the unit vector and the candidate padding vector based on the differentiable masking mechanism to obtain an initial masking matrix; performing normalization processing on the initial masking matrix, and dynamically combining the unit vector and the candidate padding vector based on the normalized mask weights to generate a mask-controlled padding vector sequence; arranging the elements according to the order of the padding vector sequence to form a padding vector with a length equal to the unit vector dimension; and performing normalization processing on the padding vector again to form a quantum state preparation vector.
[0009] In one embodiment, the quantum state preparation vector is loaded onto a corresponding number of qubits through amplitude encoding to form an amplitude-encoded quantum state that meets the quantum amplitude distribution requirements. Specifically, the process involves: obtaining the quantum state preparation vector and allocating several qubits to the quantum state preparation vector; and, based on a preset amplitude encoding rule, loading the components of the quantum state preparation vector into the amplitude of the ground state of the corresponding qubit to form an amplitude-encoded quantum state.
[0010] In one embodiment, quantum feature extraction of the amplitude-encoded quantum state is performed based on a variable quantum convolutional network to obtain the target quantum state after quantum convolution processing. Specifically, the amplitude-encoded quantum state is input into the input layer of a pre-trained variable quantum convolutional network; a feature encoding layer is set in the variable quantum convolutional network to perform initial rotation operations and entanglement operations between qubits on the amplitude-encoded quantum state to generate an initial encoded quantum state; the initial encoded quantum state is input into a quantum convolutional layer to extract local and non-local features and generate an intermediate quantum state after convolution evolution; an entanglement enhancement structure is introduced to perform additional entanglement operations between qubits on the intermediate quantum state to generate the target quantum state.
[0011] In one embodiment, a sparse measurement is performed on the target quantum state to form a quantum feature vector, which is then fused with a first feature. Specifically, a sparse quantum measurement is performed on the target quantum state to obtain the expected values of several key quantum features, forming a quantum feature vector. The quantum feature vector is then spliced or aligned with the first feature in the channel dimension to form a fused feature vector.
[0012] In one embodiment, regression prediction is performed based on the fusion result to output a time-series prediction result. Specifically, based on a neural network, the fused feature vector is input into a fully connected layer, and a linear mapping operation is performed to obtain a preliminary prediction vector. A nonlinear activation transformation is performed on the preliminary prediction vector to generate a nonlinear regression output vector. The nonlinear regression output vector is then denormalized or scaled to generate the final time-series prediction result. This final time-series prediction result is used as the final output for tram load prediction or other time-series prediction tasks.
[0013] Secondly, this application provides a time series prediction system based on amplitude encoding and hybrid quantum mechanics. The system includes: a first feature extraction module, used to input the time series data to be predicted into a pre-trained one-dimensional convolutional neural network, extracting local time patterns through multi-scale convolutional kernels to obtain a first feature; a quantum state preparation vector generation module, used to perform fully connected dimensionality reduction on the first feature, and perform normalization processing on the dimensionality reduction result to generate a unit vector. If the dimension after dimensionality reduction is less than a preset number of qubits, zero-padding is performed and the padding position is dynamically optimized based on a differentiable mask mechanism to obtain a quantum state preparation vector; an amplitude-encoded quantum state generation module, used to load the quantum state preparation vector onto the corresponding number of qubits through amplitude encoding to form an amplitude-encoded quantum state that meets the quantum amplitude distribution requirements; a quantum convolution processing module, used to extract quantum features from the amplitude-encoded quantum state based on a variable quantum convolutional network to obtain a target quantum state after quantum convolution processing; and a time series prediction module, used to perform sparse measurement on the target quantum state to form a quantum feature vector, and fuse it with the first feature, performing regression prediction based on the fusion result, and outputting the time series prediction result.
[0014] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the steps of the aforementioned timing prediction method based on amplitude encoding and hybrid quantum mechanics.
[0015] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: By fusing local temporal features extracted by classical convolution with high-dimensional quantum features extracted by variable quantum convolutional networks at multiple scales, a unified representation of local and global potential patterns is achieved. By combining linear mapping and nonlinear activation of fully connected layers for regression prediction, not only can complex nonlinear temporal relationships be efficiently captured, but the high-dimensional expressive power of quantum states is also fully utilized. At the same time, computational resource consumption is reduced, and the deployability and robustness of the model in edge and real-time application scenarios are improved, thereby significantly improving the accuracy, efficiency and scalability of temporal prediction. Attached Figure Description
[0016] Figure 1 This is a schematic flowchart of a timing prediction method based on amplitude encoding and hybrid quantum mechanics provided in an embodiment of this application.
[0017] Figure 2 This is a schematic diagram of a timing prediction system based on amplitude coding and hybrid quantum mechanics, provided as an embodiment of this application.
[0018] Figure 3 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0020] Example 1, Figure 1 A flowchart illustrating a time-series prediction method based on amplitude encoding and hybrid quantum mechanics, provided for embodiments of this application, includes the following steps: S1: Input the time series data to be predicted into a pre-trained one-dimensional convolutional neural network. Extract local time patterns through multi-scale convolutional kernels to obtain the first feature with dimension N.
[0021] In this embodiment, the time-series data to be predicted is input into a pre-trained one-dimensional convolutional neural network. Local temporal patterns are extracted using multi-scale convolutional kernels to obtain a first feature of dimension N, specifically: Obtain the time series data sequence to be predicted, and perform normalization preprocessing on the time series data sequence to obtain the standardized input data sequence; The input data sequence is input into the input layer of a one-dimensional convolutional neural network in chronological order, so that the input layer receives and forms an initial temporal tensor of length L and number of channels 1; Based on the initial temporal tensor, a feature extraction operation is performed using a one-dimensional convolutional group with multiple different kernel sizes, where each kernel size corresponds to a time scale, in order to extract local temporal patterns under different time spans; Nonlinear activation processing is applied to the convolution output at each kernel size to enhance the local temporal patterns extracted at different time scales in the corresponding activation units, resulting in a multi-scale activation feature set. Among them, activation functions for nonlinear activation processing (such as ReLU) enhance the expressive power of patterns.
[0022] By concatenating the multi-scale activation feature set along the channel dimension, local patterns from different time scales are fused in a unified feature space, resulting in a fused multi-scale feature tensor. Temporal pooling is performed on the fused multi-scale feature tensor to compress its temporal dimension and highlight key temporal responses, resulting in a dimensionality-reduced temporally compressed feature vector. A linear transformation is performed on the temporal compressed feature vector to adjust its dimension to a preset N dimension, thereby obtaining the first feature with dimension N.
[0023] It should be noted that multi-scale convolutional kernels are used to extract local patterns of time-series data in parallel across different time spans. Activation enhancement, channel fusion, and pooling compression are used to efficiently extract key temporal structures, enabling the model to capture both short-term mutation features and long-term trend information. Subsequently, linear mapping is used to uniformly convert the fused highly expressive features into a fixed-dimensional N-dimensional representation. This achieves the advantages of a compact structure and seamless integration with subsequent quantum state preparation while maintaining feature sufficiency, significantly improving the system's expressive power, robustness, and compatibility with quantum processing units.
[0024] S2, perform fully connected dimensionality reduction on the first feature, and perform normalization on the dimensionality reduction result to generate a unit vector so that it meets the amplitude normalization requirement of quantum amplitude encoding. If the dimensionality after dimensionality reduction is less than the preset number of qubits, zero padding is performed and the padding position is dynamically optimized based on the differentiable mask mechanism to obtain the quantum state preparation vector for quantum encoding.
[0025] In this embodiment, a fully connected dimensionality reduction is performed on the first feature, and the dimensionality reduction result is normalized to generate a unit vector, specifically as follows: Perform a fully connected operation on the first feature, and make the fully connected operation linearly map the first feature based on a preset dimensionality reduction matrix to obtain an intermediate dimensionality-reduced vector with compressed dimensions; Nonlinear activation is applied to the intermediate dimension-reduced vector to enhance the feature response after dimension reduction, thereby forming the dimension-reduced feature after activation. The sum of squares of each component of the dimensionality-reduced feature is calculated, and its L2 norm is calculated based on the sum of squares to characterize the overall magnitude of the dimensionality-reduced feature. The specific formula for calculating the sum of squares is as follows:
[0026] The L2 norm is calculated using the following formula:
[0027] In the formula, For the sum of squares, The L2 norm of the dimensionality-reduced feature represents the overall magnitude of the vector. Let be the i-th component in the dimensionality-reduced feature, represent the value of the i-th dimension of the feature, and d be the dimension size of the feature after dimensionality reduction (e.g., log2(N)).
[0028] Using the L2 norm as the normalization denominator, component-wise normalization is performed on each component of the dimensionality-reduced feature, so that each component is divided by the L2 norm, thereby generating a unit vector with an overall norm of 1.
[0029] Furthermore, if the dimension reduction is insufficient for the preset number of qubits, zero-padding is performed and the padding positions are dynamically optimized based on a differentiable masking mechanism to obtain the quantum state preparation vector for quantum encoding, specifically: Obtain the unit vector and determine the dimension of the unit vector required for the preset number of qubits. ,in( ); The actual dimension d of the unit vector is compared with the dimension of the unit vector. If the actual dimension is less than the dimension of the unit vector, it is determined that the unit vector has insufficient dimension. If the dimension is deemed insufficient, a zero vector with a length equal to the difference between the unit vector dimension and the actual dimension is constructed, and the zero vector is used as a candidate filling vector to ensure that the overall dimension after filling can meet the requirements for quantum state preparation. To optimize the insertion position of zero-padding in unit vectors, a differentiable masking mechanism is constructed, and learnable mask weights are assigned to unit vectors and candidate padding vectors based on the differentiable masking mechanism to obtain the initial masking matrix. The initial mask matrix is normalized, and the unit vector and candidate filling vector are dynamically combined based on the normalized mask weights to generate a mask-controlled filling vector sequence. Arrange the elements in the order of the fill vector sequence to form a filled vector with a length of unit vector dimension, so that the zero-fill positions can achieve the optimal layout under the control of the differentiable mask mechanism; The filled vector is normalized again to make the resulting vector satisfy the normalization condition that the overall L2 norm is 1, thereby forming a quantum state preparation vector that meets the requirements of quantum state amplitude.
[0030] Here, the number of qubits represents the number of the smallest basic units used to encode quantum states, and each qubit can simultaneously represent a superposition of 0 and 1. The differentiable masking mechanism is a trainable mechanism for dynamically determining zero-filling positions. By assigning differentiable weights (masks) to the unit vector and candidate filling vectors respectively, a differentiable mask matrix is constructed. During backpropagation training, the insertion positions of zero-filling are automatically optimized, thereby maximizing the preservation of original feature information and solving the filling problem when the feature vector lacks dimensionality after dimensionality reduction. This allows the zero-filling positions to be learned during training, rather than fixed, thus reducing information loss and improving the effectiveness of quantum state preparation vectors. The quantum state preparation vector is a vector of length... The normalized vector, after being processed by fully connected dimension reduction, normalization, and (if necessary) zero-padding, can be directly used as the input vector for quantum amplitude encoding.
[0031] It should be noted that by performing fully connected dimensionality reduction and normalization on the first feature, high-dimensional classical features can be compressed into unit vectors that meet the requirements of quantum amplitude encoding, ensuring the amplitude normalization of the input quantum circuit. At the same time, when the dimension is insufficient after dimensionality reduction, the padding position is dynamically optimized by combining zero padding with a differentiable mask mechanism, effectively preserving the original feature information and automatically adjusting the zero padding layout, thereby generating a quantum state preparation vector that matches the number of qubits. This achieves efficient matching between feature dimension and quantum resources, and improves the stability of quantum state encoding and the representation capability of subsequent quantum convolutional networks.
[0032] S3, for the quantum state preparation vector, loads it onto the corresponding number of qubits through amplitude encoding to form an amplitude-encoded quantum state that meets the quantum amplitude distribution requirements, which serves as the input quantum state for subsequent quantum variational convolution processing.
[0033] In this embodiment, the quantum state preparation vector is loaded onto a corresponding number of qubits through amplitude encoding to form an amplitude-encoded quantum state that meets the quantum amplitude distribution requirements, specifically as follows: Obtain the quantum state preparation vector after full-connection dimensionality reduction, normalization, and zero-padding, where the dimension of the quantum state preparation vector is a unit vector dimension. ; Assign a number of quantum state preparation vectors, i.e., k qubits, and map each component of the quantum state preparation vector to the corresponding ground state amplitude, so that the joint state of the qubits is represented as a combination of the amplitudes of the vector components; The state of each qubit, |0> or |1>, is formed by combining multiple qubits. Each ground state is used to prepare the components of the vector for the quantum state.
[0034] Based on a preset amplitude encoding rule, the components of the quantum state preparation vector are loaded as the amplitude of the corresponding qubit ground state to form an amplitude-encoded quantum state; The specific calculation formula for the amplitude-encoded quantum state is as follows:
[0035] In the formula, Encoding quantum states for amplitude, The i-th component of the vector is prepared for the quantum state. It is a multi-qubit ground state.
[0036] Among them, the amplitude-encoded quantum state satisfies This ensures that the overall amplitude is normalized.
[0037] S4. Based on the variable quantum convolutional network, quantum features are extracted from the amplitude-encoded quantum state to obtain the target quantum state after quantum convolution processing.
[0038] In this embodiment, quantum features are extracted from the amplitude-encoded quantum state based on a variable quantum convolutional network to obtain the target quantum state after quantum convolution processing, specifically: The amplitude-encoded quantum state is input into the input layer of a pre-trained Variable Quantum Convolutional Network (VQCNN); A feature encoding layer is set in the variable quantum convolutional network to perform initial rotation operation and entanglement operation between qubits on the amplitude encoded quantum state to generate the initial encoded quantum state. The feature coding layer achieves preliminary local feature mapping and qubit entanglement through single-bit rotation gates (such as Ry, Rz) and controlled-NOT gates.
[0039] An initial encoded quantum state is input into a quantum convolutional layer, which includes a unitary operator with trainable rotation gate parameters. The unitary operator acts on the input quantum state step by step through a hierarchical or step structure to extract local and non-local features and generate intermediate quantum states after convolutional evolution. Among them, quantum convolutional layers capture potential correlations across time steps and across feature dimensions by adjusting quantum state evolution through trainable parameters.
[0040] An entanglement enhancement structure is introduced to perform additional inter-qubit entanglement operations on the intermediate quantum state to expand the characteristic interactions across time steps, thereby generating the target quantum state after quantum convolution processing.
[0041] Entanglement enhancement structure refers to the additional layer of multi-qubit entanglement gates introduced into a quantum convolutional network to establish non-local dependencies between different qubits, thereby creating complex mutual coupling between the components of the quantum state and enhancing the global expressive power of quantum features. Entanglement enhancement structure achieves global feature coupling of quantum state by adding multi-qubit entanglement gates, thus improving the ability to model long-term dependencies.
[0042] It should be noted that by inputting amplitude-encoded quantum states into a pre-trained Variable Quantum Convolutional Network (VQCNN), the rotation gates and controlled-NOT gates of the feature encoding layer are used to achieve preliminary mapping of local features and entanglement between qubits. Then, the trainable unitary operators of the quantum convolutional layer are used to extract local and non-local features, and the entanglement enhancement structure is combined to expand the feature interaction across time steps. This enables the quantum state to efficiently capture complex temporal dependencies and potential laws in the high-dimensional Hilbert space, thereby significantly improving the quantum feature representation ability, enhancing the modeling of long-term dependencies across time steps, and providing rich and trainable quantum representations for subsequent quantum-classical collaborative processing, while taking into account both high-precision prediction and computational resource optimization.
[0043] S5 performs a sparsification measurement on the target quantum state to form a quantum feature vector, which is then fused with the first feature. Based on the fusion result, a regression prediction is performed, and the time series prediction result is output.
[0044] In this embodiment, a sparsity measurement is performed on the target quantum state to form a quantum feature vector, which is then fused with the first feature. Regression prediction is performed based on the fusion result, and a time-series prediction result is output. Specifically: Perform a sparse quantum measurement on the target quantum state to obtain The measured expected values of several key quantum features form a quantum feature vector. denoted as the dimension of the quantum eigenvector; Among them, sparsification measurement reduces measurement overhead by selecting some qubits or measurement basis, while retaining the main information, ensuring that the length of the generated quantum feature vector matches the requirements of the first feature fusion.
[0045] The quantum feature vector is spliced or aligned with the first feature along the channel dimension to form a fused feature vector.
[0046] Among them, multi-scale fusion of local and high-dimensional latent features is achieved by splicing, providing a unified representation for subsequent predictions.
[0047] Furthermore, regression prediction is performed based on the fusion results, and the time series prediction results are output, specifically: Based on a neural network, the fused feature vector is input into a fully connected layer, and a linear mapping operation is performed to obtain a preliminary prediction vector; The linear mapping maps the fused feature vectors to the output dimension using the weight matrix W and the bias b, as shown in the formula. ,in, is the initial prediction vector, and h is the fused feature vector.
[0048] For the initial prediction vector, perform a nonlinear activation transformation (such as ReLU, tanh, or sigmoid) to generate a nonlinear regression output vector.
[0049] The nonlinear regression output vector is denormalized or scaled to generate the final time series prediction results. The final time series forecast results are used as the final output for trolley load forecasting or other time series forecasting tasks.
[0050] It should be noted that by performing sparse measurement on the target quantum state to extract key quantum features, and then fusing them with the first features extracted by classical convolution at multiple scales, the local time pattern and high-dimensional potential law are represented in a unified manner. Subsequently, a fully connected layer is used to perform linear mapping and combined with nonlinear activation for regression prediction. This not only efficiently captures the complex nonlinear relationships of time series data, but also takes into account the high-dimensional expressive power of quantum information and the training efficiency of classical neural networks, achieving a dual improvement in prediction accuracy and computational resource optimization. It is suitable for engineering scenarios such as real-time tram load prediction.
[0051] Example 2, Figure 2 A schematic diagram of a timing prediction system based on amplitude encoding and hybrid quantum mechanics provided in this application embodiment includes a first feature extraction module, a quantum state preparation vector generation module, an amplitude encoding quantum state generation module, a quantum convolution processing module, and a timing prediction module. The modules are interconnected. The first feature extraction module is used to input the time series data to be predicted into a pre-trained one-dimensional convolutional neural network, and extract local time patterns through multi-scale convolutional kernels to obtain the first feature; The quantum state preparation vector generation module is used to perform fully connected dimensionality reduction on the first feature and normalize the dimensionality reduction result to generate a unit vector. If the dimension after dimensionality reduction is less than the preset number of qubits, zero padding is performed and the padding position is dynamically optimized based on the differentiable mask mechanism to obtain the quantum state preparation vector. The amplitude-encoded quantum state generation module is used to prepare a quantum state vector and load it onto the corresponding number of qubits through amplitude encoding to form an amplitude-encoded quantum state; The quantum convolution processing module is used to extract quantum features from the amplitude-encoded quantum state based on the variable quantum convolution network to obtain the target quantum state after quantum convolution processing. The timing prediction module is used to perform sparsification measurement on the target quantum state, form a quantum feature vector, fuse it with the first feature, perform regression prediction based on the fusion result, and output the timing prediction result.
[0052] Furthermore, embodiments of this application also disclose an electronic device, Figure 3 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0053] Figure 3This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the timing prediction method based on amplitude encoding and hybrid quantum principles disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0054] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here. The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0055] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0056] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device 20 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. It can be Windows Server, Netware, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing a timing prediction method based on amplitude encoding and hybrid quantum computing disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.
[0057] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0058] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.
[0059] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0060] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0061] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0062] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A time-series prediction method based on amplitude encoding and hybrid quantum mechanics, characterized in that, Includes the following steps: The time-series data to be predicted is input into a pre-trained one-dimensional convolutional neural network, and local time patterns are extracted through multi-scale convolutional kernels to obtain the first feature; The first feature is subjected to full-connection dimensionality reduction, and the dimensionality reduction result is normalized to generate a unit vector. If the dimension after dimensionality reduction is less than the preset number of qubits, zero padding is performed and the padding position is dynamically optimized based on the differentiable mask mechanism to obtain the quantum state preparation vector. The quantum state preparation vector is loaded into the corresponding number of qubits through amplitude encoding to form an amplitude-encoded quantum state; Quantum features of amplitude-encoded quantum states are extracted based on variable quantum convolutional networks to obtain the target quantum state after quantum convolution processing. A sparsity measurement is performed on the target quantum state to form a quantum feature vector, which is then fused with the first feature. Regression prediction is performed based on the fusion result, and the time series prediction result is output.
2. The time series prediction method based on amplitude encoding and hybrid quantum as described in claim 1, characterized in that, The time-series data to be predicted is input into a pre-trained one-dimensional convolutional neural network. Local temporal patterns are extracted using multi-scale convolutional kernels to obtain the first feature, specifically: Obtain the time series data sequence to be predicted and perform normalization preprocessing to obtain the standardized input data sequence; The input data sequence is fed into the input layer of a pre-trained one-dimensional convolutional neural network in chronological order to form the initial temporal tensor; Based on the initial temporal tensor, a one-dimensional convolutional group with multiple different kernel sizes is used to perform feature extraction operations, where each kernel size corresponds to a time scale, in order to extract local temporal patterns under different time spans; The convolutional output at each kernel size is subjected to non-linear activation processing to obtain a multi-scale activation feature set. The multi-scale activation feature set is concatenated along the channel dimension to obtain the fused multi-scale feature tensor; Temporal pooling is performed on the multi-scale feature tensor to obtain temporally compressed feature vectors; Perform a linear transformation on the time-compressed feature vector to obtain the first feature.
3. The time-series prediction method based on amplitude encoding and hybrid quantum as described in claim 1, characterized in that, The step of performing fully connected dimensionality reduction on the first feature and then normalizing the dimensionality reduction result to generate a unit vector is as follows: Perform a fully connected operation on the first feature, and make the fully connected operation linearly map the first feature based on a preset dimensionality reduction matrix to obtain an intermediate dimensionality-reduced vector with compressed dimensions; A nonlinear activation process is performed on the intermediate dimension-reduced vector to form dimension-reduced features; Calculate the sum of squares of each component of the dimensionality-reduced feature, and calculate its L2 norm based on the sum of squares; Based on the L2 norm, each component of the dimensionality-reduced feature is subjected to component-wise normalization to generate a unit vector.
4. The time series prediction method based on amplitude encoding and hybrid quantum as described in claim 3, characterized in that, If the dimension after dimensionality reduction is less than the preset number of qubits, zero-padding is performed and the padding position is dynamically optimized based on a differentiable mask mechanism to obtain the quantum state preparation vector, specifically: Obtain the unit vector and determine the dimension of the unit vector required for the preset number of qubits; The actual dimension of the unit vector is compared with the dimension of the unit vector. If the actual dimension is less than the dimension of the unit vector, it is determined that the unit vector has insufficient dimension. If the dimension is deemed insufficient, a zero vector with a length equal to the difference between the unit vector dimension and the actual dimension is constructed, and the zero vector is used as a candidate padding vector. A differentiable masking mechanism is constructed, and learnable mask weights are assigned to the unit vector and the candidate filling vector based on the differentiable masking mechanism to obtain the initial mask matrix; The initial mask matrix is normalized, and the unit vector and candidate filling vector are dynamically combined based on the normalized mask weights to generate a mask-controlled filling vector sequence. Arrange the elements in the order of the fill vector sequence to form a filled vector with a length of one vector dimension; The filled vector is normalized again to form a quantum state preparation vector.
5. The time-series prediction method based on amplitude encoding and hybrid quantum as described in claim 1, characterized in that, The quantum state preparation vector is loaded onto a corresponding number of qubits through amplitude encoding to form an amplitude-encoded quantum state, specifically as follows: Obtain a quantum state preparation vector and allocate a number of qubits to the quantum state preparation vector; Based on the preset amplitude encoding rules, the components of the quantum state preparation vector are loaded as the amplitude of the corresponding qubit ground state to form an amplitude-encoded quantum state.
6. The time-series prediction method based on amplitude encoding and hybrid quantum as described in claim 1, characterized in that, The process of extracting quantum features from the amplitude-encoded quantum state using a variable quantum convolutional network to obtain the target quantum state after quantum convolution processing is as follows: The amplitude-encoded quantum state is input into the input layer of a pre-trained variable quantum convolutional network; A feature encoding layer is set in the variable quantum convolutional network to perform initial rotation operation and entanglement operation between qubits on the amplitude encoded quantum state to generate the initial encoded quantum state. The initial encoded quantum state is input into the quantum convolutional layer to extract local and non-local features and generate intermediate quantum states after convolutional evolution; By introducing an entanglement enhancement structure, additional qubit-to-qubit entanglement operations are performed on the intermediate quantum state to generate the target quantum state.
7. The time series prediction method based on amplitude encoding and hybrid quantum as described in claim 6, characterized in that, The process of performing a sparsity measurement on the target quantum state to form a quantum feature vector, and then fusing it with the first feature, specifically involves: Perform sparse quantum measurements on the target quantum state to obtain the expected values of several key quantum features, forming a quantum feature vector; The quantum feature vector is spliced or aligned with the first feature along the channel dimension to form a fused feature vector.
8. The time-series prediction method based on amplitude encoding and hybrid quantum as described in claim 1, characterized in that, The step of performing regression prediction based on the fusion result and outputting time-series prediction results is as follows: Based on a neural network, the fused feature vector is input into a fully connected layer, and a linear mapping operation is performed to obtain a preliminary prediction vector; For the initial prediction vector, perform a nonlinear activation transformation to generate a nonlinear regression output vector. The nonlinear regression output vector is denormalized or scaled to generate the final time series prediction result. The final time series forecast results are used as the final output for trolley load forecasting or other time series forecasting tasks.
9. A system using the time-series prediction method based on amplitude encoding and hybrid quantum as described in any one of claims 1-8, characterized in that, include: The first feature extraction module is used to input the time series data to be predicted into a pre-trained one-dimensional convolutional neural network, and extract local time patterns through multi-scale convolutional kernels to obtain the first feature; The quantum state preparation vector generation module is used to perform fully connected dimensionality reduction on the first feature and normalize the dimensionality reduction result to generate a unit vector. If the dimension after dimensionality reduction is less than the preset number of qubits, zero padding is performed and the padding position is dynamically optimized based on the differentiable mask mechanism to obtain the quantum state preparation vector. The amplitude-encoded quantum state generation module is used to prepare a quantum state vector and load it onto the corresponding number of qubits through amplitude encoding to form an amplitude-encoded quantum state; The quantum convolution processing module is used to extract quantum features from the amplitude-encoded quantum state based on the variable quantum convolution network to obtain the target quantum state after quantum convolution processing. The timing prediction module is used to perform sparsification measurement on the target quantum state, form a quantum feature vector, fuse it with the first feature, perform regression prediction based on the fusion result, and output the timing prediction result.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the timing prediction method based on amplitude coding and hybrid quantum as described in any one of claims 1 to 8.