Repository navigation
feat: Poisson noise samples and frozen-phonon exit waves - #33
Merged
Merged
Conversation
ScanMeasurement.poissonNoise(dose:samples:seed:) and the dose-per-area form return that many independent Poisson draws as an array, the sample axis of abTEM poisson_noise(samples=). One generator stream runs over the samples, so sample 0 is the single draw of the same seed; samples below 1 or beyond half of the physical memory are refused before any work. STEM.scanFrozenPhonons(probe:potentials:scan:detector:backend:options:memoryLimit:) returns one ScanWaves per frozen-phonon configuration, never averaged, as abTEM keeps the configuration axis for waves. Each equals the single-potential scan bit for bit; the memory limit counts every configuration. STEM.scan with a WavesDetector still takes one potential. Tests: SimulatoDetectorTests/EnsembleTests (red before: the API did not exist). parity.md, README, the docc article and open-items updated. Done: two bullets of issue 9 (Poisson samples, WavesDetector with frozen phonons). Next: the segmented-detector DPC measurement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Requested by Paul · project thread
Part of #9
Two ensemble axes abTEM adds to a scan:
ScanMeasurement.poissonNoise(dose:samples:seed:)andpoissonNoise(dosePerArea:samplingX:samplingY:samples:seed:)returnsamplesindependent Poisson draws as an array (abTEMpoisson_noise(samples=)). One generator stream runs over the samples (abTEM also draws all samples from one stream), so sample 0 is the single draw of the same seed. Samples below 1, or beyond half of the physical memory, are refused before any work. The generator is the kit's own, as before: parity is statistical.STEM.scanFrozenPhonons(probe:potentials:scan:detector:backend:options:memoryLimit:)(built and unbuilt potentials) returns oneScanWavesper frozen-phonon configuration, never averaged. abTEM keeps the configuration axis for waves too (Waves.reduce_ensemblepasses waves through). Each configuration equals its single-potential scan bit for bit; the memory limit counts all configurations; a grid mismatch on any configuration is refused first.STEM.scanwith aWavesDetectoris unchanged.No existing number changes. Additive API, so
feat:.Test evidence:
Tests/SimulatoDetectorTests/EnsembleTests.swift(4 tests) fails to compile onmain(the API is new) and passes here; the gateswift test -c release --skip SimulatoKitParityTestsis green locally. Reviewed by a separate reviewer pass before the commit (one should-fix, the sample-count cap, applied; nits applied).Remaining in #9 (not in this PR): the segmented-detector DPC measurement, line profiles for segmented and pixelated line scans, the azimuthal average,
LineScandefaults,integrate_disc(interpolate:), tilt distributions.🤖 Generated with Claude Code