Data processing method and device based on quantum random access memory

By adopting parallel processing methods and quantum circuit technology in the QRAM architecture, the problem of low parallel reading efficiency of QRAM data is solved, the processing speed is improved and the error rate is reduced.

CN118607649AActive Publication Date: 2024-09-06ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310195986.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2024-09-06
Estimated Expiration
2043-02-28

AI Technical Summary

Technical Problem

In the existing technology, the parallel reading method of data based on quantum random access memory (QRAM) is not yet mature, resulting in slow data processing speed, high time complexity and high execution error rate.

Method used

A QRAM architecture is proposed. By obtaining the target address and preset word length, the target path is determined using the preset addressing method, and the data of the preset word length is read in a parallel manner within the preset timing, using H gates and CNOT gates. Quantum circuits such as controlled Z gates and SWAP gates are used for data copying, data routing and data exchange to achieve parallel processing of data.

Benefits of technology

The data processing speed is improved, the time complexity is optimized, and the execution error rate of the QRAM architecture is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607649A
    Figure CN118607649A
Patent Text Reader

Abstract

The invention discloses a data processing method and device based on a quantum random access memory, and the method comprises the steps: firstly obtaining a target address and a data bit with a preset word length, then determining a target path corresponding to the target address based on the target address by using a preset addressing mode, and finally determining the target path according to the preset word length of the data bit and the target path. According to the method, data corresponding to a target address is processed in a parallel mode, the parallel mode is that data with a preset word length is read at a time in a preset time sequence, a QRAM architecture is provided, a QRAM-based data parallel reading method is achieved, the data processing speed is increased, the time complexity is optimized, and the execution error rate of the QRAM architecture is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of quantum computing technology, and in particular to a data processing method and device based on quantum random access memory. Background Art

[0002] Quantum Random Access Memory (QRAM) is a storage technology that uses the principles of quantum physics. Unlike traditional computer memory, QRAM allows information to be stored in multiple locations in parallel and allows multiple pieces of information to be read at the same time. This gives QRAM an advantage in terms of efficiency when processing large amounts of data. In theory, QRAM has a much higher storage density than traditional memory technology and has stronger security because it can use quantum encryption algorithms.

[0003] Although QRAM is a technology with great potential, it is still in the research and development stage and is not a mainstream technology in the current market. At the same time, how to explore a method to achieve parallel reading of data based on QRAM and speed up data processing is still an urgent problem to be solved. Summary of the invention

[0004] The purpose of the present invention is to provide a data processing method and device based on quantum random access memory to solve the deficiencies in the prior art. It proposes a QRAM architecture to implement a method for parallel reading of data based on QRAM, thereby accelerating data processing speed, optimizing time complexity, and reducing the execution error rate of the QRAM architecture.

[0005] An embodiment of the present application provides a data processing method based on a quantum random access memory, the method comprising:

[0006] Get the target address and the data bits of the preset word length;

[0007] Based on the target address, using a preset addressing method, determining a target path corresponding to the target address;

[0008] According to the preset word length of the data bits and the target path, the data corresponding to the target address are processed in a parallel manner, wherein the parallel manner is to read the data of the preset word length once within a preset timing.

[0009] Optionally, after obtaining the target address and the data bits of the preset word length, the method further includes:

[0010] Each bit of the target address is read in sequence through an address register, and a transfer operation is performed on each bit of the target address read by the address register using a preset quantum circuit, wherein the preset quantum circuit includes an H gate, a CNOT gate, a controlled Z gate, a SWAP gate, and a controlled SWAP gate, and the transfer operation includes one or more of data copying, data routing, and data exchange.

[0011] Optionally, the quantum random access memory is a binary tree structure, which includes 1 layer of root nodes and n-1 layers of subtree nodes, wherein each layer of the binary tree structure includes an address bit and a data bit, and n is the address length of the target address.

[0012] Optionally, determining the target path corresponding to the target address by using a preset addressing mode based on the target address includes:

[0013] Starting from the root node, each bit of the n-1-bit target address read in sequence is transferred in sequence to the data bit of the corresponding target layer subtree node through the preset quantum circuit;

[0014] And the one-bit target address read from the data bit of the current target layer subtree node is exchanged with the address bit of the current target layer subtree node until a target path corresponding to the n-bit target address is generated.

