Repository navigation
Conversation
Signed-off-by: Scott Thornton <wsttiger@gmail.com>
The backend comparison in pauli_lcu_demo.py builds the alias encoding at mu=2, 3 and 4. The walk and QSVT circuits run at mu=2 and mu=3; the 19-qubit mu=4 encoding is priced, compared as an operator and applied once, since its walk and QSVT circuits took about 70 s of the example's 80 s on a two-thread CPU simulator. Including mu=3 shows the rounding behaviour the guide describes: its tables coincide with the mu=2 tables on this Hamiltonian, so the operator error stays at 4.5e-2 while the bound halves. The table now prints the bound beside the error. The resource table counted only X-type controlled gates, so the exact SELECT's controlled Y and Z (ccy, ccz, cz) and the alias circuit's cx and Hadamard gates were missing from the comparison. The row now lists rotations, uncontrolled single-qubit gates, singly, doubly and higher-controlled Paulis and Fredkins, and checks that these families sum to the estimator's total gate count. The guide and examples page describe the executed precisions and the table columns accordingly. Signed-off-by: Scott Thornton <wsttiger@gmail.com>
Signed-off-by: Scott Thornton <wsttiger@gmail.com>
wsttiger
marked this pull request as ready for review
November 10, 2026 18:47
Signed-off-by: Scott Thornton <wsttiger@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the existing PauliLCU walkthrough with exact and alias PREPARE/SELECT for the same two-qubit Hamiltonian at mu=2, 3, and 4. The default output tells the accuracy/resource story: an approximation-error table, the demonstrations actually executed, the complete gate/qubit inventory, and a small measured-moment table. The guide and examples page use the same narrative and observed values.
On this fixture mu=2 and mu=3 give the same rounded Hamiltonian (operator error 0.04516); mu=4 reduces it to 0.01734, about 2.6 times smaller, with 19 total qubits. Action executes for every backend; Walk/QSVT execute for exact and mu=2/3. The mu=4 consumer runs are skipped for CPU runtime.
All independent NumPy, alias-table, probability-bound, and gate-accounting checks remain active at their existing tolerances. Successful checks are silent by default; --verbose prints the individual diagnostics. Failures print diagnostics and raise in both modes. Coefficient-rounding error is distinguished from circuit/reference agreement.
Validation on Python 3.12.3 / CUDA-Q 0.16.0, fp64 qpp-cpu:
Independent plan 01 PR targeting main, with development in wsttiger/cudaq-algorithms. Replaces #85, where the earlier review discussion remains available.