qbraid_qir.qiskit.BasicQiskitVisitor
- class BasicQiskitVisitor(initialize_runtime=True, record_output=True, emit_barrier_calls=False)[source]
A visitor for basic Qiskit circuit elements.
This class traverses and converts Qiskit circuit elements to QIR.
- 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.emit_barrier_calls (
bool) – If True, barrier instructions will be emitted. Defaults to False.
Methods
__init__([initialize_runtime, ...])bitcode()Return the QIR as bitcode.
finalize()Finalize the QIR module by adding a return instruction.
ir()Return the QIR as a string.
record_output()Record output for classical registers using the visited module's register layout.
visit_instruction(instruction, qargs, cargs)Visit and convert an instruction to QIR.
visit_qiskit_module(module)Visit a QiskitModule and initialize the QIR builder.
visit_register(register)Visit a register and assign labels to its bits.
Attributes
entry_pointReturn the entry point name.