Quantum circuit conversion method and device, medium and equipment

By building the mapping relationship between general-purpose gate and native gate and translating it into native gate data elements, the problem of low conversion efficiency of general-purpose gate to native gate is solved, and the performance of quantum compiler is improved.

CN119398187APending Publication Date: 2025-02-07GUOKAIKE QUANTUM TECH (ANHUI) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411492653.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

How to concisely and efficiently implement general-purpose gate-to-native gate conversion to improve the performance of quantum compilers.

Method used

By constructing a mapping relationship between a general-purpose gate and a native gate, and using data elements representing the native gate, the general-purpose gate is translated into a native gate to generate a target quantum circuit.

Benefits of technology

It realizes efficient translation of source quantum lines to target quantum lines, so that source quantum lines can run on target quantum platforms, improving the performance of quantum compilers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398187A_ABST
    Figure CN119398187A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of quantum computing, and discloses a quantum circuit conversion method and device, a medium and equipment. The quantum circuit conversion method comprises the following steps: constructing a mapping relationship between a universal gate and a Native gate and a data element representing the Native gate; traversing the universal gates of the source quantum circuit, translating each universal gate into a local gate, and generating a target quantum circuit; wherein the step of translating each universal door into the local door comprises the step of representing the universal door as a combination of one or more local door data elements according to a mapping relation between the universal door and the local door. According to the invention, quantum circuit conversion from a general gate to a local gate can be simply and efficiently realized, and the performance of a quantum compiler is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of quantum computing technology, and in particular to a quantum circuit conversion method, device, medium and equipment. Background Art

[0002] A quantum computer is a device that follows the laws of quantum mechanics to perform high-speed mathematical and logical operations, store and process quantum information. Quantum computing is a computing technology based on the principles of quantum mechanics. It uses the superposition and entanglement of quantum bits to quickly process large amounts of data and solve some problems that are difficult to solve with classical computing. The characteristics of quantum computing include fast operation speed, strong information processing capabilities, and a wide range of applications. Compared with classical computing, quantum computing is more suitable for processing large-scale and complex data, and can more efficiently solve some key problems, such as prime factorization and discrete logarithms.

[0003] The specific implementation of quantum computing is based on the quantum software layer. The quantum software layer includes quantum algorithms, quantum high-level languages ​​and compilers. In the quantum compiler, the quantum circuit used for quantum computing is translated into a quantum circuit composed of native gates. The quantum circuit used for quantum computing is called the source quantum circuit, which is composed of universal quantum gates (Universal quantum gates, referred to as universal gates) acting on quantum bits. The quantum circuit composed of native gates (Native quantum gates, referred to as native gates) is called the target quantum circuit, which can be executed on the hardware target quantum platform.

[0004] The universal gate set supported by quantum computing includes: X-gate, Y-gate, Z-gate, S-gate, T-gate, H-gate, CNOT-gate, CZ-gate, etc. When compiling a quantum program, the universal gates in the source quantum circuit will be parsed into native gates supported by the hardware target quantum platform. The native gate set includes: R-gate. R-gate includes ,because Can be decomposed into Door combination: , so the local door set can also be defined to include: .

[0005] Since the generation of target quantum circuits is the basis and key of quantum compilers, how to simply and efficiently realize the conversion from universal gates to native gates and improve the performance of quantum compilers has become a technical problem that needs to be solved. Summary of the invention

[0006] The object of the present invention is to provide a quantum circuit conversion method, device, medium and equipment to concisely and efficiently realize the conversion from universal gate to local gate and improve the performance of quantum compiler.

[0007] According to one aspect of the present invention, there is provided a quantum circuit conversion method, comprising: Constructing a mapping relationship between a universal gate and a local gate and a data element representing the local gate; The universal gates of the source quantum circuit are traversed, each universal gate is translated into a local gate, and a target quantum circuit is generated; wherein, the translating each universal gate into a local gate comprises: according to the mapping relationship between the universal gate and the local gate, the universal gate is represented as a combination of one or more local gate data elements.

[0008] According to an embodiment of the present invention, the local gate data element includes a local gate type and a local gate parameter.

[0009] According to one embodiment of the present invention, the machine door is Door, The data element of the gate is represented by a data pair consisting of "x" and θ, where "x" represents The type of gate, θ represents Parameters of the door.

[0010] According to one embodiment of the present invention, the machine door is Door, The data element of the gate is represented by a data pair consisting of "y" and θ, where "y" represents The type of gate, θ represents Parameters of the door.

[0011] According to one embodiment of the present invention, the data structure of the data element is a tuple, a dictionary, or a list.

[0012] According to an embodiment of the present invention, the universal gates include an X gate, a Y gate, a Z gate, an S gate, a T gate, an H gate, a CNOT gate, and a CZ gate.

[0013] According to another aspect of the present invention, there is also provided a quantum circuit conversion device, comprising: A mapping unit, configured to construct a mapping relationship between a universal gate and a local gate; A data element unit configured to construct a data element representing a local gate; a translator configured to represent the universal gate as a combination of one or more native gate data elements according to a mapping relationship between the universal gate and the native gate; The translation iterator is configured to traverse the universal gates of the source quantum circuit, and use the translator to translate each universal gate into a native gate to generate a target quantum circuit.

[0014] According to another aspect of the present invention, a computer-readable storage medium storing a computer program is provided. When the computer program is executed by a processor, the quantum circuit conversion method as described above is implemented.

[0015] According to another aspect of the present invention, a computer device is provided, comprising: a processor; and a memory storing a computer program, wherein when the computer program is executed by the processor, the quantum circuit conversion method as described above is implemented.

[0016] By applying the quantum circuit conversion technical solution of the present invention, by establishing a mapping relationship between single-bit universal gates and native gates, the source quantum circuit composed of single-bit universal gates can be translated into a target quantum circuit composed of native gates in the quantum compiler, and the quantum circuit conversion from universal gates to native gates can be realized concisely and efficiently, thereby realizing the translation of the source quantum circuit to the target quantum circuit, so that the source quantum circuit can run on the target quantum platform, thereby improving the performance of the quantum compiler. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above objects and features of the present invention will become more apparent from the following description in conjunction with the accompanying drawings.

[0018] Figure 1 Shown is a flow chart of a quantum circuit conversion method according to an exemplary embodiment of the present invention.

[0019] Figure 2 Shown is a schematic diagram of a quantum circuit conversion device according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0020] The concept of the present invention is: first, establish a mapping relationship between universal gates and local gates and a data element representing the local gate; based on the mapping relationship and data element, represent the universal gate as a combination of one or more local gate data elements. Traverse the universal gates of the source quantum circuit, translate each universal gate into a local gate, and generate a target quantum circuit.

[0021] Based on the above invention concept, the universal gate of the source quantum circuit can be parsed into a local gate supported by the target quantum platform. The universal gate is a single-bit universal gate. The single-bit universal gate includes an X gate, a Y gate, a Z gate, an S gate, a T gate, an H gate, a CNOT gate, and a CZ gate. The local gate includes By establishing a mapping relationship between single-bit universal gates and local gates, the source quantum circuit composed of single-bit universal gates can be translated into the target quantum circuit composed of local gates in the quantum compiler, thereby realizing the translation from the source quantum circuit to the target quantum circuit, so that the source quantum circuit can run on the target quantum platform.

[0022] like Figure 1 As shown, a flow chart of a quantum circuit conversion method is given, which includes the following steps: Step S1: constructing a mapping relationship between a universal gate and a local gate and a data element representing the local gate; Step S2: traverse the universal gates of the source quantum circuit, translate each universal gate into a local gate, and generate a target quantum circuit; wherein, translating each universal gate into a local gate comprises: according to the mapping relationship between the universal gate and the local gate, representing the universal gate as a combination of one or more local gate data elements.

[0023] like Figure 2 As shown, a schematic diagram of a quantum circuit conversion device is given, and the quantum circuit conversion device includes: A mapping unit 201 is configured to construct a mapping relationship between a universal gate and a local gate; The data element unit 202 is configured to construct a data element representing the local gate; The translator 203 is configured to represent the universal gate as a combination of one or more native gate data elements according to the mapping relationship between the universal gate and the native gate; The translation iterator 204 is configured to traverse the universal gates of the source quantum circuit, and use the translator to translate each universal gate into a native gate to generate a target quantum circuit.

[0024] The mapping relationship between the general door and the local door and the representation example thereof are as follows: The X gate is represented by: , The X-gate mapping relationship is: , The Y gate is represented by: , The Y gate mapping relationship is: , The Z gate is represented by: , The Z gate mapping relationship is: , The S gate is represented by: , The S-gate mapping relationship is: , The T gate is represented by: , The T-gate mapping relationship is: , The H gate is represented by: , The mapping relationship of the H gate is: , The CNOT gate mapping relationship is: , The mapping relationship of the CZ gate is: .

[0025] At the same time, a data element representing the local gate is constructed; the local gate data element includes the local gate type and the local gate parameter. The data structure of the data element is a tuple, a dictionary, or a list.

[0026] The machine door is Door, The data element of the gate is represented by a data pair consisting of "x" and θ, where "x" represents The type of gate, θ represents Parameters of the door.

[0027] The machine door is Door, The data element of the gate is represented by a data pair consisting of "y" and θ, where "y" represents The type of gate, θ represents Parameters of the door.

[0028] For example, we can use a dictionary {"x", θ}, a tuple ("x", θ), or a list ["x", θ] to represent Gate, that is, rotation angle θ around the x-axis; represented by a dictionary {"y", θ}, a tuple ("y", θ), or a list ["y", θ] The door is rotated by an angle θ around the y-axis.

[0029] Based on the mapping relationship between universal gates and local gates and the data elements representing local gates, the universal gates X gate, Y gate, Z gate, S gate, T gate, H gate, CNOT gate, and CZ gate can be decomposed into The decomposed general gate is represented as a combination of one or more native gate data elements.

[0030] For example, the data elements represented by the dictionary structure are used to parse the universal gates. The parsed universal gates X-gate, Y-gate, Z-gate, S-gate, T-gate, and H-gate are represented as follows: X ≡ {{"x", 1}}, Y ≡ {{"y", 1}}, Z ≡ {{"y", -0.5}, {"x", 1}, {"y", 0.5}}, S ≡ {{"y", -0.5}, {"x", 0.5}, {"y", 0.5}}, T ≡ {{"y", -0.5}, {"x", 0.25}, {"y", 0.5}}, H ≡ {{"x", 1}, {"y", 0.5}}.

[0031] Furthermore, a quantum compiler may be provided according to an exemplary embodiment of the present invention. The quantum compiler includes the quantum circuit conversion device of the exemplary embodiment of the present invention.

[0032] In addition, a computer-readable storage medium storing a computer program may also be provided according to an exemplary embodiment of the present invention. The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform a quantum circuit conversion method according to an exemplary embodiment of the present invention. The computer-readable recording medium is any data storage device that can store data read out by a computer system. Examples of computer-readable recording media include: read-only memory, random access memory, read-only optical disk, magnetic tape, floppy disk, optical data storage device, and carrier wave (such as data transmission through the Internet via a wired or wireless transmission path).

[0033] In addition, a computing device may be provided according to an exemplary embodiment of the present invention. The computing device includes a processor and a memory. The memory is used to store a computer program. The computer program is executed by the processor so that the processor executes the computer program of the quantum circuit conversion method according to the exemplary embodiment of the present invention.

[0034] It should be noted that the first, second, third, fourth, etc. in the above description are to distinguish features with the same name in the same or different embodiments, and are not quantitative limitations. And the present invention is not limited to the specific configurations and processes described above or shown in the figures. The above is only a specific embodiment of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the described system, device, module or module can refer to the corresponding process in the method embodiment without further description. It should be understood that the scope of protection of the present invention is not limited to this. Any technician familiar with the technical field can think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be covered within the scope of protection of the present invention.

Claims

1. A quantum circuit conversion method, characterized in that: include: Constructing a mapping relationship between a universal gate and a local gate and a data element representing the local gate; The universal gates of the source quantum circuit are traversed, each universal gate is translated into a local gate, and a target quantum circuit is generated; wherein, the translating each universal gate into a local gate comprises: according to the mapping relationship between the universal gate and the local gate, the universal gate is represented as a combination of one or more local gate data elements.

2. The method according to claim 1, characterized in that The local door data element includes the local door type and the local door parameters.

3. The method according to claim 2, characterized in that The machine door is Door, The data element of the gate is represented by a data pair consisting of "x" and θ, where "x" represents The type of gate, θ represents Parameters of the door.

4. The method according to claim 2, characterized in that: The machine door is Door, The data element of the gate is represented by a data pair consisting of "y" and θ, where "y" represents Type of door, express Parameters of the door.

5. The method according to claim 2, characterized in that: The data structure of the data element is a tuple, a dictionary, or a list.

6. The method according to claim 1, characterized in that The universal gates include an X gate, a Y gate, a Z gate, an S gate, a T gate, an H gate, a CNOT gate, and a CZ gate.

7. The method according to claim 6, characterized in that The X-gate mapping relationship is: , The Y gate mapping relationship is: , The Z gate mapping relationship is: , The S-gate mapping relationship is: , The T-gate mapping relationship is: , The mapping relationship of the H gate is: , The CNOT gate mapping relationship is: , The CZ gate mapping relationship is: .

8. A quantum circuit conversion device, characterized in that: include: A mapping unit, configured to construct a mapping relationship between a universal gate and a local gate; A data element unit configured to construct a data element representing a local gate; a translator configured to represent the universal gate as a combination of one or more native gate data elements according to a mapping relationship between the universal gate and the native gate; The translation iterator is configured to traverse the universal gates of the source quantum circuit, and use the translator to translate each universal gate into a native gate to generate a target quantum circuit.

9. A computer-readable storage medium storing a computer program, wherein: When the computer program is executed by a processor, the quantum circuit conversion method according to any one of claims 1 to 7 is implemented.

10. A computing device comprising: processor; A memory storing a computer program, which, when executed by a processor, implements the quantum circuit conversion method according to any one of claims 1 to 7.