uniqc.compile.converter module

OriginIR and OpenQASM2 format conversion utilities.

This module provides bidirectional conversion between OriginIR-ext, official OriginIR, and OpenQASM2 quantum circuit representations.

uniqc.compile.converter.convert_oir_to_qasm(originir_str)[source]

Convert OriginIR to OpenQASM2.

Parameters:

originir_str (str)

Return type:

str

uniqc.compile.converter.convert_originir_ext_to_originir(originir_ext_str)[source]

Convert OriginIR-ext (superset) to strict official OriginIR.

Pipeline: 1. Parse the OriginIR-ext string into a Circuit. 2. Decompose extended gates to the official gate set. 3. Serialize using block-level DAGGER/CONTROL syntax.

The output is valid under the official OriginIR specification accepted by OriginQ cloud.

Parameters:

originir_ext_str (str)

Return type:

str

uniqc.compile.converter.convert_qasm_to_oir(qasm_str)[source]

Convert OpenQASM2 to OriginIR.

Parameters:

qasm_str (str)

Return type:

str