A method and related apparatus for constructing quantum circuits for implementing QRAM architecture

By identifying parallel sub-operations in the QRAM architecture and executing quantum logic gates in the same time sequence in the quantum circuit, the serial problem of data processing in the quantum circuit is solved, parallel data processing is realized, and the research efficiency of complex quantum algorithms is improved.

CN118607651BActive Publication Date: 2026-11-17ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, when implementing QRAM architecture using quantum circuits, data processing is mainly serial, which makes it difficult to analyze and study complex quantum algorithms and lacks an effective data parallel processing solution.

Method used

Based on the target address length of the QRAM architecture, the required qubits for the quantum circuit are obtained, the combination of quantum logic gates and their interaction relationships are determined, parallel sub-operations are identified, and the parallel quantum logic gates are executed in the same time sequence when constructing the quantum circuit to achieve parallel data processing.

Benefits of technology

Parallel processing reduces query time, increases data word length, lowers error rate, and promotes the analysis and research of complex quantum algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607651B_ABST
    Figure CN118607651B_ABST
Patent Text Reader

Abstract

This invention discloses a method and related apparatus for constructing quantum circuits using a QRAM architecture. The method includes: obtaining the qubits required to construct the quantum circuit based on the length of the target address to be written into the QRAM architecture; determining the combination of quantum logic gates required to perform a target operation using the QRAM architecture, and the interaction relationship between the quantum logic gate combination and the obtained qubits; determining all target sub-operation combinations from the target operation; determining each target quantum logic gate subset corresponding to the target sub-operation combination from the quantum logic gate combination, and, during the construction of the quantum circuit, applying each target quantum logic gate subset to the constructed quantum circuit in the same time sequence according to the interaction relationship. Using embodiments of this invention, the constructed quantum circuit can achieve parallel data processing within the QRAM architecture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of quantum computing technology, and in particular to a method and related apparatus for constructing quantum circuits for implementing QRAM architecture. Background Technology

[0002] Quantum Random Access Memory (QRAM) is a storage technology that utilizes the principles of quantum physics. It is a structure that can efficiently store and retrieve quantum information. The time required to prepare quantum states can reduce or even negate the computational advantages that quantum algorithms are originally expected to provide. Because QRAM can store quantum state data, it is often considered essential for realizing the advantages of quantum computing. Therefore, how to implement the QRAM architecture is one of the hot research topics in quantum computing.

[0003] Implementing QRAM architectures using quantum circuits is a research direction. However, there are currently few schemes for implementing QRAM architectures using quantum circuits, and most quantum circuits can only process data serially, which poses certain difficulties for the analysis and research of complex quantum algorithms. Therefore, how to construct a quantum circuit for implementing parallel data processing in QRAM architecture is an urgent problem to be solved. Summary of the Invention

[0004] The purpose of this invention is to provide a method and related apparatus for constructing quantum circuits for implementing QRAM architecture, so as to overcome the shortcomings of the prior art. It can propose an effective method for constructing quantum circuits and realize parallel data processing in QRAM architecture using quantum circuits.

[0005] One embodiment of this application provides a method for constructing a quantum circuit for implementing a QRAM architecture, the method comprising:

[0006] Based on the length of the target address written into the QRAM architecture, obtain the qubits required to construct the quantum circuit;

[0007] The combination of quantum logic gates required to perform a target operation using the QRAM architecture is determined, as well as the interaction between the combination of quantum logic gates and the acquired qubits, wherein the target operation includes multiple sub-operations in the data processing process;

[0008] From the target operation, determine all target sub-operation combinations, wherein the target sub-operation combinations include multiple parallel sub-operations;

[0009] From the quantum logic gate combination, each target quantum logic gate subset corresponding to the target sub-operation combination is determined, and when constructing the quantum circuit, each target quantum logic gate subset is acted on in the constructed quantum circuit in the same time sequence according to the interaction relationship, wherein the quantum logic gates in the target quantum logic gate subset are executed simultaneously.

[0010] Optionally, the QRAM architecture includes a root node, N-2 layers of child nodes, and 1 layer of leaf nodes, where N is the length of the target address;

[0011] The qubit includes one data bit and one address bit in each of the root node, each child node, and each leaf node, and the qubit corresponding to the bus.

[0012] Optionally, the target operation includes a sub-operation of writing the first address of the target address during the target address writing process;

[0013] The quantum logic gate combination includes:

[0014] The quantum logic gate required to copy the first address from the quantum bit corresponding to the bus to the data bit in the root node;

[0015] In the root node, there is the quantum logic gate required to transfer the first address bit from the data bit to the corresponding address bit.

[0016] Optionally, the target operation includes a sub-operation of writing the target bit of the target address during the target address writing process, wherein the target bit is any bit in the target address except for the first bit.

[0017] The quantum logic gate combination also includes:

[0018] The quantum logic gates required to copy each target bit from the corresponding qubit on the bus to the data bit at the root node.

[0019] The quantum logic gate required to route each target bit of the data bits in the root node to the data bits in the target node, wherein the target node is a child node or leaf node in the layer corresponding to the target bit into which the target bit is written;

[0020] In the target node, the quantum logic gates required to transfer each target bit from a data bit to its corresponding address bit.

[0021] Optionally, the target operation includes a sub-operation of copying one bit of data from the memory pool to the bus according to the target address;

[0022] The quantum logic gate combination also includes:

[0023] The quantum logic gates required to copy a single bit of data from the memory pool to the corresponding leaf node;

[0024] The quantum logic gate required to route a data bit from the leaf node through the subtree nodes to the data bit in the root node;

[0025] The quantum logic gate required to copy one bit of data from the data bit of the root node to the corresponding quantum bit of the bus.

[0026] Optionally, the data routing quantum logic gate combination includes quantum logic gates that implement bidirectional routing, wherein the data routing quantum logic gate combination is a combination of quantum logic gates required to route a single data bit between the data bits of the root node and the data bits of the leaf nodes.

[0027] Optionally, determining all combinations of target sub-operations from the target operation includes:

[0028] Determine whether there are parallelizable sub-operations within the target operation;

[0029] If they exist, group the parallelizable suboperations to obtain all combinations of the target suboperations.

[0030] Another embodiment of this application provides a construction apparatus for implementing a quantum circuit of QRAM architecture, the apparatus comprising:

[0031] The acquisition module is used to obtain the qubits required to build the quantum circuit based on the length of the target address written to the QRAM architecture.

[0032] The first determining module is used to determine the combination of quantum logic gates required to perform the target operation using the QRAM architecture, and the interaction between the combination of quantum logic gates and the acquired qubits, wherein the target operation includes multiple sub-operations in the data processing process;

[0033] The second determining module is used to determine all target sub-operation combinations from the target operation, wherein the target sub-operation combination includes multiple parallel sub-operations;

[0034] A construction module is used to determine each target quantum logic gate subset corresponding to the target sub-operation combination from the quantum logic gate combination, and when constructing a quantum circuit, to act each target quantum logic gate subset in the constructed quantum circuit in the same time sequence according to the interaction relationship, wherein the quantum logic gates in the target quantum logic gate subset are executed simultaneously.

[0035] Optionally, the QRAM architecture includes a root node, N-2 layers of child nodes, and 1 layer of leaf nodes, where N is the length of the target address;

[0036] The qubit includes one data bit and one address bit in each of the root node, each child node, and each leaf node, and the qubit corresponding to the bus.

[0037] Optionally, the target operation includes a sub-operation of writing the first address of the target address during the target address writing process;

[0038] The quantum logic gate combination includes:

[0039] The quantum logic gate required to copy the first address from the quantum bit corresponding to the bus to the data bit in the root node;

[0040] In the root node, there is the quantum logic gate required to transfer the first address bit from the data bit to the corresponding address bit.

[0041] Optionally, the target operation includes a sub-operation of writing the target bit of the target address during the target address writing process, wherein the target bit is any bit in the target address except for the first bit.

[0042] The quantum logic gate combination also includes:

[0043] The quantum logic gates required to copy each target bit from the corresponding qubit on the bus to the data bit at the root node.

[0044] The quantum logic gate required to route each target bit of the data bits in the root node to the data bits in the target node, wherein the target node is a child node or leaf node in the layer corresponding to the target bit into which the target bit is written;

[0045] In the target node, the quantum logic gates required to transfer each target bit from a data bit to its corresponding address bit.

[0046] Optionally, the target operation includes a sub-operation of copying one bit of data from the memory pool to the bus according to the target address;

[0047] The quantum logic gate combination also includes:

[0048] The quantum logic gates required to copy a single bit of data from the memory pool to the corresponding leaf node;

[0049] The quantum logic gate required to route a data bit from the leaf node through the subtree nodes to the data bit in the root node;

[0050] The quantum logic gate required to copy one bit of data from the data bit of the root node to the corresponding quantum bit of the bus.

[0051] Optionally, the data routing quantum logic gate combination includes quantum logic gates that implement bidirectional routing, wherein the data routing quantum logic gate combination is a combination of quantum logic gates required to route a single data bit between the data bits of the root node and the data bits of the leaf nodes.

[0052] Optionally, the second determining module is specifically used for:

[0053] Determine whether there are parallelizable sub-operations within the target operation;

[0054] If they exist, group the parallelizable suboperations to obtain all combinations of the target suboperations.

[0055] One embodiment of this application provides a storage medium storing a computer program, wherein the computer program is configured to implement the method described in any of the above-described embodiments when running.

[0056] One embodiment of this 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 the method described in any of the above-described embodiments.

[0057] Compared with existing technologies, this invention first provides the qubits required to construct a quantum circuit based on the length of the target address written into the QRAM architecture; then, it determines the combination of quantum logic gates required to perform the target operation using the QRAM architecture, and the interaction relationship between the quantum logic gate combination and the acquired qubits; next, it determines all target sub-operation combinations from the target operation; finally, it determines each target quantum logic gate subset corresponding to the target sub-operation combination from the quantum logic gate combination, and during the construction of the quantum circuit, it applies each target quantum logic gate subset to the constructed quantum circuit in the same time sequence according to the interaction relationship. This invention proposes an effective method for constructing quantum circuits. Based on the parallelizability of operations, it applies parallel quantum logic gates to the quantum circuit in the same time sequence, realizing parallel data processing in the QRAM architecture using quantum circuits, thereby promoting the analysis and research of complex quantum algorithms. Attached Figure Description

[0058] Figure 1 This is a network block diagram of a quantum circuit construction system for implementing a QRAM architecture, provided by an embodiment of the present invention.

[0059] Figure 2A flowchart illustrating a method for constructing a quantum circuit for implementing a QRAM architecture, provided in an embodiment of the present invention;

[0060] Figure 3 This is a schematic diagram of a QRAM architecture provided in an embodiment of the present invention;

[0061] Figure 4 A schematic diagram of a quantum circuit for copying an address from a bus to data bits at the root node, provided as an embodiment of the present invention;

[0062] Figure 5 A schematic diagram of a quantum circuit for implementing data routing provided in an embodiment of the present invention;

[0063] Figure 6 A schematic diagram of a quantum circuit for copying one bit of data from the bus to the root node data bit, provided as an embodiment of the present invention;

[0064] Figure 7 A schematic diagram of a quantum circuit for implementing data copying, provided as an embodiment of the present invention;

[0065] Figure 8 This is a schematic diagram of a construction device for implementing a quantum circuit based on a QRAM architecture, provided as an embodiment of the present invention. Detailed Implementation

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

[0067] Figure 1 This is a network block diagram of a quantum circuit construction system for implementing a QRAM architecture, provided by an embodiment of the present invention. The quantum circuit construction system for implementing a QRAM architecture may include a network 110, a server 120, a wireless device 130, a client 140, storage 150, a classical processing system 160, a quantum processing system 170, and may also include additional memory, a classical processor, a quantum processor, and other devices (not shown).

[0068] Network 110 is a medium used to provide communication links between various devices and computers connected together within a system for building quantum circuits to implement the QRAM architecture, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof, and the connection method can be wired, wireless communication links, or fiber optic cables.

[0069] Server 120 and client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computational processes. Client 140 may be a personal computer or a network computer, so the data may also be provided by server 120. Wireless device 130 may be a smartphone, tablet, laptop, smart wearable device, etc. Storage unit 150 may include database 151, which can be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.

[0070] 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 program 162 (application program 173). The application program 162 (application program 173) may be used to implement a quantum algorithm compiled according to the method for constructing quantum circuits for implementing QRAM architecture provided in the embodiments of the present invention.

[0071] 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 executed therein can also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0072] It should be noted that a true quantum computer has a hybrid structure, which includes at least... Figure 1 The system consists of two main parts: 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 to achieve quantum computing.

[0073] The aforementioned classical processing system 160 and quantum processing system 170 can be integrated into a single device or distributed across two different devices. For example, the first device, including the classical processing system 160, runs a classical computer operating system that provides quantum application development tools and services, as well as the storage and network services required for quantum applications. Users develop quantum applications using the quantum application development tools and services on the second device and send the quantum program to the second device, including the quantum processing system 170, via the network services. The second device runs a quantum computer operating system, which parses the code of the quantum program and compiles it into instructions that can be recognized and executed by the quantum computer control system. The quantum processor 170 then implements the quantum algorithm corresponding to the quantum program based on these instructions.

[0074] In the classic silicon-based processing system 160, the units of the classic processor 161 are CMOS transistors. These computing units are not limited by time or coherence; that is, they are available at any time without time constraints. Furthermore, the number of these computing units in a silicon chip is sufficient; currently, a classic processor contains tens of thousands of computing units. The sufficient number of computing units and the fixed selectable computing logic of the CMOS transistors, such as AND logic, allow for computational efficiency through a combination of numerous CMOS transistors and limited logic functions.

[0075] Unlike the logic units in the classical processing system 160, the basic computational unit of the quantum processor 171 in the quantum processing system 170 is the qubit. The input of a qubit is limited by coherence and coherence time; that is, a qubit is limited by its available usage time and is not always readily available. Making full use of qubits within their available usage time is a key challenge in quantum computing. Furthermore, the number of qubits in a quantum computer is one of the representative indicators of its performance. Each qubit performs computational functions through on-demand configured logic functions. Given the limited number of qubits and the diverse logic functions available in quantum computing, such as Hadamard gates (H gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), X gates, RY gates, RZ gates, CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc., quantum computing requires combining a limited number of qubits with diverse logic function combinations to achieve computational effects.

[0076] Based on these differences, the design of logical functions applied to qubits (including the design of whether qubits are used and the design of the efficiency of each qubit) is crucial to improving the computational performance of quantum computers and requires special design. The aforementioned design considerations for qubits are technical problems that ordinary computing devices do not need to consider or address. Therefore, this invention proposes a method and related apparatus for constructing quantum circuits for implementing a QRAM architecture in quantum computing. The aim is to provide a novel method for constructing quantum circuits for implementing a QRAM architecture, enabling parallel processing of data at the same address within the QRAM architecture.

[0077] QRAM is a storage system used in quantum computers, a quantum version of RAM (Random Access Memory) in classical computers. QRAM can be used to create quantum superposition states containing information. Unlike RAM, which requires reading data one element at a time, QRAM can read superimposed data at superimposed addresses. For example, it can store e0, e1, ..., e... in the address [0, N).n-1 Using classic RAM, the input address is i, and the output data is e. i For the quantum version of QRAM, the following quantum state can be input as the address:

[0078] Σ|i>

[0079] The following output is obtained using QRAM:

[0080] Σ|i>|e i >

[0081] This process of inputting an address and outputting data can be called a 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 into quantum data), and an important condition for quantum speedup of these algorithms is that the query time of QRAM cannot be too long, the embodiments of the present invention can minimize the query time by constructing quantum circuits.

[0082] See Figure 2 , Figure 2 A flowchart illustrating a method for constructing a quantum circuit for implementing a QRAM architecture, provided as an embodiment of the present invention, may include the following steps:

[0083] S201: Based on the length of the target address written to the QRAM architecture, obtain the qubits required to construct the quantum circuit.

[0084] The specific architecture of QRAM can be determined by the length of the target address. When using QRAM architecture to implement data processing, the number of qubits required to construct the quantum circuit can be 2^36. N N is the length of the target address.

[0085] S202: Determine the combination of quantum logic gates required to perform the target operation using the QRAM architecture, and the interaction between the combination of quantum logic gates and the acquired qubits, wherein the target operation includes multiple sub-operations in the data reading process.

[0086] The data processing includes a target address write process and a data read process. A sub-operation is the smallest unit of operation within either the target address write process or the data read process. A sub-operation can be writing a single bit of the target address during the target address write process, or copying a single bit of data from the memory pool to the bus during the data read process. If the target address length is 4, then the target address write process contains 4 sub-operations. If the preset word length is 3, then 3 bits of data need to be read, and the data read process contains 6 sub-operations, including the sub-operation of copying each bit of data from the bus to the memory pool, and the sub-operation of routing each bit of data back to the root node.

[0087] Once the sub-operations contained in the target operation are determined, the combination of quantum logic gates required to implement the corresponding function and the QRAM architecture can be determined based on the function to be implemented by the target operation and the quantum bits that each quantum logic gate in the combination acts on, i.e., the interaction relationship.

[0088] S203: From the target operation, determine all target sub-operation combinations, wherein the target sub-operation combinations include multiple parallel sub-operations.

[0089] In the process of data processing using the QRAM structure, some sub-operations can be parallelized. The parallelizable sub-operations in the target operation are identified, and based on the identified parallelizable sub-operations, all combinations of target sub-operations are determined. The sub-operations in the combination of target sub-operations can be parallelized with each other.

[0090] S204: From the quantum logic gate combination, determine each target quantum logic gate subset corresponding to the target sub-operation combination, and when constructing the quantum circuit, apply each target quantum logic gate subset to the constructed quantum circuit in the same time sequence according to the interaction relationship, wherein the quantum logic gates in the target quantum logic gate subset are executed simultaneously.

[0091] Each sub-operation in the target sub-operation combination corresponds to at least one quantum logic gate. The sub-operations in the target sub-operation combination can be synchronous or asynchronous. Therefore, the quantum logic gates corresponding to the target sub-operation combination are not executed simultaneously to a large extent. To minimize query time and ensure that parallelizable sub-operations are executed in parallel within the quantum circuit when using the QRAM structure for data processing, a subset of target quantum logic gates is determined. When constructing the quantum circuit, the quantum logic gates in a subset of target quantum logic gates are applied within the same time sequence. Quantum logic gates within the same time sequence are executed simultaneously within the quantum circuit.

[0092] Current research on QRAM architecture focuses on single-bit data inputs, while multi-bit inputs may be more common and practical. To increase the word length of QRAM, two possible methods have been proposed: multiple QRAM queries or increasing bandwidth, i.e., increasing the number of qubits that can be carried from the memory pool simultaneously. Both of these methods increase the error by multiplying by the word length, which is a significant cost for the quality requirements of qubits. The parallelizable quantum circuit for QRAM proposed in this invention effectively suppresses the error rate.

[0093] In this embodiment of the invention, parallelizable quantum logic gates are applied to the same quantum circuit within the same time sequence, achieving parallel operation in the QRAM architecture, increasing the data word length of the QRAM, and using O(2^3) time complexity. n Each quantum circuit has 100 qubits, and each query achieves a time complexity of O(n+k), where k is the preset word length, i.e., the number of bits that can be read at once. The quantum circuit constructed in this embodiment optimizes the time complexity, eliminates the need for multiple queries, does not increase bandwidth, reduces the error rate of the entire QRAM architecture, and makes it more reliable.

[0094] As can be seen, this embodiment of the invention first obtains the qubits required to construct the quantum circuit based on the length of the target address written into the QRAM architecture; then, it determines the combination of quantum logic gates required to execute the target operation using the QRAM architecture, and the interaction relationship between the quantum logic gate combination and the obtained qubits; next, it determines all target sub-operation combinations from the target operation; finally, it determines each target quantum logic gate subset corresponding to the target sub-operation combination from the quantum logic gate combination, and when constructing the quantum circuit, it applies each target quantum logic gate subset to the constructed quantum circuit in the same time sequence according to the interaction relationship. This embodiment of the invention proposes an effective method for constructing quantum circuits. Based on the parallelizability of operations, it applies parallel quantum logic gates to the quantum circuit in the same time sequence, realizing parallel data processing in the QRAM architecture using quantum circuits, thereby promoting the analysis and research of complex quantum algorithms.

[0095] In some possible embodiments of the present invention, the QRAM architecture includes a root node, N-2 layers of child nodes and 1 layer of leaf nodes, wherein N is the length of the target address;

[0096] The qubit includes one data bit and one address bit in each of the root node, each child node, and each leaf node, and the qubit corresponding to the bus.

[0097] The entire QRAM architecture can present a binary tree structure. For example... Figure 3As shown, taking a target address length of 3 as an example, the A (Address Qubit) and D (Data Qubit) shown in the dashed box form a group called a node, which is a basic unit in a binary tree. All nodes form a binary tree, and the root of the binary tree is the output part of the QRAM (not shown in the figure), which records a binary data bit. In the figure, (0,0) represents the 0th node of the 0th level, i.e., the root node; (1,0) represents the 0th node of the 1st level, i.e., the 0th child node of the 1st level; and (2,0) represents the 0th node of the 2nd level, i.e., a leaf node. For a QRAM with an address length of N (such as 32-bit, 64-bit, etc., typical data word lengths), the maximum address space of the QRAM is from 0 to 2. N -1.

[0098] The acquired qubits include qubits corresponding to a bus. This bus has both address and data bus functions, allowing the qubits corresponding to the bus to input address information and read each data bit of a preset word length. In this embodiment of the invention, the address bits in a node can be an address register, and the data bits can be a data register.

[0099] In some possible embodiments of the present invention, the target operation includes a sub-operation of writing the first address of the target address during the target address writing process;

[0100] The quantum logic gate combination may include:

[0101] The quantum logic gate required to copy the first address from the quantum bit corresponding to the bus to the data bit in the root node;

[0102] In the root node, there is the quantum logic gate required to transfer the first address bit from the data bit to the corresponding address bit.

[0103] The process of writing the target address involves determining the access path in the QRAM. Writing the first bit of the address differs slightly from writing the other bits. The first bit is written to the root node, all bits except the last one are written to the child nodes, and the last bit is written to the leaf nodes. The process of writing the first bit is as follows: the first bit is copied from the bus to the root node. Specifically, the first bit is copied to the data bits of the root node. This can be achieved using methods such as... Figure 4 The quantum circuit shown implements the address bus input, A i Let d be the address of the i-th bit. 0,0The data bits of the root node; when the first address is copied to the data bits of the root node, the first address also needs to be transferred to the address bits of the root node. Specifically, a SWAP gate or other multiple quantum logic gates that implement data exchange can be used to exchange the data bits and address bits in a node.

[0104] In some possible embodiments of the present invention, the target operation includes a sub-operation of writing the target bit of the target address during the target address writing process, wherein the target bit is any bit in the target address except for the first bit.

[0105] The quantum logic gate combination may further include:

[0106] The quantum logic gates required to copy each target bit from the corresponding qubit on the bus to the data bit at the root node.

[0107] The quantum logic gate required to route each target bit of the data bits in the root node to the data bits in the target node, wherein the target node is a child node or leaf node in the layer corresponding to the target bit into which the target bit is written;

[0108] In the target node, the quantum logic gates required to transfer each target bit from a data bit to its corresponding address bit.

[0109] The writing of the first bit of the target address differs from the writing of the other bits. Writing the other bits requires downward addressing and routing to the corresponding node. Routing can be implemented using controlled swap gates. A specific quantum circuit diagram can be seen as follows: Figure 5 As shown in the diagram, the node to which the data is routed is determined by the previous address bit. For example, if the address bit in the p-th address of layer l is 0, the current target bit is routed from the data bit of the p-th node in layer l to the data bit of the 2p-th node in layer (l+1). If the address bit in the p-th node in layer l is 1, the current target bit is routed from the data bit of the p-th node in layer l to the data bit of the 2p+1-th node in layer (l+1). When the target address is written, the first address bit is written in the root node, the last address bit is written in a leaf node, and the corresponding address bit is written in each child node of each layer. During the target address writing process, the routing path required for data reading is also gradually determined.

[0110] In this embodiment of the invention, the target node corresponding to the target bit is determined by the target address. Specifically, it is determined based on the addresses of other bits preceding the target bit and preset routing rules. For example, because the QRAM architecture is a binary tree structure, the routing direction (left or right) can be determined based on the address of the previous layer. For instance, using... Figure 3For example, the target address is 010, and the preset routing rule is 0 to the left and 1 to the right. The address in the address bits of the root node of layer 0 is 0. For the second address, it is copied from the bus to the data bits of layer 0. Since the address in the address bits of layer 0 is 0, the second address is routed to the left. The target node corresponding to the second address is (1,0). The third address is copied from the bus to the data bits of layer 0. It is routed from the data bits of node (0,0) to node (1,0). Since the second bit is 1, it is routed to the right to node (2,1). The third address is finally written into the address bits of node (2,1).

[0111] In some possible embodiments of the present invention, the target operation may include a sub-operation of copying one bit of data from the memory pool to the bus according to the target address;

[0112] The quantum logic gate combination may further include:

[0113] The quantum logic gates required to copy a single bit of data from the memory pool to the corresponding leaf node;

[0114] The quantum logic gate required to route a data bit from the leaf node through the subtree nodes to the data bit in the root node;

[0115] The quantum logic gate required to copy one bit of data from the data bit of the root node to the corresponding quantum bit of the bus.

[0116] In this embodiment of the invention, the qubit may further include the qubit corresponding to the memory pool. The number of data bits is a preset word length. If the preset word length is 3 bits, the corresponding 3 bits of data need to be copied sequentially from the memory pool to the corresponding leaf node. When reading data, the data to be read is located in the memory pool. One bit of data in the memory pool is copied to the QRAM architecture. Using the routing path (the routing path is determined by the node writing the target address), the data bit is routed from the leaf node to the root node, and then copied to the bus to complete the data reading. Specifically, one bit of data is copied to the corresponding leaf node. According to the target address, the data is routed upwards, passing through the data bits of each child node that writes the corresponding bit address, and finally routed to the root node. Then, the data bits of the root node are copied to the bus.

[0117] Copying one bit of data from the bus to the data bit of the root node is called data bus input. Specifically, this can be achieved using methods such as... Figure 6 The quantum circuit shown is defined using an H-gate so that subsequent data copy operations can perform phase encoding, thereby distinguishing the |0> state of data bits from the |0> state of non-data bits; that is, encoding the |0> state into... state.

[0118] In data processing, both address writing and data reading involve bus copying to the data bits of the root node, differing only in the copying method. The routing method remains the same: address writing is achieved through data exchange within the same node's bits, while a single data bit is routed to the leaf node and copied to the corresponding qubit in the memory pool. The quantum logic gates required for the copy operation include controlled Z-gates, enabling the acquisition of classical data into data qubits through classical controlled operations. In some implementations, the quantum circuitry for copying can be as follows: Figure 7 As shown, the leaf node is address bit a. l,p The data bits are d l,p Through a controlled Z-gate, a single bit of data is stored in the corresponding qubit in the memory pool. If address bit a l,p The address in the memory is 0, and it is copied to memory pool m. 2p The corresponding quantum bit, if address bit a l,p The address in the memory is 1, and it is copied to memory pool m. 2p+1 The corresponding qubit.

[0119] In some possible embodiments of the present invention, the data routing quantum logic gate combination includes quantum logic gates that implement bidirectional routing, wherein the data routing quantum logic gate combination is a combination of quantum logic gates required to route a single bit of data between the data bits of the root node and the data bits of the leaf nodes.

[0120] The data routing quantum gate combination is included in the determined quantum logic gate combination, consisting of quantum logic gates corresponding to the routing of one bit of data. In this embodiment of the invention, during data reading, there are parallel operations. For example, when copying the second bit of data from the root node to the memory pool, an upward routing operation of the first bit of data can be performed. From the perspective of the QRAM architecture, the routing paths are the same, but the routing directions are different; one is routing from top to bottom, and the other is routing from bottom to top. During the routing process, bidirectional routing can be used by passing through the same nodes, which can realize the exchange of read data, reduce the number of quantum logic gates in the quantum circuit, and thus reduce the depth of the quantum circuit. In this embodiment of the invention, the quantum logic gate that realizes bidirectional routing can be a SWAP gate. During the reading process, the SWAP gate exchanges the data in the node it operates on.

[0121] In some possible embodiments of the present invention, determining all combinations of target sub-operations from the target operation includes:

[0122] Determine whether there are parallelizable sub-operations within the target operation;

[0123] If they exist, group the parallelizable suboperations to obtain all combinations of the target suboperations.

[0124] The target operation contains multiple sub-operations. Some sub-operations can be parallelized, while others cannot. It is necessary to identify the parallelizable sub-operations in the target operation. The specific identification method can be based on the identifiers set by humans in advance for the sub-operations, or it can be based on the analysis of the data processing process using algorithms to determine the parallelizable sub-operations.

[0125] Once all parallelizable sub-operations are determined, the ranges of mutually parallelizable sub-operations are grouped together to obtain all combinations of the target sub-operations.

[0126] It should be noted that the method for constructing quantum circuits for implementing a QRAM architecture provided in this embodiment of the invention can be applied to different types of quantum computers. Because quantum computers differ in type, their quantum states may also differ. For example, an ion trap quantum computer has two quantum states, while a superconducting quantum computer has three. In a superconducting quantum computer, the data bits copied from the bus to the root node do not require an H-gate. In this embodiment of the invention, the specific quantum circuit is only an example of a quantum circuit in one type of quantum computer that implements a certain function. It does not mean that the quantum circuit implementing a function is uniquely determined in all quantum computers; a quantum circuit only needs to implement the corresponding function. The specific structure of the quantum circuit corresponding to a certain function may also differ in different quantum computers.

[0127] See Figure 8 , Figure 8 This is a schematic diagram of the structure of a quantum circuit construction device for implementing a QRAM architecture provided in an embodiment of the present invention. Figure 2 Corresponding to the process shown, the apparatus includes:

[0128] The acquisition module 801 is used to acquire the qubits required to build the quantum circuit based on the length of the target address written to the QRAM architecture.

[0129] The first determining module 802 is used to determine the combination of quantum logic gates required to perform the target operation using the QRAM architecture, and the interaction relationship between the combination of quantum logic gates and the acquired qubits, wherein the target operation includes multiple sub-operations in the data processing process;

[0130] The second determining module 803 is used to determine all target sub-operation combinations from the target operation, wherein the target sub-operation combination includes multiple parallel sub-operations;

[0131] The construction module 804 is used to determine each target quantum logic gate subset corresponding to the target sub-operation combination from the quantum logic gate combination, and when constructing the quantum circuit, to act each target quantum logic gate subset in the constructed quantum circuit in the same time sequence according to the interaction relationship, wherein the quantum logic gates in the target quantum logic gate subset are executed simultaneously.

[0132] In some possible embodiments of the present invention, the QRAM architecture includes a root node, N-2 layers of child nodes and 1 layer of leaf nodes, wherein N is the length of the target address;

[0133] The qubit includes one data bit and one address bit in each of the root node, each child node, and each leaf node, and the qubit corresponding to the bus.

[0134] In some possible embodiments of the present invention, the target operation includes a sub-operation of writing the first address of the target address during the target address writing process;

[0135] The quantum logic gate combination includes:

[0136] The quantum logic gate required to copy the first address from the quantum bit corresponding to the bus to the data bit in the root node;

[0137] In the root node, there is the quantum logic gate required to transfer the first address bit from the data bit to the corresponding address bit.

[0138] In some possible embodiments of the present invention, the target operation may include a sub-operation of writing the target bit of the target address during the target address writing process, wherein the target bit is any bit in the target address except for the first bit.

[0139] The quantum logic gate combination may further include:

[0140] The quantum logic gates required to copy each target bit from the corresponding qubit on the bus to the data bit at the root node.

[0141] The quantum logic gate required to route each target bit of the data bits in the root node to the data bits in the target node, wherein the target node is a child node or leaf node in the layer corresponding to the target bit into which the target bit is written;

[0142] In the target node, the quantum logic gates required to transfer each target bit from a data bit to its corresponding address bit.

[0143] In some possible embodiments of the present invention, the target operation may include a sub-operation of copying one bit of data from the memory pool to the bus according to the target address;

[0144] The quantum logic gate combination may further include:

[0145] The quantum logic gates required to copy a single bit of data from the memory pool to the corresponding leaf node;

[0146] The quantum logic gate required to route a data bit from the leaf node through the subtree nodes to the data bit in the root node;

[0147] The quantum logic gate required to copy one bit of data from the data bit of the root node to the corresponding quantum bit of the bus.

[0148] In some possible embodiments of the present invention, the data routing quantum logic gate combination includes quantum logic gates that implement bidirectional routing, wherein the data routing quantum logic gate combination is a combination of quantum logic gates required to route a single bit of data between the data bits of the root node and the data bits of the leaf nodes.

[0149] In some possible embodiments of the present invention, the second determining module 803 is specifically used for:

[0150] Determine whether there are parallelizable sub-operations within the target operation;

[0151] If they exist, group the parallelizable suboperations to obtain all combinations of the target suboperations.

[0152] As can be seen, the embodiments of the present invention first obtain the qubits required to construct the quantum circuit based on the length of the target address written into the QRAM architecture; then determine the combination of quantum logic gates required to perform the target operation using the QRAM architecture, and the interaction relationship between the combination of quantum logic gates and the obtained qubits; then determine all the target sub-operation combinations from the target operation; finally determine each target quantum logic gate subset corresponding to the target sub-operation combination from the quantum logic gate combination, and when constructing the quantum circuit, apply each target quantum logic gate subset to the constructed quantum circuit in the same time sequence according to the interaction relationship.

[0153] This invention proposes an effective method for constructing quantum circuits. Based on the parallelism of operations, parallel quantum logic gates are applied to the same time sequence of the quantum circuit, realizing parallel data processing in the QRAM architecture using quantum circuits, thereby promoting the analysis and research of complex quantum algorithms.

[0154] This invention also provides a storage medium storing a computer program, wherein the computer program is configured to implement the steps in any of the above method embodiments when it is run.

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

[0156] S201: Based on the length of the target address written to the QRAM architecture, obtain the qubits required to build the quantum circuit;

[0157] S202: Determine the combination of quantum logic gates required to perform the target operation using the QRAM architecture, and the interaction between the combination of quantum logic gates and the acquired qubits, wherein the target operation includes multiple sub-operations in the data processing process;

[0158] S203: From the target operation, determine all target sub-operation combinations, wherein the target sub-operation combinations include multiple parallel sub-operations;

[0159] S204: From the quantum logic gate combination, determine each target quantum logic gate subset corresponding to the target sub-operation combination, and when constructing the quantum circuit, apply each target quantum logic gate subset to the constructed quantum circuit in the same time sequence according to the interaction relationship, wherein the quantum logic gates in the target quantum logic gate subset are executed simultaneously.

[0160] This invention also 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.

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

[0162] Specifically, in this embodiment, the processor described above can be configured to implement the following steps via a computer program:

[0163] S201: Based on the length of the target address written to the QRAM architecture, obtain the qubits required to build the quantum circuit;

[0164] S202: Determine the combination of quantum logic gates required to perform the target operation using the QRAM architecture, and the interaction between the combination of quantum logic gates and the acquired qubits, wherein the target operation includes multiple sub-operations in the data processing process;

[0165] S203: From the target operation, determine all target sub-operation combinations, wherein the target sub-operation combinations include multiple parallel sub-operations;

[0166] S204: From the quantum logic gate combination, determine each target quantum logic gate subset corresponding to the target sub-operation combination, and when constructing the quantum circuit, apply each target quantum logic gate subset to the constructed quantum circuit in the same time sequence according to the interaction relationship, wherein the quantum logic gates in the target quantum logic gate subset are executed simultaneously.

[0167] The above description, based on the embodiments shown in the figures, details the structure, features, and effects of the present invention. The above description is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the figures. Any changes made in accordance with the concept of the present invention, or equivalent embodiments modified to have equivalent changes, that do not exceed the spirit covered by the specification and figures, should be within the protection scope of the present invention.

Claims

1. A method for constructing quantum circuits for implementing a QRAM architecture, characterized in that, The method includes: Based on the length of the target address written into the QRAM architecture, the qubits required to construct the quantum circuit are obtained. The QRAM architecture includes a root node, N-2 layers of child nodes and 1 layer of leaf nodes, where N is the length of the target address. The qubits include the root node, one data bit and one address bit in each child node and each leaf node, and the qubits corresponding to the bus. The combination of quantum logic gates required to perform a target operation using the QRAM architecture is determined, as well as the interaction between the combination of quantum logic gates and the acquired qubits, wherein the target operation includes multiple sub-operations in the data processing process; From the target operation, determine all target sub-operation combinations, wherein the target sub-operation combination includes multiple parallel sub-operations, and the target operation includes the sub-operation of writing the first address of the target address in the target address writing process; From the quantum logic gate combinations, each target quantum logic gate subset corresponding to the target sub-operation combination is determined, and when constructing a quantum circuit, each target quantum logic gate subset is applied to the constructed quantum circuit in the same time sequence according to the interaction relationship, wherein the quantum logic gates in the target quantum logic gate subsets are executed simultaneously, and the quantum logic gate combination includes: the quantum logic gate required to copy the first address from the quantum bit corresponding to the bus to the data bit in the root node; and the quantum logic gate required to transfer the first address from the data bit to the corresponding address bit in the root node.

2. The method according to claim 1, characterized in that, The target operation also includes a sub-operation of writing the target bit of the target address during the target address writing process, wherein the target bit is any bit in the target address except for the first bit. The quantum logic gate combination also includes: The quantum logic gates required to copy each target bit from the corresponding qubit on the bus to the data bit of the root node; The quantum logic gate required to route each target bit of the data bits in the root node to the data bits in the target node, wherein the target node is a child node or leaf node in the layer corresponding to the target bit into which the target bit is written; In the target node, the quantum logic gates required to transfer each target bit from a data bit to its corresponding address bit.

3. The method according to claim 2, characterized in that, The target operation also includes a sub-operation of copying one bit of data from the memory pool to the bus according to the target address; The quantum logic gate combination also includes: The quantum logic gates required to copy a single bit of data from the memory pool to the corresponding leaf node; The quantum logic gate required to route a data bit from the leaf node through the subtree nodes to the data bit in the root node; The quantum logic gate required to copy one bit of data from the data bit of the root node to the corresponding quantum bit of the bus.

4. The method according to claim 3, characterized in that, The data routing quantum logic gate combination includes quantum logic gates that enable bidirectional routing, wherein the data routing quantum logic gate combination is a combination of quantum logic gates required to route a single data bit between the data bits of the root node and the data bits of the leaf nodes.

5. The method according to any one of claims 1-4, characterized in that, The step of determining all combinations of target sub-operations from the target operation includes: Determine whether there are parallelizable sub-operations within the target operation; If they exist, group the parallelizable suboperations to obtain all combinations of the target suboperations.

6. A device for constructing quantum circuits for implementing a QRAM architecture, characterized in that, The device includes: The acquisition module is used to acquire the qubits required to construct the quantum circuit based on the length of the target address written into the QRAM architecture. The QRAM architecture includes a root node, N-2 layers of child nodes and 1 layer of leaf nodes, where N is the length of the target address. The qubits include the root node, one data bit and one address bit in each child node and each leaf node, and the qubits corresponding to the bus. The first determining module is used to determine the combination of quantum logic gates required to perform the target operation using the QRAM architecture, and the interaction relationship between the combination of quantum logic gates and the acquired qubits, wherein the target operation includes multiple sub-operations in the data processing process, and the target operation includes the sub-operation of writing the first address of the target address in the target address writing process; The second determining module is used to determine all target sub-operation combinations from the target operation, wherein the target sub-operation combination includes multiple parallel sub-operations; A construction module is used to determine each target quantum logic gate subset corresponding to the target sub-operation combination from the quantum logic gate combination, and to act on each target quantum logic gate subset in the constructed quantum circuit in the same time sequence according to the interaction relationship when constructing the quantum circuit. The quantum logic gates in the target quantum logic gate subset are executed simultaneously. The quantum logic gate combination includes: the quantum logic gate required to copy the first address from the quantum bit corresponding to the bus to the data bit in the root node; and the quantum logic gate required to transfer the first address from the data bit to the corresponding address bit in the root node.

7. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to implement the method described in any one of claims 1 to 5 when it is run.

8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to implement the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Quantum computing simulation principle verification method based on high-performance heterogeneous cluster

    CN114462612A

  • QRAM architecture quantum circuit construction method and apparatus, and quantum address data analysis method and apparatus

    WO2022110705A1