Skip to content

Implement "lazy function creator" interface to handle unknown QIR methods #34

@sethrj

Description

@sethrj

The QIR specification does not provide an exhaustive list of "runtime" (rt) or "quantum instruction set" (qis) functions: we've only implemented the most common in RuntimeInterface and QuantumInterface, respectively.

LLVM's execution engine provides a InstallLazyFunctionCreator method to create new methods on the fly. Create a generic function in QuantumInterface.hh and RuntimeInterface that take the symbol name and the function arguments so that applications can add new functions more easily.

To complete this task you must add:

  1. A suitable lazy function creator in src/qiree/Executor.cc to bind the symbol so it calls out to q_interface_/r_interface_ and passes the function name and arguments.
  2. A new .ll example to be placed in the folder examples/unitaryhack2025 that contains "unexpected" qis/rt function names, and an .ll "failure mode" example that contains a symbol that doesn't have the qis/rt prefix.
  3. A test fixture in Executor.test.cc demonstrating the new capability works for the given qis/rt functions, and a test demonstrating that the framework catches and (if possible) gracefully fails when encountering unexpected symbols.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestunitaryHACK2025Issues that can receive Unitary Hack bounties

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions