Skip to content

docs: add alias sampling and LCU tutorial - #84

Draft
wsttiger wants to merge 2 commits into
mainfrom
codex/v02-04-alias-sampling-lcu
Draft

wsttiger wants to merge 2 commits into
mainfrom
codex/v02-04-alias-sampling-lcu

Conversation

@wsttiger

@wsttiger wsttiger commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Adds a self-verifying alias-sampling tutorial that reconstructs the complete prepared state and exact rational index probabilities from public tables, demonstrates entangled garbage, and verifies complete preparation cleanup. It then composes 0.6 X_0 - 0.4 CZ_01 with a work-assisted SELECT body and checks the represented block, clean SELECT work, and shared Walk/QSVT consumers against independent NumPy models. Ideal-versus-discretized error is reported separately from circuit error.

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

  • Standalone example passed; maximum 12 executed qubits, 13.53 s in the initial direct run.
  • python3 -m pytest tests/python/test_examples.py -k alias_sampling_lcu -q: 1 passed.
  • python3 -m sphinx -W --keep-going -b html docs/sphinx docs/sphinx/_build/html: passed.
  • YAPF 0.43.0 and whitespace checks passed.

Independent plan 04 PR against main; all documentation/navigation is included. No PauliLCU-demo changes, other proposed tutorials, or new dependencies are required.

Signed-off-by: Scott Thornton <wsttiger@gmail.com>
The primitives guide described the kernel factories by contrast with
QROM.kernel and the pinned QROM variant as a property of "the current
LCU implementation". Say what they are: kernel()/adjoint_kernel() are
zero-argument methods whose kernels take (index, garbage), and
LCUBlockEncoding pins the "select" variant so SELECT reuses the clean
ladder.

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