intermediate_compiler Module
The pyqpanda3.intermediate_compiler module provides bidirectional conversion between quantum programs (QProg) and intermediate representation formats: OriginIR and OpenQASM 2.0. These conversions enable interoperability with external tools, circuit visualization, and program serialization.
Overview
The module supports two intermediate representation formats:
- OriginIR -- QPanda's native intermediate representation language for describing quantum circuits.
- OpenQASM 2.0 -- The widely-used open standard for describing quantum circuits, compatible with many quantum computing frameworks.
For each format, the module provides functions to parse strings and files into QProg objects, as well as functions to export QProg objects back to the corresponding string representation.
Sub-topics
| Topic | Description |
|---|---|
| OriginIR | convert_originir_string_to_qprog, convert_originir_file_to_qprog, convert_qprog_to_originir |
| QASM | convert_qasm_string_to_qprog, convert_qasm_file_to_qprog, convert_qprog_to_qasm |