Quantum circuit construction method based on cascade variable component sub-state compression and related device

Through the cascading variable component quantum state compression method, the local features of massive image data are extracted into the quantum superimposed state, solving the problem of storage and computing bottlenecks of quantum computers processing massive image data, and realizing efficient data processing on existing equipment .

CN119272885AActive Publication Date: 2025-01-07ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD

Patent Information

Application Number
CN202411203825.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2025-01-07
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

At this stage, quantum computers are difficult to effectively process massive image data due to the limitations of the number of bits and coherent time, resulting in storage and computing bottlenecks.

Method used

Using a quantum circuit construction method based on cascaded variable component quantum state compression, multiple sub-data values ​​are encoded into quantum states through angle encoding and variational encoder, and using quantum state reset and training parameter weights to gradually transfer local data. Features are extracted into quantum superposition states, reducing the number of qubits and measurements required.

Benefits of technology

A new idea of ​​solving practical problems through quantum neural networks on existing NISQ devices is realized, making the number of qubits independent of the original data dimension, and improving the efficiency and interpretability of processing massive image data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272885A_ABST
    Figure CN119272885A_ABST
Patent Text Reader

Abstract

The invention discloses a quantum circuit construction method and related device based on cascade variable component sub-state compression, and the method comprises the steps: obtaining data sets, each data set comprises a plurality of sub-data sets, and each sub-data set comprises a plurality of data values; and constructing a first quantum circuit comprising a first quantum bit and a second quantum bit, wherein the first quantum circuit comprises a plurality of first quantum revolving doors sequentially acting on the first quantum bit and a logic gate combination of a variational encoder simultaneously acting on the first quantum bit and the second quantum bit. Compared with the prior art, the characteristics of the local area of the classic data are gradually extracted into the quantum superposition state through cascaded angle coding and variable component sub-state compression, quantum state compression and characteristic extraction are integrated into one process, the first quantum bit is repeatedly utilized through quantum state resetting, and the method has the advantages that the number of needed bits is small, and the efficiency is high. The locality interpretability is good, and the number of required measurement times is small.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of quantum computing technology, and in particular to a quantum circuit construction method based on cascade variational quantum state compression and a related device. Background Art

[0002] Due to the superposition property of quantum bits, N quantum bits can store 2 N Using quantum bits to store and represent information will greatly save storage space and computing power. As a method of representing information, images are intuitive and rich in content, but massive image data requires ultra-large storage and computing power. Storage based on classical bits is difficult to cope with the current massive increase in image data. Quantum bits are expected to solve the bottleneck problems of storage and computing faced by massive image data.

[0003] However, on current quantum computers, due to limitations in the number of bits and coherence time, they are often unable to handle real-world tasks. Summary of the invention

[0004] The purpose of the present invention is to provide a quantum circuit construction method and related devices based on cascade variational quantum state compression to solve the technical problems in the prior art, so that the number of quantum bits is independent of the dimension of the original data, thereby providing a new idea for using quantum neural networks to solve practical problems on NISQ devices at this stage.

[0005] In a first aspect, the present invention provides a method for constructing a quantum circuit based on cascade variational quantum state compression, the method comprising:

[0006] Acquire a data set, each of the data sets includes a plurality of sub-data sets, and the sub-data sets have a plurality of data values;

[0007] Constructing a first quantum circuit including a first quantum bit and a second quantum bit, wherein the first quantum circuit includes a logic gate combination of a plurality of first quantum rotation gates acting on the first quantum bit in sequence and a variational encoder acting on the first quantum bit and the second quantum bit simultaneously;

[0008] sequentially encoding the data values ​​in the plurality of sub-data values ​​into the quantum state of the first quantum bit by means of angle encoding;

[0009] After all data values ​​in a sub-data set are encoded into the quantum state of the first quantum bit, the quantum state information is associated and compressed onto the second quantum bit through a variational encoder;

[0010] Restoring the first quantum bit to a ground state, and then encoding the data values ​​in the next sub-data set, until the quantum state information of the data values ​​in all the sub-data sets are compressed into the second quantum bit;

[0011] The quantum state information of the second quantum bit is used as the input state to train the variational encoder and determine the parameter weights in the variational encoder.

[0012] In the above-mentioned method for constructing a quantum circuit based on cascade variational quantum state compression, preferably, each of the data sets includes a plurality of sub-data sets, each of which has a plurality of data values, including:

[0013] The image is segmented to obtain a plurality of target regions, each of which includes at least one pixel point, each of which provides a data value, and all data values ​​in each target region are combined into a sub-data set.

[0014] A quantum circuit construction method based on cascade variational quantum state compression as described above, wherein preferably, the first quantum rotation gate in each layer of the action sequence is used to encode multiple data values ​​in a subset of data sets by angle encoding to obtain an input quantum state when the first quantum bit is in the ground state, including:

[0015] Determining the first quantum bit number according to the number of pixels in the target area;

[0016] Along the action sequence, a plurality of the first quantum rotation gates act on each of the first quantum bits, all data values ​​of the same target region are encoded into the rotation control parameters of the plurality of the first quantum rotation gates in the same action sequence, and data values ​​of different target regions are encoded into the rotation control parameters of the first quantum rotation gates in different action sequences.

[0017] In the method for constructing a quantum circuit based on cascade variational quantum state compression as described above, preferably, the number of pixels in the target area is equal to the number of the first quantum bits.

[0018] A quantum circuit construction method based on cascade variational quantum state compression as described above, wherein preferably, the variational encoder includes a plurality of CNOT gates and a plurality of second quantum rotation gates arranged in sequence along the action sequence, the CNOT gate acts on adjacent quantum bits of the first quantum bit and the second quantum bit, the control bit of the CNOT gate is a high-order quantum bit adjacent to the acted quantum bit, and the second quantum rotation gate acts on each quantum bit of the first quantum bit and the second quantum bit.

[0019] A quantum circuit construction method based on cascade variational quantum state compression as described above, wherein, preferably, the first quantum rotation gate includes one or more of a first RX gate, a first RY gate and the first RZ gate, and the second quantum rotation gate includes one or more of a second RX gate, a second RY gate and the second RZ gate.

[0020] In the above-mentioned method for constructing a quantum circuit based on cascade variational quantum state compression, preferably, the step of using the quantum state information of the second quantum bit as the input state to train the variational encoder to determine the parameter weights in the variational encoder includes:

[0021] Constructing a training set and a test set, setting the number of batches, selecting an optimizer, and defining a loss function, wherein each batch includes at least one of the data sets, and sending multiple data sets in the same batch one by one into the first quantum circuit to calculate loss values, wherein each data set generates a loss value;

[0022] Sum up multiple loss values ​​within a batch to get the average loss value within a batch;

[0023] Performing back propagation calculation according to the average loss value to obtain the gradient value of each of the second quantum rotation gates, and updating the rotation control parameters of the second quantum rotation gate according to the gradient value, thereby completing a batch of training;

[0024] The above process is iterated until the loss value cannot be reduced any further, thus obtaining the final variational encoder.

[0025] In a second aspect, the present invention provides a quantum circuit construction device, the device comprising:

[0026] An acquisition module, used for acquiring a data set, each of which includes a plurality of sub-data sets, each of which has a plurality of data values;

[0027] A first quantum circuit construction module, used to construct a first quantum circuit including a first quantum bit and a second quantum bit, wherein the first quantum circuit includes a logic gate combination of a plurality of first quantum rotation gates acting on the first quantum bit in sequence and a variational encoder acting on the first quantum bit and the second quantum bit simultaneously;

[0028] An angle encoding module, used to encode data values ​​in a plurality of sub-data values ​​into the quantum state of the first quantum bit in sequence by means of angle encoding;

[0029] A quantum state compression module, for, after all data values ​​in a sub-data set are encoded into the quantum state of the first quantum bit, associating the quantum state information through a variational encoder and compressing the quantum state information onto the second quantum bit to restore the first quantum bit to a ground state, and then encoding the data values ​​in the next sub-data set, until all the quantum state information of the data values ​​in the sub-data sets are compressed into the second quantum bit;

[0030] Training module: used to train the variational encoder using the quantum state information of the second quantum bit as the input state to determine the parameter weights in the variational encoder.

[0031] In a third aspect, the present invention provides a storage medium storing a computer program, wherein the computer program is configured to execute the aforementioned method when run.

[0032] In a fourth aspect, the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the aforementioned method.

[0033] Compared with the prior art, the present invention gradually extracts the features of the local area of ​​classical data into the quantum superposition state through cascaded angle encoding and variational quantum state compression. Quantum state compression and feature extraction are integrated into one process. The first quantum bit is reused through quantum state reset, and the quantum features are preserved. It has the advantages of a small number of bits required, good local interpretability, and a small number of measurements required. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 is a network block diagram of a quantum circuit construction system provided in an embodiment of the present application;

[0035] Figure 2 It is a flow chart of a quantum circuit construction method based on cascade variational quantum state compression provided by an embodiment of the present application;

[0036] Figure 3 This is a schematic diagram of cascade angle coding in the quantum circuit construction method provided in the embodiment of the present application;

[0037] Figure 4 is a schematic diagram of a variational encoder provided in an embodiment of the present application;

[0038] Figure 5 A flow chart of a parameter training method for a variational encoder provided in an embodiment of the present application;

[0039] Figure 6 A schematic diagram of the structure of a quantum circuit construction device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0041] [Structure of the quantum circuit construction system]

[0042] Figure 1 1 is a network block diagram of a quantum circuit construction system provided in an embodiment of the present application. The quantum circuit construction system may include a network 110, a server 120, a wireless device 130, a client 140, a storage unit 150, a classical processing system 160, a quantum processing system 170, and may also include additional memories, classical processors, quantum processors, and other devices not shown.

[0043] The network 110 is a medium for providing communication links between various devices and computers connected together in the quantum circuit construction system, including but not limited to the Internet, corporate intranet, local area network, mobile communication network and their combination. The connection method can be wired, wireless communication links or optical fiber cables.

[0044] The server 120 and the client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computing processes. The client 140 may be a personal computer or a network computer, so the data may also be provided by the server 120. The wireless device 130 may be a smart phone, a tablet, a laptop, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as quantum bit parameters, quantum logic gate parameters, quantum circuits, quantum programs, etc.

[0045] The classical processing system 160 (quantum processing system 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 163 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application 162 (application 173). The application 162 (application 173) may be used to implement a quantum algorithm compiled according to the quantum circuit construction method provided in an embodiment of the present application.

[0046] Any data or information stored or generated in the classical processing system 160 (quantum processing system 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0047] It should be noted that a true quantum computer is a hybrid structure, which includes at least Figure 1 There are two major parts in it: the classical processing system 160, which is responsible for performing classical calculations and control; and the quantum processing system 170, which is responsible for running quantum programs and thus realizing quantum calculations.

[0048] The classical processing system 160 and the quantum processing system 170 may be integrated into one device or distributed in two different devices. For example, the first device including the classical processing system 160 runs a classical computer operating system, on which quantum application development tools and services are provided, as well as storage and network services required for quantum applications. Users develop quantum applications through the quantum application development tools and services thereon, and send quantum programs to the second device including the quantum processing system 170 through the network services thereon. The second device runs a quantum computer operating system, parses the code of the quantum program through the quantum computer operating system, and compiles it into instructions that can be recognized and executed by the quantum computer measurement and control system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.

[0049] In the classic processing system 160 based on silicon chips, the unit of the classic processor 161 is a CMOS tube. This computing unit is not limited by time and coherence, that is, this computing unit is not limited by the length of use and is available at any time. In addition, in the silicon chip, the number of such computing units is also sufficient. At present, the number of computing units in a classic processor is tens of thousands. The number of computing units is sufficient and the computing logic that can be selected by the CMOS tube is fixed, for example: AND logic. When calculating with the help of CMOS tubes, a large number of CMOS tubes are combined with limited logic functions to achieve the calculation effect.

[0050] Unlike this logic unit in the classical processing system 160, the basic computing unit of the quantum processor 171 in the quantum processing system 170 is a quantum bit, and the input of the quantum bit is limited by coherence and coherence time, that is, the quantum bit is limited by the use time and is not available at any time. Making full use of the quantum bit within the available use time of the quantum bit is a key problem in quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of a quantum computer. Each quantum bit realizes the computing function through the logical function configured on demand. In view of the limited number of quantum bits, the logical functions in the field of quantum computing are diverse, such as: Hadamard gate (Hadamard gate, H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate), Pauli-Z gate (Z gate), RX gate, RY gate, RZ gate, CR gate, CR gate, iSWAP gate, Toffoli gate, etc. In quantum computing, it is necessary to use limited quantum bits combined with a variety of logical functions to achieve the computing effect.

[0051] Based on these differences, the design of the logical function on the quantum bit (including the design of whether the quantum bit is used and the design of the efficiency of each quantum bit) is the key to improving the computing performance of quantum computers, and requires special design. The above-mentioned design for quantum bits is a technical problem that ordinary computing devices do not need to consider or face.

[0052]

Quantum circuit construction method based on cascade variational quantum state compression

[0053] like Figures 2 to 4 As shown, the present invention provides a quantum circuit construction method based on cascade variational quantum state compression, which is used to encode classical data into a quantum superposition state, and the method includes:

[0054] Step S101: Obtain a data set, each data set includes multiple sub-data sets, and the sub-data set has multiple data values. In the embodiment provided by the present invention, the data values ​​are derived from the image data of the pixel points. The set of image data of all the pixels of a picture is the data set. The image data of all the pixels of a picture is split into multiple parts, and each set of image data of the pixel points is a sub-data set.

[0055] In the implementation manner provided by the present invention, the image is segmented to obtain several target areas. The image can be divided into multiple target areas according to longitude and latitude, and each target area includes at least one pixel point. In this way, all pixel points of the image are divided into multiple target areas arranged in a grid, and the number of pixels in each target area corresponds to the number of first quantum bits mentioned later.

[0056] Each pixel point provides pixel point feature information respectively. The values ​​of the pixel point feature information provided by different pixels may be the same or different, and there is no limitation on this. Each pixel point corresponds to a first quantum bit setting, so that the pixel point feature information reflected by each pixel point is encoded into the quantum circuit where the corresponding first quantum bit is located.

[0057] Step S102: constructing a first quantum circuit including a first quantum bit and a second quantum bit, wherein the first quantum circuit includes a logic gate combination of a plurality of first quantum rotation gates acting on the first quantum bit in sequence and a variational encoder acting on the first quantum bit and the second quantum bit simultaneously.

[0058] Among them, the number of first quantum bits is determined according to the number of pixels in the target area, and can be determined according to the number of quantum bits supported by the quantum device. It is generally less than or equal to the number of supported quantum bits. When the number of quantum bits supported by the quantum device is relatively large, the number of first quantum bits required for preparation can be selected according to the situation.

[0059] In the embodiment provided by the present invention, the number of pixel points in the target area is limited to be equal to the number of first quantum bits to reduce the complexity of the quantum circuit and the demand for quantum resources. Those skilled in the art will appreciate that more auxiliary quantum bits can also be set to optimize the structure of the circuit and improve the flexibility and efficiency of the quantum circuit, which is not limited here.

[0060] Step S103: When the first quantum bit is in the ground state, the data values ​​in the plurality of sub-data values ​​are sequentially encoded into the quantum state of the first quantum bit by means of angle encoding.

[0061] Along the action sequence, multiple first quantum rotation gates act on each first quantum bit, all data values ​​of the same target area (sub-data set) are encoded into the rotation control parameters of multiple first quantum rotation gates in the same action sequence, and data values ​​of different target areas are encoded into the rotation control parameters of the first quantum rotation gates in different action sequences.

[0062] In one feasible implementation, take an n-dimensional vector The target region d-dimensional vector Then for the d-dimensional vector Perform normalization to obtain Make The calculation is shown in formula 1;

[0063] x i =arctan(l i )#(1)

[0064] Use angle encoding to encode d-dimensional vectors As shown in Formula 2:

[0065]

[0066] Among them, |ψ> represents the encoded superposition quantum state, and |i> represents the i-th quantum state.

[0067] The data values ​​in different target areas are encoded into the quantum state of the first quantum bit in sequence by means of angle coding, so as to establish a connection between the data value in the target area and the first quantum circuit, so that the first quantum bit contains relevant information of the data value. In the embodiment provided in the present application, a connection is established between the pixel feature information of the pixel points of the image and the first quantum bit, so that the first quantum bit contains the pixel feature information of each pixel point.

[0068] Multiple target areas are linearly sorted, and multiple data values ​​of a single target area are encoded on the first quantum bit in sequence. Before the next target area is encoded, the first quantum bit is restored to the ground state. There are many ways to reset the first quantum bit to the ground state, such as by measuring and then returning to the ground state.

[0069] Step S104: along the action sequence, after the data values ​​in a sub-data set are encoded into the quantum state of the first quantum bit, the quantum state information is associated through the variational encoder and compressed to the second quantum bit, thereby changing the quantum state |ψ′> of the second quantum bit.

[0070] Step S105: restore the first quantum bit to the ground state, and then encode the data value in the next sub-data set until the quantum state information of the data values ​​in all sub-data sets is compressed into the second quantum bit to obtain the final quantum state |ψ′ final >.

[0071] In the embodiment provided by the present invention, each variational encoder corresponds to a first quantum rotating gate setting of an action sequence, referring to Figure 4 As shown, the variational encoder includes multiple variational modules arranged in sequence along the action sequence. The variational modules are repeated multiple times to increase the depth of evolution and thus increase the number of parameters, thereby enhancing the expressive power of the model, capturing complex features and improving the entanglement of the quantum state.

[0072] Each variational module includes multiple CNOT gates and multiple second quantum rotation gates. The CNOT gate is located before the action sequence of the second quantum rotation gate. The number of second quantum bits is equal to that of first quantum bits. The first quantum bit is located at the high position of all second quantum bits. The CNOT gate acts on adjacent quantum bits among the first quantum bits and the second quantum bits. The control quantum bit of the CNOT gate is the high-position quantum bit adjacent to the quantum bit it acts on. The CNOT gate is a two-qubit controlled NOT gate. The CNOT gate is used to construct an entanglement relationship between quantum bits to form multi-qubit entanglement. The second quantum rotation gate acts on each quantum bit among the first quantum bit and the second quantum bit.

[0073] In a feasible implementation, the first quantum rotating gate is a single-qubit rotating gate, including one or more of a first RX gate, a first RY gate, and a first RZ gate. After executing the first quantum rotating gate operation, only the amplitude of the quantum state changes, and the data value is used as the rotation control parameter of the first quantum rotating gate. Preferably, the first quantum rotating gate is a first RY gate, and the value of the rotation control parameter of the first RY gate is arctanx, where x is the data value to be encoded by the first quantum bit.

[0074] The second quantum rotating gate is also a single-qubit rotating gate. The second quantum rotating gate includes one or more of a second RX gate, a second RY gate and a second RZ gate. Preferably, the second quantum rotating gate is a second RY gate. The rotation control parameters of the second quantum rotating gate are not fixed in advance, and they need to be updated in the subsequent training optimization process.

[0075] Furthermore, in the amplitude-coded quantum circuit construction method, after step S105, step S106 is further included: using the quantum state information of the second quantum bit as the input state to train the variational encoder to determine the parameter weights in the variational encoder, specifically, referring to Figure 5 As shown, the following steps are included:

[0076] Step S1061: Construct training sets and test sets, set the number of batches, select optimizers, and define loss functions. Each batch includes at least one data set. Multiple data sets in the same batch are sent one by one into the first quantum circuit to calculate the loss value. Each data set generates a loss value L i .

[0077] Step S1062: Sum multiple loss values ​​in a batch to obtain an average loss value in the batch , as shown in formula 3;

[0079] Step S1063: Back propagation is performed based on the average loss value to obtain the gradient value of each second quantum rotation gate. Based on the calculated gradient value, the parameters are optimized through the optimizer. For example, the gradient value is sent to the Adam optimizer. The Adam optimizer is used to update the rotation control parameters of the second quantum rotation gate, thereby completing a batch of training.

[0080] Step S1064: Iterate the above process until the loss value is lower than the set threshold or reaches the set number of iterations, completing the training process, determining the parameter weights in the variational encoder, and obtaining the desired variational encoder.

[0081] [Structure of quantum circuit construction device]

[0082] Reference Figure 6 As shown, the quantum circuit construction device includes:

[0083] An acquisition module is used to acquire a data set, each of which includes multiple sub-data sets, each of which has multiple data values;

[0084] A first quantum circuit construction module, used to construct a first quantum circuit including a first quantum bit and a second quantum bit, wherein the first quantum circuit includes a logic gate combination of a plurality of first quantum rotation gates acting on the first quantum bit in sequence and a variational encoder acting on the first quantum bit and the second quantum bit simultaneously;

[0085] An angle encoding module, used to encode data values ​​in a plurality of sub-data values ​​into the quantum state of a first quantum bit in sequence by means of angle encoding;

[0086] A quantum state compression module is used to, after all data values ​​in a sub-data set are encoded into the quantum state of the first quantum bit, associate this quantum state information through a variational encoder and compress the quantum state information onto the second quantum bit to restore the first quantum bit to the ground state, and then encode the data values ​​in the next sub-data set until the quantum state information of the data values ​​in all sub-data sets are compressed into the second quantum bit;

[0087] Training module: used to train the variational encoder using the quantum state information of the second quantum bit as the input state to determine the parameter weights in the variational encoder.

[0088]

Storage medium structure

[0089] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to implement the steps of any of the above method embodiments when running.

[0090] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for implementing the following steps:

[0091] S101: Acquire a data set, each data set including a plurality of sub-data sets, each of which has a plurality of data values.

[0092] S102: Construct a first quantum circuit including a first quantum bit and a second quantum bit, wherein the first quantum circuit includes a logic gate combination of a plurality of first quantum rotation gates acting on the first quantum bit in sequence and a variational encoder acting on the first quantum bit and the second quantum bit simultaneously.

[0093] S103: Encode the data values ​​in the plurality of sub-data values ​​sequentially into the quantum state of the first quantum bit by means of angle encoding.

[0094] S104: After the data values ​​in a sub-data set are encoded into the quantum state of the first quantum bit, the quantum state information is associated through a variational encoder and compressed onto the second quantum bit.

[0095] S105: Restoring the first quantum bit to the ground state, and then encoding the data values ​​in the next sub-data set, until the quantum state information of the data values ​​in all sub-data sets is compressed into the second quantum bit.

[0096] S106: Using the quantum state information of the second quantum bit as the input state to train the variational encoder, and determine the parameter weights in the variational encoder.

[0097]

Structure of electronic devices

[0098] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to implement the steps in any one of the above method embodiments.

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

[0100] Specifically, in this embodiment, the processor may be configured to implement the following steps through a computer program:

[0101] S101: Acquire a data set, each data set including a plurality of sub-data sets, each of which has a plurality of data values.

[0102] S102: Construct a first quantum circuit including a first quantum bit and a second quantum bit, wherein the first quantum circuit includes a logic gate combination of a plurality of first quantum rotation gates acting on the first quantum bit in sequence and a variational encoder acting on the first quantum bit and the second quantum bit simultaneously.

[0103] S103: Encode the data values ​​in the plurality of sub-data values ​​sequentially into the quantum state of the first quantum bit by means of angle encoding.

[0104] S104: After the data values ​​in a sub-data set are encoded into the quantum state of the first quantum bit, the quantum state information is associated through a variational encoder and compressed onto the second quantum bit.

[0105] S105: Restoring the first quantum bit to the ground state, and then encoding the data values ​​in the next sub-data set, until the quantum state information of the data values ​​in all sub-data sets is compressed into the second quantum bit.

[0106] S106: Using the quantum state information of the second quantum bit as the input state to train the variational encoder, and determine the parameter weights in the variational encoder.

[0107] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the drawings. Any changes made according to the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the description and drawings, should be within the protection scope of the present invention.

Claims

1. A method for constructing a quantum circuit based on cascade variational quantum state compression, characterized in that: The method comprises: Acquire a data set, each of the data sets includes a plurality of sub-data sets, and the sub-data sets have a plurality of data values; Constructing a first quantum circuit including a first quantum bit and a second quantum bit, wherein the first quantum circuit includes a logic gate combination of a plurality of first quantum rotation gates acting on the first quantum bit in sequence and a variational encoder acting on the first quantum bit and the second quantum bit simultaneously; sequentially encoding the data values ​​in the plurality of sub-data values ​​into the quantum state of the first quantum bit by means of angle encoding; After all data values ​​in a sub-data set are encoded into the quantum state of the first quantum bit, the quantum state information is associated and compressed onto the second quantum bit through a variational encoder; Restoring the first quantum bit to a ground state, and then encoding the data values ​​in the next sub-data set, until the quantum state information of the data values ​​in all the sub-data sets are compressed into the second quantum bit; The quantum state information of the second quantum bit is used as the input state to train the variational encoder and determine the parameter weights in the variational encoder.

2. The method according to claim 1, characterized in that: Each of the data sets includes a plurality of sub-data sets, each of which has a plurality of data values, including: The image is segmented to obtain a plurality of target regions, each of which includes at least one pixel point, each of which provides a data value, and all data values ​​in each target region are combined into a sub-data set.

3. The method according to claim 2, characterized in that: The first quantum rotating gate is used to sequentially encode data values ​​in a plurality of sub-data values ​​into the quantum state of the first quantum bit by angle encoding when the first quantum bit is in the ground state, including: Determining the first quantum bit number according to the number of pixels in the target area; Along the action sequence, a plurality of the first quantum rotation gates act on each of the first quantum bits, all data values ​​of the same target region are encoded into the rotation control parameters of the plurality of the first quantum rotation gates in the same action sequence, and data values ​​of different target regions are encoded into the rotation control parameters of the first quantum rotation gates in different action sequences.

4. The method according to claim 3, characterized in that: The number of pixels in the target area is equal to the number of the first quantum bits.

5. The method according to claim 1, characterized in that: The variational encoder includes a plurality of CNOT gates and a plurality of second quantum rotation gates which are sequentially arranged along an action sequence. The CNOT gate acts on adjacent quantum bits of the first quantum bit and the second quantum bit. The control bit of the CNOT gate is a high-order quantum bit adjacent to the acted quantum bit. The second quantum rotation gate acts on each quantum bit of the first quantum bit and the second quantum bit.

6. The method according to claim 5, characterized in that: The first quantum rotating gate includes one or more of a first RX gate, a first RY gate, and the first RZ gate, and the second quantum rotating gate includes one or more of a second RX gate, a second RY gate, and the second RZ gate.

7. The method according to claim 1, characterized in that: The step of using the quantum state information of the second quantum bit as an input state to train the variational encoder and determine the parameter weights in the variational encoder includes: Constructing a training set and a test set, setting the number of batches, selecting an optimizer, and defining a loss function, wherein each batch includes at least one of the data sets, and sending multiple data sets in the same batch one by one into the first quantum circuit to calculate loss values, wherein each data set generates a loss value; Sum up multiple loss values ​​within a batch to get the average loss value within a batch; Performing back propagation calculation according to the average loss value to obtain the gradient value of each of the second quantum rotation gates, and updating the rotation control parameters of the second quantum rotation gate according to the gradient value, thereby completing a batch of training; The above process is iterated until the loss value is lower than the set threshold or the set number of iterations is reached, and the training process is completed to determine the parameter weights in the variational encoder.

8. A quantum circuit construction device, characterized in that: The device comprises: An acquisition module, used for acquiring a data set, each of which includes a plurality of sub-data sets, each of which has a plurality of data values; A first quantum circuit construction module, used to construct a first quantum circuit including a first quantum bit and a second quantum bit, wherein the first quantum circuit includes a logic gate combination of a plurality of first quantum rotation gates acting on the first quantum bit in sequence and a variational encoder acting on the first quantum bit and the second quantum bit simultaneously; An angle encoding module, used to encode data values ​​in a plurality of sub-data values ​​into the quantum state of the first quantum bit in sequence by means of angle encoding; A quantum state compression module, for, after all data values ​​in a sub-data set are encoded into the quantum state of the first quantum bit, associating the quantum state information through a variational encoder and compressing the quantum state information onto the second quantum bit to restore the first quantum bit to a ground state, and then encoding the data values ​​in the next sub-data set, until all the quantum state information of the data values ​​in the sub-data sets are compressed into the second quantum bit; Training module: used to train the variational encoder using the quantum state information of the second quantum bit as the input state to determine the parameter weights in the variational encoder.

9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Quantum automatic coding method based on machine learning framework and related device

    CN114372582A

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

    CN117787428A

  • Construction method and device of variable component sub-circuit, medium and electronic device

    CN117852660A

  • Engineering structure information model similarity evaluation method

    CN118503725A

  • Nanometer photon parameter quantum information processor

    CN118541705A

Cited By

  • Quantum variation circuit, data processing method and device, medium and equipment

    CN119808973A