Model training method, device, equipment and medium for quantum state generation

Through the training method of the generative model, quantum state sample data is used for encoding and reparameterization processing, and the target quantum decoding layer of the quantum neural network is adjusted, solving the problem of low efficiency in combining generative artificial intelligence with quantum computing, and achieving efficient and accurate quantum state data generation.

CN117634623BActive Publication Date: 2025-09-02BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311607357.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-28
Publication Date
2025-09-02
Estimated Expiration
2043-11-28

AI Technical Summary

Technical Problem

In the prior art, there is less combination of generative artificial intelligence and quantum computing, and it is difficult to effectively use quantum computing to improve the efficiency and accuracy of generative artificial intelligence.

Method used

Through the training method of generating the model, quantum state sample data is used for encoding processing, reparameterization processing is performed, the target quantum decoding layer of the quantum neural network is adjusted, output data similar to the style of the quantum state sample data, and the accuracy of the generative model is improved through training.

Benefits of technology

The generative model can more accurately and efficiently generate output data similar to the data style of quantum state sample, which improves the data generation efficiency and accuracy of quantum computing, and reduces the risk of sensitive information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117634623B_ABST
    Figure CN117634623B_ABST
Patent Text Reader

Abstract

The present disclosure provides a training method for a generative model, which relates to the field of artificial intelligence technology, and in particular to the field of generative artificial intelligence and quantum computing technology. The specific implementation scheme is as follows: according to quantum state sample data, a first encoding result and a second encoding result are obtained; according to the first encoding result and the second encoding result, a reparameterization process is performed to obtain sample data to be processed; according to the sample data to be processed, parameter data is obtained; the target quantum decoding layer of the quantum neural network of the generative model is adjusted using the parameter data to obtain the adjusted quantum neural network; the quantum state output data is generated using the adjusted quantum neural network; and the generative model is trained based on the quantum state sample data and the quantum state output data. The present disclosure also provides a data generation method, device, electronic device and storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of artificial intelligence technology, particularly generative artificial intelligence (AIGC) and quantum computing, and can be applied to scenarios such as automated writing, speech synthesis, and image generation. More specifically, the present disclosure provides a generative model training method, data generation method, device, electronic device, and storage medium. Background Art

[0002] With the development of artificial intelligence and quantum computing technology, quantum computing technology can be introduced into artificial intelligence tasks to improve the execution efficiency of artificial intelligence tasks; artificial intelligence technology can also be used to expand the application scenarios of quantum computing. Summary of the Invention

[0003] The present disclosure provides a training method for generating a model, a data generation method, an apparatus, a device, and a storage medium.

[0004] According to one aspect of the present disclosure, a method for training a generative model is provided, the method comprising: obtaining a first encoding result and a second encoding result based on quantum state sample data; performing reparameterization processing based on the first encoding result and the second encoding result to obtain sample data to be processed; obtaining parameter data based on the sample data to be processed; using the parameter data to adjust a target quantum decoding layer of a quantum neural network of the generative model to obtain an adjusted quantum neural network, wherein the quantum neural network of the generative model includes multiple quantum decoding layers, the multiple quantum decoding layers include a quantum decoding layer to be trained, and the target quantum decoding layer is a quantum decoding layer subsequent to the quantum decoding layer to be trained; generating quantum state output data using the adjusted quantum neural network; and training the generative model based on the quantum state sample data and the quantum state output data.

[0005] According to another aspect of the present disclosure, a data generation method is provided, comprising: obtaining parameter data based on input data to be processed; generating quantum state output data using a quantum neural network of a generative model based on the parameter data; and determining target data based on the quantum state output data, wherein the generative model is trained using the method provided by the present disclosure.

[0006] According to another aspect of the present disclosure, a training device for a generative model is provided, the device comprising: a first acquisition module for obtaining a first encoding result and a second encoding result based on quantum state sample data; a reparameterization processing module for performing reparameterization processing based on the first encoding result and the second encoding result to obtain sample data to be processed; a second acquisition module for obtaining parameter data based on the sample data to be processed; an adjustment module for adjusting a target quantum decoding layer of a quantum neural network of the generative model using the parameter data to obtain an adjusted quantum neural network, wherein the quantum neural network of the generative model includes multiple quantum decoding layers, the multiple quantum decoding layers include a quantum decoding layer to be trained, and the target quantum decoding layer is a quantum decoding layer subsequent to the quantum decoding layer to be trained; a first generation module for generating quantum state output data using the adjusted quantum neural network; and a training module for training the generative model based on the quantum state sample data and the quantum state output data.

[0007] According to another aspect of the present disclosure, a data generation device is provided, which includes: a third acquisition module for obtaining parameter data based on input data to be processed; a second generation module for generating quantum state output data using a quantum neural network of a generation model based on the parameter data; and a determination module for determining target data based on the quantum state output data, wherein the generation model is trained using the device provided by the present disclosure.

[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided according to the present disclosure.

[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method provided according to the present disclosure.

[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the method provided according to the present disclosure when executed by a processor.

[0011] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0013] Figure 1 is a schematic flow chart of a training method for a generative model according to one embodiment of the present disclosure;

[0014] Figure 2 is a schematic diagram of a coding model according to an embodiment of the present disclosure;

[0015] Figure 3 is a schematic diagram of a generative model according to one embodiment of the present disclosure;

[0016] Figure 4 is a schematic diagram of a quantum neural network of a generative model according to another embodiment of the present disclosure;

[0017] Figure 5 is a schematic flow chart of a data generation method according to an embodiment of the present disclosure;

[0018] Figure 6 is a block diagram of a training apparatus for a generative model according to one embodiment of the present disclosure;

[0019] Figure 7 is a block diagram of a data generating apparatus according to an embodiment of the present disclosure; and

[0020] Figure 8 1 is a block diagram of an electronic device to which a training method for generating a model and / or a data generation method can be applied according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0022] Generative AI represents a new machine learning approach that transforms machines from passive information processing devices into creative devices capable of generating new content. By leveraging large amounts of existing text, images, audio, and other data, generative AI technology can learn and generate new content that is similar to the original data. Typical applications of this technology include automated writing, speech synthesis, and image generation. Generative AI holds enormous potential in content creation.

[0023] Quantum computing is an emerging computing method that leverages the principles of quantum mechanics to perform calculations more efficiently than traditional computers. Quantum computing uses quantum bits (qubits) as the basic unit of computation. Qubits can simultaneously exist in a superposition of 0 and 1, enabling parallel computing. Furthermore, qubits can form entanglements, enabling quantum computing to process and store more complex information.

[0024] Generative AI and quantum computing are both important research areas, but relatively little research has combined the two. For example, there are relatively few ways to use quantum computing to generate new content.

[0025] Leveraging the advantages of quantum computing can better handle and solve complex optimization problems, providing more accurate and efficient algorithmic support for generative AI. Furthermore, generative AI can also bring new applications to the field of quantum computing. For example, using generative AI, it is possible to generate the ground state of the Hamiltonian or generate quantum states that meet specific requirements.

[0026] Based on this, the present disclosure provides a training method for generating a model, which will be described below.

[0027] Figure 1 4 is a flowchart of a training method for a generative model according to an embodiment of the present disclosure.

[0028] like Figure 1 As shown, the method 100 may include operations S110 to S160.

[0029] In operation S110 , a first encoding result and a second encoding result are obtained according to the quantum state sample data.

[0030] In the embodiment of the present disclosure, the quantum state sample data may correspond to data having a target style. Multiple quantum state sample data may correspond to data having the same target style.

[0031] In the disclosed embodiments, various methods can be used to encode quantum state sample data to obtain at least one first encoding result and at least one second encoding result. The first encoding result can be a numerical value. The second encoding result can also be a numerical value.

[0032] In operation S120 , re-parameterization processing is performed according to the first encoding result and the second encoding result to obtain sample data to be processed.

[0033] In the disclosed embodiment, the first encoding result can be used as an average value, and the second encoding result can be used as a variance. Thus, based on at least one first encoding result and at least one second encoding result, reparameterization processing can be performed to obtain at least one sample data to be processed.

[0034] In operation S130 , parameter data is obtained according to the sample data to be processed.

[0035] In the embodiments of the present disclosure, parameter data can be obtained using various methods. The parameter data can be one or more. For example, the sample data to be processed can be converted into parameter data according to a preset mapping relationship. For another example, the sample data to be processed can be processed using a fully connected network to obtain the parameter data.

[0036] In operation S140, the target quantum decoding layer of the quantum neural network of the generative model is adjusted using the parameter data to obtain an adjusted quantum neural network.

[0037] In the disclosed embodiments, the generative model may include a quantum neural network. The quantum neural network may correspond to a certain number of quantum bits. The number of parameter data may be an integer multiple of the number of quantum bits.

[0038] In the disclosed embodiments, the quantum neural network of the generative model includes multiple quantum decoding layers. For example, assuming that multiple qubits are configured with the same number of quantum logic gates, the first quantum logic gate of each of the multiple qubits can constitute a quantum decoding layer. The second quantum logic gate of each of the multiple qubits can constitute a quantum decoding layer. The last quantum logic gate of each of the multiple qubits can constitute another quantum decoding layer. It is understood that multiple qubits can also be configured with different numbers of quantum logic gates, and this disclosure is not limited to this.

[0039] In the disclosed embodiment, the multiple quantum decoding layers include at least one quantum decoding layer to be trained. For example, a quantum decoding layer composed of the second quantum logic gate of each of the multiple quantum bits can be used as the quantum decoding layer to be trained.

[0040] In the disclosed embodiments, the target quantum decoding layer is the decoding layer following the quantum decoding layer to be trained. At least one target quantum decoding layer is derived from at least one quantum decoding layer following the quantum decoding layer to be trained. The target quantum decoding layer can be the quantum decoding layer following any quantum decoding layer to be trained. For example, at least one target quantum decoding layer can include a quantum decoding layer consisting of the last quantum logic gate of each of the aforementioned multiple qubits.

[0041] In operation S150 , quantum state output data is generated using the adjusted quantum neural network.

[0042] For example, arbitrary quantum state data can be input into the adjusted quantum neural network to generate quantum state output data.

[0043] In operation S160, a model is trained based on the quantum state sample data and the quantum state output data.

[0044] In the disclosed embodiment, the generative model can be trained based on the difference between the quantum state sample data and the quantum state output data. For example, the parameters of the quantum decoding layer to be trained can be adjusted to train the generative model.

[0045] Through the disclosed embodiments, based on the reparameterization process, the generative model can fully obtain effective information from the encoding results, and can also enable the generative model to generate output data that is similar to but different from the quantum state sample data. In addition, based on the sample data to be processed obtained by the reparameterization process, parameter data is obtained, and the parameters of the decoding layer after the quantum decoding layer to be trained are adjusted. This can fully utilize the information of the quantum state sample data and improve the accuracy of the quantum neural network. The style of the quantum state sample data can be more accurately and efficiently added to the quantum state output data, allowing the generative model to generate quantum state data with a style similar to that of the quantum state sample data.

[0046] Furthermore, through the disclosed embodiments, the trained quantum neural network of the generative model can realize the simulation of quantum computing. Based on the parameters of the trained quantum neural network of the generative model, the data generation efficiency and accuracy of the quantum computing device can be improved.

[0047] It will be appreciated that the training method of the present disclosure has been described above in conjunction with a generative model. However, the present disclosure is not limited thereto. During the model training process, a coding model may also be trained to obtain a first coding result and a second coding result based on quantum state sample data, as will be described below.

[0048] In some embodiments, obtaining the first encoding result and the second encoding result based on the quantum state sample data includes: inputting the quantum state sample data into a coding model to obtain the first encoding result and the second encoding result.

[0049] In the embodiment of the present disclosure, the coding model may include a quantum neural network and a fully connected network. Figure 2 The encoding model is described.

[0050] Figure 2 is a schematic diagram of a coding model according to an embodiment of the present disclosure.

[0051] like Figure 2 As shown, the encoding model may include a quantum neural network QNN21 and a fully connected network NN21.

[0052] In the embodiment of the present disclosure, the quantum neural network of the encoding model can be a quantum neural network of N quantum bits. N can be an integer greater than 1. Figure 2 As shown, the quantum neural network QNN21 can be, for example, a 4-qubit quantum neural network. The 4 qubits corresponding to the quantum neural network QNN21 can include a first qubit, a second qubit, a third qubit, and a fourth qubit. The first qubit can be configured with a single-bit rotation gate E y (θ 1,1 ), single bit revolving door R z (θ 1,5 ), single bit revolving door R y (θ 1,9 ) and single-bit revolving door R z (θ 1,13 The second qubit can be configured as a single-bit rotation gate R y (θ 1,2 ), single bit revolving door E z (θ 1,6 ), single bit revolving door E y (θ 1,10 ) and single bit revolving door E z (θ 1,14 ). The third qubit can be configured as a single-bit rotation gate R y (θ 1,3 ), single bit revolving door R z (θ 1,7 ), single bit revolving door R y (θ 1,11 ) and single bit revolving door E z (θ 1,15 The fourth qubit can be configured as a single-bit rotation gate E y (θ 1,4 ), single bit revolving door R z (θ 1,8 ), single bit revolving door R y (θ 1,12 ) and single-bit revolving door R z (θ 1,16 ). A controlled NOT gate (CNOT) can be configured between the two single-bit rotation gates of any qubit. It is understood that N can also be other integers, and this disclosure is not limited to this.

[0053] In the embodiment of the present disclosure, the quantum neural network of the coding model may include multiple quantum coding layers. The quantum coding layer may include a single-bit rotation gate for each of the multiple quantum bits. Figure 2 As shown, the quantum encoding layer E21 may include a single-bit rotation gate E y (θ1,1 ), the single-bit rotation gate R of the second qubit y (θ 1,2 ), the single-bit rotating gate R of the third qubit y (θ 1,3 ), the fourth qubit single-bit rotation gate E y (θ 1,4 ). The quantum encoding layer E22 may include a single-bit rotation gate R of the first quantum bit. y (θ 1,5 ), the single-bit rotation gate R of the second qubit y (θ 1,6 ), the single-bit rotating gate R of the third qubit y (θ 1,7 ), the fourth qubit single-bit rotation gate R y (θ 1,8 ). The quantum encoding layer E23 may include a single-bit rotation gate R of the first quantum bit. y (θ 1,9 ), the single-bit rotation gate R of the second qubit y (θ 1,10 ), the single-bit rotating gate R of the third qubit y (θ 1,11 ), the fourth qubit single-bit rotation gate R y (θ 1,12 ). The quantum encoding layer E24 may include a single-bit rotation gate R of the first quantum bit. y (θ 1,13 ), the single-bit rotation gate R of the second qubit y (θ 1,14 ), the single-bit rotating gate R of the third qubit y (θ 1,15 ), the fourth qubit single-bit rotation gate R y (θ 1,16 ).

[0054] It is understood that, in addition to the first quantum coding layer E21, the controlled NOT gates of the quantum coding layer and the multiple qubits can implement various processing (e.g., convolution processing). For example, the quantum coding layer E22 and the multiple controlled NOT gates between the quantum coding layer E21 and the quantum coding layer E22 can implement convolution processing.

[0055] In the disclosed embodiment, the quantum state sample data is input into the quantum neural network of the encoding model to obtain the measurement result.

[0056] For example, the quantum state sample data can be a vector. Figure 2As shown, the quantum state sample data |x> can be a 16×1 vector. Taking the quantum state sample data obtained based on image sample data as an example, for example, a 4×4 image can be stretched into a 16×1 initial vector and encoded into a quantum state to obtain the quantum state sample data |x>.

[0057] For example, by inputting quantum state sample data into the quantum neural network of the encoding model, N output results can be obtained. Measuring the N output results can obtain N measurement results. The Pauli-Z operator can be used for measurement to obtain N measurement results. The N measurement results may include, for example, measurement result M21, measurement result M22, measurement result M23, and measurement result M24. Through the embodiments of the present disclosure, multiple measurement results corresponding to the quantum sample data are obtained, avoiding simple reconstruction of the quantum state sample data and facilitating the generation of quantum states.

[0058] For example, by inputting multiple measurement results into the fully connected network of the coding model, at least one first coding result and at least one second coding result can be obtained. For example, by inputting measurement results M21, measurement results M22, measurement results M23 and measurement results M24 into the fully connected network NN21, a first coding result μ21, a first coding result μ21, a second coding result σ21 and a second coding result σ22 can be obtained. The numerical range of the first coding result can be negative infinity (-∞) to positive infinity (+∞). The second coding result can be greater than zero. It can be understood that, taking N=4 as an example, N can be an even number 4. N measurement results are input into the fully connected network of the coding model to obtain N / 2 first coding results and N / 2 second coding results. Through the embodiment of the present disclosure, an even number of quantum bits can produce an even number of output results. Thus, the first coding result and the second coding result can be obtained, which helps to realize subsequent reparameterization processing.

[0059] In some embodiments, a first encoding result may correspond to a second encoding result. For example, the first encoding result μ21 may correspond to the second encoding result σ21. The first encoding result μ22 may correspond to the second encoding result σ22.

[0060] It can be understood that some methods of obtaining the first encoding result and the second encoding result are described above, and some methods of performing re-parameterization processing according to the first encoding result and the second encoding result will be described below.

[0061] In some embodiments, performing reparameterization processing based on the first encoding result and the second encoding result to obtain the sample data to be processed includes: multiplying the processing parameter by the second encoding result to obtain a product result, and adding the first encoding result and the product result to obtain the sample data to be processed.

[0062] In the embodiment of the present disclosure, the processing parameters are randomly sampled from a standard normal distribution. For example, the sample data z to be processed can be obtained by the following formula:

[0063] z=μ+σ·∈ (Formula 1)

[0064] μ can be the first encoding result, σ can be the second encoding result, and ∈ can be a processing parameter. σ·∈ can be the product result. Thus, the sample data to be processed conforms to the Gaussian distribution.

[0065] In the embodiment of the present disclosure, the sample data to be processed may be at least one. For example, according to the above-mentioned first encoding result μ21, the corresponding second encoding result σ21 and the processing parameter ∈1, the sample data to be processed z1 can be obtained using the above-mentioned formula 1. According to the above-mentioned first encoding result μ22, the corresponding second encoding result σ22 and the processing parameter ∈2, the sample data to be processed z2 can be obtained using the above-mentioned formula 1. Through the embodiment of the present disclosure, reparameterization processing is performed, which can be based on the variational autoencoder (VAE), which helps to generate quantum state data more accurately. The generated quantum state output data has a higher style similarity with the quantum state sample data. In the case of training with multiple quantum state sample data, the generated quantum state output data can be made more consistent with objective laws, which can fully improve the user experience. In addition, through the embodiment of the present disclosure, based on the reparameterization processing, the trained generation model can generate quantum state data using data in the standard normal distribution, which helps to reduce the risk of leakage of sensitive information and improve security.

[0066] It can be understood that the above describes some of the ways of reparameterization. Figure 3 The generation model of the present disclosure is further explained.

[0067] Figure 3 is a schematic diagram of a generative model according to an embodiment of the present disclosure.

[0068] like Figure 3As shown, the quantum state sample data is input into the quantum neural network QNN31 of the encoding model to obtain measurement results M31, measurement results M32, measurement results M33 and measurement results M34. The measurement results M31, measurement results M32, measurement results M33 and measurement results M34 are input into the fully connected network NN31 to obtain the first encoding result μ31, the first encoding result μ32, the second encoding result σ31 and the second encoding result σ32. According to the first encoding result μ31 and the second encoding result σ31, reparameterization processing is performed to obtain the sample data z31 to be processed. According to the first encoding result μ32 and the second encoding result σ32, reparameterization processing is performed to obtain the sample data z32 to be processed. It can be understood that the description of the quantum neural network QNN31 and the fully connected network NN31 is the same or similar to the above-mentioned quantum neural network QNN21 and the fully connected network NN21, and will not be repeated in this disclosure. The method of obtaining the sample data z31 to be processed and the sample data z32 to be processed is the same as or similar to the method of obtaining the sample data z1 to be processed and the sample data z2 to be processed, and will not be described in detail in this disclosure.

[0069] In some embodiments, the generative model may include a fully connected network and a quantum neural network. Figure 3 As shown, the generation model may include a fully connected network NN32 and a quantum neural network QNN32. The fully connected network NN32 will be described below.

[0070] In the disclosed embodiment, obtaining parameter data based on the sample data to be processed includes: inputting the sample data to be processed into a fully connected network of a generative model to obtain the parameter data. The parameter data may be one or more. For example, inputting the sample data to be processed z31 and the sample data to be processed z32 into the fully connected network NN32 may obtain parameter data y1 to parameter data y8.

[0071] In the embodiments of the present disclosure, the parameter data may include first parameter data and second parameter data. In the case of multiple parameter data, the first parameter data may be at least one, and the second parameter data may also be at least one. For example, parameter data y1 to parameter data y4 may be used as four first parameter data. Parameter data y5 to parameter data y8 may be used as four second parameter data. It will be understood that the fully connected network of the generative model of the present disclosure is described above, and the quantum neural network of the generative model will be described below.

[0072] In the embodiment of the present disclosure, the quantum neural network of the generation model corresponds to at least one quantum bit. Figure 3As shown, the quantum neural network QNN32 may correspond to 4 qubits. The 4 qubits may include a fifth qubit, a sixth qubit, a seventh qubit, and an eighth qubit. It is understood that the number of qubits in the quantum neural network of the generation model may be the same as or different from the number of qubits in the quantum neural network of the encoding model, and this disclosure is not limited thereto.

[0073] In the embodiment of the present disclosure, the quantum neural network of the generation model may include multiple quantum decoding layers. The multiple quantum decoding layers may include a quantum decoding layer to be trained. The quantum decoding layer may include a single-bit rotation gate of at least one quantum bit. For example, the quantum decoding layer D32 may include a single-bit rotation gate R of the fifth quantum bit. z (θ 2,1 ), the sixth qubit single-bit revolving gate R z (θ 2,2 ), the single-bit revolving gate R of the seventh quantum bit z (θ 2,3 ), the single-bit rotating gate R of the eighth quantum bit z (θ 2,4 ). The quantum decoding layer D32 can serve as the quantum decoding layer to be trained.

[0074] In some embodiments, using parameter data to adjust a target quantum decoding layer of a quantum neural network of a generative model to obtain an adjusted quantum neural network includes: using the parameter data to adjust a rotation angle of a single-bit rotation gate of a quantum bit in the target quantum decoding layer.

[0075] In the embodiment of the present disclosure, the target quantum decoding layer may be from at least one quantum decoding layer after the quantum decoding layer to be trained. The input of the quantum decoding layer after the quantum decoding layer to be trained is determined according to the output of the quantum decoding layer to be trained. The rotation angle of the single-bit rotation gate of at least one quantum bit in the target quantum decoding layer can be adjusted by using at least one parameter data. Figure 3 As shown, the quantum decoding layer D33 is a subsequent quantum decoding layer of the quantum decoding layer D32 and can be used as a target quantum decoding layer. The parameter data y5 to parameter data y8 can be used to adjust the rotation angles of the single-bit rotation gates of the multiple quantum bits in the quantum decoding layer D33. For example, for the quantum decoding layer D33, the parameter data y5 can be used as the rotation angle of the single-bit rotation gate of the fifth quantum bit, the parameter data y6 can be used as the rotation angle of the single-bit rotation gate of the sixth quantum bit, the parameter data y7 can be used as the rotation angle of the single-bit rotation gate of the seventh quantum bit, and the parameter data y8 can be used as the rotation angle of the single-bit rotation gate of the eighth quantum bit. Thus, the adjusted quantum decoding layer D33 may include the single-bit rotation gate R of the fifth quantum bit. y (y5), the single-bit revolving gate R of the sixth quantum bity (y6), the single-bit revolving gate R of the seventh quantum bit y (y7) and the single-bit rotation gate R of the eighth qubit y (y8). Through the embodiment of the present disclosure, the target quantum decoding layer comes from the subsequent quantum decoding layer of the quantum decoding layer to be trained. Therefore, compared with using parameter data to adjust the previous quantum decoding layer of the quantum decoding layer to be trained, using parameter data to adjust the target quantum decoding layer can make full use of the effective information of the quantum state sample data, and can also fully improve the accuracy of the generation model, which is conducive to generating quantum state output data that is more similar to the style of the quantum state sample data. It can be understood that in addition to using parameter data as the rotation angle of a single-bit rotation gate, other methods can also be used to adjust the rotation angle. For example, various operations (such as addition, etc.) can be performed on the parameter data and the current rotation angle of the corresponding single-bit rotation gate to adjust the rotation angle.

[0076] It is understood that the second parameter data is used to adjust the subsequent quantum decoding layer of the quantum decoding layer to be trained. However, the present disclosure is not limited thereto, and the previous quantum decoding layer of the quantum decoding layer to be trained may also be adjusted, as will be explained below.

[0077] In the embodiment of the present disclosure, the multiple quantum decoding layers also include a quantum decoding layer before the quantum decoding layer to be trained. There may be one or more quantum decoding layers before the quantum decoding layer to be trained. The input of the quantum decoding layer to be trained may be determined based on the previous quantum decoding layer of the quantum decoding layer to be trained. Figure 3 As shown, the quantum decoding layer D31 may be the previous quantum decoding layer of the quantum decoding layer D32.

[0078] In the embodiment of the present disclosure, using parameter data to adjust the target quantum decoding layer of the quantum neural network of the generation model further includes: using the first parameter data to adjust the quantum decoding layer before the target quantum decoding layer. Figure 3 As shown, the quantum decoding layer D31 can be the previous quantum decoding layer of the quantum decoding layer D32. The rotation angle of the single-bit rotation gate of at least one quantum bit in the previous quantum decoding layer can be adjusted using at least one first parameter data. For example, for the quantum decoding layer D31, the parameter data y1 can be used as the rotation angle of the single-bit rotation gate of the fifth quantum bit, the parameter data y2 can be used as the rotation angle of the single-bit rotation gate of the sixth quantum bit, the parameter data y3 can be used as the rotation angle of the single-bit rotation gate of the seventh quantum bit, and the parameter data y4 can be used as the rotation angle of the single-bit rotation gate of the eighth quantum bit. Thus, the adjusted quantum decoding layer D31 may include the single-bit rotation gate R of the fifth quantum bit. y (y1), the single-bit revolving gate R of the sixth quantum bit y (y2), the single-bit revolving gate R of the seventh quantum bit y(y3) and the single-bit rotation gate R of the eighth quantum bit y (y4). Through the disclosed embodiments, the target quantum decoding layer is derived from a subsequent quantum decoding layer of the quantum decoding layer to be trained. When parameter data is used to adjust the target quantum decoding layer, the parameter data is also used to adjust the preceding quantum decoding layer of the quantum decoding layer to be trained. This can further utilize the effective information of the quantum state sample data, helping to reduce training complexity and further improve the accuracy of the generated model, thereby facilitating the rapid and efficient generation of quantum state output data that is more similar in style to the quantum state sample data.

[0079] It can be understood that when the first and second parameter data are used to adjust the preceding and succeeding quantum decoding layers of the quantum decoding layer to be trained, respectively, different single-bit rotary gates of the same qubit overload different information from the quantum state sample data. For example, the two single-bit rotary gates of the fifth qubit are loaded with parameter data y1 and parameter data y5, respectively. The two single-bit rotary gates of the sixth qubit are loaded with parameter data y2 and parameter data y6, respectively. The two single-bit rotary gates of the seventh qubit are loaded with parameter data y3 and parameter data y7, respectively. The two single-bit rotary gates of the eighth qubit are loaded with parameter data y4 and parameter data y8, respectively. This allows further utilization of the effective information of the quantum state sample data.

[0080] It can be understood that the above describes some methods for adjusting the target quantum decoding layer, and the following describes some methods for generating quantum state output data.

[0081] In some embodiments, generating quantum state output data using the adjusted quantum neural network includes: inputting initial quantum state data into the adjusted quantum neural network to obtain quantum state output data.

[0082] In the embodiment of the present disclosure, the initial quantum state data can be any quantum state data. For example, the initial quantum state data can be zero state |0>. The zero state |0> can be input into the adjusted quantum neural network QNN32 to obtain the quantum state output data Quantum state output data It can also be a vector of 16 × 1. Through the embodiments of the present disclosure, the resource overhead required for generating quantum state output data can be reduced.

[0083] It can be understood that the above describes some methods of generating quantum state output data, and the following will describe some methods of training the generation model.

[0084] In some embodiments, training the generation model based on the quantum state sample data and the quantum state output data includes: training the generation model and the encoding model based on the quantum state sample data and the quantum state output data.

[0085] In an embodiment of the present disclosure, training a generation model and an encoding model based on quantum state sample data and quantum state output data includes: determining loss based on the quantum state sample data and quantum state output data.

[0086] In an embodiment of the present disclosure, determining the loss based on the quantum state sample data and the quantum state output data may include: determining the relative entropy loss based on the first encoding result and the second encoding result.

[0087] In an embodiment of the present disclosure, determining the relative entropy sub-loss based on the first encoding result and the second encoding result may include: obtaining a first processed encoding result based on the first encoding result; obtaining a second processed encoding result based on the second encoding result corresponding to the first encoding result; processing the second processed encoding result using a preset function to obtain a third processed encoding result; and determining the relative entropy sub-loss based on the first processed encoding result, the second processed encoding result, and the third processed encoding result.

[0088] In the embodiment of the present disclosure, the first encoding result may be at least one, and the second encoding result may also be at least one. Thus, based on the encoding result after the first processing, the encoding result after the second processing, and the encoding result after the third processing, a relative entropy difference can be determined. Based on at least one relative entropy difference, a relative entropy loss can be determined. For example, based on the above-mentioned first encoding result μ31 and the second encoding result σ31, a relative entropy difference can be determined. Based on the above-mentioned first encoding result μ32 and the second encoding result σ32, a relative entropy difference can also be determined. Based on these two relative entropy differences, a relative entropy sub-loss can be determined. For another example, the relative entropy sub-loss kld_loss can be determined by the following formula:

[0089]

[0090] λ can be a regularization coefficient greater than 0. μ i The value of can be the first encoding result μ31 and the first encoding result μ32. i The value of can be the second encoding result σ31 and the first encoding result σ32. The result may be encoded after the first processing. The result may be encoded after the second processing. Through the embodiment of the present disclosure, constraints on the first encoding result and the second encoding result can be added, which helps to efficiently train the encoding model and improve the training efficiency of the generation model.

[0091] In the disclosed embodiment, determining the loss based on the quantum state sample data and the quantum state output data may further include: determining a reconstruction loss based on the quantum state sample data and the quantum state output data. For example, the reconstruction loss may be determined based on the fidelity between the quantum state sample data and the quantum state output data. The reconstruction loss recons_loss may be determined using the following formula:

[0092]

[0093] Can represent quantum state sample data |x> and quantum state output data Through the embodiments of the present disclosure, the information of the sample data can be fully utilized, which helps to efficiently train the generation model and improve the training efficiency of the generation model.

[0094] In an embodiment of the present disclosure, determining the loss based on the quantum state sample data and the quantum state output data may further include: determining the loss based on at least one of a reconstruction sub-loss and a relative entropy sub-loss.

[0095] For example, the loss can be determined by the following formula:

[0096] loss=recons_loss+kld_loss (Formula 4)

[0097] In the embodiment of the present disclosure, the parameters of the generation model and the encoding model can be adjusted according to the loss. For example, the parameters of each quantum encoding layer in the quantum neural network QNN31 (rotation angle θ 1,1 To rotation angle θ 1,16 ), you can also adjust the parameters of the fully connected network NN31 and the fully connected network NN32, you can also adjust the parameters of the quantum coding layer to be trained in the quantum neural network QNN32 (rotation angle θ 2,1 To rotation angle θ 2,4 ).

[0098] It will be appreciated that some methods for training the generation model and the encoding model have been described above. Next, the generation model and the encoding model can be trained multiple times using different quantum state sample data in the quantum state sample dataset until a preset termination condition is met. The preset termination condition may include the above-mentioned loss convergence or the number of training times being greater than or equal to a preset training number threshold. Different quantum state sample data in the quantum state sample dataset can have the same or similar style.

[0099] It will be appreciated that the above description of the present disclosure uses the example of a quantum neural network generating a model including a quantum decoding layer to be trained. However, the present disclosure is not limited to this. The quantum neural network generating a model may include multiple quantum decoding layers to be trained. The target quantum decoding layer may be at least one quantum decoding layer subsequent to at least one of the multiple quantum decoding layers to be trained, as will be explained below.

[0100] Figure 4 is a schematic diagram of a quantum neural network of a generative model according to another embodiment of the present disclosure.

[0101] like Figure 4 As shown, quantum neural network QNN42' may include quantum decoding layer D41, quantum decoding layer D42, quantum decoding layer D43, and quantum decoding layer D44. Quantum decoding layer D42 and quantum decoding layer D44 can serve as quantum decoding layers to be trained. It is understood that the above description of quantum decoding layer D31 and quantum decoding layer D33 also applies to quantum decoding layer D41 and quantum decoding layer D43, and will not be repeated in this disclosure.

[0102] The quantum decoding layer D42 may include a single-bit rotation gate R y (θ 2,1 ), single bit revolving door R y (θ 2,2 ) and single-bit revolving door R y (θ 2,3 ) and single-bit revolving door R y (θ 2,4 ). The quantum decoding layer D44 may include a single-bit rotation gate E y (θ 2,5 ), single bit revolving door E y (θ 2,6 ) and single bit revolving door E y (θ 2,7 ) and single-bit revolving door R y (θ 2,8 ).

[0103] In the disclosed embodiment, quantum decoding layer D43 is the quantum decoding layer following quantum decoding layer D42 and can serve as the target quantum decoding layer. It will be appreciated that after adjusting quantum neural network QNN42', the maximum quantum superposition state data can be used as initial quantum state data and input into the adjusted quantum neural network QNN42' to generate quantum state output data.

[0104] It will be appreciated that the above description of the present disclosure uses the example of quantum state sample data being obtained based on image sample data. However, the present disclosure is not limited thereto. The quantum state sample data is obtained based on training sample data, which includes at least one of image sample data, text sample data, and audio sample data.

[0105] For example, when the training sample data includes text sample data, multiple characters of the text sample data may be converted into tokens to obtain multiple tokens, and the multiple tokens may be encoded into quantum states to obtain quantum state sample data.

[0106] For another example, when the training sample data includes audio sample data, multiple phonemes of the audio sample data may be encoded into quantum states to obtain quantum state sample data.

[0107] It will be appreciated that the present disclosure is described above using the example of quantum state sample data obtained based on image, text, and audio sample data. In some embodiments, the quantum state sample data may include Hamiltonian ground state sample data, which corresponds to the ground state of a chemical molecule. For example, the encoding model and the generative model described above may be trained using the Hamiltonian ground state sample data. After training is complete, the generative model may be used to generate Hamiltonian ground state output data. The chemical molecule may be, for example, a hydrogen molecule (H2).

[0108] It can be understood that after the preset termination condition is met, the generation model can be used to generate quantum state data, which will be explained below.

[0109] Figure 5 is a schematic flowchart of a data generation method according to an embodiment of the present disclosure.

[0110] like Figure 5 As shown, method 500 may include operations S510 to S530.

[0111] In operation S510 , parameter data is obtained according to input data to be processed.

[0112] In the disclosed embodiments, the input data to be processed may come from a standard normal distribution. There may be at least one piece of input data to be processed. There may also be at least one piece of parameter data. For example, the input data to be processed may be converted into parameter data based on a preset mapping relationship. For another example, a full join may be performed on the input data to obtain the parameter data.

[0113] In operation S520 , quantum state output data is generated using a quantum neural network of a generative model according to the parameter data.

[0114] In the embodiment of the present disclosure, the generative model may be trained according to the above method 100. The generative model may include, for example, the trained quantum neural network QNN32.

[0115] In the disclosed embodiments, the parameter data can be used to adjust the target quantum decoding layer of the quantum neural network of the generative model to obtain an adjusted quantum neural network. The target quantum decoding layer can be a quantum decoding layer after the trained quantum decoding layer. For example, after the training of the above-mentioned quantum decoding layer D32 is completed, the quantum decoding layer D32 can be used as the trained quantum decoding layer.

[0116] In operation S530, target data is determined according to the quantum state output data.

[0117] For example, the quantum state output data may be converted into target data, which may be target image data.

[0118] In the disclosed embodiment, the generative model may further include a fully connected network. The fully connected network of the generative model may be the trained fully connected network NN32 described above. At least one input data to be processed may be input into the fully connected network of the generative model to obtain at least one parameter data.

[0119] In an embodiment of the present disclosure, the target data includes at least one of target image data, target text data, and target audio data.

[0120] Figure 6 is a block diagram of a training apparatus for generating a model according to an embodiment of the present disclosure.

[0121] like Figure 6 As shown, the apparatus 600 may include a first obtaining module 610 , a re-parameterization processing module 620 , a second obtaining module 630 , an adjustment module 640 , a first generating module 650 and a training module 660 .

[0122] The first obtaining module 610 is configured to obtain a first encoding result and a second encoding result according to the quantum state sample data.

[0123] The re-parameterization processing module 620 is used to perform re-parameterization processing according to the first encoding result and the second encoding result to obtain sample data to be processed.

[0124] The second obtaining module 630 is configured to obtain parameter data according to the sample data to be processed.

[0125] The adjustment module 640 is used to adjust the target quantum decoding layer of the quantum neural network of the generation model using the parameter data to obtain an adjusted quantum neural network.

[0126] In an embodiment of the present disclosure, the quantum neural network of the generative model includes multiple quantum decoding layers, the multiple quantum decoding layers include a quantum decoding layer to be trained, and the target quantum decoding layer comes from the quantum decoding layer after the quantum decoding layer to be trained.

[0127] The first generating module 650 is configured to generate quantum state output data using the adjusted quantum neural network.

[0128] The training module 660 is used to train and generate a model based on quantum state sample data and quantum state output data.

[0129] In some embodiments, the quantum state sample data is obtained based on training sample data, and the training sample data includes at least one of image sample data, text sample data, and audio sample data.

[0130] In some embodiments, the first obtaining module includes: a first obtaining submodule, configured to input quantum state sample data into a coding model to obtain a first coding result and a second coding result.

[0131] In some embodiments, the first obtaining submodule includes: a first obtaining unit configured to input quantum state sample data into a quantum neural network of an encoding model to obtain a plurality of measurement results; and a second obtaining unit configured to input the plurality of measurement results into a fully connected network of the encoding model to obtain a first encoding result and a second encoding result.

[0132] In some embodiments, the quantum neural network of the encoding model is an N-qubit quantum neural network, where N is an integer greater than 1. The first obtaining unit includes: a first obtaining subunit, configured to input quantum state sample data into the quantum neural network of the encoding model to obtain N output results; and a measuring subunit, configured to measure the N output results to obtain N measurement results.

[0133] In some embodiments, the multiple measurement results are N measurement results, N is an even number greater than 1, and the second obtaining unit includes: a second obtaining subunit, used to input the N measurement results into a fully connected network of the encoding model to obtain N / 2 first encoding results and N / 2 second encoding results.

[0134] In some embodiments, the first encoding result corresponds to a second encoding result, and the reparameterization processing module includes a multiplication submodule for multiplying a processing parameter by the second encoding result to obtain a product result. The processing parameter is randomly sampled from a standard normal distribution. An addition submodule is for adding the first encoding result and the product result to obtain sample data to be processed.

[0135] In some embodiments, the quantum neural network of the generation model corresponds to at least one qubit, and the quantum decoding layer includes a single-bit rotation gate for at least one qubit. The adjustment module includes a first adjustment submodule configured to adjust the rotation angle of the single-bit rotation gate for the qubit in the target quantum decoding layer using parameter data.

[0136] In some embodiments, the parameter data includes first parameter data and second parameter data. The adjustment module includes: a second adjustment submodule for adjusting a quantum decoding layer preceding the quantum decoding layer to be trained using the first parameter data; and a third adjustment submodule for adjusting a target quantum decoding layer using the second parameter data.

[0137] In some embodiments, the first generation module includes: a second acquisition submodule, configured to input the quantum state initial data into the adjusted quantum neural network to obtain quantum state output data.

[0138] In some embodiments, the training module includes: a training submodule for training the generation model and the encoding model based on the quantum state sample data and the quantum state output data.

[0139] In some embodiments, the training submodule includes: a first determining unit configured to determine a loss based on the quantum state sample data and the quantum state output data; and a first adjusting unit configured to adjust parameters of the generation model and the encoding model based on the loss.

[0140] In some embodiments, the first determination unit includes: a first determination subunit for determining a reconstruction sub-loss based on the quantum state sample data and the quantum state output data; a second determination subunit for determining a relative entropy sub-loss based on the first encoding result and the second encoding result; and a third determination subunit for determining a loss based on at least one of the reconstruction sub-loss and the relative entropy sub-loss.

[0141] In some embodiments, the second determining subunit is further configured to: obtain a first processed encoding result based on the first encoding result; obtain a second processed encoding result based on a second encoding result corresponding to the first encoding result; process the second processed encoding result using a preset function to obtain a third processed encoding result; and determine a relative entropy sub-loss based on the first processed encoding result, the second processed encoding result, and the third processed encoding result.

[0142] Figure 7 is a block diagram of a data generating apparatus according to another embodiment of the present disclosure.

[0143] like Figure 7 As shown, the apparatus 700 may include a third obtaining module 710 , a second generating module 720 and a determining module 730 .

[0144] The third obtaining module 710 is configured to obtain parameter data according to the input data to be processed.

[0145] The second generating module 720 is used to generate quantum state output data using the quantum neural network of the generation model according to the parameter data.

[0146] The determination module 730 is used to determine the target data according to the quantum state output data.

[0147] In the embodiment of the present disclosure, the generative model is trained using the apparatus provided by the present disclosure. For example, the generative model may be trained using the apparatus 600.

[0148] In some embodiments, the target data includes at least one of target image data, target text data, and target audio data.

[0149] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0150] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0151] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0152] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the device 800 can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0153] Various components in device 800 are connected to I / O interface 805, including an input unit 806, such as a keyboard, mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, optical disk, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0154] The computing unit 801 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as the training method and / or data generation method for generating a model. For example, in some embodiments, the training method and / or data generation method for generating a model can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the training method and / or data generation method for generating a model described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the training method and / or data generation method of the generative model in any other appropriate manner (e.g., by means of firmware).

[0155] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0156] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0157] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0158] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) display or an LCD (liquid crystal display)) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0159] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0160] Computer systems may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The client and server relationship arises through computer programs running on the respective computers and having a client-server relationship to each other.

[0161] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0162] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A training method for a generative model, comprising: Obtaining a first encoding result and a second encoding result according to the quantum state sample data, wherein the quantum state sample data is obtained based on training sample data, and the training sample data includes at least one of image sample data, text sample data, and audio sample data; Performing re-parameterization processing according to the first encoding result and the second encoding result to obtain sample data to be processed; Obtaining parameter data according to the sample data to be processed; Using the parameter data to adjust a target quantum decoding layer of a quantum neural network of a generative model to obtain an adjusted quantum neural network, wherein the quantum neural network of the generative model includes multiple quantum decoding layers, the quantum neural network of the generative model corresponds to at least one quantum bit, the multiple quantum decoding layers include a quantum decoding layer to be trained, the target quantum decoding layer is a quantum decoding layer subsequent to the quantum decoding layer to be trained, and the quantum decoding layer includes a single-bit rotation gate of at least one quantum bit; Generating quantum state output data using the adjusted quantum neural network; and The generative model is trained based on the quantum state sample data and the quantum state output data to add the style of the quantum state sample data to the quantum state output data, wherein the quantum neural network of the generative model is used to realize the simulation of quantum computing, The step of adjusting the target quantum decoding layer of the quantum neural network of the generative model using the parameter data includes adjusting the rotation angle of the single-bit rotation gate of the quantum bit in the target quantum decoding layer using the parameter data.

2. The method according to claim 1, wherein Obtaining the first encoding result and the second encoding result according to the quantum state sample data includes: The quantum state sample data is input into a coding model to obtain the first coding result and the second coding result.

3. The method according to claim 2, wherein: Inputting the quantum state sample data into a coding model to obtain the first coding result and the second coding result includes: Inputting the quantum state sample data into the quantum neural network of the encoding model to obtain multiple measurement results; The multiple measurement results are input into a fully connected network of the coding model to obtain the first coding result and the second coding result.

4. The method according to claim 3, wherein: The quantum neural network of the encoding model is a quantum neural network of N quantum bits, where N is an integer greater than 1. Inputting the quantum state sample data into the quantum neural network of the encoding model to obtain multiple measurement results includes: Inputting quantum state sample data into the quantum neural network of the encoding model to obtain N output results; The N output results are measured to obtain N measurement results.

5. The method according to claim 3, wherein The plurality of measurement results is N measurement results, where N is an even number greater than 1, Inputting the plurality of measurement results into a fully connected network of the coding model to obtain the first coding result and the second coding result includes: Inputting the N measurement results into a fully connected network of the coding model to obtain N / 2 first coding results and N / 2 second coding results.

6. The method according to claim 1, wherein The first encoding result corresponds to one second encoding result, The performing re-parameterization processing according to the first encoding result and the second encoding result to obtain the sample data to be processed includes: multiplying a processing parameter by the second encoding result to obtain a product result, wherein the processing parameter is randomly sampled from a standard normal distribution; The first encoding result and the multiplication result are added to obtain the sample data to be processed.

7. The method according to claim 1, wherein The parameter data includes first parameter data and second parameter data; The target quantum decoding layer of the quantum neural network of the generative model adjusted by the parameter data includes: Using the first parameter data, adjusting a quantum decoding layer preceding the quantum decoding layer to be trained; The target quantum decoding layer is adjusted using the second parameter data.

8. The method according to claim 1, wherein The generating of quantum state output data using the adjusted quantum neural network includes: The quantum state initial data is input into the adjusted quantum neural network to obtain the quantum state output data.

9. The method according to claim 2, wherein: The training of the generative model according to the quantum state sample data and the quantum state output data includes: The generation model and the encoding model are trained according to the quantum state sample data and the quantum state output data.

10. The method according to claim 9, wherein: The training of the generation model and the encoding model according to the quantum state sample data and the quantum state output data includes: determining a loss based on the quantum state sample data and the quantum state output data; Parameters of the generation model and the encoding model are adjusted according to the loss.

11. The method according to claim 10, wherein: The determining of the loss according to the quantum state sample data and the quantum state output data includes: Determining a reconstruction sub-loss according to the quantum state sample data and the quantum state output data; Determining a relative entropy loss according to the first encoding result and the second encoding result; The loss is determined according to the reconstruction sub-loss and the relative entropy sub-loss.

12. The method according to claim 11, wherein The determining the relative entropy sub-loss according to the first encoding result and the second encoding result includes: Obtaining a first processed encoding result according to the first encoding result; Obtaining a second processed encoding result according to the second encoding result corresponding to the first encoding result; Processing the second processed encoding result using a preset function to obtain a third processed encoding result; The relative entropy sub-loss is determined according to the encoding result after the first processing, the encoding result after the second processing, and the encoding result after the third processing.

13. A data generation method comprising: Obtain parameter data according to the input data to be processed; Generating quantum state output data using a quantum neural network of a generative model according to the parameter data; Determine target data according to the quantum state output data, The generative model is trained using the method according to any one of claims 1 to 12.

14. The method according to claim 13, wherein The target data includes at least one of target image data, target text data, and target audio data.

15. A training device for generating a model, comprising: A first obtaining module is configured to obtain a first encoding result and a second encoding result based on quantum state sample data, wherein the quantum state sample data is obtained based on training sample data, and the training sample data includes at least one of image sample data, text sample data, and audio sample data; a re-parameterization processing module, configured to perform re-parameterization processing according to the first encoding result and the second encoding result to obtain sample data to be processed; A second obtaining module is used to obtain parameter data according to the sample data to be processed; an adjustment module, configured to adjust a target quantum decoding layer of a quantum neural network of a generative model using the parameter data to obtain an adjusted quantum neural network, wherein the quantum neural network of the generative model includes multiple quantum decoding layers, the quantum neural network of the generative model corresponds to at least one quantum bit, the multiple quantum decoding layers include a quantum decoding layer to be trained, the target quantum decoding layer is a quantum decoding layer subsequent to the quantum decoding layer to be trained, and the quantum decoding layer includes a single-bit rotation gate of at least one quantum bit; A first generating module is configured to generate quantum state output data using the adjusted quantum neural network; and a training module for training the generative model based on the quantum state sample data and the quantum state output data to add the style of the quantum state sample data to the quantum state output data, wherein the quantum neural network of the generative model is used to realize the simulation of quantum computing, The adjustment module includes: a first adjustment submodule, configured to adjust the rotation angle of the single-bit rotation gate of the quantum bit in the target quantum decoding layer using the parameter data.

16. A data generating device, comprising: A third obtaining module is used to obtain parameter data according to the input data to be processed; A second generation module is used to generate quantum state output data using a quantum neural network of a generation model according to the parameter data; A determination module is used to determine target data according to the quantum state output data, Wherein, the generative model is trained using the apparatus as claimed in claim 15.

17. The device according to claim 16, wherein The target data includes at least one of target image data, target text data, and target audio data.

18. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 14.

19. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 14.

20. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Quantum neural network training method, data processing method, device and medium

    CN115374948A

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

    CN116011682A