Skip to content

Document tensor-network noise learning#554

Open
vedika-saravanan wants to merge 3 commits into
NVIDIA:mainfrom
vedika-saravanan:noise-learning-docs
Open

Document tensor-network noise learning#554
vedika-saravanan wants to merge 3 commits into
NVIDIA:mainfrom
vedika-saravanan:noise-learning-docs

Conversation

@vedika-saravanan

@vedika-saravanan vedika-saravanan commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR documents tensor-network noise learning with NMOptimizer.

Runtime / performance impact

N/A. Documentation-only change.

Self-review checklist

Please confirm each item before requesting review. Check [x] or strike
through and explain.

Before requesting review

  • I reviewed my own full diff in GitHub or my editor.
  • PR is in Draft if it is not yet ready for review.
  • Temporary / debugging changes have been removed.
  • Local test logs reviewed; no unexplained warnings or errors.
  • CI logs reviewed; no unexplained warnings or errors.
  • Full CI has been run.

Scope and size

  • PR is under ~1000 lines, or an exception is justified in the description.
  • Refactoring-only changes are isolated in their own PR(s).
  • No existing tests were disabled or modified just to make this PR pass
    (if so, an issue has been raised).

Tests

  • New functionality has new tests.
  • Tests fail if the new functionality is broken (including crashes), not
    just when it is missing.
  • Negative tests added where exceptions are expected. N/A: docs-only.
  • Truth data added where simple EXPECT_* / assert checks are
    insufficient for algorithmic correctness. N/A: docs-only.
  • CI runtime impact considered; team notified if significant.

Documentation

  • Public-facing APIs have Doxygen docs.
  • User-visible behavior changes have public docs, or a follow-up is
    tracked.

Code style

  • Naming follows the existing convention (snake_case vs camelCase) for
    the area being modified.

Dependencies

  • No new third-party dependencies, or the team has been notified and
    OSRB tickets filed.

@vedika-saravanan vedika-saravanan marked this pull request as draft May 19, 2026 21:14
Adds Sphinx API narrative and decoder docs for noise-learning integration,
split from the integration PR for focused review.

Signed-off-by: vedika-saravanan <vsaravanan@nvidia.com>
@NVIDIA NVIDIA deleted a comment from copy-pr-bot Bot May 19, 2026
vedika-saravanan added a commit that referenced this pull request May 26, 2026
…526)

## Summary

Productizes Nico's `NMOptimizer` into the TN decoder. Fits per-error
noise
probabilities by backpropagating through a torch-backed tensor-network
contraction.

> `oe_torch` / `oe_torch_compiled` contractors aren't included, unused
by `NMOptimizer`.

## What's in it

- `NMOptimizer` + `make_compiled_step`, exposed top-level via `from
cudaq_qec import NMOptimizer`
- Three execute modes (`codegen` / `unrolled` / `opt_einsum`); optional
`torch.compile`; prior auto-clamping
- Unit tests parameterised over `(cpu, cuda)` × execute modes, plus
`test_forward_parity_with_tn_decoder` against the base TN decoder
- Example (`tn_noise_learning.py`) runs in CI as the end-to-end LER gate

## Test plan

- [x] `pytest libs/qec/python/tests/test_nm_optimizer.py -v`
- [x] `pytest libs/qec/python/tests/test_tensor_network_decoder.py -v`
- [x] `python3 docs/sphinx/examples/qec/python/tn_noise_learning.py`


## Follow-ups


- cuTensorNet backend (currently forced to torch for autograd), unlocks
  larger code distances (d=5+ surface codes)
- KPI on real partner noise data
- Decoder-agnostic mixin (QLDPC)
- Docs: [#554](#554)

NVBug for new deps: https://nvbugspro.nvidia.com/bug/6177164

---------

Signed-off-by: vedika-saravanan <vsaravanan@nvidia.com>
@vedika-saravanan vedika-saravanan self-assigned this Jun 9, 2026
@vedika-saravanan vedika-saravanan marked this pull request as ready for review June 22, 2026 21:41
@vedika-saravanan vedika-saravanan changed the title docs(qec): tensor network noise-learning decoder docs Document tensor-network noise learning Jun 22, 2026
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