-
Notifications
You must be signed in to change notification settings - Fork 645
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
Program capture sharp bits page for v0.41 #7062
Program capture sharp bits page for v0.41 #7062
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v0.41.0-rc0 #7062 +/- ##
==============================================
Coverage ? 99.64%
==============================================
Files ? 513
Lines ? 50069
Branches ? 0
==============================================
Hits ? 49893
Misses ? 176
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Did an initial pass through :)
Note, this is a better fit in the "Release news" part of the ToC, as this is not really a quickstart guide.
We have a similar Sharp bits page for the new operators in the quickstart guide (which can probably be removed now)
Co-authored-by: Josh Izaac <josh146@gmail.com>
**Context:** To use the `default.tensor` device in PennyLane, we must import the `quimb` Python package. The strategy adopted for this was the same previously used for the `default.clifford` device, which depends on the `stim` Python package. That is, when the user imports `pennylane`, the package is imported if installed on the system, otherwise it is not imported. An error is raised if the user explicitly tries to instantiate the device without the package installed. However, `quimb` frequently raises a warning message when it is imported if `kahypar` is not installed. This seems to be a long-standing issue with the `contengra` package, and causes the following unpleasant situation: if a user has `quimb` installed on the system (along with some other packages) and imports `pennylane`, the following warning message is raised: ``` UserWarning: Couldn't import `kahypar` - skipping from default hyper optimizer and using basic `labels` method instead. ``` **Description of the Change:** We no longer import the `DefaultTensor` class in `pennylane/devices/__init__.py`. **Benefits:** Now, the warning message is only raised if the user explicitly instantiates the device, which makes more sense and is less ambiguous: ``` qml.device("default.tensor", wires=2) UserWarning: Couldn't import `kahypar` - skipping from default hyper optimizer and using basic `labels` method instead. warnings.warn( ``` Furthermore, this also speeds up the pennylane import process. **Benefits:** Warnings are no longer raised when importing pennylane if `cotengra` is installed along with other packages. **Possible Drawbacks:** The documentation of the `DefaultTensor` device, as listed in the 'next generation devices', is slightly different:  **Related GitHub Issues:** #6893 [sc-83272]
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.
Thank @isaacdevlugt !
**Context:** The recent paper [Rise of conditionally clean ancillae for optimizing quantum circuits](https://arxiv.org/abs/2407.17966) presents an improved decomposition of MCX gates using conditionally clean ancilla qubits. The proposed method achieves the following trade-offs in terms of Toffoli gate count and circuit depth: - 2n − 3 Toffoli and O(n) depth using 1 clean ancilla - 2n − 3 Toffoli and O(log(n)) depth using 2 clean ancilla - 4n − 8 Toffoli and O(n) depth using 1 dirty ancilla - 4n - 8 Toffoli and O(log(n)) depth using 2 dirty ancilla This approach is currently optimal regarding Toffoli count (for 1 and 2 ancillae) and significantly improves circuit depth. **Description of the Change:** Added `_decompose_mcx_with_two_workers` and `_decompose_mcx_with_one_worker_kg24` decompositions. **Benefits:** Extend support to: - `len(work_wires) == 2`, enabling a more efficient decomposition - Improved decomposition for `len(work_wires) == 1`, reducing circuit depth. **Related GitHub Issues:** Implements #6997 --------- Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca> Co-authored-by: Jay Soni <jay@xanadu.ai> Co-authored-by: Astral Cai <astralcai@gmail.com>
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.
Amazing! Great work @isaacdevlugt. If anything comes up during QA we can always modify this document. 😄
Context: Documentation for program capture (sc-84388)
Description of the Change: Adds a sharp bits page for program capture features (or lack thereof!)
Benefits: Explains the caveats, nuances, and edge cases associated with using this very new feature in PennyLane
Possible Drawbacks: Hopefully none :)
Related GitHub Issues: