Skip to content

docs: add sparse encodings and a sparse QSVT inverse - #88

Draft
wsttiger wants to merge 3 commits into
mainfrom
codex/v02-05-sparse-block-encoding-and-inverse
Draft

wsttiger wants to merge 3 commits into
mainfrom
codex/v02-05-sparse-block-encoding-and-inverse

Conversation

@wsttiger

@wsttiger wsttiger commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Adds a sparse-access tutorial comparing matrix-data QROM oracles with arithmetic banded oracles using independent fixed-point matrix references. Both routes execute block, complex-action, scratch-restoration, Walk, and QSVT checks; a four-point banded case verifies clipped boundaries. Metadata covers slots, alpha, workspace, alternate data forms, and Hermitian dilation.

Extends example 07 with an executed 2x2 sparse SPD inverse at three angle bits, fresh degree-83 CKS phases, independent ideal/quantized NumPy solves, and layered error budgets. The original five-dimensional dense solve remains and now also uses analytically known scale/sign corrections instead of fitting a scalar. Binomial-tail coefficients avoid overflow, and both cases verify their complex response with an independent signal model.

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

  • Sparse introduction passed: maximum 16 executed qubits, 23.87 s in the initial direct run.
  • Extended inverse passed: maximum 14 executed qubits, 11.86 s in the initial direct run; the sparse case took 9.90 s.
  • python3 -m pytest tests/python/test_examples.py -k 'sparse_block_encoding or 07_matrix_inversion_qsvt' -q: 2 passed in 79.82 s.
  • Sphinx HTML build with -W --keep-going: passed independently.
  • YAPF 0.43.0 and whitespace checks passed.

Independent plan 05 PR against main; requires no heat application, sibling example, library change, or new dependency. Full-state real-response extraction is explicitly simulator postprocessing.

Signed-off-by: Scott Thornton <wsttiger@gmail.com>
Signed-off-by: Scott Thornton <wsttiger@gmail.com>
The guide paragraphs on the sparse inverse say what example 07 is: a
dense PauliLCU solve and a sparse encode_sparse solve, with power-of-two
reciprocal fixtures and an identity-padded dense case. The oracle-contract
sentence keeps the statement that work-free oracles such as banded_oracles
invert globally while table oracles built on unary-iteration walks invert
only with clean scratch, matching the _sparse_oracle module docstring.
The examples page links example 07 the same way.

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