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

result feature doesn't seem to generate correct HUGR for classical programs #365

Closed
qartik opened this issue Aug 7, 2024 · 3 comments · Fixed by #370
Closed

result feature doesn't seem to generate correct HUGR for classical programs #365

qartik opened this issue Aug 7, 2024 · 3 comments · Fixed by #370
Assignees
Labels
bug Something isn't working

Comments

@qartik
Copy link
Member

qartik commented Aug 7, 2024

Result function introduced in #271 generates correct HUGR for quantum measurements, such as, result(0, measure(q)), but not for a program like the following:

mod = GuppyModule("main")
mod.load(quantum)
@guppy(mod)
def main() -> None:
    a = 1 + 2  # noqa: F841
    result(0, a)
@qartik qartik added the bug Something isn't working label Aug 7, 2024
@mark-koch
Copy link
Collaborator

I think this is because the result function introduced in #271 doesn't yet conform to the new results extension spec from CQCL/tket2#494. See issue #369

For now, you should be able to make validation pass by not including thetket2_hseries::extension::result extension in the registry.

@mark-koch mark-koch self-assigned this Aug 12, 2024
github-merge-queue bot pushed a commit that referenced this issue Aug 12, 2024
Fixes #369 and fixes #365.

Make Guppy conform with the latest results spec introduced in
CQCL/tket2#494

BREAKING CHANGE:
* Result tags are now strings instead of ints
* Only numeric values and arrays thereof are allowed as results
@qartik
Copy link
Member Author

qartik commented Aug 12, 2024

Thanks @mark-koch! Would you be able to make a release as well?

@mark-koch
Copy link
Collaborator

guppylang v0.9.0 with the fix is released 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants