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

hugr-model: panic while round-tripping export/import #1876

Closed
doug-q opened this issue Jan 20, 2025 · 0 comments · Fixed by #1888
Closed

hugr-model: panic while round-tripping export/import #1876

doug-q opened this issue Jan 20, 2025 · 0 comments · Fixed by #1888
Assignees

Comments

@doug-q
Copy link
Collaborator

doug-q commented Jan 20, 2025

See failing test case in #1875. A json Hugr is committed to the tree there, generated from this guppy program:

from guppylang import guppy, quantum, qubit
from guppylang.std.angles import angle, angles
from guppylang.std.builtins import result
from guppylang.std.quantum import h, measure, rz

guppy.load(quantum)
guppy.load(angles)


@guppy
def rx(q: qubit, x: angle) -> None:
    # Implement Rx via Rz rotation
    h(q)
    rz(q, x)
    h(q)


@guppy
def main() -> None:
    q = qubit()
    rx(q, angle(1.5))
    result("1", measure(q))


if __name__ == "__main__":
    print(guppy.get_module().compile().package.to_json())
github-merge-queue bot pushed a commit that referenced this issue Jan 22, 2025
Import now determines the bound of the custom type correctly.

Fixes #1876.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants