Data processing method and apparatus, quantum computing device, readable storage medium, and program product
By reconstructing phase space and adapting the configuration of quantum networks, the problems of high computational complexity and insufficient generalization ability in time series data processing are solved, achieving efficient state prediction and resource utilization, and adapting to dynamic adjustment under different market conditions.
Patent Information
- Application Number
- CN202611157412.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-11-03
AI Technical Summary
Existing time series data processing methods suffer from high computational complexity and insufficient generalization ability when dealing with low signal-to-noise ratio, volatile clustering, and non-stationary data. This is especially true in high-frequency trading and real-time risk control scenarios, where the classic Transformer model struggles to effectively remove high-dimensional random noise, leading to resource waste and low prediction accuracy.
One-dimensional time series are extended into a high-dimensional state feature vector matrix by phase space reconstruction, and dimensionality reduction is performed using intrinsic dimensions. Combined with the adaptive configuration of quantum networks, including dynamic adjustment of the number of qubits and the depth of line evolution, a quantum self-attention mechanism is constructed to capture the core geometric structure and long-range dependencies of the data.
It improves the prediction accuracy and resource allocation efficiency of time series data, reduces computational overhead, enhances the model's generalization ability in complex environments, and adapts to dynamic adjustments under different market conditions.
Smart Images

