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

Keep the Hugr around after compiling a module #246

Closed
aborgna-q opened this issue Jun 18, 2024 · 0 comments · Fixed by #247
Closed

Keep the Hugr around after compiling a module #246

aborgna-q opened this issue Jun 18, 2024 · 0 comments · Fixed by #247
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@aborgna-q
Copy link
Collaborator

Right now calling GuppyModule.compile throws an error if the module has already been compiled.

In some cases we may want to use a module multiple times, for example when generating multiple circuits from it.
Currently the work around is to manually keep the HUGR around, but it would be more straightforward if we can keep a reference to compiled hugr in the module.

@guppy(module)
def my_func():
  pass

@guppy(module)
def my_other_func():
  pass

make_circuit(module, "my_func")
make_circuit(module, "my_other_func") # This cannot access the hugr anymore
@aborgna-q aborgna-q added enhancement New feature or request good first issue Good for newcomers labels Jun 18, 2024
@aborgna-q aborgna-q self-assigned this Jun 18, 2024
aborgna-q added a commit that referenced this issue Jun 18, 2024
Closes #246 

I'm not sure where to add a test for this, as it's not integration nor
error testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant