qbraid_qir.qasm3.QasmQIRVisitor

class QasmQIRVisitor(initialize_runtime=True, record_output=True, external_gates=None)[source]

A visitor for converting OpenQASM 3 programs to QIR.

This class is designed to traverse and interact with statements in an OpenQASM program.

Parameters:
  • initialize_runtime (bool) – If True, quantum runtime will be initialized. Defaults to True.

  • record_output (bool) – If True, output of the circuit will be recorded. Defaults to True.

  • external_gates (list[str]) – List of custom gates that should not be unrolled. Instead, these gates are marked for external linkage, as qir-functions with the name “__quantum__qis__<GateName>__body”

__init__(initialize_runtime=True, record_output=True, external_gates=None)[source]

Methods

__init__([initialize_runtime, ...])

bitcode()

finalize()

ir()

record_output(module)

visit_qasm3_module(module)

Visit a Qasm3 module.

visit_statement(statement)

Visit a statement element.

Attributes

entry_point