IP Library › Granted Patent US 12,346,678
Granted Patent B2
US 12,346,678 · App. 17/589,647 · Granted Jul 1, 2025

Hybrid compilation apparatus and method for quantum-classical code sequences

Inventors: Xiang Zou (Portland, OR); Justin Hogaboam (Aloha, OR); Pradnya Laxman Khalate (Cornelius, OR); Xin-Chuan Wu (Santa Clara, CA); Anne Matsuura (Portland, OR); Shavindra Premaratne (Portland, OR)
Assignee: Intel Corporation
G06F8/447G06N10/80
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,346,678
App. No.
17/589,647
Filed
Jan 31, 2022
Granted
Jul 1, 2025
Kind
B2
Art Unit
2151
USPC
717/140
Abstract

Apparatus and method for compiling and executing hybrid classical-quantum programs. For example, one embodiment of a method comprises: reading source code specifying both non-quantum operations to be performed by a host processor and quantum operations to be performed by a quantum accelerator; compiling the source code to generate a target object file, wherein portions of the source code specifying the quantum operations are compiled into quantum basic blocks (QBBs) in the target object file, each QBB comprising one or more quantum instructions to be executed by the quantum accelerator and wherein portions of the source code specifying the non-quantum operations are compiled into native instructions to be executed by the host processor.

Claims (71)

1. A machine-readable medium having program code stored thereon which, when executed by a machine, cause the machine to perform operations comprising:

reading source code specifying both non-quantum operations to be performed by a host processor and quantum operations to be performed by a quantum accelerator; and

compiling the source code to generate one or more target object files,

wherein portions of the source code specifying the quantum operations are to be compiled into quantum basic blocks, each quantum basic block comprising one or more quantum instructions to be executed by the quantum accelerator, and

wherein portions of the source code specifying the non-quantum operations are compiled into native processor instructions executable by the host processor.

2. The machine-readable medium of claim 1 wherein compiling the source code further comprises:

evaluating the quantum operations specified in the source code; and

grouping the corresponding quantum instructions into the quantum basic blocks based on the evaluation of the quantum operations.

3. The machine-readable medium of claim 2 wherein grouping the corresponding quantum instructions further comprises:

terminating a first quantum basic block in response to detecting a quantum measurement operation; and

starting a second quantum basic block directly following the quantum measurement operation.

4. The machine-readable medium of claim 2 wherein compiling the source code further comprises:

sequentially bounding one or more of the quantum basic blocks which do not include a quantum measurement with portions of the native processor instructions.

5. The machine-readable medium of claim 1 further comprising program code to cause the machine to perform the operations of:

for each quantum basic block, injecting into the one or more target object files a call to a quantum runtime module, each call associated with one of the quantum basic blocks.

6. The machine-readable medium of claim 5 further comprising program code to cause the machine to perform the operations of:

assembling the quantum basic blocks and the native processor instructions from the one or more target object files into a unified executable file.

7. The machine-readable medium of claim 6 wherein the executable file is an Executable and Linker Format for Quantum (ELFQ) file.

8. The machine-readable medium of claim 1 wherein the quantum operations are arranged in one or more quantum kernels, and wherein compiling further comprises:

extracting the quantum kernels from the source code;

generating an integration header file to store quantum kernel information; and

using the quantum kernel information when generating the one or more target object files.

9. The machine-readable medium of claim 8 wherein the operations of extracting the quantum kernels and generating the integration header is performed by a first compiler or compiler component and wherein the quantum kernel information is used by a second compiler or compiler component.

10. A method comprising:

reading source code specifying both non-quantum operations to be performed by a host processor and quantum operations to be performed by a quantum accelerator; and

compiling the source code to generate one or more target object files,

wherein portions of the source code specifying the quantum operations are to be compiled into quantum basic blocks, each quantum basic block comprising one or more quantum instructions to be executed by the quantum accelerator, and

wherein portions of the source code specifying the non-quantum operations are compiled into native processor instructions executable by the host processor.

11. The method of claim 10 wherein compiling the source code further comprises:

evaluating the quantum operations specified in the source code; and

grouping the corresponding quantum instructions into the quantum basic blocks based on the evaluation of the quantum operations.

12. The method of claim 11 wherein grouping the corresponding quantum instructions further comprises:

terminating a first quantum basic block in response to detecting a quantum measurement operation; and

starting a second quantum basic block directly following the quantum measurement operation.

13. The method of claim 11 wherein compiling the source code further comprises:

sequentially bounding one or more of the quantum basic blocks which do not include a quantum measurement with portions of the native processor instructions.

14. The method of claim 10 further comprising:

for each quantum basic block, injecting into the one or more target object files a call to a quantum runtime module, each call associated with one of the quantum basic blocks.

15. The method of claim 14 further comprising:

assembling the quantum basic blocks and the native processor instructions from the one or more target object files into a unified executable file.

16. The method of claim 15 wherein the executable file is an Executable and Linker Format for Quantum (ELFQ) file.

17. The method of claim 10 wherein the quantum operations are arranged in one or more quantum kernels, and wherein compiling further comprises:

extracting the quantum kernels from the source code;

generating an integration header file to store quantum kernel information; and

using the quantum kernel information when generating the one or more target object files.

18. The method of claim 17 wherein the operations of extracting the quantum kernels and generating the integration header is performed by a first compiler or compiler component and wherein the quantum kernel information is used by a second compiler or compiler component.

19. A system comprising:

a host processor;

a quantum accelerator coupled to the host processor;

a memory to store source code specifying both non-quantum operations to be performed by the host processor and quantum operations to be performed by a quantum accelerator; and

the host processor execute program code to:

compile portions of the source code specifying the quantum operations into quantum basic blocks, each quantum basic block comprising one or more quantum instructions to be executed by the quantum accelerator, and

compile portions of the source code specifying the non-quantum operations into native processor instructions executable by the host processor.

20. The system of claim 19 wherein compiling the source code further comprises:

evaluating the quantum operations specified in the source code; and

grouping the corresponding quantum instructions into the quantum basic blocks based on the evaluation of the quantum operations.

21. The system of claim 20 wherein grouping the corresponding quantum instructions further comprises:

terminating a first quantum basic block in response to detecting a quantum measurement operation; and

starting a second quantum basic block directly following the quantum measurement operation.

22. The system of claim 20 wherein compiling the source code further comprises:

sequentially bounding one or more of the quantum basic blocks which do not include a quantum measurement with portions of the native processor instructions.

23. The system of claim 19 further comprising:

for each quantum basic block, injecting into the one or more target object files a call to a quantum runtime module, each call associated with one of the quantum basic blocks.

24. The system of claim 22 further comprising:

assembling the quantum basic blocks and the native processor instructions from the one or more target object files into a unified executable file.

25. The system of claim 24 wherein the executable file is an Executable and Linker Format for Quantum (ELFQ) file.

26. The system of claim 19 wherein the quantum operations are arranged in one or more quantum kernels, and wherein compiling further comprises:

extracting the quantum kernels from the source code;

generating an integration header file to store quantum kernel information; and

using the quantum kernel information when generating the one or more target object files.

27. The system of claim 26 wherein the operations of extracting the quantum kernels and generating the integration header is performed by a first compiler or compiler component executed by the host processor and wherein the quantum kernel information is used by a second compiler or compiler component executed by the host processor.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 4, 2022
From: ZOU, XIANG; HOGABOAM, JUSTIN; KHALATE, PRADNYA LAXMAN; WU, XIN-CHUAN; MATSUURA, ANNE; PREMARATNE, SHAVINDRA
To: INTEL CORPORATION
Reel/Frame 059178/0434 →
Continuity (1)
Related Publication 20230244459A1 · Aug 3, 2023
References Cited (32)
US 10223084B1 · Dunn · 2019 [cited by examiner]
US 10908885B2 · Ducore · 2021 [cited by examiner]
US 12165007B2 · Kim · 2024 [cited by examiner]
US 20190042971A1 · Zou · 2019 [cited by applicant]
US 20200320437A1 · Gambetta · 2020 [cited by examiner]
US 20210173660A1 · Hogaboam et al. · 2021 [cited by applicant]
US 20210303282A1 · Chaplin · 2021 [cited by examiner]
US 20220137989A1 · Pistoia · 2022 [cited by examiner]
US 20220405649A1 · Rastunkov · 2022 [cited by examiner]
US 20230020389A1 · Davis · 2023 [cited by examiner]
US 20230040849A1 · Shanmugam Sakthivadivel · 2023 [cited by examiner]
US 20230129967A1 · Oh · 2023 [cited by examiner]
US 20230244457A1 · Bookstein · 2023 [cited by examiner]
US 20230289638A1 · Peterson · 2023 [cited by examiner]
US 20240177037A1 · Griffin · 2024 [cited by examiner]
US 20240192938A1 · Cruz Benito · 2024 [cited by examiner]
US 20240193451A1 · Matsuura · 2024 [cited by examiner]
US 20250021849A1 · Daraeizadeh · 2025 [cited by examiner]
US 20250036989A1 · Naveh · 2025 [cited by examiner]
CN 112926741A · 2021 [cited by applicant]
WO 2021165639A1 · 2021 [cited by applicant]
WO 2021195197A1 · 2021 [cited by applicant]
Khalate, Pradnya, et al. “An LLVM-based C++ compiler toolchain for variational hybrid quantum-classical algorithms and quantum accelerators.” arXiv preprint arXiv:2202.11142 (2022). [cited by examiner]
Lubinski, Thomas, et al. “Advancing hybrid quantum-classical computation with real-time execution.” Frontiers in Physics 10 (2022). [cited by examiner]
Ramouthar, Ravindra, and Huseyin Seker. “Hybrid Quantum-Classical Computing—A Fusion of Classical and Quantum Computational Substrates.” (2023). [cited by examiner]
Da Rosa, Evandro Chagas Ribeiro, and Rafael De Santiago. “Ket quantum programming.” ACM Journal on Emerging Technologies in Computing Systems (JETC) 18.1 (2021): 1-25. [cited by examiner]
Gokhale et al., “Partial compilation of variational algorithms for noisy intermediate-scale quantum machines”, Proceedings of the 52nd Annual IEEE/ACM International Symposium on Microarchitecture, Sep. 2019, 13 pages. [cited by applicant]
Kandala et al., “Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets”, Nature, vol. 549, No. 7671, Apr. 2017, pp. 242-246. [cited by applicant]
Preskill et al., “Quantum Computing in the NISQ era and beyond”, Quantum, vol. 2 Jan. 2018, pp. 1-22. [cited by applicant]
International Search Report and Written Opinion, PCT App. No. PCT/US22/54284, Aug. 23, 2024, 10 pages. [cited by applicant]
Nemec et al., “Infinite Families of Quantum-Classical Hybrid Codes”, Sep. 9, 2020, 10 pages. [cited by applicant]
International Preliminary Report on Patentability, PCT App. No. PCT/US2022/054284, Sep. 12, 2024, 07 pages. [cited by applicant]