Skip to content

[Docs] Dem Sampling Docs, follow-up #479#511

Open
kvmto wants to merge 3 commits intoNVIDIA:mainfrom
kvmto:dem_sampling_pr_docs
Open

[Docs] Dem Sampling Docs, follow-up #479#511
kvmto wants to merge 3 commits intoNVIDIA:mainfrom
kvmto:dem_sampling_pr_docs

Conversation

@kvmto
Copy link
Copy Markdown
Collaborator

@kvmto kvmto commented Apr 20, 2026

This is a follow-up for #479

Summary

Adds comprehensive documentation for the dem_sampling feature across the Sphinx doc tree: API references (Python and C++), a dedicated example page with narrative explanation, and a new section in the QEC introduction page.

Changes

  • docs/sphinx/examples_rst/qec/dem_sampling.rst — New dedicated page covering the DEM sampling workflow, GPU acceleration pipeline (sparse Bernoulli sampling, GF(2) sparse-dense multiply, bitpacking), input type handling (NumPy, PyTorch CUDA, PyTorch CPU), and backend selection logic.
  • docs/sphinx/examples/qec/python/dem_sampling.py — Runnable Python example: basic usage, syndrome verification, reproducibility check, explicit CPU backend.
  • docs/sphinx/examples/qec/cpp/dem_sampling.cpp — Runnable C++ example using dem_sampler::cpu::sample_dem with syndrome verification.
  • docs/sphinx/components/qec/introduction.rst — Added "DEM Sampling" subsection under "Numerical Experiments" with inline Python/C++ snippets and a link to the full example page.
  • docs/sphinx/api/qec/python_api.rst — Added autofunction:: cudaq_qec.dem_sampling section.
  • docs/sphinx/api/qec/cpp_api.rst — Added doxygenfunction entries for all 5 C++ API functions (cpu::sample_dem x2, gpu::sample_dem, legacy dem_sampling x2).
  • docs/sphinx/examples_rst/qec/examples.rst — Added dem_sampling.rst to the examples toctree.

Testing

  • All 4 code snippets (Python standalone, Python inline, C++ standalone, bash compile command) compiled/ran successfully.
  • Sphinx build (ninja docs) succeeds with no new warnings.
  • Rendered HTML verified for correct heading hierarchy, content, and cross-links.

kvmto added 2 commits April 24, 2026 14:41
Signed-off-by: kvmto <kmato@nvidia.com>
Signed-off-by: kvmto <kmato@nvidia.com>
@kvmto kvmto force-pushed the dem_sampling_pr_docs branch from 45db397 to 0636f23 Compare April 24, 2026 14:42
Signed-off-by: kvmto <kmato@nvidia.com>
@bmhowe23 bmhowe23 added the documentation Improvements or additions to documentation label Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants