Skip to content

Compiler directives #567

Description

@ss2165

Let's use this issue to collect ideas for compiler directives in guppy.

I propose using optional arguments to @guppy decorators to collect compiler directives.

Some will be directives for the guppy compiler, some will be passed down. Those passed down can be collected using reserved keys in hugr metadata. We could even opaquely include LLVM directives?

Examples:

@guppy(inline=True)
def foo(...):
    pass

# add order edges to preserve ordering between operations (what about nested operations?)
@guppy(preserve_order=True)
def bar(...):
   pass

# disallow non-unitary operations
@guppy(unitary=True)
def circ(qs: array<qubit>):
    pass

Related issues:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions