-
Notifications
You must be signed in to change notification settings - Fork 11
feat: add some tests for guppy 1q squashing #1221
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
base: main
Are you sure you want to change the base?
Conversation
| @guppy | ||
| def qsystem_chain(q: qubit) -> None: | ||
| phased_x(q, angle(0.91), angle(0.5)) | ||
| phased_x(q, angle(0.53), angle(0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I should make these angles a bit friendlier. I have included the pytket code below though.
The argument order for the phased X gate should be the same as pytket
|
Had some issues generating the HUGRs in my local env. Will try again tomorrow. |
ferbetanzo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the lines at the bottom of the .py files to generate the hugr, like in the other test_files/ examples (see below). Was this on purpose?
program = main.compile()
Path(argv[0]).with_suffix(".hugr").write_bytes(program.to_bytes())|
Oh, and also the lines to specify the dependencies to the uv script: # /// script
# requires-python = ">=3.13"
# dependencies = [
# "guppylang >=0.21.3",
# ]
# /// |
Ah thanks Fernando, I missed that |
The first part here is identical to examples from #1221 but I also needed myself. The second part....well, revealed why we need the first (I think updating to include Quantinuum/guppylang#1311 is particularly important) - DCE was taking out the gates because we were not doing anything to keep the `result` ops (!).
guppy_optimization/1q_squashdirectory).compile()->.compile_function()).