IP Library Granted Patent US 12,436,747
Granted Patent B2
US 12,436,747 · App. 18/235,141 · Granted Oct 7, 2025

Method for executing quantum program and method for compiling quantum program

Inventor: Xiangzhen Zhou (Shenzhen, CN)
Assignees: SHENZHEN TENCENT COMPUTER SYSTEMS COMPANY LIMITED; INSTITUTE OF SOFTWARE CHINESE ACADEMY OF SCIENCES
G06F8/41
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,436,747
App. No.
18/235,141
Granted
Oct 7, 2025
Kind
B2
Abstract

This application relates to a method for executing a quantum program and a method for compiling a quantum program performed by a computer device. The executing method includes: using an initial quantum circuit in a physical quantum circuit contained in a target quantum program as a current quantum circuit; executing the current quantum circuit to obtain a quantum measurement result; identifying a target quantum circuit matching the quantum measurement result from candidate quantum circuits having a connection relationship with the current quantum circuit; and using the target quantum circuit as the current quantum circuit by executing a mapping transformation circuit between the current quantum circuit and the target quantum circuit, and returning to the step of executing the current quantum circuit to obtain a quantum measurement result to continue executing till a program executing result is obtained in response to meeting an executing termination condition.

Claims (67)

1. A method for executing a quantum program performed by a computer device, the method comprising:

using an initial quantum circuit in a physical quantum circuit contained in a target quantum program as a current quantum circuit;

executing the current quantum circuit to obtain a quantum measurement result;

identifying a target quantum circuit matching the quantum measurement result from candidate quantum circuits having a connection relationship with the current quantum circuit, the connection relationship matching a control flow corresponding to the target quantum program;

using the target quantum circuit as the current quantum circuit by executing a mapping transformation circuit between the current quantum circuit and the target quantum circuit; and

returning to the operation of executing the current quantum circuit to obtain a quantum measurement result to continue executing till a program executing result is obtained in response to meeting an executing termination condition.

2. The method according to claim 1 , further comprising:

compiling an initial quantum program according to a control flow of the initial quantum program based on an executing condition corresponding to a quantum program executing environment to obtain the target quantum program;

each physical quantum circuit contained in the target quantum program corresponding to each node of the control flow, and the mapping transformation circuits among all the physical quantum circuits corresponding to connection relationships among all the nodes.

3. The method according to claim 2 , wherein, the compiling an initial quantum program containing a control flow according to an executing condition corresponding to a quantum program executing environment to obtain the target quantum program comprises:

determining a plurality of logical quantum circuits contained in an initial quantum program and connection relationships among all the logical quantum circuits according to a control flow of the initial quantum program;

transforming each logical quantum circuit into a physical quantum circuit respectively according to an executing condition corresponding to a quantum program executing environment;

performing transformation of a quantum bit mapping relationship on two physical quantum circuits having a connection relationship based on mapping, among the physical quantum circuits, of the connection relationships among all the logical quantum circuits to obtain a mapping transformation circuit; and

determining the target quantum program comprising the physical quantum circuits and the mapping transformation circuit.

4. The method according to claim 1 , wherein the using the target quantum circuit as the current quantum circuit by executing a mapping transformation circuit between the current quantum circuit and the target quantum circuit, and returning to the operation of executing the current quantum circuit to obtain a quantum measurement result to continue executing till a program executing result is obtained in response to meeting an executing termination condition comprise:

using the target quantum circuit as the current quantum circuit by executing the mapping transformation circuit between the current quantum circuit and the target quantum circuit in response to that the target quantum circuit is not a termination quantum circuit;

returning to the operation of executing the current quantum circuit to obtain a quantum measurement result to continue executing; and

executing the termination quantum circuit in response to that the target quantum circuit is the termination quantum circuit to obtain an executing result of the target quantum program.

5. The method according to claim 1 , further comprising:

performing a quantum measurement operation on a target quantum bit in the current quantum circuit in response to an executing starting event for the current quantum circuit; and

the executing the current quantum circuit to obtain a quantum measurement result comprising:

obtaining the quantum measurement result corresponding to the target quantum bit in response to finishing executing for the current quantum circuit.

6. The method according to claim 5 , wherein, the performing a quantum measurement operation on a target quantum bit in the current quantum circuit in response to an executing starting event for the current quantum circuit comprises:

determining a target quantum gate used for performing a measurement operation in the current quantum circuit and the target quantum bit matching the target quantum gate in response to the executing starting event for the current quantum circuit; and

performing the measurement operation on state data of the target quantum bit matching the target quantum gate based on the target quantum gate.

7. The method according to claim 5 , wherein, a plurality of target quantum bits are provided; and

the obtaining the quantum measurement result corresponding to the target quantum bit in response to finishing executing for the current quantum circuit comprises:

reading binary bit data representing the quantum measurement result from a target quantum gate used for performing a quantum measurement in response to finishing executing for the current quantum circuit; and

using a binary bit string composed of each binary bit data as the quantum measurement result.

8. A method for compiling a quantum program performed by a computer device, the method comprising:

determining a plurality of logical quantum circuits contained in an initial quantum program and connection relationships among all the logical quantum circuits according to a control flow of the initial quantum program;

transforming each logical quantum circuit into a physical quantum circuit respectively according to an executing condition corresponding to a quantum program executing environment;

performing transformation of a quantum bit mapping relationship on two physical quantum circuits having a connection relationship based on mapping, among the physical quantum circuits, of the connection relationships among all the logical quantum circuits to obtain a mapping transformation circuit; and

using a target quantum program comprising the physical quantum circuits and the mapping transformation circuit as a compiling result of the initial quantum program.

9. The method according to claim 8 , wherein, the transforming each logical quantum circuit into a physical quantum circuit respectively according to an executing condition corresponding to a quantum program executing environment; and performing transformation of a quantum bit mapping relationship on two physical quantum circuits having a connection relationship based on mapping, among the physical quantum circuits, of the connection relationships among all the logical quantum circuits to obtain a mapping transformation circuit comprise:

establishing a directed graph with the logical quantum circuits as nodes and the connection relationships among all the logical quantum circuits as connection edges among the nodes;

performing quantum circuit transformation according to the executing condition corresponding to the quantum program executing environment based on each to-be-transformed node of the directed graph, so as to transform the logical quantum circuit represented by each to-be-transformed node into the physical quantum circuit respectively; and

performing transformation of initial and final quantum bit mapping relationships on physical quantum circuits connected with each to-be-transformed connection edge based on each to-be-transformed connection edge of the directed graph to obtain the mapping transformation circuit.

10. A computer device, comprising a memory and a processor, the memory storing a computer-readable instruction that, when executed by the processor, causes the computer device to perform a method for executing a quantum program, the method including:

using an initial quantum circuit in a physical quantum circuit contained in a target quantum program as a current quantum circuit;

executing the current quantum circuit to obtain a quantum measurement result;

identifying a target quantum circuit matching the quantum measurement result from candidate quantum circuits having a connection relationship with the current quantum circuit, the connection relationship matching a control flow corresponding to the target quantum program;

using the target quantum circuit as the current quantum circuit by executing a mapping transformation circuit between the current quantum circuit and the target quantum circuit; and

returning to the operation of executing the current quantum circuit to obtain a quantum measurement result to continue executing till a program executing result is obtained in response to meeting an executing termination condition.

11. The computer device according to claim 10 , wherein the method further comprises:

compiling an initial quantum program according to a control flow of the initial quantum program based on an executing condition corresponding to a quantum program executing environment to obtain the target quantum program;

each physical quantum circuit contained in the target quantum program corresponding to each node of the control flow, and the mapping transformation circuits among all the physical quantum circuits corresponding to connection relationships among all the nodes.

12. The computer device according to claim 11 , wherein, the compiling an initial quantum program containing a control flow according to an executing condition corresponding to a quantum program executing environment to obtain the target quantum program comprises:

determining a plurality of logical quantum circuits contained in an initial quantum program and connection relationships among all the logical quantum circuits according to a control flow of the initial quantum program;

transforming each logical quantum circuit into a physical quantum circuit respectively according to an executing condition corresponding to a quantum program executing environment;

performing transformation of a quantum bit mapping relationship on two physical quantum circuits having a connection relationship based on mapping, among the physical quantum circuits, of the connection relationships among all the logical quantum circuits to obtain a mapping transformation circuit; and

determining the target quantum program comprising the physical quantum circuits and the mapping transformation circuit.

13. The computer device according to claim 10 , wherein the using the target quantum circuit as the current quantum circuit by executing a mapping transformation circuit between the current quantum circuit and the target quantum circuit, and returning to the operation of executing the current quantum circuit to obtain a quantum measurement result to continue executing till a program executing result is obtained in response to meeting an executing termination condition comprise:

using the target quantum circuit as the current quantum circuit by executing the mapping transformation circuit between the current quantum circuit and the target quantum circuit in response to that the target quantum circuit is not a termination quantum circuit;

returning to the operation of executing the current quantum circuit to obtain a quantum measurement result to continue executing; and

executing the termination quantum circuit in response to that the target quantum circuit is the termination quantum circuit to obtain an executing result of the target quantum program.

14. The computer device according to claim 10 , wherein the method further comprises:

performing a quantum measurement operation on a target quantum bit in the current quantum circuit in response to an executing starting event for the current quantum circuit; and

the executing the current quantum circuit to obtain a quantum measurement result comprising:

obtaining the quantum measurement result corresponding to the target quantum bit in response to finishing executing for the current quantum circuit.

15. The computer device according to claim 14 , wherein, the performing a quantum measurement operation on a target quantum bit in the current quantum circuit in response to an executing starting event for the current quantum circuit comprises:

determining a target quantum gate used for performing a measurement operation in the current quantum circuit and the target quantum bit matching the target quantum gate in response to the executing starting event for the current quantum circuit; and

performing the measurement operation on state data of the target quantum bit matching the target quantum gate based on the target quantum gate.

16. The computer device according to claim 14 , wherein a plurality of target quantum bits are provided; and

the obtaining the quantum measurement result corresponding to the target quantum bit in response to finishing executing for the current quantum circuit comprises:

reading binary bit data representing the quantum measurement result from a target quantum gate used for performing a quantum measurement in response to finishing executing for the current quantum circuit; and

using a binary bit string composed of each binary bit data as the quantum measurement result.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 17, 2023
From: ZHOU, XIANGZHEN
To: SHENZHEN TENCENT COMPUTER SYSTEMS COMPANY LIMITED; INSTITUTE OF SOFTWARE CHINESE ACADEMY OF SCIENCE
Reel/Frame 064627/0646 →
Priority Claims (1)
CN 2021111492774.7 · Dec 8, 2021 · national
Continuity (2)
Continuation PCTCN2022126780 · Oct 21, 2022
Related Publication 20240354074A1 · Oct 24, 2024
References Cited (22)
US 10223084B1 · Dunn · 2019 [cited by applicant]
US 11010145B1 · Smith et al. · 2021 [cited by applicant]
US 20200218842A1 · Itoko et al. · 2020 [cited by applicant]
US 20210064350A1 · Cao · 2021 [cited by applicant]
US 20210286601A1 · Fitzsimons et al. · 2021 [cited by applicant]
US 20210334081A1 · Chong · 2021 [cited by applicant]
US 20220284336A1 · Liu · 2022 [cited by examiner]
CN 110889507A · 2020 [cited by applicant]
CN 110929873A · 2020 [cited by applicant]
CN 111767055A · 2020 [cited by applicant]
CN 112085204A · 2020 [cited by applicant]
CN 112668722A · 2021 [cited by examiner]
CN 113537502A · 2021 [cited by examiner]
CN 115907023A · 2023 [cited by examiner]
JP 2006331249A · 2006 [cited by applicant]
Tencent Technology, ISR, PCT/CN2022/126780, Jan. 18, 2023, 2 pgs. [cited by applicant]
Tencent Technology, WO, PCT/CN2022/126780, Jan. 18, 2023, 3 pgs. [cited by applicant]
Tencent Technology, IPRP, PCT/CN2022/126780, Jun. 5, 2024, 4 pgs. [cited by applicant]
Tencent Technology, Japanese Office Action, JP Patent Application No. 2023-538916, Jul. 2, 2024, 5 pgs. [cited by applicant]
Tencent Technology, Extended European Search Report, EP Patent Application No. 22903036.6, Aug. 26, 2024, 10 pgs. [cited by applicant]
Michael Cubeddu et al., “Introducing Control Flow in Qubit Allocation for Quantum Turing Machines”, ARXIV.org, Cornell University Library, Jul. 2019, 8 pgs., https://arxiv.org/abs/1907.07113. [cited by applicant]
X. Fu et al., “eQASM: An Executable Quantum Instruction Set Architecture”, IEEE, In Proceedings of the 25th International Symposium on High Performance Computer Architecture (HPCA), DOI: 10.1109/HPCA.2019.00040, Feb. 20… [cited by applicant]