Figure CN123030870A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quantum computing, and in particular to a data processing method, apparatus, quantum computing device, readable storage medium, and program product. Background Technology
[0002] Time series data with low signal-to-noise ratio, volatile clustering, and non-stationarity exhibit highly complex nonlinear dynamic characteristics, making accurate prediction of them quite difficult.
[0003] Early statistical models, such as the autoregressive moving average model and the generalized autoregressive conditional heteroscedasticity model, relied on the stationarity assumption, making it difficult to fully exploit the deep nonlinear correlations inherent in time series data. With the development of deep learning technology, the Transformer architecture, with its attention mechanism at its core, has been widely used in time series data prediction due to its ability to model long-range dependencies. However, when time series data exhibits massive volume and high-frequency updates, the classic Transformer's self-attention mechanism faces the challenge of computational complexity increasing quadratically with the sequence length, leading to a significant computational bottleneck. Furthermore, time series data typically contains a large amount of random walk noise, and conventional deep learning models lack the geometric perception of the data's intrinsic manifold structure. Their strong fitting characteristics easily lead to the model misclassifying high-dimensional disordered noise as valid features for learning. This overfitting phenomenon significantly weakens the model's generalization ability in out-of-sample testing or real-world applications.
[0004] Therefore, there is an urgent need for a data processing method that can improve the accuracy and efficiency of resource allocation for processing time series data with low signal-to-noise ratio, fluctuating clustering, and non-stationarity. Summary of the Invention
[0005] Therefore, in response to the aforementioned technical problems, this application provides a data processing method, apparatus, quantum computing device, readable storage medium, and program product that can improve the accuracy and resource allocation efficiency of time series data processing with low signal-to-noise ratio, fluctuation clustering, and non-stationarity.
[0006] In a first aspect, this application provides a data processing method, including:
[0007] Obtain the time series of state observation data of the target object, wherein the time series of state observation data includes state observation data at multiple historical moments;
[0008] Based on the target time length, the phase space of the state observation data time series is reconstructed to obtain a state feature vector matrix, wherein each state feature vector in the state feature vector matrix includes the state observation data within the target time length;
[0009] The intrinsic dimension of the state feature vector matrix is determined based on the correlation between the state feature vectors in the state feature vector matrix.
[0010] The state feature vector matrix is reduced in dimension to obtain the reduced state feature vector matrix.
[0011] Based on the intrinsic dimension, the number of qubits in the quantum network and the depth of the quantum circuit evolution layer are determined.
[0012] The reduced state feature vector matrix is input into the quantum network so that the quantum network outputs the state prediction data of the target object based on the number of qubits and the depth of the quantum circuit evolution layer.
[0013] In some embodiments, determining the intrinsic dimension of the state feature vector matrix based on the correlation between the state feature vectors in the state feature vector matrix includes:
[0014] Calculate the first nearest neighbor distance between each state feature vector in the state feature vector matrix and the first nearest neighbor state feature vector, and the second nearest neighbor distance between each state feature vector and the second nearest neighbor state feature vector;
[0015] Based on the first nearest neighbor distance and the second nearest neighbor distance corresponding to each state feature vector, the distance ratio corresponding to each state feature vector is determined;
[0016] Based on the statistical distribution characteristics of the distance ratios corresponding to each state feature vector, the intrinsic dimension of the state feature vector matrix is determined.
[0017] In some embodiments, the dimensionality reduction processing of the state feature vector matrix to obtain the dimensionality-reduced state feature vector matrix includes:
[0018] The state feature vector matrix is decomposed to obtain multiple feature vectors and the feature values corresponding to each of the multiple feature vectors.
[0019] Based on the magnitude relationship of the feature values corresponding to each of the multiple feature vectors, the multiple feature vectors are sorted.
[0020] Determine a specific number of target feature vectors from the sorted plurality of feature vectors;
[0021] Based on the target feature vector, the state feature vector matrix is transformed to obtain the dimensionality-reduced state feature vector matrix.
[0022] In some embodiments, determining the number of qubits and the quantum circuit evolution depth of the quantum network based on the intrinsic dimension includes:
[0023] Based on the intrinsic dimension and the preset mapping relationship, the number of target qubits and the depth of the target quantum circuit evolution layer required for the quantum network are determined, wherein the preset mapping relationship includes the mapping relationship between the number of target qubits and the depth of the target quantum circuit evolution layer and the intrinsic dimension.
[0024] Adjust the number of qubits in the quantum network to the target number of qubits;
[0025] The quantum circuit evolution layer depth of the quantum network is adjusted to the target quantum circuit evolution layer depth.
[0026] In some embodiments, inputting the dimensionality-reduced state feature vector matrix into the quantum network, so that the quantum network outputs state prediction data of the target object based on the number of qubits and the depth of the quantum circuit evolution layer, includes:
[0027] Each state feature vector in the reduced-dimensional state feature vector matrix is encoded as the initial quantum state of the quantum network;
[0028] The initial quantum state is evolved through the qubit gates of the quantum network to obtain the evolved quantum state; wherein, the qubit gates include single-qubit rotation gates and controlled NOT gates;
[0029] The evolved quantum state is measured to obtain the measurement result;
[0030] Based on the measurement results, the state prediction data of the target object is determined.
[0031] In some embodiments, after inputting the dimensionality-reduced state feature vector matrix into the quantum network, so that the quantum network outputs state prediction data of the target object based on the number of qubits and the depth of the quantum circuit evolution layer, the process includes:
[0032] The first measurement result of each parameter to be updated of the quantum network after being offset by a preset angle in the positive direction, and the second measurement result after being offset by a preset angle in the negative direction are obtained respectively.
[0033] Based on the first measurement result and the true label of the target object, a first loss value is determined, and based on the second measurement result and the true label, a second loss value is determined.
[0034] Based on the first loss value and the second loss value, the gradient of the corresponding parameter to be updated is determined;
[0035] The parameters of the quantum network to be updated are updated according to their gradients.
[0036] Secondly, this application also provides a data processing apparatus, comprising:
[0037] The data acquisition module is used to acquire the time series of state observation data of the target object, which includes state observation data at multiple historical moments.
[0038] The phase space reconstruction module is used to reconstruct the phase space of the state observation data time series based on the target time length to obtain a state feature vector matrix, wherein each state feature vector in the state feature vector matrix includes the state observation data within the target time length.
[0039] The intrinsic dimension determination module is used to determine the intrinsic dimension of the state feature vector matrix based on the correlation between each state feature vector in the state feature vector matrix.
[0040] The dimension reduction processing module is used to perform dimension reduction processing on the state feature vector matrix to obtain the dimension-reduced state feature vector matrix.
[0041] A quantum network determination module is used to determine the number of qubits and the depth of the quantum circuit evolution layer of the quantum network based on the intrinsic dimension.
[0042] A quantum network processing module is used to input the dimensionality-reduced state feature vector matrix into the quantum network, so that the quantum network outputs the state prediction data of the target object based on the number of qubits and the depth of the quantum circuit evolution layer.
[0043] Thirdly, this application also provides a quantum computing device, including a memory, a processor, and a quantum network, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the above-mentioned embodiments.
[0044] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0045] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the above claims.
[0046] The aforementioned data processing methods, apparatus, computer equipment, computer-readable storage media, and computer program products expand a one-dimensional time series into a high-dimensional state feature vector matrix through phase space reconstruction, enabling a more comprehensive capture of the temporal state evolution of the target object. By reducing the dimensionality of the state feature vector matrix, the data is projected from the original high-dimensional space to the core low-dimensional manifold. In this low-dimensional space, redundant components unrelated to the core manifold are removed, while the core geometric structure that plays a dominant role in state evolution is retained, thereby improving the accuracy of state prediction. By determining the number of qubits and the evolution layer depth of the quantum circuit based on the intrinsic dimension, the structure of the quantum network can be adaptively configured according to the inherent complexity of the data, thereby reducing the computational overhead in the quantum network processing. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating the data processing method in some embodiments;
[0049] Figure 2 This is a flowchart illustrating step 130 in some embodiments;
[0050] Figure 3 This is a flowchart illustrating step 140 in some embodiments;
[0051] Figure 4 This is a flowchart illustrating the manifold sensing and noise reduction based on TwoNN in some embodiments;
[0052] Figure 5 This is a flowchart illustrating step 150 in some embodiments;
[0053] Figure 6 This is a flowchart illustrating the process of dynamic mapping of variable quantum architecture driven by intrinsic dimension (ID) in some embodiments;
[0054] Figure 7 This is a flowchart illustrating step 160 in some embodiments;
[0055] Figure 8 This is a flowchart illustrating the Gadget gate quantum attention mechanism for suppressing barren plateaus in some embodiments;
[0056] Figure 9This is a schematic diagram of the parameter offset closed-loop optimization and prediction execution process in some embodiments;
[0057] Figure 10 This is a schematic diagram of the process from financial data input to prediction result output and closed-loop iteration in some embodiments;
[0058] Figure 11 This is a structural block diagram of the data processing apparatus in some embodiments. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0061] Financial time series data is characterized by low signal-to-noise ratio, volatility clustering, and non-stationarity, making accurate prediction of asset trends such as stock prices challenging. Among related technologies, the Transformer architecture, with its attention mechanism at its core, is used for predicting the interconnectedness of multiple financial assets. However, in high-frequency trading and real-time risk control scenarios, financial data is characterized by massive volume and high-frequency updates. Furthermore, financial time series data contains significant random walk noise, which significantly diminishes the model's generalization ability in out-of-sample testing or real-world trading environments. To overcome these limitations in computing power and architecture, quantum computing methods, with their exponential state space and high-dimensional parallel processing capabilities, have been gradually introduced. In particular, using noisy medium-scale quantum (NISQ) devices, quantum neural networks constructed using quantum superposition and entanglement properties can extract complex financial manifold features at a relatively low parameter scale, thus providing a new technical path to alleviate the computational complexity and noise interference of classical sequence models.
[0062] In existing stock price sequence prediction engineering practices, financial prediction algorithms based on the classic Transformer architecture (whose fundamental theory originates from the attention mechanism framework proposed by Vaswani et al. in 2017 and related financial derivative models) typically involve the following technical implementation process: First, the system extracts multi-dimensional basic price and volume indicators and financial technical factors of the underlying asset and performs data preprocessing such as standardization. Since the Transformer lacks an inherent structure for sequential time series modeling, this approach utilizes sine and cosine functions to construct positional encoding, superimposing the absolute or relative position information of timestamps into the feature vector. In the feature extraction stage, the algorithm employs a multi-head self-attention mechanism, linearly mapping the input sequence to query, key, and value matrices using a weight matrix, and calculating the correlation weights between time nodes within the sequence using scaled dot products to assess the global dependencies between features at different historical moments. The calculated feature vectors are then input into a feedforward neural network for nonlinear transformation, supplemented by residual connections and layer normalization to maintain gradient stability. After stacking a fixed number of encoder layers, the hidden layer output is decoded by a fully connected layer to obtain the stock price value or trend probability within the target time window. While this scheme has the advantage of handling long-range dependencies, it has significant limitations in practical applications: Firstly, its network structure parameters (such as the number of network layers and the allocation of computational resources) are statically fixed before training, making it impossible to dynamically adjust the computational complexity according to market fluctuations. Secondly, the linear positional encoding and dot product attention mechanism lack the ability to topologically filter low signal-to-noise ratio data, failing to geometrically remove high-dimensional random noise outside the financial manifold. This results in a large amount of computational resources being consumed in fitting noisy data, thereby weakening the model's generalization performance in complex market environments.
[0063] Based on this, embodiments of this application provide a data processing method that can be applied to a processor in a quantum computing device, which also includes a quantum network. Figure 1 As shown, the method includes steps 110 to 160. Wherein:
[0064] Step 110: Obtain the time series of state observation data of the target object. The time series of state observation data includes state observation data at multiple historical moments.
[0065] The target object can be a target resource, a target product, etc. For example, the target object can be stocks, bonds, energy products, etc.
[0066] For example, time series of state observation data for a target object across multiple dimensions can be obtained. The time series of state observation data for each dimension includes state observation data from multiple historical moments within that dimension. For instance, the time series of state observation data could be financial data. The time series of state observation data across multiple dimensions could include time series of attribute values (such as price, opening price, closing price, highest price, lowest price, etc.) and time series of transfer quantities (such as trading volume, open interest, etc.).
[0067] Step 120: Based on the target time length, the phase space of the state observation data time series is reconstructed to obtain the state feature vector matrix. Each state feature vector in the state feature vector matrix includes the state observation data within the target time length.
[0068] Phase space reconstruction refers to the process of mapping one-dimensional time series data to a higher-dimensional space using embedding techniques to recover the state-space structure of the original dynamical system. The theoretical basis of phase space reconstruction is Takens' embedding theorem, which states that for a one-dimensional observed time series, a higher-dimensional state space topologically equivalent to the original dynamical system can be reconstructed by using appropriate embedding dimensions and time delays. The target time length refers to the span of the time window used to construct a single state feature vector, which determines the embedding dimension of the phase space reconstruction.
[0069] For example, the phase space of the time series of state observations can be reconstructed by a sliding time window to obtain a state feature vector matrix. The state feature vector matrix consists of multiple state feature vectors, and each state feature vector corresponds to a time window position.
[0070] In one possible implementation, a sliding window technique can be used for one-dimensional time series. Perform phase space reconstruction; set the embedding dimension as... The time delay is ,exist High-dimensional state feature vector reconstructed at each moment It can be represented as:
[0071] (1)
[0072] Thus, the original one-dimensional time series is mapped to... A high-dimensional phase space matrix (i.e., state feature vector matrix) composed of points. In practical applications, the embedding dimension m can be set empirically or determined using the False Nearest Neighbors (FNN) method, and the time delay τ can be determined using the autocorrelation function or mutual information method. For multi-dimensional state observation data (such as data containing both price and trading volume), the reconstructed vectors of each dimension can be concatenated to form a higher-dimensional state feature vector matrix.
[0073] Step 130: Determine the intrinsic dimension of the state feature vector matrix based on the correlation between the state feature vectors in the state feature vector matrix.
[0074] Intrinsic dimension (ID) refers to the true degrees of freedom of high-dimensional data implicitly contained within a low-dimensional manifold; that is, the minimum number of independent variables required to characterize the essential structure of the data. In time series analysis, intrinsic dimension reflects the number of core factors driving the evolution of the system. Correlation refers to the geometric proximity or statistical dependence between state eigenvectors in the state eigenvector matrix, used to measure the density of data points in high-dimensional space.
[0075] For example, the intrinsic dimension of the state feature vector matrix can be determined based on algorithms such as TwoNN, Principal Component Analysis (PCA), or Moment Estimation (MOM).
[0076] Step 140: Dimensionality reduction is performed on the state feature vector matrix to obtain the dimensionality-reduced state feature vector matrix.
[0077] Dimensionality reduction refers to the process of projecting a high-dimensional state feature vector matrix onto a low-dimensional subspace spanned by the core feature vectors, in order to remove redundant information and high-frequency noise that are orthogonal to the intrinsic structure of the data.
[0078] For example, the state feature vector matrix can be dimensionality reduced based on the intrinsic dimension or a preset dimension. In one possible implementation, an orthogonal projection method based on the intrinsic dimension can be used for dimensionality reduction.
[0079] Step 150: Based on the intrinsic dimension, determine the number of qubits in the quantum network and the depth of the quantum circuit evolution layer.
[0080] In this context, a quantum network refers to a computational model built upon the principles of quantum mechanics. It consists of parameterized quantum circuits (PQCs) containing tunable parameters. A quantum network can be a quantum neural network (such as a quantum Transformer), utilizing variable quantum circuits to replace or enhance specific functional modules in a classical neural network. The evolution depth of a quantum circuit refers to the number of cascaded layers of parametric entangled gates (such as controlled rotation gates) in a parameterized quantum circuit, which determines the quantum network's ability to capture nonlinear many-body correlations between features.
[0081] For example, when the intrinsic dimension is in the low threshold range, fewer qubits can be allocated and shallow circuitry can be used; when the intrinsic dimension is in the high threshold range, more qubits can be activated and the circuitry depth can be increased.
[0082] Step 160: Input the dimensionality-reduced state feature vector matrix into the quantum network so that the quantum network outputs the state prediction data of the target object based on the number of qubits and the depth of the quantum circuit evolution layer.
[0083] In this context, the quantum network can be an attention mechanism neural network incorporating the characteristics of quantum computing, utilizing variable quantum circuits (VQC) to replace or enhance the self-attention and feedforward network modules in the classical Transformer. The quantum self-attention mechanism can refer to a hybrid model architecture that uses the unitary transformation properties of quantum circuits and quantum state overlap to simulate the attention allocation mechanism in the classical Transformer, used to capture long-range logical relationships between sequence elements. State prediction data can include attribute values (such as price).
[0084] For example, after inputting the dimensionality-reduced state feature vector matrix into the quantum network, the quantum network can encode each state feature vector into a quantum state, perform unitary transformation evolution on the quantum state through parameterized quantum circuits to extract the correlation information between features, perform projection measurement on the evolved quantum state to obtain the measurement result, and map the measurement result into the state prediction data of the target object through affine transformation.
[0085] The aforementioned data processing method expands a one-dimensional time series into a high-dimensional state feature vector matrix through phase space reconstruction, enabling a more comprehensive capture of the temporal state evolution of the target object. By reducing the dimensionality of the state feature vector matrix, the data is projected from the original high-dimensional space to the core low-dimensional manifold. In this low-dimensional space, redundant components unrelated to the core manifold are removed, while the core geometric structure that plays a dominant role in state evolution is retained, thereby improving the accuracy of state prediction. By determining the number of qubits and the evolution layer depth of the quantum circuit based on the intrinsic dimension, the structure of the quantum network can be adaptively configured according to the inherent complexity of the data, thereby reducing the computational overhead in the quantum network processing.
[0086] In one exemplary embodiment, the TwoNN algorithm can be used to derive the intrinsic dimension using local distance ratios. ,like Figure 2 As shown, step 130 includes:
[0087] Step 310: Calculate the first nearest neighbor distance between each state feature vector in the state feature vector matrix and the first nearest neighbor state feature vector, and the second nearest neighbor distance between each state feature vector and the second nearest neighbor state feature vector.
[0088] Here, the first nearest neighbor state feature vector is the state feature vector that is closest to the current state feature vector, and the second nearest neighbor state feature vector is the state feature vector that is second closest to the current state feature vector. The distance metric can be Euclidean distance.
[0089] For example, for any feature point in the state feature vector matrix X We can calculate the Euclidean distance from a feature point to all other feature points in the matrix, and determine the feature point with the smallest distance as the first nearest neighbor feature vector, and the feature point with the second smallest distance as the second nearest neighbor feature vector. Calculation The Euclidean distance to the feature vector of its first nearest neighbor state is denoted as the first nearest neighbor distance. .calculate The Euclidean distance to the feature vector of its second nearest neighbor state is denoted as the second nearest neighbor distance. .
[0090] Step 320: Determine the distance ratio corresponding to each state feature vector based on the first nearest neighbor distance and the second nearest neighbor distance corresponding to each state feature vector.
[0091] For example, for any feature point its second nearest neighbor distance Divide by the distance to the first nearest neighbor The distance ratio corresponding to this feature point is obtained:
[0092] (2)
[0093] in, Representing feature points The geometric distribution characteristic within a local neighborhood, with a value greater than or equal to 1.
[0094] Step 330: Determine the intrinsic dimension of the state feature vector matrix based on the statistical distribution characteristics of the distance ratios corresponding to each state feature vector.
[0095] Among them, statistical distribution characteristics refer to the probability distribution shape of the distance ratio μ on all state feature vectors.
[0096] For example, when the data is uniformly distributed within a very small local neighborhood, the distance ratio μ follows a Pareto distribution, and its cumulative probability distribution function is... With intrinsic dimension The following parsing relationship is satisfied:
[0097] (3)
[0098] Taking the logarithm of both sides of the above equation, we get:
[0099] (4)
[0100] In practical applications, the distance ratio can be calculated from all N state feature vectors. Statistical analysis is performed, and the intrinsic dimension is solved using Maximum Likelihood Estimation (MLE). :
[0101] (5)
[0102] Alternatively, a Pareto distribution curve can be fitted based on the distance ratios corresponding to the eigenvectors of each state, and the intrinsic dimension can be determined through linear regression in logarithmic coordinates. and Perform a linear fit, and the absolute value of the fit slope is the intrinsic dimension. .
[0103] In this embodiment, by measuring the intrinsic complexity of the state feature vector matrix from the local geometric structure, without the need for a preset subjective threshold, it is possible to adaptively extract the core degrees of freedom of the manifold structure for different types of target objects, thereby improving the versatility and robustness of subsequent data processing.
[0104] In one exemplary embodiment, such as Figure 3 As shown, step 140 includes:
[0105] Step 410: Decompose the state feature vector matrix to obtain multiple feature vectors and their corresponding feature values.
[0106] Among them, the feature values are used to represent the magnitude of the data variance in each feature vector direction.
[0107] For example, singular value decomposition or eigenvalue decomposition can be performed on the covariance matrix of the state eigenvector matrix, or singular value decomposition can be performed on the state eigenvector matrix.
[0108] For example, for the state eigenvector matrix within a local time window, its covariance matrix can be calculated; then, singular value decomposition (SVD) can be performed on the covariance matrix to obtain the set of eigenvectors. and the corresponding eigenvalues The covariance matrix represents the degree of linear correlation between the dimensions of the state feature vector matrix. Eigenvalues represent the variance of the data along the corresponding feature vector direction; larger eigenvalues indicate a more dispersed data distribution and contain more information in that direction.
[0109] Step 420: Sort the multiple feature vectors based on the magnitude relationship of their respective feature values.
[0110] Step 430: Determine a specific number of target feature vectors from the sorted feature vectors.
[0111] The target feature vector refers to the feature vector selected from the sorted feature vectors that corresponds to the larger feature value. The larger feature value is used to characterize the main variance contribution direction in the data distribution, that is, the principal component direction of the corresponding state feature vector matrix.
[0112] For example, the specific number is determined by the intrinsic dimension. For instance, it can be a set of feature vectors. The eigenvectors in the model are arranged according to the magnitude of their corresponding eigenvalues; then the intrinsic dimensions are... As the cutoff criterion, the preceding... The eigenvectors are used as the principal eigenvectors. Indicates the intrinsic dimension Rounding to the nearest integer, when When the value is less than 1, the value is 1 to ensure that at least one main feature vector is retained.
[0113] Alternatively, the previous option can also be selected. The eigenvectors are used as the principal eigenvectors. Indicates the intrinsic dimension Round down to the nearest integer.
[0114] Step 440: Based on the target feature vector, transform the state feature vector matrix to obtain the dimensionality-reduced state feature vector matrix.
[0115] For example, each state feature vector in the state feature vector matrix can be projected onto the space spanned by the principal feature vector to obtain the dimensionality-reduced state feature vector matrix.
[0116] For example, for the state eigenvectors in the state eigenvector matrix The result of projecting it onto the space spanned by the principal eigenvectors is:
[0117] (6)
[0118] in, Represents the state feature vector In the principal feature vector Projected components (i.e., inner product) in the direction. This represents the vector representation of the projected component in the original space. For all state eigenvectors... Performing the above projection operation yields the dimensionality-reduced state feature vector matrix. .
[0119] It is understandable that, through the above projection operation, the original state feature vector is projected to a feature index greater than [a certain value]. The high-dimensional components along the eigenvector directions are forcibly discarded. These discarded high-dimensional components correspond to the directions with smaller eigenvalues in the covariance matrix, that is, the dimensions with smaller variance and less information in the data distribution. Their physical meaning corresponds to random walk noise.
[0120] In one possible implementation, please refer to Figure 4 , Figure 4This is a flowchart illustrating the manifold perception and noise reduction based on TwoNN in some embodiments. The process includes steps 1 to 6, where: Step 1, Phase Space Reconstruction: The acquired one-dimensional time series is mapped to a high-dimensional space using a sliding window technique to obtain a high-dimensional state feature matrix. Step 2, Distance Ratio Calculation: In the high-dimensional state feature matrix, the Euclidean distance between each feature point and its first and second nearest neighbor feature points is calculated, and the ratio of the second nearest neighbor distance to the first nearest neighbor distance is calculated to obtain the distance ratio corresponding to each feature point. Step 3, Dimension ID Extraction: Based on the distance ratio corresponding to each feature point, a Pareto distribution is fitted, and the intrinsic dimension ID of the current local data manifold is extracted through linear regression or maximum likelihood estimation in logarithmic coordinates. Step 4, Singular Value Decomposition (SVD): The high-dimensional state feature matrix or its covariance matrix within the local time window is subjected to singular value decomposition to obtain a set of feature vectors arranged in order of eigenvalue magnitude. Step 5, Orthogonal Dimension Truncation: Using the intrinsic dimension ID extracted in Step 3 as the truncation criterion, select the first ID eigenvectors from the arranged eigenvectors as the target eigenvectors. High-dimensional eigenvectors with feature indices greater than ID are forcibly discarded. Step 6, Core Manifold Projection: Project each state eigenvector in the high-dimensional state eigenma matrix onto the low-dimensional subspace spanned by the target eigenvectors to obtain the dimensionality-reduced state eigenvector matrix.
[0121] In this embodiment, by adaptively reducing the dimensionality of the state feature vector matrix using the intrinsic dimension as a hard truncation benchmark, without relying on manually set variance thresholds or other empirical parameters, the dimensionality of the reduced representation can be adaptively determined for the data distribution of different target objects. This reduces the data dimensionality while retaining the main information, effectively suppressing the risk of overfitting in subsequent processing. Specifically, the preceding... The intrinsic dimensions constitute the core manifold surface that determines the movement of financial asset prices, while the higher-dimensional components orthogonal to it correspond to random walk noise in the financial market. By orthogonal projection based on intrinsic dimensions, redundant noise can be geometrically removed without human intervention or prior assumptions, providing high-purity and effective feature signals for subsequent quantum networks.
[0122] In current noisy medium-scale quantum (NISQ) devices, qubits and coherence time are scarce computational resources. Therefore, in an exemplary embodiment, such as... Figure 5 As shown, step 150 includes:
[0123] Step 510: Based on the intrinsic dimension and the preset mapping relationship, determine the number of target qubits and the depth of the target quantum circuit evolution layer required for the quantum network. The preset mapping relationship includes the mapping relationship between the number of target qubits and the depth of the target quantum circuit evolution layer and the intrinsic dimension.
[0124] For example, the preset mapping relationship may include a positive correlation between the number of target qubits and the intrinsic dimension. For instance, if the maximum number of usable qubits in the target quantum chip is represented as... The basic guarantee bit count is expressed as The number of target qubits This can be determined through the following mapping relationship:
[0125] (7)
[0126] in, This is a hardware feature scaling factor. This indicates rounding up. This mapping can represent the target number of qubits. With intrinsic dimension They are positively correlated.
[0127] The evolution of quantum circuits is deep. This determines the model's ability to capture nonlinear multi-body relationships between features. If If the value is too large, it will lead to overfitting of parameters and induce decoherence; if If the depth is too small, the expressive power is limited. Therefore, the pre-defined mapping relationship can include a positive correlation between the depth of quantum circuit evolution and the intrinsic dimension. For example, the depth of quantum circuit evolution... It can be set to be about the intrinsic dimension The step function or logarithmic growth function line. For example, the depth of the road evolution layer. This can be determined through the following mapping relationship:
[0128] (8)
[0129] in, This refers to the number of basic evolutionary layers (such as the number of basic multi-head attention evolutionary layers). The intrinsic dimension threshold that triggers depth expansion, This is the step size parameter for increasing the number of layers. This indicates rounding down. It's understandable that when the intrinsic dimension... Less than or equal to the threshold At that time, the line layer depth remains the basic evolution layer number. When the intrinsic dimension Exceeding the threshold At that time, the line layer depth increases with the logarithm of the intrinsic dimension. This mapping relationship can represent the evolution layer of the target line. Depth and intrinsic dimension They are positively correlated.
[0130] Step 520: Adjust the number of qubits in the quantum network to the target number of qubits.
[0131] For example, the target number of qubits can be determined. It sends configuration instructions to the underlying quantum processor to allocate the corresponding number of logical qubits.
[0132] Step 530: Adjust the quantum circuit evolution layer depth of the quantum network to the target quantum circuit evolution layer depth.
[0133] For example, a variable quantum circuit topology with L layers of parametric entangled gates can be constructed based on a determined target quantum circuit evolution layer depth L.
[0134] Specifically, when the sliding window moves into a range of data complexity fluctuations (such as during periods of financial market volatility), the compiler can issue instructions to the underlying quantum processor in real time to dynamically chain together more parametric entanglement gates (such as controlled rotation gates). , (etc.) to extend the line; and when the data enters a stable range (such as when the market enters a stable period), the excess variable layering is forcibly truncated, degenerating into a shallow quantum network.
[0135] In one possible implementation, please refer to Figure 6 , Figure 6 This is a flowchart illustrating the dynamic mapping process of variable quantum architecture driven by intrinsic dimension (ID) in some embodiments. The process includes steps 1 to 6, where: Step 1, Receiving Feedforward ID: Obtaining the intrinsic dimension ID output by the manifold sensing layer as the control variable for dynamic mapping of the architecture. Step 2, Calculating Bit Allocation: Calculating and allocating the required number of logical qubits based on the received intrinsic dimension ID and the hardware constraints of the target quantum chip through a preset mapping relationship. This mapping relationship includes a positive correlation between the number of qubits and the intrinsic dimension. Step 3, Adaptive Encoding Strategy: Adaptively switching the quantum state encoding strategy according to the allocated number of qubits. This strategy includes various quantum state encoding methods such as angle encoding or amplitude encoding to adapt to different scales of qubit resources. Step 4, Calculating Line Depth L: Calculating the required variable quantum line evolution depth L using a logarithmic step function or a step function based on the intrinsic dimension ID. This mapping relationship indicates that the depth of quantum circuit evolution layers is positively correlated with the intrinsic dimension. When the intrinsic dimension is lower than or equal to a preset threshold, the circuit layer depth remains the basic evolution layer number; when the intrinsic dimension exceeds the preset threshold, the circuit layer depth increases with the logarithm of the intrinsic dimension. Step 5, Topology Reconstruction: Based on the calculated target number of qubits and the depth of quantum circuit evolution layers, the parametric entanglement layers in the variable quantum circuit are adaptively added or removed to reconstruct the topology of the quantum network. Step 6, Issuing Compilation Instructions: The reconstructed quantum network topology is compiled into control instructions executable by the underlying quantum processor and issued to the underlying quantum hardware devices to execute subsequent quantum state evolution and computation tasks.
[0136] In this embodiment, by quantizing and mapping the data geometric complexity index to quantum hardware resource configuration parameters, the structural complexity of the quantum network can be matched with the intrinsic complexity of the input data. This reduces the computational resource overhead caused by redundant configuration while ensuring sufficient expressive power of the quantum network, improving the utilization efficiency of quantum computing resources. It avoids the mismatch between computational resources and data complexity caused by the static fixation of network topology architecture (such as the number of qubits and network layer depth) in traditional quantum deep learning models before model training. Specifically, when processing non-stationary financial time series, traditional static networks often face the dual dilemma of wasted computing power and overfitting during stationary periods, and insufficient computing power and underfitting during oscillating periods. This embodiment transforms the underlying geometric complexity index (i.e., intrinsic dimension) of financial data into the underlying hardware compilation instructions of the quantum computer, achieving a match between scarce qubit resources and dynamic market complexity. It reduces unnecessary quantum gate operations to delay system decoherence and, by actively reducing the model hypothesis space of low-dimensional data, suppresses the overfitting of the quantum network to random noise.
[0137] When constructing time-series attention mechanisms based on Variable Quantum Circuits (VQC), traditional schemes typically employ high-order many-body global entanglement gates to directly calculate the correlation weights between global nodes in the time series. However, as network depth and the number of qubits increase, such global evolution causes the system to rapidly approach a unitary 2-design, resulting in an exponential decay of the gradient variance of the objective function, triggering the "Barren Plateau (BP)" effect, which renders classical optimizers ineffective. In an exemplary embodiment, a quantum self-attention architecture embedding controlled Gadget gates can be used to break the BP effect through entanglement localization and parameter binding. Figure 7 As shown, step 160 includes:
[0138] Step 610: Encode each state feature vector in the reduced-dimensional state feature vector matrix into the initial quantum state of the quantum network.
[0139] For example, angle encoding can be used to directly map each component in the dimensionality-reduced state feature vector to the rotation angle of a single qubit. This involves applying a single-qubit rotation gate to each qubit and representing the feature data with the rotation angle value. This encoding method has shallow circuit depth and strong robustness to decoherent noise. By utilizing... 1 qubit The exponential capacity of the Widhillbert space allows for the parallel compression of complex high-dimensional features into the probability amplitude of quantum states.
[0140] Alternatively, amplitude encoding can be used to encode the normalized state feature vector after dimensionality reduction into the probability amplitude of the quantum state.
[0141] Step 620: The initial quantum state is evolved through the qubit gates of the quantum network to obtain the evolved quantum state; wherein, the qubit gates include single-qubit rotation gates and controlled NOT gates.
[0142] For example, the evolution of each layer of a quantum network includes: applying a single-qubit rotation gate to each qubit; and then establishing entanglement between adjacent qubits through a controlled NOT gate (CNOT gate) to achieve interaction between features.
[0143] Optionally, to prevent gradient vanishing in deep quantum networks, single-qubit rotation gates corresponding to the same time step within the same evolution layer can be bound to the same parameters, i.e., forcibly sharing the same set of trainable angle parameters. These parameters are trainable and updated iteratively during training. The parameter sharing mechanism mathematically restricts the dynamic Lie algebra dimension of the variable quantum network generation, ensuring that the lower bound of the gradient variance satisfies polynomial decay, thus guaranteeing the trainability of deep quantum networks.
[0144] For example, within the same evolutionary layer, Gadget gates that process the same financial time step features can be forcibly bound to the same set of trainable angle parameters. This limits the dimensionality of the dynamic Lie Algebra (DLA) generated by the variable quantum circuit.
[0145] Under this constrained DLA, the lower bound of the gradient variance of the loss function satisfies polynomial decay rather than exponential decay:
[0146] (9)
[0147] This ensures that the gradient backpropagation signal remains robust even when using deep quantum networks to extract highly complex financial features, breaking through the technical bottleneck that deep quantum sequence models cannot be effectively trained.
[0148] Specifically, the attention evolution operator of the quantum network can adopt the product form of the Pauli Gadget gate, decomposing the global high-order many-body evolution into local low-order interactions. Each Gadget gate unit uses the CNOT ladder to converge the entangled states of qubits in the local subset to the target qubit, performing a single-qubit parameterized rotation gate. Then, entanglement is resolved through a symmetric inverse CNOT ladder. By using Gadget gate topology, the quantum network strictly constrains the evolution that was originally diffused throughout the Hilbert space to a local subspace, thereby suppressing the gradient vanishing effect in deep circuits.
[0149] For example, the attention evolution operator between time nodes can be:
[0150] (10)
[0151] in, Indicates the intrinsic dimension A constrained set of local topological connections. The evolution of the Gadget gate in each locality. Corresponding to a low-order Pauli string sub-Hamiltonian (e.g. ).
[0152] Optionally, the quantum network can be configured with auxiliary qubits. When generating the final similarity score (such as the query-key similarity score), the entanglement information on the feature bits can be non-destructively transferred to the auxiliary bits through a series of controlled local gadget gates (such as the approximation of the controlled SWAP operator), and mid-circuit measurement and classical feedforward can be performed on the auxiliary bits.
[0153] In this way, the entangled state can be prevented from spreading endlessly throughout the time series, and the variational circuit can be maintained in a "shallow-depth Regime" that is highly immune to noise.
[0154] Step 630: Perform a measurement on the evolved quantum state to obtain the measurement result.
[0155] For example, after the Gadget gate completes its attention evolution, a Pauli-Z basis projection measurement can be applied to the evolved quantum state, collapsing the quantum superposition state into a classical expectation scalar. The measurement result includes the expectation value of one or more qubits:
[0156] (11)
[0157] in, Indicates line parameters, This represents the final state after evolution. This represents the Pauli Z operator acting on the i-th qubit.
[0158] Step 640: Based on the measurement results, determine the state prediction data of the target object.
[0159] For example, since the expected value of Pauli Z measurement is physically constrained... Within this range, an affine transformation layer can be configured in a classical computing environment to map quantum measurement results to specific state prediction targets (e.g., future states). (Expected stock returns or price volatility over a period of time).
[0160] (12)
[0161] in, and Learnable scaling weights and biases for classic layers. The measurement results are as follows.
[0162] In one possible implementation, please refer to Figure 8 , Figure 8 This is a flowchart illustrating the Gadget gate quantum attention mechanism for suppressing barren plateaus in some embodiments. The process includes steps 1 to 6, where: Step 1, Global Operator Decomposition: The global high-order many-body evolution map is decomposed into local low-order interactions, confining the disordered evolution originally diffused throughout the Hilbert space to a local subspace. Step 2, CNOT Ladder Convergence: The CNOT ladder is used to converge the entangled states of qubits within the local subset to the target qubit, achieving entanglement concentration of local quantum states to the target qubit. Step 3, Dynamic Parameter Binding: After the CNOT ladder convergence is completed, a single-qubit parameterized rotation gate is executed. In this process, rotation gates corresponding to the same time step in the same evolutionary layer are bound to the same trainable parameters to achieve a parameter sharing mechanism. Step 4, Inverse deentanglement operation: After performing a single-bit rotation, deentanglement is performed through an equivalent inverse CNOT ladder to restore the local state of the qubit. Step 5, Auxiliary bit transfer: When attention scores need to be extracted, entanglement information on the feature bit is non-destructively transferred to the auxiliary bit through a series of controlled local Gadget gates (such as the approximation of the controlled SWAP operator), achieving non-destructive extraction of local correlations. Step 6, Truncating deep evolution: Mid-course local measurement and classical feedforward are performed on the auxiliary bit to avoid the endless spread of entangled states throughout the time series evolution, strictly suppress dynamic Lie algebra expansion and gradient vanishing, and maintain the variational circuit in a shallow state.
[0163] In this embodiment, gradient vanishing is suppressed in the quantum neural network through parameter sharing. This reduces the parameter dimensionality during optimization without altering the overall expressive power of the quantum network, thus addressing the convergence problem of deep quantum networks due to gradient decay during training and improving the training efficiency of quantum networks on real physical devices. Specifically, traditional quantum sequence models often face the dilemma of shallow networks being unable to extract temporal features, while deep networks suffer from gradient vanishing. This embodiment introduces Pauli Gadget gates and auxiliary qubit topology, supplemented by a parameter sharing mechanism, ensuring that the quantum network has sufficient capacity to capture the nonlinear dynamics of time series while suppressing the gradient vanishing problem caused by the disordered expansion of the model's expressive power.
[0164] Since variational quantum circuits (VQCs) undergo unitary evolution on real physical qubits, traditional classical deep learning backpropagation algorithms cannot directly calculate the gradient of the quantum state. Therefore, in an exemplary embodiment, hybrid quantum-classical closed-loop optimization and prediction can be achieved based on the parameter-shift rule. The aforementioned data processing method also includes:
[0165] Step 710: Obtain the first measurement result of each parameter to be updated in the quantum network after being offset by a preset angle in the positive direction, and the second measurement result after being offset by a preset angle in the negative direction.
[0166] Among them, the parameters to be updated refer to the parameterized rotating gates (such as...) in the variable quantum circuit. The adjustable angle parameter. The preset angle refers to the angle offset amount used for parameter offset rules (such as...). ).
[0167] For example, for any parameter to be updated in a quantum circuit Two query commands can be sent to the underlying quantum processor via a quantum instruction set interface (such as QASM): the parameters to be updated are... Offset by a preset angle in the positive direction (e.g., set to) Keeping other parameters constant, the quantum circuit is executed, and the first measurement result is obtained; the second time, the parameters to be updated are... Offset by a preset angle in the negative direction (e.g., set to) Keeping other parameters unchanged, the corresponding second measurement result is obtained after executing the quantum circuit.
[0168] Step 720: Determine a first loss value based on the first measurement result and the true label of the target object, and determine a second loss value based on the second measurement result and the true label.
[0169] The true label refers to the actual state observation data of the target object within the prediction target time window, which is used to compare with the prediction output of the quantum network to calculate the loss value.
[0170] For example, in a classic computing environment, the first measurement result can be mapped to a first predicted value through an affine transformation layer, and then the first predicted value can be compared with the true label to calculate a first loss value using a loss function. Similarly, the second measurement result can be mapped to a second predicted value through an affine transformation layer to calculate a second loss value.
[0171] Specifically, the loss function can be a smoothed Huber loss function instead of the traditional mean squared error (MSE) to enhance the model's robustness to extreme market outliers:
[0172] (13)
[0173] in, The preset threshold parameter, y represents the predicted output of the quantum network, and y represents the true label.
[0174] Step 730: Based on the first loss value and the second loss value, determine the gradient of the corresponding parameter to be updated.
[0175] For example, for an arbitrary parameterized rotation gate generated by a Pauli gate in a quantum circuit, its parameter... The gradient is obtained by performing a difference operation on the first loss value and the second loss value:
[0176] (14)
[0177] Step 740: Update each parameter of the quantum network according to the gradient of each parameter to be updated.
[0178] For example, in obtaining gradients Then, a classic optimization center (such as the Adam optimizer) can be used to optimize the learning rate according to the set parameters. Calculate the parameter update step size and update each parameter of the quantum circuit that needs to be updated:
[0179] (15)
[0180] in, Indicates the current iteration step. Indicates the first The parameter vector at the next iteration This indicates that the gradient is optimized using an adaptive moment estimator. The updated parameter set is fed back for quantum compilation and rewritten into the control impulses of the qubit gate.
[0181] Alternatively, the optimizer can be replaced by stochastic gradient descent (SGD), RMSprop, or other classic optimization algorithms instead of the Adam optimizer.
[0182] In one possible implementation, please refer to Figure 9 , Figure 9 This is a schematic diagram of the parameter offset closed-loop optimization and prediction execution process in some embodiments. The process includes steps 1 to 6: Step 1, Pauli Z-basis measurement: Perform Pauli Z-basis projection measurement on the quantum state at the end of the variable quantum circuit to obtain the expected value of the quantum state at the end of the circuit as the measurement result. Step 2, Classical affine decoding: In the classical computing environment, the measured quantum expected value is mapped to the state prediction scalar through an affine transformation layer, completing the decoding process from quantum expected value to classical prediction value. Step 3, Robustness error calculation: Compare the decoded state prediction value with the true label of the target object, and calculate the error using a smooth Huber loss function. Step 4, Trigger phase shift: Send parameter query instructions to the underlying quantum processor through the quantum instruction set interface, causing each parameter to be updated in the quantum network to be shifted by a preset angle in the positive and negative directions respectively, keeping other parameters unchanged, and obtaining the corresponding measurement result after executing the quantum circuit. Step 5, Classical differential calculation: In classical memory, calculate the loss value according to the measurement results obtained after the positive and negative shifts, and then solve the analytical gradient of the parameter to be updated through differential operation. Step 6, Adam Iterative Feedback: Based on the calculated gradient, the classical optimization center uses the Adam optimizer to calculate the parameter update step size according to the set learning rate, iteratively updates the trainable parameters of each rotating gate in the quantum circuit, and feeds back the updated parameter set for quantum compilation, rewriting it into the control pulses of the qubit gate.
[0183] In this embodiment, analytical gradients are obtained through parameter offset rules, and the quantum network is iteratively optimized. This enables closed-loop optimization of quantum network parameters without additional quantum hardware resources, ensuring stable training and convergence of the quantum network on physical devices. Specifically, the parameter offset rules allow operation without relying on idealized fault-tolerant quantum computers, adapting to the hardware conditions of current noisy, medium-scale quantum devices. By physically dividing the work—with quantum processors handling parallel evolution and expectation calculations of high-dimensional features, and classical processors handling parameter storage and analytical gradient updates—the unmeasurability of hardware gradients is avoided. Simultaneously, combined with a parameter sharing mechanism, the dimensionality of the parameters to be measured is reduced, thus achieving convergence efficiency and engineering feasibility during training on practical physical devices.
[0184] In one possible implementation, please refer to Figure 10 , Figure 10This is a schematic diagram of the process from financial data input to prediction result output and closed-loop iteration in some embodiments. The process includes two parts: feedforward control flow and closed-loop optimization flow. The feedforward control flow includes steps 1 to 7: Step 1, Financial data access and reconstruction: Multidimensional time series data is reconstructed into a high-dimensional state feature vector matrix through a sliding window mechanism. Step 2, TwoNN dimension estimation: The distance ratio between each feature point in the high-dimensional state feature vector matrix and its first and second nearest neighbors is calculated, a Pareto distribution is fitted, and the manifold intrinsic dimension ID is extracted. Step 3, Manifold projection denoising: The state feature vector matrix is decomposed based on the intrinsic dimension ID, and each state feature vector is projected onto a low-dimensional subspace spanned by the target feature vector, eliminating orthogonal random walk noise. Step 4, Dynamic architecture mapping: Based on the intrinsic dimension ID, the number of qubits and the evolution layer depth of the quantum network are adaptively allocated through a preset mapping relationship. Step 5, Quantum State Preparation and Encoding: The denoised core manifold feature signal is encoded into the initial quantum state of the quantum network through a parameterized rotation gate. Step 6, Gadget Enhanced Attention: The initial quantum state is evolved using the qubit gates of the quantum network to extract the correlation information between features. Step 7, Projection Measurement and Decoding: Pauli Z-basis projection measurement is performed on the evolved quantum state, and the measurement results are mapped to the state prediction data of the target object through an affine transformation. The closed-loop optimization flow includes Step 8: Step 8, Closed-Loop Optimization Update: The error between the state prediction data and the true label is calculated. The gradient of each parameter to be updated in the quantum network is extracted through parameter offset rules. The optimizer is used to update each parameter to be updated in the quantum network and then fed back, completing the complete computational closed loop from data input to parameter iteration.
[0185] Specifically, Step 1 includes: receiving multi-dimensional time-series data from the financial market in real time (such as tick-level or candlestick-level price and volume indicators and macroeconomic factors) through a data interface, performing missing and outlier processing, and then converting the one-dimensional time-series data into a high-dimensional state feature vector matrix through a sliding window. Step 2 includes: calculating the distance ratio between each state feature vector and its first and second nearest neighbors using the TwoNN algorithm, fitting a Pareto distribution, and extracting the intrinsic dimension ID of the current local financial data manifold using maximum likelihood estimation or linear regression in logarithmic coordinates. Step 3 includes: using the intrinsic dimension ID as a truncation criterion, performing singular value decomposition on the covariance matrix of the high-dimensional state feature vector matrix to obtain a set of feature vectors arranged by eigenvalue size, selecting the first number of target feature vectors specified by the intrinsic dimension, and projecting each state feature vector into a low-dimensional subspace spanned by the target feature vectors. High-dimensional components with feature indices greater than the intrinsic dimension are forcibly discarded. Step 4 includes: dynamically calculating and locking the number of logical qubits and the evolution depth of the variable quantum circuit required for the current time window based on the intrinsic dimension ID and the preset mapping relationship; then, compiling these topological parameters along with the denoised core manifold feature signal output from Step 3 into a set of control instructions executable by the underlying quantum hardware (such as QASM assembly instructions or microwave pulse signals). Step 5 includes: encoding the denoised core manifold feature signal into the initial quantum state of the quantum network through parameterized rotation gates according to the issued control instructions. Step 6 includes: performing evolution processing on the initial quantum state through parameterized quantum circuits of the quantum network, where the parameterized quantum circuits include single-qubit rotation gates and controlled NOT gates. To prevent gradient vanishing in deep circuits, in one possible implementation, when the number of qubits is large or the quantum circuit evolution depth is large, Pauli Gadget gates can be introduced into the parameterized quantum circuits. Specifically, each Gadget gate unit of the attention evolution operator in the quantum network converges the entangled states of qubits within a local subset to the target qubit through a CNOT ladder, performs a single-qubit parameterized rotation gate, and then disentangles them through a symmetric inverse CNOT ladder. Gadget gates corresponding to the same time step in the same evolution layer are bound with the same trainable angle parameters. Step 7 includes: applying a Pauli Z-basis projection measurement to the evolved quantum state, collapsing the quantum superposition state into a classical expectation scalar as the measurement result; then, since the expectation value of the Pauli Z measurement is physically restricted to the interval [-1,1], the system configures an affine transformation layer in a classical computing environment to map the measurement result to a stock price prediction value or a probability of rise or fall.Step 8 includes: comparing the predicted value with the real market label and calculating the loss value using a smooth Huber loss function; to update the adjustable angle parameters of each parameterized rotating gate in the quantum network, the system sends two query commands to the quantum layer through the quantum instruction set interface to obtain the first measurement result after offsetting each parameter to be updated by a preset angle in the positive direction and the second measurement result after offsetting each parameter by a preset angle in the negative direction, and calculates the corresponding loss value for each, and solves the analytical gradient through differential operation; finally, the Adam optimizer is used to calculate the parameter update step size according to the set learning rate, updates each parameter to be updated in the quantum network, and sends the updated parameter set back for quantum compilation, rewriting it into the control pulse of the qubit gate. Simultaneously, the final prediction result is input into the strategy system to generate buy / sell execution signals with risk control conditions.
[0186] In practical applications, the data processing methods described in any of the above embodiments can be applied to predict the high-frequency price trend of a highly volatile technology stock in the next 5 minutes.
[0187] For example, firstly, high-frequency trading data (including intraday volume and price, order book depth, and micro-features of buy and sell orders) of the stock over a past period can be obtained in real time. A sliding window mechanism is used to transform one-dimensional time series slices into, for example, a high-dimensional state feature vector matrix of 256 dimensions to capture the initial state of the market's nonlinear dynamics. The system then executes the TwoNN algorithm on the 256-dimensional data to calculate the intrinsic dimension of the current market state (e.g., calculating...). This indicates that there are currently few core driving factors. The system forcibly projects the data onto these 8-dimensional core manifolds, completely removing the remaining 248-dimensional high-frequency random walk noise. Simultaneously, the system... The dynamic decision only requires calling 4 logical qubits and a shallower variable layer depth, and efficiently mapping these 8-dimensional pure features into quantum states through angle encoding.
[0188] During the training phase, the historical true return labels of the stock are obtained. The encoded quantum state is received, and self-attention computation based on Gadget gate topology is performed on the NISQ device. To avoid the plateau effect of deep networks, multi-body entanglement is transformed into local low-order interactions using Gadget gates. The classical optimizer sends two phase shift instructions to the system via parameter shift rules to accurately extract gradients and uses the Adam algorithm to update the rotation gate parameters of the quantum circuit. During the inference phase, the trained quantum Transformer receives the latest real-time denoised quantum state, efficiently exploring and evaluating complex deep long-range nonlinear correlations between features at different time points on quantum hardware.
[0189] Then, Pauli Z-basis projection measurements are performed on the terminal characteristic qubits after the quantum Transformer evolution, causing the quantum superposition state to collapse, resulting in a set of expected values representing the strength of characteristic entanglement (ranging from -1 to 1). These expected values are received, decoded and denormalized through an affine transformation layer, transforming the quantum expected values into specific predicted values for financial targets (e.g., predicting a +0.45% return or an 82% probability of an increase in the next 5 minutes). Finally, based on the predicted values and internal risk control thresholds, the system generates specific live trading instructions (e.g., triggering a "buy" signal and dynamically adjusting Kelly positions), and sends them directly to the quantitative execution engine via API.
[0190] The aforementioned data processing method expands a one-dimensional time series into a high-dimensional state feature vector matrix through phase space reconstruction, enabling a more comprehensive capture of the temporal state evolution of the target object. By reducing the dimensionality of the state feature vector matrix, the data is projected from the original high-dimensional space to the core low-dimensional manifold. In this low-dimensional space, redundant components unrelated to the core manifold are removed, while the core geometric structure that plays a dominant role in state evolution is retained, thereby improving the accuracy of state prediction. By determining the number of qubits and the evolution layer depth of the quantum network based on the intrinsic dimension, the structure of the quantum network can be adaptively configured according to the inherent complexity of the data, thereby reducing the computational overhead in the quantum network processing. Specifically, the TwoNN algorithm accurately removes noise from the time series data and achieves on-demand dynamic allocation of quantum computing power. At the same time, the quantum network enhanced by Gadget gates suppresses the gradient vanishing phenomenon in the key stages of temporal entanglement and feature extraction. That is, it combines the geometric manifold prior of classical data with the high-dimensional nonlinear representation capability of quantum computing, thereby improving the accuracy of state prediction in low signal-to-noise ratio environments and possessing engineering feasibility on current quantum hardware.
[0191] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0192] Based on the same inventive concept, this application also provides a data processing apparatus for implementing the data processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more data processing apparatus embodiments provided below can be found in the limitations of the data processing method described above, and will not be repeated here.
[0193] In one exemplary embodiment, such as Figure 11 As shown, a data processing device 800 is provided, including: a data acquisition module 801, a phase space reconstruction module 802, an intrinsic dimension determination module 803, a dimension reduction processing module 804, a quantum network determination module 805, and a quantum network processing module 806, wherein:
[0194] Data acquisition module 801 is used to acquire the state observation data time series of the target object, which includes state observation data at multiple historical moments.
[0195] The phase space reconstruction module 802 is used to reconstruct the phase space of the time series of state observation data based on the target time length to obtain a state feature vector matrix. Each state feature vector in the state feature vector matrix includes the state observation data within the target time length.
[0196] The intrinsic dimension determination module 803 is used to determine the intrinsic dimension of the state feature vector matrix based on the correlation between each state feature vector in the state feature vector matrix.
[0197] The dimension reduction processing module 804 is used to perform dimension reduction processing on the state feature vector matrix to obtain the dimension-reduced state feature vector matrix.
[0198] The quantum network determination module 805 is used to determine the number of qubits and the depth of the quantum circuit evolution layer of the quantum network based on the intrinsic dimension.
[0199] The quantum network processing module 806 is used to input the dimensionality-reduced state feature vector matrix into the quantum network, so that the quantum network can output the state prediction data of the target object based on the number of qubits and the depth of the quantum circuit evolution layer.
[0200] In some embodiments, the intrinsic dimension determination module 803 includes:
[0201] The distance calculation submodule is used to calculate the first nearest neighbor distance between each state feature vector in the state feature vector matrix and the first nearest neighbor state feature vector, and the second nearest neighbor distance between each state feature vector and the second nearest neighbor state feature vector.
[0202] The ratio calculation submodule is used to determine the distance ratio corresponding to each state feature vector based on the first nearest neighbor distance and the second nearest neighbor distance corresponding to each state feature vector.
[0203] The intrinsic dimension determination submodule is used to determine the intrinsic dimension of the state feature vector matrix based on the statistical distribution characteristics of the distance ratios corresponding to each state feature vector.
[0204] In some embodiments, the dimensionality reduction processing module 804 includes:
[0205] The matrix decomposition submodule is used to decompose the state feature vector matrix to obtain multiple feature vectors and their corresponding feature values.
[0206] The vector sorting submodule is used to sort multiple feature vectors based on the magnitude relationship of their respective feature values.
[0207] The vector determination submodule is used to determine a specific number of target feature vectors from a sorted set of feature vectors.
[0208] The dimensionality reduction submodule is used to transform the state feature vector matrix based on the target feature vector to obtain the dimensionality-reduced state feature vector matrix.
[0209] In some embodiments, the quantum network determination module 805 includes:
[0210] The parameter determination submodule is used to determine the number of target qubits and the depth of the target quantum circuit evolution layer required by the quantum network based on the intrinsic dimension and the preset mapping relationship. The preset mapping relationship includes the mapping relationship between the number of target qubits and the depth of the target quantum circuit evolution layer and the intrinsic dimension.
[0211] The first adjustment submodule is used to adjust the number of qubits in the quantum network to the target number of qubits;
[0212] The second adjustment submodule is used to adjust the quantum circuit evolution layer depth of the quantum network to the target quantum circuit evolution layer depth.
[0213] In some embodiments, the quantum network processing module 806 includes:
[0214] The quantum state encoding submodule is used to encode each state feature vector in the reduced-dimensional state feature vector matrix into the initial quantum state of the quantum network.
[0215] The evolution processing submodule is used to perform evolution processing on the initial quantum state through the qubit gates of the quantum network to obtain the evolved quantum state; wherein, the qubit gates include single-qubit rotation gates and controlled NOT gates;
[0216] The measurement submodule is used to perform measurements on the evolved quantum state and obtain the measurement results;
[0217] The prediction submodule is used to determine the state prediction data of the target object based on the measurement results.
[0218] In some embodiments, the data processing apparatus 800 further includes a quantum network optimization module, for:
[0219] The first measurement result of each parameter to be updated in the quantum network after being offset by a preset angle in the positive direction, and the second measurement result after being offset by a preset angle in the negative direction are obtained respectively.
[0220] Based on the first measurement result and the true label of the target object, a first loss value is determined, and based on the second measurement result and the true label, a second loss value is determined.
[0221] Based on the first loss value and the second loss value, the gradient of the corresponding parameter to be updated is determined;
[0222] Update the parameters of the quantum network according to their gradients.
[0223] Each module in the aforementioned data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0224] In one exemplary embodiment, a quantum computing device is provided, including a memory, a processor, and a quantum network. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0225] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0226] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0227] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0228] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0229] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data processing method, characterized in that, The method includes: Obtain the time series of state observation data of the target object, wherein the time series of state observation data includes state observation data at multiple historical moments; Based on the target time length, the phase space of the state observation data time series is reconstructed to obtain a state feature vector matrix, wherein each state feature vector in the state feature vector matrix includes the state observation data within the target time length; The intrinsic dimension of the state feature vector matrix is determined based on the correlation between the state feature vectors in the state feature vector matrix. The state feature vector matrix is reduced in dimension to obtain the reduced state feature vector matrix. Based on the intrinsic dimension, the number of qubits in the quantum network and the depth of the quantum circuit evolution layer are determined. The reduced state feature vector matrix is input into the quantum network so that the quantum network outputs the state prediction data of the target object based on the number of qubits and the depth of the quantum circuit evolution layer.
2. The method according to claim 1, characterized in that, Determining the intrinsic dimension of the state feature vector matrix based on the correlation between the state feature vectors in the state feature vector matrix includes: Calculate the first nearest neighbor distance between each state feature vector in the state feature vector matrix and the first nearest neighbor state feature vector, and the second nearest neighbor distance between each state feature vector and the second nearest neighbor state feature vector; Based on the first nearest neighbor distance and the second nearest neighbor distance corresponding to each state feature vector, the distance ratio corresponding to each state feature vector is determined; Based on the statistical distribution characteristics of the distance ratios corresponding to each state feature vector, the intrinsic dimension of the state feature vector matrix is determined.
3. The method according to claim 1, characterized in that, The state feature vector matrix is reduced in dimension to obtain a reduced state feature vector matrix, including: The state feature vector matrix is decomposed to obtain multiple feature vectors and the feature values corresponding to each of the multiple feature vectors. Based on the magnitude relationship of the feature values corresponding to each of the multiple feature vectors, the multiple feature vectors are sorted. Determine a specific number of target feature vectors from the sorted plurality of feature vectors; Based on the target feature vector, the state feature vector matrix is transformed to obtain the dimensionality-reduced state feature vector matrix.
4. The method according to claim 1, characterized in that, The determination of the number of qubits and the depth of the quantum circuit evolution layer based on the intrinsic dimension includes: Based on the intrinsic dimension and the preset mapping relationship, the number of target qubits and the depth of the target quantum circuit evolution layer required for the quantum network are determined, wherein the preset mapping relationship includes the mapping relationship between the number of target qubits and the depth of the target quantum circuit evolution layer and the intrinsic dimension. Adjust the number of qubits in the quantum network to the target number of qubits; The quantum circuit evolution layer depth of the quantum network is adjusted to the target quantum circuit evolution layer depth.
5. The method according to claim 1, characterized in that, The step of inputting the dimensionality-reduced state feature vector matrix into the quantum network, so that the quantum network outputs the state prediction data of the target object based on the number of qubits and the depth of the quantum circuit evolution layer, includes: Each state feature vector in the reduced-dimensional state feature vector matrix is encoded as the initial quantum state of the quantum network; The initial quantum state is evolved through the qubit gates of the quantum network to obtain the evolved quantum state; wherein, the qubit gates include single-qubit rotation gates and controlled NOT gates; The evolved quantum state is measured to obtain the measurement result; Based on the measurement results, the state prediction data of the target object is determined.
6. The method according to claim 1, characterized in that, The process of inputting the dimensionality-reduced state feature vector matrix into the quantum network, so that the quantum network outputs state prediction data of the target object based on the number of qubits and the depth of the quantum circuit evolution layer, includes: The first measurement result of each parameter to be updated of the quantum network after being offset by a preset angle in the positive direction, and the second measurement result after being offset by a preset angle in the negative direction are obtained respectively. Based on the first measurement result and the true label of the target object, a first loss value is determined, and based on the second measurement result and the true label, a second loss value is determined. Based on the first loss value and the second loss value, the gradient of the corresponding parameter to be updated is determined; The parameters of the quantum network to be updated are updated according to their gradients.
7. A data processing apparatus, characterized in that, The device includes: The data acquisition module is used to acquire the time series of state observation data of the target object, which includes state observation data at multiple historical moments. The phase space reconstruction module is used to reconstruct the phase space of the state observation data time series based on the target time length to obtain a state feature vector matrix, wherein each state feature vector in the state feature vector matrix includes the state observation data within the target time length. The intrinsic dimension determination module is used to determine the intrinsic dimension of the state feature vector matrix based on the correlation between each state feature vector in the state feature vector matrix. The dimension reduction processing module is used to perform dimension reduction processing on the state feature vector matrix to obtain the dimension-reduced state feature vector matrix. A quantum network determination module is used to determine the number of qubits and the depth of the quantum circuit evolution layer of the quantum network based on the intrinsic dimension. A quantum network processing module is used to input the dimensionality-reduced state feature vector matrix into the quantum network, so that the quantum network outputs the state prediction data of the target object based on the number of qubits and the depth of the quantum circuit evolution layer.
8. A quantum computing device, characterized in that, The method includes a memory, a processor, and a quantum network, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
