Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Intermediate code generation method and device for quantum program compilation

A program compilation and code generation technology, applied in the field of quantum computing, can solve the problem of repetitive labor resource occupation, and achieve the effect of reducing repetitive labor and the occupation of human and material resources

Active Publication Date: 2019-08-30
ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF7 Cites 16 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, it is absolutely impossible for existing compiler architectures such as LLVM to be directly applied to quantum computers and quantum programs written in quantum languages.
Moreover, existing research platforms often develop independent quantum languages, quantum instruction sets, and quantum software development kits. When compiling a quantum program written in a certain quantum language, it can only be compiled to the quantum instruction set of the corresponding research platform. , or, when compiling a quantum program developed by a certain research platform, the backend can only be connected to the quantum software development kit developed by the corresponding research platform, so that project development based on quantum instruction sets or quantum software development kits of different companies requires Use the quantum language developed by the other party to write corresponding quantum programs, resulting in duplication of labor and resource occupation.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Intermediate code generation method and device for quantum program compilation
  • Intermediate code generation method and device for quantum program compilation
  • Intermediate code generation method and device for quantum program compilation

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0045] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but not to be construed as a limitation of the present invention.

[0046] see figure 1 , figure 1 A schematic flowchart of an intermediate code generation method for quantum program compilation provided by an embodiment of the present invention may include the following steps:

[0047] S101, obtaining a source code of a quantum program; wherein, the logic structure of the source code at least includes: a quantum branch structure, a quantum loop structure and a quantum logic gate;

[0048] Those skilled in the art can understand that the existing quantum programming language Qrunes consists of three parts: a setting module (Setting), a quantum program building module (QCode) and a classical programming module (Script). The information configuration of the code is described, and the language type of the classical programming modu...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses an intermediate code generation method and device for quantum program compiling. The method comprises the steps of obtaining that a source code of a quantum program is obtained;, wherein the logic structure of the source code at least comprises a quantum branch structure, a quantum circulation structure and a quantum logic gate; carrying out lexical analysis on the source code, and segmenting the source code into a plurality of grammatical unit tokens; performing grammatical analysis on all tokens, and constructing an abstract syntax tree AST; wherein the AST comprisesa root node, a plurality of sub-tree nodes and a plurality of leaf nodes, the root node and the sub-tree nodes comprise grammar rule information, and the leaf nodes comprise token information; and according to the node information of the AST and a preset construction rule, constructing an intermediate code corresponding to the source code. By utilizing the embodiment of the invention, repeated labor can be avoided, and resource occupation is reduced.

Description

technical field [0001] The invention belongs to the technical field of quantum computing, in particular to an intermediate code generation method and device for quantum program compilation. Background technique [0002] Compilation refers to the process of translating program code written in a high-level computer language into binary machine language code that can be run by a computer. Using a compiler program, a program written in a certain programming language can be translated into an equivalent program in another language . The compiler is also called a compiler, for example, a classical language compiler LLVM (Low Level Virtual Machine, bottom virtual machine), the front end of which describes the representation of the language, such as C language and JAVA language. The description is for different hardware machines, software development kits or instruction sets, such as X86 instruction set, ARM instruction set or single-chip microcomputer and so on. [0003] However,...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F8/41
CPCG06F8/425G06F8/42G06F8/447Y02D10/00
Inventor 方圆高宁陶飞
Owner ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products