[0015] Optionally, starting from the root node, transferring each bit of the n-1-bit target address read in sequence to the data bit of the corresponding target layer subtree node through the preset quantum circuit, includes:

[0016] Starting from n=0, the 0th address of the target address is transferred to the root node of the binary tree structure;

[0017] Starting from the i-th layer subtree node, the step of transferring the i-th address bit of the target address to the i-th layer subtree node data bit of the binary tree structure is executed until each bit of the target address is transferred, wherein i is an integer and its value is taken from 1 to n-1 in sequence.

[0018] Optionally, processing the data corresponding to the target address in a parallel manner according to the preset word length of the data bits and the target path includes:

[0019] When the target path is received, data corresponding to each bit address in the target path is obtained according to a data bit parallel reading rule of a preset word length;

[0020] Through the preset quantum circuit, the data corresponding to each bit address is transferred to the address bit of the root node in the binary tree structure to complete the parsing process of the data corresponding to the target path.

[0021] Another embodiment of the present application provides a data processing device based on quantum random access memory, the device comprising:

[0022] An acquisition module, used to obtain a target address and data bits of a preset word length;

[0023] A determination module, configured to determine a target path corresponding to the target address based on the target address and using a preset addressing method;

[0024] A processing module is used to process the data corresponding to the target address in a parallel manner according to the preset word length of the data bit and the target path, wherein the parallel manner is to read the data of the preset word length once within a preset timing.

[0025] Optionally, after the obtaining module, the device further includes:

[0026] A transfer module is used to read each bit of the target address in sequence through an address register, and perform a transfer operation on each bit of the target address read by the address register using a preset quantum circuit, wherein the preset quantum circuit includes an H gate, a CNOT gate, a controlled Z gate, a SWAP gate, and a controlled SWAP gate, and the transfer operation includes one or more of data copying, data routing, and data exchange.

[0027] Optionally, the determining module includes:

[0028] A transfer unit, used to transfer each bit of the n-1-bit target address read in sequence to a data bit of a corresponding target layer subtree node in sequence, starting from the root node through the preset quantum circuit;

[0029] The exchange unit is used to exchange the one-bit target address read from the data bit of the current target layer subtree node to the address bit of the current target layer subtree node until a target path corresponding to the n-bit target address is generated.

[0030] Optionally, the transfer unit comprises:

[0031] A first transfer subunit, used for transferring the 0th address of the target address to the root node of the binary tree structure starting from n=0;

[0032] The second transfer sub-unit is used to execute the step of transferring the i-th address bit of the target address to the i-th sub-tree node data bit of the binary tree structure, starting from the i-th sub-tree node, until each bit of the target address is transferred, wherein i is an integer and its value is from 1 to n-1 in sequence.

[0033] Optionally, the processing module includes:

[0034] An acquisition unit, configured to acquire data corresponding to each bit address in the target path according to a data bit parallel reading rule of a preset word length when the target path is received;

[0035] The parsing unit is used to transfer the data corresponding to each bit address to the address bit of the root node in the binary tree structure through the preset quantum circuit to complete the parsing processing of the data corresponding to the target path.

[0036] Yet another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to implement any of the above methods when executed.

[0037] Yet another embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement any of the methods described above.

[0038] Compared with the prior art, the present invention first obtains the target address and data bits of a preset word length, then determines the target path corresponding to the target address based on the target address and using a preset addressing method, and finally processes the data corresponding to the target address in a parallel manner according to the preset word length and target path of the data bits, wherein the parallel manner is to read data of a preset word length once within a preset timing. It proposes a QRAM architecture to implement a method for parallel reading of data based on QRAM, thereby accelerating data processing speed, optimizing time complexity, and reducing the execution error rate of the QRAM architecture. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a system network block diagram corresponding to a data processing method based on quantum random access memory provided by an embodiment of the present invention;

[0040] Figure 2 It is a flowchart of a data processing method based on quantum random access memory provided by an embodiment of the present invention;

[0041] Figure 3 It is a schematic diagram of a binary tree structure of a quantum random access memory provided by an embodiment of the present invention;

[0042] Figure 4 This is a schematic diagram of a quantum circuit for implementing data copying provided by an embodiment of the present invention;

[0043] Figure 5 This is a schematic diagram of a quantum circuit for implementing address bus input provided by an embodiment of the present invention;

[0044] Figure 6 This is a schematic diagram of a quantum circuit for implementing data bus input provided by an embodiment of the present invention;

[0045] Figure 7 is a schematic diagram of a quantum circuit for implementing data routing provided by an embodiment of the present invention;

[0046] Figure 8 is a schematic diagram of a parallel data processing method based on quantum random access memory provided by an embodiment of the present invention;

[0047] Fig. 9 It is a schematic diagram of the structure of a data processing device based on quantum random access memory provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] 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.

[0049] The embodiment of the present invention first provides a data processing method based on quantum random access memory, which can be applied to electronic devices such as computer terminals, specifically ordinary computers, quantum computers, etc.

[0050] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 1 is a system network block diagram corresponding to a data processing method based on a quantum random access memory provided by an embodiment of the present invention. The system corresponding to the data processing method based on a quantum random access memory 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.

[0051] The network 110 is a medium for providing communication links between various devices and computers connected together in a system corresponding to the data processing method of the quantum random access memory, 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 link or optical fiber cable.

[0052] 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.

[0053] 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 by a data processing method based on a quantum random access memory provided in an embodiment of the present invention.

[0054] 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.

[0055] 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.

[0056] 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.

[0057] 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.

[0058] 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), X gate, RY gate, RZ gate, CNOT 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.

[0059] Based on these differences, the design of the logical function acting on the quantum bit (including the design of whether the quantum bit is used or not and the design of the efficiency of the use of each quantum bit) is the key to improving the computing performance of the quantum computer, 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. Based on this, in order to explore a method for realizing parallel data reading based on QRAM, the present invention proposes a data processing method and device based on quantum random access memory to solve the deficiencies in the prior art. It proposes a QRAM architecture to realize a method for parallel data reading based on QRAM, speed up data processing, optimize time complexity, and reduce the execution error rate of the QRAM architecture.

[0060] See also Figure 2 , Figure 2 A schematic flow chart of a data processing method based on a quantum random access memory provided in an embodiment of the present invention may include the following steps:

[0061] S201: Obtain a target address and data bits of a preset word length.

[0062] Specifically, the target address may be a binary string representing an instruction pointing to a specific storage unit, and the data bits of the preset word length may refer to the amount of data stored in a specific storage unit at one time or the length of data stored in a specific storage unit.

[0063] It should be noted that the architecture of quantum random access memory QRAM can usually be composed of the following parts: quantum storage unit, quantum control unit, quantum error correction unit and transmission interface unit. Among them, the quantum storage unit is the core part of QRAM for storing data, and usually uses quantum bits to store information; the quantum control unit is responsible for reading and writing operations on the quantum storage unit; the quantum error correction unit is used to implement the quantum error correction mechanism to ensure the correctness of the data; the transmission interface unit is used to implement data exchange with other computer systems, which can usually be achieved using quantum communication technology. In general, the QRAM architecture requires efficient quantum control capabilities and powerful quantum error correction mechanisms to ensure the correctness and security of data.

[0064] QRAM can also be understood as a storage system for quantum computers. It is a quantum version of RAM (Random Access Memory) in classical computers. QRAM can be used to create quantum superposition states containing information. Compared with RAM, which needs to be read one by one, superposition data can be read with superposition addresses. For example, d0, d1, d2, ..., d3 are stored in the address [0, n]. n , using classic RAM, input address i output data d i ; For QRAM, the following quantum states can be input as addresses:

[0065] ∑|i>

[0066] The following target quantum states can be output through QRAM:

[0067] ∑|i>| i >

[0068] This process of inputting addresses and outputting data can be called query or access. Since QRAM plays the role of converting classical data to quantum data in many quantum algorithms (as an intermediate memory for converting classical data to quantum data), and an important condition for quantum acceleration of these algorithms is that the time for QRAM to execute queries cannot be too long, the present application can reduce the query time by parallelization.

[0069] The QRAM architecture can be presented as a binary tree structure, wherein the binary tree structure includes 1 layer of root nodes and n-1 layers of subtree nodes, each layer of the binary tree structure includes an address bit and a data bit, and n is the address length of the target address.

[0070] See also Figure 3 , Figure 3 Schematic diagram of a binary tree structure of a quantum random access memory provided by an embodiment of the present invention. Figure 3 As shown in the figure, taking the target address length of 3 as an example, in the QRAM architecture, as shown in the dashed box in the figure, a continuous vertical A (Address Qubit) and a D (Data Qubit) constitute a group, which is called a node, that is, a basic unit in a binary tree. All nodes constitute a binary tree. (0,0) in the figure represents the 0th node of the 0th layer, that is, the root node, (1,0) represents the 0th node of the 1st layer, that is, the 0th subtree node of the 1st layer, and so on, which will not be repeated here.

[0071] In an optional implementation, after obtaining the target address and the data bits of the preset word length, the method may further include:

[0072] Each bit of the target address is read in sequence through the address register, and each bit of the target address read by the address register is transferred using a preset quantum circuit, wherein the preset quantum circuit includes an H gate, a CNOT gate, a controlled Z gate, a SWAP gate, and a controlled SWAP gate, and the transfer operation includes one or more of data copying, data routing, and data exchange. The quantum bits of the preset quantum circuit include quantum bits corresponding to the bus, and the bus includes an address bus and a data bus. The functions of the bus include inputting address information, inputting each data bit of a preset word length, and the like.

[0073] Specifically, the overall workflow of the QRAM architecture is divided into two major components: one is preset addressing, and the other is data loading. These two parts can be summarized into the following steps: data copy, address bus input, data bus input, data routing, and data exchange between address bits and data bits.

[0074] For example, see Figure 4 , Figure 4 is a schematic diagram of a quantum circuit for implementing data copying provided by an embodiment of the present invention, in which the address bit of the node is a l,p , the data bit is d l,p , through the controlled Z gate, one bit of data is stored in the corresponding quantum bit m of the memory pool 2p In the case where address bit a l,pThe address in is 0, and the quantum bit m corresponding to the memory pool is stored 2p ; If address bit a l,p If the address in is 1, then it is stored in the memory pool m 2p+1 The corresponding quantum bit.

[0075] It should be noted that data copying is a data replication operation, which copies classical data from address bits to data bits through controlled operations. Since the Toffoli gate cannot be used to encode the quantum state |0> into The quantum state |1> is encoded as Therefore, the data qubit can be phase-encoded through a controlled Z gate to complete the data copy operation.

[0076] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of a quantum circuit for implementing address bus input provided by an embodiment of the present invention. i is the i-th address, d 0,0 The address bus input is to copy the i-th binary digit of the address bus to the root node, and the CNOT gate can be used for the copy operation. For example, the first bit of the target address is copied to the data bit of the root node, and then the first bit of the target address needs to be transferred to the address bit of the root node. Specifically, the SWAP gate or other multiple quantum logic gates that realize data exchange can be used to exchange the data bits and address bits in a node.

[0077] See also Figure 6 , Figure 6 : is a schematic diagram of a quantum circuit for implementing data bus input provided by an embodiment of the present invention. Data bus input is to transmit the i-th binary digit of the data bus to the data bit of the root node. For example, the H gate and SWAP gate in the figure can be used, where the H gate is used to perform phase encoding for the data copy operation, thereby distinguishing the |0> state of the data bit and the |0> state of the non-data bit, that is, encoding the |0> state into state,|1>state is encoded into

[0078] In an optional implementation, the process of writing the target address is the process of determining the access path in the QRAM. The writing of the first bit address is different from the writing of other bit addresses. Since the first bit address is written to the root node, the other bit addresses are written to the subtree nodes. The process of writing the first bit address is specifically: copying the first bit address from the bus to the root node, and then copying the first bit address to the data bit of the root node. The writing of other bit addresses requires downward addressing and routing to the corresponding subtree nodes. The routing can be implemented using a controlled SWAP gate. For a specific quantum circuit diagram, see Figure 7, Figure 7 This is a schematic diagram of a quantum circuit for implementing data routing provided by an embodiment of the present invention. As can be seen from the figure, the node layer to which the routing is to be carried out is determined by the previous address. Exemplarily, if the address in the p-th address bit of the l-th layer is 0, the current target bit is routed from the data bit of the p-th node of the l-th layer to the data bit of the 2p-th node of the l+1-th layer. If the address in the address bit of the p-th node of the l-th layer is 1, the current target bit is routed from the data bit of the p-th node of the l-th layer to the data bit of the 2p+1-th node of the l+1-th layer.

[0079] S202: Based on the target address, determine a target path corresponding to the target address by using a preset addressing method.

[0080] Specifically, determining the target path corresponding to the target address by using a preset addressing mode based on the target address may include:

[0081] Starting from the root node, each bit of the n-1-bit target address read in sequence is transferred to the data bit of the corresponding target layer subtree node in sequence through the preset quantum circuit; and the one-bit target address read by the data bit of the current target layer subtree node is exchanged to the address bit of the current target layer subtree node until a target path corresponding to the n-bit target address is generated.

[0082] Among them, starting from the root node, transferring each bit of the n-1-bit target address read in sequence to the data bit of the corresponding target layer subtree node through the preset quantum circuit may include:

[0083] Starting from n=0, the 0th address bit of the target address is transferred to the root node of the binary tree structure; starting from the i-th layer subtree node, the step of transferring the i-th address bit of the target address to the data bit of the i-th layer subtree node of the binary tree structure is performed until each bit of the target address is transferred, wherein i is an integer and its value ranges from 1 to n-1.

[0084] S203: Processing the data corresponding to the target address in a parallel manner according to the preset word length of the data bits and the target path, wherein the parallel manner is to read the data of the preset word length once within a preset timing.

[0085] Specifically, processing the data corresponding to the target address in a parallel manner according to the preset word length of the data bits and the target path may include:

[0086] Step 1: upon receiving the target path, obtaining data corresponding to each bit address in the target path according to a data bit parallel reading rule of a preset word length.

[0087] Step 2: Through the preset quantum circuit, the data corresponding to each bit address is transferred to the address bit of the root node in the binary tree structure to complete the parsing process of the data corresponding to the target path.

[0088] Exemplarily, for example, the target path corresponding to the target address can be obtained first and marked or lit (Route), and then the data in the corresponding memory pool can be copied according to the target path corresponding to the target address, that is, the data in the memory pool corresponding to the target path can be copied and obtained. Through the above steps, the addressing operation of the preset mode of the memory pool is realized, and the corresponding data is read, thereby realizing the analogy of the load operation in the classical computer instruction system, completing a set of classical-control not operations through the classical controller, and completing the conversion of classical data to quantum data, and finally realizing the preparation of the quantum state of the data in the memory pool corresponding to each bit address in the target path.

[0089] Specifically, the parsing process of the data corresponding to the target path may include at least one of the writing process, data storage process and data reading process of the data corresponding to the target path. Exemplarily, a parsing operation may be the writing of one of the addresses in the writing process of the data corresponding to the target path, or the writing of one bit of data in the data storage process, or the reading of one bit of data in the data reading process. For example, if the length of the target address is 4, then 4 parsing operations may be included in the target address writing process. If the preset word length of the data bit is 3, it can be understood that 3 bits of data need to be parsed at a time within the preset timing.

[0090] For example, for the above Figure 3 The corresponding binary tree structure decides whether to route left or right based on the address of the previous layer. For example, if the target address is 010, according to the preset routing rules, 0 is routed to the left and 1 is routed to the right. The address in the address bit of the root node of the 0th layer is 0. For the second address, it is copied from the bus to the data bit of the 0th layer. Because the address in the address bit of the 0th layer is 0, the second address is routed to the left. The first subtree node corresponding to the second address is (1,0). The third address is copied from the bus to the data bit of the 0th layer, and the data bit of the (0,0) node is routed to the (1,0) node. Because the second address is 1, it is routed to the right to the (2,1) node. The third address is finally written into the address bit of the (2,1) node. Finally, the data corresponding to each bit of the target address is transferred to the address bit of the root node in the binary tree structure.

[0091] It should be noted that this process can be executed in parallel. Figure 8 , Figure 8It is a schematic diagram of a parallel data processing method based on quantum random access memory provided by an embodiment of the present invention. Among them, the horizontal band represents the QRAM layer, the first black slope line represents the target address setting stage, the last black slope line represents the reverse calculation stage, and the remaining slope lines from left to right represent the data acquisition stage in the preset time sequence. D0, D1 and D2 are data bits with a preset word length of 3. First, the target address (Address setting) is obtained. It can be seen from the figure that, for example, when a certain bit of the target address has been moved from the first layer to the second layer, the next address of the target address can be moved to the first layer in parallel, so that the time required for the entire transfer step will not exceed the time for the nth bit address to be moved to the nth layer. It can be called a data copy or reading process (Data fetch), and then enters the reverse calculation step (Uncomputing), where the purpose of reverse calculation is to clear all intermediate results in the data processing process in order to return to the initial state.

[0092] It can be seen that the present invention first obtains the target address and the data bits of the preset word length, and then determines the target path corresponding to the target address based on the target address and using the preset addressing method. Finally, according to the preset word length and target path of the data bits, the data corresponding to the target address is processed in a parallel manner, wherein the parallel manner is to read the data of the preset word length once within the preset timing. It proposes a QRAM architecture to implement a method for parallel reading of data based on QRAM, thereby accelerating the data processing speed, optimizing the time complexity, and reducing the execution error rate of the QRAM architecture.

[0093] See also Fig. 9 , Fig. 9 A schematic diagram of a data processing device based on a quantum random access memory provided by an embodiment of the present invention, and Figure 2 The process shown here corresponds to the following:

[0094] An acquisition module 901 is used to obtain a target address and data bits of a preset word length;

[0095] A determination module 902 is used to determine a target path corresponding to the target address based on the target address by using a preset addressing method;

[0096] The processing module 903 is used to process the data corresponding to the target address in a parallel manner according to the preset word length of the data bits and the target path, wherein the parallel manner is to read the data of the preset word length once within a preset timing.

[0097] Specifically, after the obtaining module, the device further includes:

[0098] A transfer module is used to read each bit of the target address in sequence through an address register, and perform a transfer operation on each bit of the target address read by the address register using a preset quantum circuit, wherein the preset quantum circuit includes an H gate, a CNOT gate, a controlled Z gate, a SWAP gate, and a controlled SWAP gate, and the transfer operation includes one or more of data copying, data routing, and data exchange.

[0099] Specifically, the determination module includes:

[0100] A transfer unit, used to transfer each bit of the n-1-bit target address read in sequence to a data bit of a corresponding target layer subtree node in sequence, starting from the root node through the preset quantum circuit;

[0101] The exchange unit is used to exchange the one-bit target address read from the data bit of the current target layer subtree node to the address bit of the current target layer subtree node until a target path corresponding to the n-bit target address is generated.

[0102] Specifically, the transfer unit includes:

[0103] A first transfer subunit, used for transferring the 0th address of the target address to the root node of the binary tree structure starting from n=0;

[0104] The second transfer sub-unit is used to execute the step of transferring the i-th address bit of the target address to the i-th sub-tree node data bit of the binary tree structure, starting from the i-th sub-tree node, until each bit of the target address is transferred, wherein i is an integer and its value is from 1 to n-1 in sequence.

[0105] Specifically, the processing module includes:

[0106] An acquisition unit, configured to acquire data corresponding to each bit address in the target path according to a data bit parallel reading rule of a preset word length when the target path is received;

[0107] The parsing unit is used to transfer the data corresponding to each bit address to the address bit of the root node in the binary tree structure through the preset quantum circuit to complete the parsing processing of the data corresponding to the target path.

[0108] Compared with the prior art, the present invention first obtains the target address and data bits of a preset word length, then determines the target path corresponding to the target address based on the target address and using a preset addressing method, and finally processes the data corresponding to the target address in a parallel manner according to the preset word length and target path of the data bits, wherein the parallel manner is to read data of a preset word length once within a preset timing. It proposes a QRAM architecture to implement a method for parallel reading of data based on QRAM, thereby accelerating data processing speed, optimizing time complexity, and reducing the execution error rate of the QRAM architecture.

[0109] 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 in any of the above method embodiments when running.

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

[0111] S201: Obtain the target address and data bits of a preset word length;

[0112] S202: Based on the target address, determine a target path corresponding to the target address by using a preset addressing method;

[0113] S203: Processing the data corresponding to the target address in a parallel manner according to the preset word length of the data bits and the target path, wherein the parallel manner is to read the data of the preset word length once within a preset timing.

[0114] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

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

[0116] 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.

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

[0118] S201: Obtain the target address and data bits of a preset word length;

[0119] S202: Based on the target address, determine a target path corresponding to the target address by using a preset addressing method;

[0120] S203: Processing the data corresponding to the target address in a parallel manner according to the preset word length of the data bits and the target path, wherein the parallel manner is to read the data of the preset word length once within a preset timing.

[0121] 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 data processing method based on quantum random access memory, characterized in that: The method comprises: Get the target address and the data bits of the preset word length; Based on the target address, using a preset addressing method, determining a target path corresponding to the target address; According to the preset word length of the data bits and the target path, the data corresponding to the target address is processed in a parallel manner, wherein the parallel manner is to read the data of the preset word length at one time within a preset timing.

2. The method according to claim 1, characterized in that After obtaining the target address and the data bits of the preset word length, the method further includes: Each bit of the target address is sequentially read through an address register, and a preset quantum circuit is used to perform a transfer operation on each bit of the target address read by the address register, wherein the preset quantum circuit includes an H gate, a CNOT gate, a controlled Z gate, a SWAP gate, and a controlled SWAP gate, and the transfer operation includes one or more of data copying, data routing, and data exchange.

3. The method according to claim 2, characterized in that The quantum random access memory has a binary tree structure, which includes 1 layer of root nodes and n-1 layers of subtree nodes, wherein each layer of the binary tree structure includes an address bit and a data bit, and n is the address length of the target address.

4. The method according to claim 3, characterized in that The determining, based on the target address and using a preset addressing mode, a target path corresponding to the target address includes: Starting from the root node, each bit of the n-1-bit target address read in sequence is transferred to the data bit of the corresponding target layer subtree node in sequence through the preset quantum circuit; And the one-bit target address read from the data bit of the current target layer subtree node is exchanged with the address bit of the current target layer subtree node until a target path corresponding to the n-bit target address is generated.

5. The method according to claim 4, characterized in that Starting from the root node, each bit of the n-1-bit target address read in sequence is transferred to the data bit of the corresponding target layer subtree node through the preset quantum circuit, including: Starting from n=0, the 0th address of the target address is transferred to the root node of the binary tree structure; Starting from the i-th layer subtree node, the step of transferring the i-th address bit of the target address to the i-th layer subtree node data bit of the binary tree structure is executed until each bit address of the target address is transferred, wherein i is an integer and its value ranges from 1 to n-1 in sequence.

6. The method according to any one of claims 1 to 5, characterized in that The processing of the data corresponding to the target address in a parallel manner according to the preset word length of the data bits and the target path includes: Upon receiving the target path, obtaining data corresponding to each bit address in the target path according to a data bit parallel reading rule of a preset word length; The data corresponding to each bit address is transferred to the address bit of the root node in the binary tree structure through the preset quantum circuit to complete the parsing process of the data corresponding to the target path.

7. A data processing device based on quantum random access memory, characterized in that: The device comprises: An acquisition module is used to obtain the target address and the data bits of the preset word length; A determination module, configured to determine a target path corresponding to the target address based on the target address and using a preset addressing method; The processing module is used to process the data corresponding to the target address in a parallel manner according to the preset word length of the data bit and the target path, wherein the parallel manner is to read the data of the preset word length at one time within a preset timing.

8. The device according to claim 7, characterized in that After the obtaining module, the device further includes: A transfer module is configured to sequentially read each bit of the target address through an address register, and perform a transfer operation on each bit of the target address read by the address register using a preset quantum circuit, wherein the preset quantum circuit includes an H gate, a CNOT gate, a controlled Z gate, a SWAP gate, and a controlled SWAP gate, and the transfer operation includes one or more of data copying, data routing, and data exchange.

9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to implement the method according to any one of claims 1 to 6 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 execute the computer program to implement the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Quantum memory addressing techniques and related systems and methods

    CN114175061A

  • Method and device for reading data based on address, storage medium and electronic device

    CN114626532A

  • Data reading method and device, storage medium and electronic device

    CN114638367A

  • Method and device for constructing quantum circuit for QRAM (Quantum Random Access Memory) architecture

    CN114638368A

  • Data reading method and apparatus, storage medium and electronic apparatus

    WO2022110704A1