qbraid.transpiler.conversions.openqasm3.openqasm3_to_pyquil

openqasm3_to_pyquil(program)[source]

Returns a pyQuil Program equivalent to the input OpenQASM 3 program.

Supports the standard gate set (including gate modifiers and controlled gates, which pyqasm decomposes during unrolling), measurement, barrier (-> pyQuil FENCE), reset (-> RESET), delay (-> DELAY), and if (c == 0|1) classical feedforward (-> conditional JUMP-WHEN). Declared-but-idle qubits are padded with identity so the operator dimension matches the source register width.

Parameters:

program (str or openqasm3.ast.Program) – OpenQASM 3 program to convert.

Returns:

pyQuil Program equivalent to the input program.

Return type:

pyquil.Program

Raises:

ProgramConversionError – If the program is malformed or contains a gate/statement that is not supported by the conversion.