feat(qec): surface-code noise model upscaling for training (6e-3 target)#2
Merged
ivanbasov merged 2 commits intoMar 9, 2026
Merged
Conversation
4083926 to
3d72484
Compare
Replace the old 1e-3 "sparsity guard" in train.py with a proper noise-model upscaling module in noise_model.py that: - Scales all 25 noise-model parameters so max(grouped totals) = 6e-3 (just below surface-code threshold ~7.5e-3) for training data only. - Skips upscaling for non-surface-code types. - Provides skip_noise_upscaling config flag and PREDECODER_SKIP_NOISE_UPSCALING=1 env var to bypass upscaling. - Emits clear warnings when noise is above target or downscale is skipped. Adds 10 unit tests covering upscale, downscale, skip, non-surface-code, zero-totals, and reference-preservation scenarios. Updates README with detailed documentation of the upscaling rules and how to disable them. Ported from gitlab MR !33 (feature/surface-code-noise-upscale-6e3). Made-with: Cursor
Made-with: Cursor
3d72484 to
0852a99
Compare
Member
Author
bmhowe23
approved these changes
Mar 9, 2026
ivanbasov
added a commit
that referenced
this pull request
Apr 10, 2026
…et) (#2) * feat(qec): surface-code noise model upscaling for training (6e-3 target) Replace the old 1e-3 "sparsity guard" in train.py with a proper noise-model upscaling module in noise_model.py that: - Scales all 25 noise-model parameters so max(grouped totals) = 6e-3 (just below surface-code threshold ~7.5e-3) for training data only. - Skips upscaling for non-surface-code types. - Provides skip_noise_upscaling config flag and PREDECODER_SKIP_NOISE_UPSCALING=1 env var to bypass upscaling. - Emits clear warnings when noise is above target or downscale is skipped. Adds 10 unit tests covering upscale, downscale, skip, non-surface-code, zero-totals, and reference-preservation scenarios. Updates README with detailed documentation of the upscaling rules and how to disable them. Ported from gitlab MR !33 (feature/surface-code-noise-upscale-6e3). Made-with: Cursor * Apply yapf style to rebased branch Made-with: Cursor
ivanbasov
added a commit
that referenced
this pull request
Apr 10, 2026
…et) (#2) * feat(qec): surface-code noise model upscaling for training (6e-3 target) Replace the old 1e-3 "sparsity guard" in train.py with a proper noise-model upscaling module in noise_model.py that: - Scales all 25 noise-model parameters so max(grouped totals) = 6e-3 (just below surface-code threshold ~7.5e-3) for training data only. - Skips upscaling for non-surface-code types. - Provides skip_noise_upscaling config flag and PREDECODER_SKIP_NOISE_UPSCALING=1 env var to bypass upscaling. - Emits clear warnings when noise is above target or downscale is skipped. Adds 10 unit tests covering upscale, downscale, skip, non-surface-code, zero-totals, and reference-preservation scenarios. Updates README with detailed documentation of the upscaling rules and how to disable them. Ported from gitlab MR !33 (feature/surface-code-noise-upscale-6e3). Made-with: Cursor * Apply yapf style to rebased branch Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
train.pywith a proper noise-model upscaling module (get_training_upscaled_noise_modelinnoise_model.py) that scales all 25 noise-model parameters somax(grouped totals) = 6e-3(just below surface-code threshold ~7.5e-3) for training data only. Evaluation uses the user-specified noise model as-is.skip_noise_upscaling: truein config orPREDECODER_SKIP_NOISE_UPSCALING=1env var to bypass upscaling (useful for benchmarking/controlled experiments).Ported from internal GitLab MR !33 (
feature/surface-code-noise-upscale-6e3).Changed files
README.mdcode/qec/noise_model.pyget_grouped_totals,get_training_upscaled_noise_model, constantscode/tests/test_noise_model.pyTestNoiseModelUpscalingclass (10 tests)code/training/train.pyTest plan
PYTHONPATH=code python -m unittest discover -s code/tests -p "test_noise_model.py")Made with Cursor