-
Notifications
You must be signed in to change notification settings - Fork 706
[FTQC][Unified Compiler] Outline MBQC transform #8619
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8619 +/- ##
==========================================
- Coverage 99.43% 99.42% -0.01%
==========================================
Files 587 587
Lines 61967 61967
==========================================
- Hits 61615 61613 -2
- Misses 352 354 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
joeycarter
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.
This looks great, thanks @multiphaseCFD! 💯
I don't have much to add, just a few minor things.
tests/python_compiler/transforms/mbqc/test_xdsl_convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
pennylane/compiler/python_compiler/transforms/mbqc/convert_to_mbqc_formalism.py
Show resolved
Hide resolved
pennylane/compiler/python_compiler/transforms/mbqc/convert_to_mbqc_formalism.py
Show resolved
Hide resolved
tests/python_compiler/transforms/mbqc/test_xdsl_convert_to_mbqc_formalism.py
Show resolved
Hide resolved
pennylane/compiler/python_compiler/transforms/mbqc/convert_to_mbqc_formalism.py
Show resolved
Hide resolved
mlxd
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.
Nice one @multiphaseCFD
Just wondering if we should merge this PR or #8632 first?
Happy to approve based on the answer.
tests/python_compiler/transforms/mbqc/test_xdsl_convert_to_mbqc_formalism.py
Outdated
Show resolved
Hide resolved
pennylane/compiler/python_compiler/transforms/mbqc/convert_to_mbqc_formalism.py
Show resolved
Hide resolved
lillian542
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.
Thanks, Shuli, this looks great! As well as the reduction in how many lines of IR we’re producing, it also feel his also makes both the IR and the xDSL pass source code easier to read.
I left a couple minor comments, nothing blocking. You may want to coordinate with Sengthai about his PR, I think one of you will have to solve merge conflicts 😅
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-103563]
The MBQC transform has been outlined in the subroutines in the
convert_to_mbqc_formalismpass. This would reduce the number of lines in the IR if the circuit is unrolled.A few other improvements/considerations:
visibilityof subroutines are set asprivateto work better with thesymbol-dcepass defined in the catalyst pipeline. Note that current pass inserts subroutines for all gates in the MBQC gate set. This could be redundant if not all gates are applied in a given circuit. However, there is no need to worry about that since thesymbol-dcepass would eliminate the unreferenced subroutine given that itsvisibilityis private.mbqc_transform. This attribute is used to skip theconvert_to_mbqc_formalismtransform for the subroutine (There are "Hadamard" gates in the subroutine, which we don't want to replace it with a subroutine call).IfOpin the subroutines could be hitted by theconvert_to_mbqc_formalismtransform. No need to worry for now as there are no gates in the MBQC gate set there.Description of the Change:
Benefits:
Take the
ncas = 10(or21qubits) XAS circuit (stateprepignored), the number of lines ofcircuit.mliris26158, compared to92185for themasterbranch. The number of lines of_llvm.ir.llis213173, compared to420280for themasterbranch.Possible Drawbacks:
Related GitHub Issues: