Skip to content

docs: compare exact and alias PauliLCU backends - #85

Draft
wsttiger wants to merge 2 commits into
mainfrom
codex/v02-01-pauli-lcu-exact-vs-alias
Draft

wsttiger wants to merge 2 commits into
mainfrom
codex/v02-01-pauli-lcu-exact-vs-alias

Conversation

@wsttiger

@wsttiger wsttiger commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Extends the existing PauliLCU walkthrough with the same mixed-sign, Y-containing Hamiltonian using exact PREPARE/SELECT and alias precision mu=2 and mu=4 (skipping mu=3). Independent NumPy matrices and public alias-table enumeration distinguish coefficient discretization from circuit error while exercising the same action, Walk, and QSVT consumers. A separate small fixture checks odd/even moments; the resource table includes all ancillas and separates rotations, Toffolis, higher-controlled X, and Fredkins.

Validation on CUDA-Q 0.16.0, Python 3.12.3, qpp-cpu:

  • Standalone example passed; maximum 19 executed qubits. The new comparison took 41.08 s in the initial direct run.
  • python3 -m pytest tests/python/test_examples.py -k pauli_lcu_demo -q: 1 passed in 59.51 s.
  • python3 -m sphinx -W --keep-going -b html docs/sphinx docs/sphinx/_build/html: passed.
  • YAPF 0.43.0 and whitespace checks passed.
  • Broader validation: timeout 1200 python3 -m pytest tests/python -q reached its 20-minute limit (exit 124) during existing LCU regression cases. No failures were reported before timeout; the remaining suite is unverified. The focused example test and Sphinx build passed independently.

Independent plan 01 PR against main; the original introduction and module-level composition remain in place. No other proposed example or new dependency is required.

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>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant