Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler directives #567

Open
ss2165 opened this issue Oct 17, 2024 · 0 comments
Open

Compiler directives #567

ss2165 opened this issue Oct 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ss2165
Copy link
Member

ss2165 commented Oct 17, 2024

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:

@ss2165 ss2165 added the enhancement New feature or request label Oct 17, 2024
@ss2165 ss2165 pinned this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant