pyqasm.unroll

unroll(program, as_module=False, **kwargs)[source]

Converts an OpenQASM 3 program to an unrolled qasm program

Parameters:

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

Returns:

An object containing unrolled qasm representation along with

some useful metadata and methods

Return type:

Qasm3Module

Raises:
  • TypeError – If the input is not a valid OpenQASM 3 program.

  • ValidationError – If the conversion fails.