IP Library › Granted Patent US 12,639,605
Granted Patent B2
US 12,639,605 · App. 18/072,176 · Granted May 26, 2026

Decomposing quantum source code files into quantum code snippets

Inventors: Leigh Griffin (Waterford, IE); Stephen Coady (Waterford, IE)
Assignee: Red Hat, LLC
G06N10/20
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,639,605
App. No.
18/072,176
Granted
May 26, 2026
Kind
B2
Abstract

A quantum source code file is received. One or more portions of the quantum source code file to be decomposed into at least one quantum code snippet are identified. The one or more portions of the quantum source code file are validated as independently compilable. The at least one quantum code snippet is generated.

Claims (79)

1 . A method comprising:

receiving, by a computing system comprising a computing device, the computing device comprising a processor device, a quantum source code file;

identifying, by the computing device, one or more portions of the quantum source code file to be decomposed into at least one quantum code snippet;

validating, by the computing device, the one or more portions of the quantum source code file as independently compilable; generating, by the computing device, the at least one quantum code snippet;

storing, by the computing device, the at least one quantum code snippet to a quantum snippet repository in association with metadata identifying the at least one quantum code snippet to the computing device and one or more additional computing devices, the quantum snippet repository accessible to the one or more additional computing devices;

responsive to a query, identifying, by a quantum computing device of the computing system, the at least one quantum code snippet in the quantum snippet repository based on the metadata; and

implementing, by the quantum computing device, a manipulation to a qubit in accordance with the at least one quantum code snippet.

2 . The method of claim 1 , wherein validating, by the computing device, the one or more portions of the quantum source code file as independently compilable comprises:

providing, by the computing device, a portion of the quantum source code file of the one or more portions as input to a quantum compiler;

determining, by the computing device, an outcome of a compiling operation of the portion performed by the quantum compiler;

determining, by the computing device, that the outcome is a successful outcome; and

in response to determining that the outcome is a successful outcome, validating the portion of the quantum source code file as independently compilable.

3 . The method of claim 2 , wherein validating the one or more portions of the quantum source code file as independently compilable further comprises:

determining, by the computing device, that the outcome is an unsuccessful outcome having one or more errors; and

modifying the portion of the quantum source code file based at least in part on the one or more errors.

4 . The method of claim 3 , wherein modifying the portion of the quantum source code file comprises:

determining a preamble for the portion of the quantum source code file; and

including the preamble in the portion of the quantum source code file.

5 . The method of claim 4 , wherein modifying the portion of the quantum source code file comprises modifying at least one of a start instruction of the portion of the quantum source code file or an end instruction of the portion of the quantum source code file.

6 . The method of claim 1 , wherein identifying, by the computing device, the one or more portions of the quantum source code file to be decomposed into the at least one quantum code snippet comprises receiving, by the computing device, a request to decompose the quantum source code file, the request identifying the one or more portions of the quantum source code file.

7 . The method of claim 1 , wherein the quantum source code file comprises a QASM file.

8 . The method of claim 1 , wherein the method further comprises transmitting the at least one quantum code snippet to the quantum snippet repository accessible by the one or more additional computing devices.

9 . The method of claim 1 , further comprising modifying the quantum source code file to replace the at least one quantum code snippet in place of one or more instructions of the quantum source code file corresponding to the at least one quantum code snippet.

10 . The method of claim 1 , further comprising:

receiving, by the computing device, a command to execute a section of the quantum source code file, the section of the quantum source code file comprising a start instruction and an end instruction;

selecting, by the computing device, a selected quantum code snippet based on the start instruction and the end instruction of the section of the quantum source code file;

executing, by the quantum computing device, the selected quantum code snippet to generate a program state of the quantum computing device subsequent to executing the selected quantum code snippet; and

recording, by the computing device, the program state of the quantum computing device.

11 . A quantum computing device, comprising:

a memory; and

a quantum processor device coupled to the memory;

wherein the quantum processor device is to:

receive a quantum source code file;

identify one or more portions of the quantum source code file to be decomposed into at least one quantum code snippet;

validate the one or more portions of the quantum source code file as independently compilable;

generate the at least one quantum code snippet;

store the at least one quantum code snippet to a quantum snippet repository accessible to one or more additional computing devices in association with metadata identifying the at least one quantum code snippet to the computing device and one or more additional computing devices, the quantum snippet repository accessible to the one or more additional computing devices;

responsive to a query, identify the at least one quantum code snippet in the quantum snippet repository based on the metadata; and

implement a manipulation to a qubit of the quantum processor device in accordance with the at least one quantum code snippet.

12 . The quantum computing device of claim 11 , wherein, to validate the one or more portions of the quantum source code file as independently compilable, the quantum processor device is further to:

provide a portion of the quantum source code file of the one or more portions as input to a quantum compiler;

determine an outcome of a compiling operation of the portion performed by the quantum compiler;

determine that the outcome is a successful outcome; and

in response to determining that the outcome is a successful outcome, validate the portion of the quantum source code file as an independently compilable layer.

13 . The quantum computing device of claim 12 , wherein, to validate the one or more portions of the quantum source code file as independently compilable, the quantum processor device is further to:

determine that the outcome is an unsuccessful outcome having one or more errors; and

modify the portion of the quantum source code file based at least in part on the one or more errors.

14 . The quantum computing device of claim 13 , wherein, to modify the portion of the quantum source code file, the quantum processor device is further to:

determine a preamble for the portion of the quantum source code file; and

include the preamble in the portion of the quantum source code file.

15 . The quantum computing device of claim 11 , wherein the quantum processor device is further to:

receive a command to execute a section of the quantum source code file, the section of the quantum source code file comprising a start instruction and an end instruction;

select a selected quantum code snippet based on the start instruction and the end instruction of the section of the quantum source code file;

execute the selected quantum code snippet to generate a program state of the quantum computing device subsequent to executing the selected quantum code snippet; and

record the program state of the quantum computing device.

16 . A non-transitory computer-readable storage medium comprising instructions to cause one or more processor devices to:

receive a quantum source code file;

identify one or more portions of the quantum source code file to be decomposed into at least one quantum code snippet;

validate the one or more portions of the quantum source code file as independently compilable;

generate the at least one quantum code snippet;

store the at least one quantum code snippet to a quantum snippet repository accessible to one or more additional computing devices in association with metadata identifying the at least one quantum code snippet to the computing device and one or more additional computing devices, the quantum snippet repository accessible to the one or more additional computing devices;

responsive to a query, identify the at least one quantum code snippet in the quantum snippet repository based on the metadata; and

cause a manipulation to a qubit in accordance with the at least one quantum code snippet.

17 . The non-transitory computer-readable storage medium of claim 16 , wherein, to validate the one or more portions of the quantum source code file as independently compilable, the instructions further cause the one or more processor devices to:

provide a portion of the quantum source code file of the one or more portions as input to a quantum compiler;

determine an outcome of a compiling operation of the portion performed by the quantum compiler;

determine that the outcome is a successful outcome; and

in response to determining that the outcome is a successful outcome, validate the portion of the quantum source code file as an independently compilable layer.

18 . The non-transitory computer-readable storage medium of claim 17 , wherein, to validate the one or more portions of the quantum source code file as independently compilable, the instructions further cause the one or more processor devices to:

determine that the outcome is an unsuccessful outcome having one or more errors; and

modify the portion of the quantum source code file based at least in part on the one or more errors.

19 . The non-transitory computer-readable storage medium of claim 18 , wherein, to modify the portion of the quantum source code file, the instructions further cause the one or more processor devices to:

determine a preamble for the portion of the quantum source code file; and

include the preamble in the portion of the quantum source code file.

20 . The non-transitory computer-readable storage medium of claim 16 , wherein the instructions further cause the one or more processor devices to:

receive a command to execute a section of the quantum source code file, the section of the quantum source code file comprising a start instruction and an end instruction;

select a selected quantum code snippet based on the start instruction and the end instruction of the section of the quantum source code file;

execute the selected quantum code snippet to generate a program state of a quantum computing device subsequent to executing the selected quantum code snippet; and

record the program state of the quantum computing device.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded May 1, 2026
From: RED HAT, INC.; RED HAT, LLC
To: RED HAT, LLC
Reel/Frame 075352/0548 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 31, 2023
From: GRIFFIN, LEIGH; COADY, STEPHEN
To: RED HAT, INC.
Reel/Frame 062550/0395 →
Continuity (1)
Related Publication 20240177037A1 · May 30, 2024
References Cited (17)
US 10223084B1 · Dunn · 2019 [cited by examiner]
US 10698789B1 · Liu et al. · 2020 [cited by applicant]
US 11243248B2 · Liu et al. · 2022 [cited by applicant]
US 11797276B1 · Shi · 2023 [cited by examiner]
US 20070283098A1 · O'Brien · 2007 [cited by examiner]
US 20130326489A1 · Eijndhoven · 2013 [cited by examiner]
US 20200074346A1 · Griffin et al. · 2020 [cited by applicant]
US 20210173660A1 · Hogaboam et al. · 2021 [cited by applicant]
US 20210182724A1 · Zou et al. · 2021 [cited by applicant]
US 20210286601A1 · Fitzsimons · 2021 [cited by examiner]
US 20210334081A1 · Chong et al. · 2021 [cited by applicant]
US 20210350265A1 · Jung · 2021 [cited by examiner]
US 20220374239A1 · Freedman · 2022 [cited by examiner]
CN 110179450A · 2019 [cited by examiner]
CN 111079933B · 2023 [cited by examiner]
Smith, Robert S., et al., “A Practical Quantum Instruction Set Architecture,” arXiv:1608.03355v2 [quant-ph], 2016, 15 pages. [cited by applicant]
Svore, Krysta Marie, et al., “A layered software architecture for quantum computing design tools,” https://www.researchgate.net/publication/2956450, IEEE Computer Society, 39, 74-83, 10.1109/MC.2006.4, Feb. 2006, 11 pag… [cited by applicant]