Compiling method and device of quantum program
The invention discloses a compiling method and device of a quantum program. The method comprises the steps: obtaining a source code of the quantum program, wherein the logic structure of the source code at least comprises a loop structure; performing lexical analysis on the source code to obtain a p...
Gespeichert in:
Hauptverfasser: | , |
---|---|
Format: | Patent |
Sprache: | chi ; eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The invention discloses a compiling method and device of a quantum program. The method comprises the steps: obtaining a source code of the quantum program, wherein the logic structure of the source code at least comprises a loop structure; performing lexical analysis on the source code to obtain a plurality of syntax unit tokens; performing grammatical analysis on the token, and constructing a syntax tree; performing semantic analysis on the source code based on the syntax tree, and determining types corresponding to source code variables, expressions and functions, wherein the types at leastcomprise auxiliary types and classic types; according to the types corresponding to the variables, the expressions and the functions, compiling the source codes into intermediate codes in a specific form, wherein logic structures of the intermediate codes do not include a loop structure. According to the invention, the problem that the type needs to be strictly distinguished at present can be solved from a user programmin |
---|