-
Couldn't load subscription status.
- Fork 706
[Unified compiler] Convert to MBQC formalism #7870
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
Conversation
pennylane/compiler/python_compiler/transforms/convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
tests/python_compiler/transforms/test_xdsl_convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
tests/python_compiler/transforms/test_xdsl_convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
…mbqc gate set only)
Co-authored-by: erick-xanadu <[email protected]>
Co-authored-by: erick-xanadu <[email protected]>
Co-authored-by: Joey Carter <[email protected]>
Co-authored-by: Joey Carter <[email protected]>
Co-authored-by: Mudit Pandey <[email protected]>
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.
Looks good, thanks @multiphaseCFD! Happy to approve once these few remaining items are resolved.
pennylane/compiler/python_compiler/transforms/convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
pennylane/compiler/python_compiler/transforms/convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
pennylane/compiler/python_compiler/transforms/convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
pennylane/compiler/python_compiler/transforms/convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
pennylane/compiler/python_compiler/transforms/convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
pennylane/compiler/python_compiler/transforms/convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
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.
Looks good! 💯
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.
Thanks @multiphaseCFD, looks great! I left a few non-blocking comments 🚀
Before submitting
Please complete the following checklist when submitting a PR:
All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to the
test directory!
All new functions and code must be clearly commented and documented.
If you do make documentation changes, make sure that the docs build and
render correctly by running
make docs.Ensure that the test suite passes, by running
make test.Add a new entry to the
doc/releases/changelog-dev.mdfile, summarizing thechange, and including a link back to the PR.
The PennyLane source code conforms to
PEP8 standards.
We check all of our code against Pylint.
To lint modified files, simply
pip install pylint, and thenrun
pylint pennylane/path/to/file.py.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Context:
[sc-88794]
This PR adds a pass to lower all gates in the MBQC gate set to a MBQC formalism. Those gates include
Hadamard,S,RZ,RotXZX,CNOT. The program structure or control flows (if,for,while) can be also maintained.The resource auxiliary qubits used as computational resources are statically allocated and deallocated in a gate by gate manner. This PR also assumes that a auxiliary qubit can be swapped with a target qubit in the global register.
This pass can lower a circuit with 1k wires, 10 k gates and 100k shots on a
null.qubitdevice, given thatautographis set asTrue. It's also compatible with themeasurements_from_samples_pass, which is tested in the unit test as well.Here is a sample script (
pennylane_catalyst==0.13.0.dev18andxdsl==0.46.0):To capture the program structure without unrolling loops:
Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues: