Quantum residual attention neural network, application and material design method

By applying quantum residual attention neural network in materials science, using the characteristics of quantum computing, the problems of existing algorithms overfitting and slow training under small samples are solved, achieving high accuracy and fast training effects.

CN119601151AActive Publication Date: 2025-03-11SOUTHWEST JIAOTONG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411772610.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-11
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

In materials science, existing machine learning algorithms are overfitting due to scarce data and small training samples, which has low accuracy, long training cycles and slow convergence.

Method used

A quantum residual attention neural network is proposed, which uses technologies such as quantum logic gate and quantum residual attention layer, combined with variable component quantum circuits and quantum pooling layers to improve the generalization and training speed of the model.

Benefits of technology

Under the condition of a small number of training samples, the quantum residual attention neural network can maintain a high accuracy rate, shorten the training time, and improve the convergence speed of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119601151A_ABST
    Figure CN119601151A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of quantum computing, and discloses a quantum residual attention neural network, which comprises a quantum embedding layer based on a quantum logic gate and used for encoding input data into an initial quantum state; the variable component sub-circuit is used for acting on the initial quantum state in combination with the auxiliary quantum state, realizing evolution of the quantum state and performing quantum state feature extraction; and the quantum measurement layer is used for carrying out measurement through a Fouli Z gate according to the quantum state characteristics output by the variable component sub-circuit to obtain output data. The invention also provides a material design method. The method comprises the following steps: acquiring material component data; performing dimension reduction processing on the material component data to obtain dimension-reduced material component feature data; and inputting the material component characteristic data into the quantum residual attention neural network to obtain material performance prediction data. According to the method, generalization of the neural network is provided, and high accuracy can be obtained under the condition of a small number of training samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of quantum computing technology, relates to a novel quantum residual attention neural network and its application, and also relates to a material design method based on the quantum residual attention neural network. Background Art

[0002] The traditional process of developing new materials uses trial and error, and the experimental steps are cumbersome. The long cycle and high cost constraints make it difficult to accelerate the development of materials. As an alternative, the rise of machine learning technology has become a powerful tool for discovering new materials.

[0003] Machine learning can quickly predict materials based on material databases, which is expected to accelerate the design of new materials and shorten the material development cycle. It has begun to play an important role in materials science because it can learn behaviors and trends from existing data without understanding the underlying physical mechanisms.

[0004] At present, the technology of predicting material properties by machine learning mainly uses neural networks to extract data features, and then obtains the predictive performance of the model through regression algorithms. However, since the material composition-performance data itself needs to be obtained through experimental characterization, the amount of data itself is relatively scarce and precious. Therefore, under the condition of a small number of training samples, the current machine learning algorithm model is prone to overfitting, resulting in low prediction accuracy of the model. In addition, the training cycle of machine learning algorithms based on neural networks is often long and requires many iterations to converge. Summary of the invention

[0005] The purpose of the present invention is to provide a quantum residual attention neural network to address the problems existing in the prior art, which has good generalization and can maintain a high accuracy rate under the condition of a small number of training samples.

[0006] Another object of the present invention is to provide an application of the above-mentioned quantum residual attention neural network in material design.

[0007] The third object of the present invention is to provide a material design method based on the above-mentioned quantum residual attention neural network.

[0008] In order to achieve the above object, the present invention adopts the following technical solutions to achieve it.

[0009] The present invention provides a quantum residual attention neural network, which comprises:

[0010] A quantum embedding layer based on quantum logic gates to encode input data into the initial quantum state;

[0011] A variational quantum circuit is used to combine the auxiliary quantum state to act on the initial quantum state, realize the evolution of the quantum state, and extract the characteristics of the quantum state; the variational quantum circuit includes a trunk quantum circuit where the initial quantum state is located and an auxiliary quantum circuit where the auxiliary quantum state is located; the variational quantum circuit is provided with a plurality of quantum residual attention layers, and a quantum pooling layer located between two adjacent quantum residual attention layers; each quantum residual attention layer takes the initial quantum state and the auxiliary quantum state as input, or the output quantum state of the quantum pooling layer and the auxiliary quantum state acted on by the previous quantum residual attention layer as input; the quantum pooling layer takes the output quantum state on the trunk quantum circuit of the previous quantum residual attention layer as input;

[0012] The quantum residual attention layer performs alternating operations on the input quantum state through the RX rotation gate and the RY rotation gate;

[0013] The quantum pooling layer performs alternating operations on any two input quantum states through an RZ rotation gate and a CX control NOT gate;

[0014] The quantum measurement layer is used to obtain output data by measuring the quantum state characteristics of the variational quantum circuit output through the Pauli Z gate.

[0015] In the quantum residual attention neural network, the quantum embedding layer is connected through the quantum logic gate U φ (x) acts on or In the ground state, the encoded input initial quantum state |φ(x)> is obtained, where n represents the number of quantum bits required to encode the input data; the specific expression is as follows:

[0016] or

[0017]

[0018] The quantum logic gate U φ (x) Includes at least one of the RX revolving door, RY revolving door, RZ revolving door, etc.

[0019] In the above-mentioned quantum residual attention neural network, the variational quantum circuit is composed of a number of quantum bits corresponding to the input data and quantum bits corresponding to the auxiliary quantum states, and each quantum bit corresponds to a quantum circuit.

[0020] The final quantum state obtained through the variational quantum circuit is |α L (x)>, specifically expressed as follows:

[0021] |α L (x)>=U θ |φ(x)>|γ>;

[0022] Among them, |γ> auxiliary quantum state is |0> or |1>;

[0023] U θ Represent a variational quantum circuit with variational parameter θ:

[0024]

[0025] U αL represents the last quantum residual attention layer; U αi , U βi They represent the i-th quantum residual attention layer and the i-th quantum pooling layer respectively. Indicates the round-up operation, and n indicates the number of input data.

[0026] In the quantum residual attention neural network, in the quantum residual attention layer, the matrix form of the RX revolving gate is:

[0027]

[0028] Here, θ represents the rotation angle around the X-axis.

[0029] The matrix form of the RY revolving door is:

[0030]

[0031] Here, θ represents the rotation angle around the Y axis.

[0032] For the input quantum state on the trunk quantum circuit, the quantum residual attention layer includes one layer of RX revolving gate operation and several layers of RY revolving gate operation; before the RY revolving gate operation, a CX control NOT gate is set, and the control bit and target bit of the CX control NOT gate are respectively located on adjacent quantum circuits; after the last layer of RY revolving gate operation, a CX control NOT gate is also set, and the control bit of the CX control NOT gate is located on the quantum circuit where the auxiliary quantum state is located, and the target bit is located on the quantum circuit where the input quantum state is located;

[0033] For the auxiliary quantum state, the quantum residual attention layer includes a layer of H gate operation, several layers of CRY controlled rotating gate operation and H gate operation; the control bit of the CRY controlled rotating gate operation is the quantum state of the adjacent quantum circuit, and the target bit is the auxiliary quantum state.

[0034] Furthermore, for the input quantum state, the quantum residual attention layer also performs an H-gate operation on the outputs of the last two quantum circuits.

[0035] For the CX controlled NOT gate, if the control bit is in the |1> state, the X gate is executed on the target bit. If the control bit is in the |0> state, the target bit does not perform any operation. The X gate operator acts on the base state and can flip the base state. It can change the base state |0> to |1> and the base state |1> to |0>. The matrix form of the CX controlled NOT gate is:

[0036]

[0037] For the H gate, i.e. the Hadamard gate, the matrix form is: It can transform the base state |0> into (|0>+|1>).

[0038] For the CRY controlled revolving door, if the control bit is in the |1> state, the RY revolving door operation is performed on the target bit. If the control bit is in the |0> state, no operation is performed on the target bit.

[0039] In the above-mentioned quantum residual attention neural network, the quantum pooling layer first performs an RZ (-π / 2) rotation gate on the quantum state on the first quantum circuit of any two quantum circuits, and the operation result is used as the control bit of the CX control NOT gate, and an X gate operation is performed on the quantum state on the second quantum circuit; then, an RZ rotation gate operation is performed on the quantum states of the first quantum circuit and the second quantum circuit respectively, and the result of the RZ rotation gate operation on the quantum state on the second quantum circuit is used as the control bit of the CX control NOT gate, and an X gate operation is performed on the quantum state on the first quantum circuit; then, an RY rotation gate operation is performed on the quantum state on the first quantum circuit.

[0040] The matrix form of the RZ revolving door is:

[0041]

[0042] Here, θ represents the rotation angle around the Z axis.

[0043] For the above quantum residual attention neural network, the output data obtained by the quantum measurement layer is expressed as follows:

[0044]

[0045] Among them, h l represents the output data of the quantum measurement layer, |α L (x)> represents the final quantum state, Represents Pauli-Z gate.

[0046] The matrix form of the Pauli Z-gate is:

[0047]

[0048] In the above-mentioned quantum residual attention neural network, the variational quantum circuit outputs at least two quantum state characteristics; and the quantum measurement layer measures all quantum state characteristics through the Pauli Z gate to obtain more than two output data.

[0049] The above quantum residual attention neural network also includes an output layer for processing more than two output data to obtain final prediction data. The output layer uses a fully connected layer.

[0050] The loss function used in the above quantum residual attention neural network is the mean square error loss function.

[0051] The present invention also provides the application of the above-mentioned quantum residual attention neural network in material design.

[0052] The present invention also provides a material design method, which comprises the following steps:

[0053] S1 obtains material composition data;

[0054] S2 performs dimensionality reduction processing on the material composition data to obtain the material composition characteristic data after dimensionality reduction;

[0055] S3 inputs the material composition characteristic data into the quantum residual attention neural network to obtain the material performance prediction data.

[0056] In the above step S2, principal component analysis is performed on the material composition data, and the constructed principal components are used as the material composition feature data after dimensionality reduction.

[0057] The above step S3 includes the following sub-steps:

[0058] S31 encodes material composition characteristic data into initial quantum states through a quantum embedding layer based on quantum logic gates;

[0059] S32 uses a variational quantum circuit to perform quantum state evolution operations on the initial quantum state and extract quantum state characteristics;

[0060] S33 measures the extracted quantum state characteristics through the quantum measurement layer to obtain material performance output data.

[0061] The above step S3 also includes:

[0062] S34 processes the material performance output data through the fully connected layer to obtain the final material performance prediction data.

[0063] Compared with the prior art, the present invention has the following beneficial effects:

[0064] 1) Based on quantum algorithm, this paper proposes a new type of quantum residual attention neural network, which uses the quantum noise and quantum parallel computing characteristics of quantum computers to improve the generalization of neural networks and obtain a higher accuracy rate under the condition of a small number of training samples;

[0065] 2) The quantum residual attention neural network provided by the present invention is mainly implemented based on multiple quantum gate operations, and adopts the parallel characteristics of quantum computing to improve the convergence speed of algorithm training and save training time;

[0066] 3) The present invention also combines a classical fully connected layer to output the results of quantum measurement to a regression value through linear combination, thereby obtaining material performance data through denormalization;

[0067] 4) The quantum residual attention neural network provided by the present invention can be applied to the field of material design;

[0068] 5) Applying the quantum residual attention neural network provided by the present invention to material design can achieve effective prediction of the performance of new materials. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 A schematic diagram of the structure of a quantum residual attention neural network provided in Example 1 of the present invention;

[0070] Figure 2 A schematic diagram of a material design method flow chart provided in Example 2 of the present invention;

[0071] Figure 3 Schematic diagram of the material properties prediction process. DETAILED DESCRIPTION

[0072] The following will clearly and completely describe the technical solutions of various embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0073] Example 1

[0074] This embodiment provides a quantum residual attention neural network, such as Figure 1 As shown, it includes: a quantum embedding layer based on quantum logic gates, a variational quantum circuit, a quantum measurement layer and an output layer.

[0075] (1) Quantum Embedding Layer

[0076] A quantum embedding layer based on quantum logic gates is used to encode input data into the initial quantum state.

[0077] The quantum embedding layer is connected via quantum logic gate U φ (x) acts on In the ground state, the encoded input initial quantum state |φ(x)> is obtained, where n represents the number of quantum bits required to encode the input data; the specific expression is as follows:

[0078]

[0079] Quantum Logic Gate U φ (x) Includes at least one of the RX revolving door, RY revolving door, RZ revolving door, etc.

[0080] In this embodiment, the angle encoding technology (see Stoudenmire, E., Schwab, DJ: Supervised learning with tensor networks. Advances in neural information processing systems 29 (2016)) is used to convert n classical input data {x1, x2, ..., x n} is encoded into a quantum state, and the embedded rotation angle is restricted to the range [0, π).

[0081] For example, when the classical input data is 4 and all are real numbers, n = 4. Using the angle coding technology, through the quantum logic gate U φ (x) (here composed of 4 RY rotation gates) encodes the classical input data into an initial quantum state |φ(x)>, corresponding to 4 quantum bits.

[0082] (2) Variational quantum circuits

[0083] The variational quantum circuit is used to combine the auxiliary quantum state with the initial quantum state to realize the evolution of the quantum state and extract the characteristics of the quantum state.

[0084] The variational quantum circuit is composed of a number of quantum bits corresponding to the initial quantum state (n represents the number of corresponding quantum bits) and quantum bits corresponding to the auxiliary quantum state. The auxiliary quantum bits are used to generate quantum entanglement in the variational quantum circuit, thereby providing an attention mechanism; the initial quantum state corresponding to the auxiliary quantum bits is |0>. Each quantum bit corresponds to a quantum circuit. Therefore, the variational quantum circuit includes the main quantum circuit (constituting the main network) where the initial quantum state is located and the auxiliary quantum circuit where the auxiliary quantum state is located.

[0085] Several quantum residual attention layers and a quantum pooling layer located between two adjacent quantum residual attention layers are provided on the variational quantum circuit. In this embodiment, two quantum residual attention layers (i.e., a first quantum residual attention layer and a second quantum residual attention layer) are provided on the variational quantum circuit, as well as a quantum pooling layer located between the two quantum residual attention layers. The first quantum residual attention layer takes the initial quantum state and the auxiliary quantum state as input; the second quantum residual attention layer takes the output quantum state of the quantum pooling layer and the auxiliary quantum state of the first quantum residual attention layer as input. The quantum pooling layer takes the output quantum state on the trunk quantum circuit of the first quantum residual attention layer as input.

[0086] The above-mentioned quantum residual attention layer alternately operates the input quantum state on the backbone quantum circuit through the RX revolving gate and the RY revolving gate, maps the classical real numbers to a wider complex domain space through the alternating action of the RX revolving gate and the RY revolving gate, and provides a residual attention mechanism for the neural network through a series of interactions between an auxiliary quantum bit and the backbone network, thereby enhancing the expressive power of the neural network. At the same time, it also provides technical support for improving the generalization and parallel accelerated computing capabilities of the neural network.

[0087] The matrix form of the RX revolving door is:

[0088]

[0089] Here, θ represents the rotation angle around the X-axis.

[0090] The matrix form of the RY revolving door is:

[0091]

[0092] Here, θ represents the rotation angle around the Y axis.

[0093] For the input quantum states on the trunk quantum circuit (e.g. |q1>-|q4>), the quantum residual attention layer includes a layer of RX revolving gate operation (e.g. Rx(θ[0])-Rx(θ[3]), and several layers of RY revolving gate operations (e.g. Ry(θ[5])-Ry(θ[8], R represents the number of layers of RY revolving gate). Before the RY revolving gate operation, a CX control NOT gate is set, and the control bit and target bit of the CX control NOT gate are respectively located on adjacent quantum circuits (e.g. |q1> is used as the control bit after the Rx(θ[0] operation, and acts on the target bit of |q2> after the Rx(θ[1] operation); after the last layer of RY revolving gate operation, a CX control NOT gate is also set, and the control bit of the CX control NOT gate is located on the quantum circuit where the auxiliary quantum state is located, and the target bit is located on the quantum circuit where the input quantum state is located. And for the last two quantum circuits (e.g. the quantum circuit where |q3>-|q4> is located here, the corresponding output of the quantum residual attention layer also needs to undergo an H gate operation.

[0094] For the auxiliary quantum state, the quantum residual attention layer includes a layer of H gate operation, several layers of CRY controlled rotating gate operation (for example, Ry(θ[4]), where R represents the number of layers of CRY controlled rotating gate) and H gate operation. The control bit of the CRY controlled rotating gate operation is the quantum state of the adjacent quantum circuit (for example, the quantum state obtained after |q4> is controlled by the CX NOT gate operation), and the target bit is the auxiliary quantum state.

[0095] For the CX controlled NOT gate, if the control bit is in the |1> state, the X gate is executed on the target bit. If the control bit is in the |0> state, the target bit does not perform any operation. The X gate operator acts on the base state and can flip the base state. It can change the base state |0> to |1> and the base state |1> to |0>. The matrix form of the CX controlled NOT gate is:

[0096]

[0097] For the H gate, i.e. the Hadamard gate, the matrix form is: It can transform the base state |0> into (|0>+|1>).

[0098] For the CRY controlled revolving door, if the control bit is in the |1> state, the RY revolving door operation is performed on the target bit. If the control bit is in the |0> state, no operation is performed on the target bit.

[0099] The above quantum pooling layer performs alternating operations on any two input quantum states through the RZ rotation gate and the CX control NOT gate. The quantum pooling layer can combine the information of two quantum bits into one quantum bit (for example, reducing the dimension of n quantum bits to n / 2 quantum bits), thereby reducing the subsequent calculation amount and improving the performance of the quantum circuit.

[0100] In a specific implementation, the quantum pooling layer, for any quantum state on the first quantum circuit of two quantum circuits (for example |q i >) first performs an RZ(-π / 2) rotation gate, and the operation result is used as the control bit of the CX control NOT gate, and an X gate operation is performed on the quantum state on the second quantum circuit (for example, |q1>); then, an RZ rotation gate operation is performed on the quantum states of the first quantum circuit and the second quantum circuit respectively (for example, Rz(θ[1] and Rz(θ[0]), and the result of the RZ rotation gate operation on the quantum state on the second quantum circuit is used as the control bit of the CX control NOT gate, and an X gate operation is performed on the quantum state on the first quantum circuit; then, an RY rotation gate operation is performed on the quantum state on the first quantum circuit (for example, Ry(θ[2]).

[0101] In this embodiment, there are 4 input data, and there are four output quantum states after passing through the first quantum residual attention layer. The four output quantum states are input into the quantum pooling layer, and there are two valid output quantum states after being processed by the quantum pooling layer; the two valid output quantum states and the auxiliary quantum state acted upon by the first quantum residual attention layer are input into the second quantum residual attention layer to obtain two final quantum states.

[0102] The matrix form of the RZ revolving door is:

[0103]

[0104] Here, θ represents the rotation angle around the Z axis.

[0105] The final quantum state obtained through the variational quantum circuit is |α L (x)>, specifically expressed as follows:

[0106] |α L (x)>=U θ |φ(x)>|γ>(6);

[0107] Among them, |γ> is an auxiliary quantum state, here the bit is |0>;

[0108] U θ Represent a variational quantum circuit with variational parameter θ:

[0109]

[0110] U αL represents the last quantum residual attention layer; U αi , U βi They represent the i-th quantum residual attention layer and the i-th quantum pooling layer respectively. Indicates the round-up operation, and n indicates the number of input data.

[0111] In this embodiment, U θ =U α2 U β1 U α1 .

[0112] (3) Quantum Measurement Layer

[0113] The quantum measurement layer is used to obtain output data by measuring the quantum state characteristics of the variational quantum circuit output through the Pauli Z gate.

[0114] The output data obtained by the quantum measurement layer is expressed as follows:

[0115]

[0116] Among them, h l represents the output data of the quantum measurement layer, |α L (x)> represents the final quantum state, Represents Pauli-Z gate.

[0117] The matrix form of the Pauli Z-gate is:

[0118]

[0119] In this embodiment, the variational quantum circuit outputs two quantum state characteristics; the quantum measurement layer measures all quantum state characteristics through the Pauli Z gate to obtain two output data, namely h1 and h2.

[0120] (4) Output layer

[0121] The output layer is composed of a fully connected neural network, which is used to process the two output data h1 and h2 to obtain the final prediction data.

[0122] The loss function used in the above quantum residual attention neural network is the mean square error loss function, which is expressed as:

[0123]

[0124] In order to evaluate the performance of quantum residual attention neural network, widely used evaluation indicators are introduced to comprehensively evaluate the performance of the algorithm, including accuracy and complexity evaluation system. The evaluation indicators of algorithm accuracy usually use root mean square error (RMSE), mean absolute error (MAE) and coefficient of determination (R 2 ) to evaluate the regression effect, the formulas of these indicators are defined as:

[0125]

[0126] Among them, y O , Represent the actual value of the jth sample, the predicted value, and the average of the actual values ​​of all samples, and m represents the number of samples. RMSE can evaluate the degree of change in the data. The smaller the RMSE, the better the accuracy of the fitting function in predicting the data. MAE reflects the error of the predicted value. The smaller the MAE, the better the fitting effect. 2 It measures the overall fit of the regression function, and its value range is [0,1]. Generally speaking, R 2 The larger the value, the better the model fit.

[0127] Example 2

[0128] This embodiment provides a material design method, which includes the following steps:

[0129] S1 obtains material composition data.

[0130] The main purpose here is to obtain the chemical elements that constitute the material and the molar percentage of each chemical element.

[0131] S2 performs dimensionality reduction processing on the material composition data to obtain the material composition characteristic data after dimensionality reduction.

[0132] In this embodiment, principal component analysis (PCA) is performed on the material composition data, and the first four principal components are extracted to form the material composition characteristic data after dimensionality reduction. This can be achieved by conventional means disclosed in the art (see Kurita, T.: Principal component analysis (pca). Computer vision: a reference guide, 1-4 (2019)).

[0133] S3 inputs the material composition characteristic data into the quantum residual attention neural network to obtain the material performance prediction data.

[0134] This step includes the following sub-steps:

[0135] S31 encodes material composition characteristic data into initial quantum states through a quantum embedding layer based on quantum logic gates;

[0136] S32 uses a variational quantum circuit to perform quantum state evolution operations on the initial quantum state and extract quantum state characteristics;

[0137] S33 measures the extracted quantum state characteristics through the quantum measurement layer to obtain material performance output data;

[0138] S34 processes the material performance output data through the fully connected layer to obtain the final material performance prediction data.

[0139] Application Examples

[0140] In this application example, the quantum residual attention neural network provided in Example 1 is used.

[0141] This application example uses 12 elements (including Co (cobalt), Cr (chromium), Fe (iron), Ni (nickel), Ti (titanium), Nb (niobium), Mo (molybdenum), W (tungsten), Cu (copper), Al (aluminum), Si (silicon), B (boron)) to form 600 kinds of high entropy alloys and corresponding performance labels, such as melting point, according to the proportion. Based on these 600 kinds of material components and corresponding performance labels, the material design method provided by the present invention is explained in detail.

[0142] This application example first uses principal component analysis (PCA) to reduce the dimension of 12 elements based on 600 material component data X0 (each row represents an alloy material, and each column corresponds to the molar percentage of each element in a material component) to obtain the first four principal components. The specific steps are as follows:

[0143] (1) Standardize data.

[0144] PCA is very sensitive to the dimension of features, so before performing PCA, it is usually necessary to standardize the data. The column standardization formula for the kth element is:

[0145]

[0146] Among them, X b,c , represents the sample vector of the kth element before and after standardization; μ c represents the mean molar percentage of the kth element in all samples; σ c It represents the standard deviation of the mole percentage of the kth element in all samples.

[0147] Through the above formula, the material component sample after standardization is expressed as

[0148] (2) Construct the covariance matrix C of 600 material components, N stands for The amount of alloy material;

[0149] (3) Perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalue λ and eigenvector P;

[0150] (4) Arrange in descending order of eigenvalues ​​and select the first four principal components; select the corresponding four eigenvectors to form the eigenvector matrix P′;

[0151] (5) Transformed into the new space constructed by 4 eigenvectors, we get

[0152] One of the principal component data is shown in Table 1.

[0153] Table 1 Results of principal component analysis

[0154] Principal component 1 Principal component 2 Principal component 3 Principal component 4 0.555940 -0.182522 0.665081 -0.056903

[0155] After dimensionality reduction processing of 600 material components, the material composition characteristic data of 600 materials were obtained.

[0156] At the same time, the melting points of 600 materials are normalized, which helps in the following aspects:

[0157] (1) Accelerate convergence: If the melting point has a large numerical range (for example, the difference between 2000°C and 300°C), the gradient of the neural network may be very large, which may lead to unstable training. Normalization can compress the output range, making the model training more stable.

[0158] (2) Numerical scale consistency: Normalization can make the outputs on a similar numerical scale, which helps the optimization process.

[0159] The normalized formula is generally:

[0160]

[0161] y0 represents the original melting point value, y xyz ,y xi{ They represent the maximum and minimum values ​​of the melting point data respectively, and y represents the normalized melting point; for example, if the melting point range is between 300℃ and 3000℃, after normalization, 300℃ will be converted to 0 and 3000℃ will be converted to 1.

[0162] The material composition characteristic data after dimension reduction and the normalized melting point form a data pair (X, y), X = {x1, x2, x3, x4}, and are divided into a training set and a test set in a ratio of 8:2.

[0163] The quantum residual attention neural network provided in the embodiment is trained using the training set, using the mean square error loss function, and using the loss value to optimize the variational parameters through the gradient descent algorithm until the loss value tends to be stable and unchanged.

[0164] The test set data is then input into the trained quantum residual attention neural network for testing, and the root mean square error (RMSE), mean absolute error (MAE) and coefficient of determination (R 2) to evaluate the regression effect. If the effect is not good, the quantum residual attention neural network can be adjusted by adjusting the gate operation, the number of quantum residual attention layers and quantum pooling layers, or the input data dimension (that is, the number of principal components) can be adjusted to further train the quantum residual attention neural network until it has an excellent evaluation regression effect.

[0165] After training, the output of the network will be a normalized value between [0,1]. In order to convert the output value back to the true melting point value, it needs to be denormalized. The denormalization formula is:

[0166]

[0167] This will normalize the output values ​​back to the actual melting point range.

[0168] For example, the input data of the material components in Table 2 after dimensionality reduction is input into the trained quantum residual attention neural network, and the normalized value obtained is The predicted melting point was 2595 °C using inverse normalization.

[0169] Table 2 Material composition and melting point

[0170] Co Cr Fe Ni Ti Nb Mo W Cu Al Si B Melting point(℃) 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.05 0.05 0.05 0.05 2650

[0171] The regression effect evaluation of the QRANN of the present invention is compared with that of the commonly used multi-layer perceptron (MLP) (as shown in Table 3). The scheme proposed by the present invention can have higher prediction accuracy. Moreover, the QRANN of the present invention converges in only 30 iterations, while the currently commonly used MLP requires 400 iterations to converge. It can be seen that the quantum residual attention neural network provided by the present invention not only has excellent prediction effect, but also has a fast training convergence speed, effectively saving training time.

[0172] Table 3 Evaluation of material performance prediction results (the best data are in bold)

[0173] network <![CDATA[R 2 ]]> RMSE MAE Iterations QRANN 0.99±0.002 0.105±0.012 0.083±0.011 30 MLP 0.977±0.006 0.158±0.019 0.107±0.003 400

[0174] The present invention belongs to the field of quantum artificial intelligence computing. It realizes the quantum neural network computing process through variational quantum circuits, and utilizes the quantum noise characteristics of quantum computers to improve the generalization of the model, which is particularly suitable for improving the accuracy of the model in small sample training. In addition, it makes full use of the parallel characteristics of quantum computing to achieve the purpose of accelerating model training and improve the speed of model convergence.

[0175] Those skilled in the art will appreciate that the embodiments herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.

Claims

1. A quantum residual attention neural network, characterized in that: include: A quantum embedding layer based on quantum logic gates to encode input data into the initial quantum state; A variational quantum circuit is used to combine the auxiliary quantum state to act on the initial quantum state, realize the evolution of the quantum state, and extract the characteristics of the quantum state; the variational quantum circuit includes a trunk quantum circuit where the initial quantum state is located and an auxiliary quantum circuit where the auxiliary quantum state is located; the variational quantum circuit is provided with a plurality of quantum residual attention layers, and a quantum pooling layer located between two adjacent quantum residual attention layers; Each quantum residual attention layer takes the initial quantum state and the auxiliary quantum state as input, or the output quantum state of the quantum pooling layer and the auxiliary quantum state acted upon by the previous quantum residual attention layer as input; the quantum pooling layer takes the output quantum state on the main quantum circuit of the previous quantum residual attention layer as input; The quantum residual attention layer performs alternating operations on the input quantum state through the RX rotation gate and the RY rotation gate; The quantum pooling layer performs alternating operations on any two input quantum states through an RZ rotation gate and a CX control NOT gate; The quantum measurement layer is used to obtain output data by measuring the quantum state characteristics of the variational quantum circuit output through the Pauli Z gate.

2. The quantum residual attention neural network according to claim 1, characterized in that The quantum embedding layer is connected through the quantum logic gate U φ (x) acts on or In the ground state, the encoded initial quantum state |φ(x)> is obtained, where n represents the number of quantum bits required to encode the input data; the specific expression is as follows: or The quantum logic gate U φ (x) includes at least one of the RX revolving door, RY revolving door, and RZ revolving door.

3. The quantum residual attention neural network according to claim 1, characterized in that The final quantum state obtained through the variational quantum circuit is |α L (x)>, specifically expressed as follows: |a L (x)>=U θ |φ(x)>|γ>; Among them, |γ> auxiliary quantum state is |0> or |1>; U θ Represent a variational quantum circuit with variational parameter θ: U αL represents the last quantum residual attention layer; U αi , U βi They represent the i-th quantum residual attention layer and the i-th quantum pooling layer respectively. Indicates the round-up operation, and n indicates the number of input data.

4. The quantum residual attention neural network according to claim 1, characterized in that In the quantum residual attention layer, the matrix form of the RX revolving gate is: Where θ represents the rotation angle around the X axis; The matrix form of the RY revolving door is: Here, θ represents the rotation angle around the Y axis.

5. The quantum residual attention neural network according to claim 4, characterized in that For the input quantum state on the trunk quantum circuit, the quantum residual attention layer includes one layer of RX revolving gate operation and several layers of RY revolving gate operation; before the RY revolving gate operation, a CX control NOT gate is set, and the control bit and target bit of the CX control NOT gate are respectively located on adjacent quantum circuits; after the last layer of RY revolving gate operation, a CX control NOT gate is also set, and the control bit of the CX control NOT gate is located on the quantum circuit where the auxiliary quantum state is located, and the target bit is located on the quantum circuit where the input quantum state is located; For the auxiliary quantum state, the quantum residual attention layer includes a layer of H gate operation, several layers of CRY controlled rotating gate operation and H gate operation; the control bit of the CRY controlled rotating gate operation is the quantum state of the adjacent quantum circuit, and the target bit is the auxiliary quantum state.

6. The quantum residual attention neural network according to claim 5, characterized in that For the control NOT gate CX, if the control bit is in the |1> state, the X gate is executed at the target bit, and if the control bit is in the |0> state, the target bit does not perform any operation; the matrix form of the control NOT gate CX is:

7. The quantum residual attention neural network according to claim 1, characterized in that The quantum pooling layer first performs an RZ (-π / 2) rotation gate on the quantum state on the first quantum circuit of any two quantum circuits, and the operation result is used as the control bit of the CX control NOT gate, and an X gate operation is performed on the quantum state on the second quantum circuit; then, an RZ rotation gate operation is performed on the quantum states of the first quantum circuit and the second quantum circuit respectively, and the result of the RZ rotation gate operation on the quantum state on the second quantum circuit is used as the control bit of the CX control NOT gate, and an X gate operation is performed on the quantum state on the first quantum circuit; then, an RY rotation gate operation is performed on the quantum state on the first quantum circuit.

8. The quantum residual attention neural network according to claim 7, characterized in that In the quantum pooling layer, the matrix form of the RZ revolving gate is: Here, θ represents the rotation angle around the Z axis.

9. The quantum residual attention neural network according to claim 1, characterized in that The variational quantum circuit outputs at least two quantum state characteristics; the quantum measurement layer measures all quantum state characteristics through the Pauli Z gate to obtain more than two output data; The quantum residual attention neural network also includes an output layer, which is used to process more than two output data to obtain final prediction data.

10. Application of the quantum residual attention neural network described in any one of claims 1 to 9 in material design.

11. A material design method, characterized in that: The following steps are involved: S1 obtains material composition data; S2 performs dimensionality reduction processing on the material composition data to obtain the material composition characteristic data after dimensionality reduction; S3 inputs the material composition characteristic data into the quantum residual attention neural network described in any one of claims 1 to 9 to obtain material performance prediction data.

Citation Information

Patent Citations

  • Meteorological data prediction method and device, storage medium and electronic device

    CN116011682A

  • Quantum state coding circuit, quantum calculation method and related device

    CN117787428A

  • Image multi-classification method based on hybrid quantum neural network, electronic equipment and storage medium

    CN118823483A