Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
partial_coherence: reduce the defocus ensembles with reduce_ensemble() instead of .sum(0)/.mean(0), which ignore the weights; describe the ensemble members as unweighted images whose weights are applied at reduction; move p outside the norm in the probe equations; normalize the Riemann sum by the weights. Also fix the missing minus sign in the Gaussian, and the stated standard deviation and truncation (the code uses sigma = delta/sqrt(2) = 37.12 A, not 52.5 A). ensembles: explain that weights are probabilities applied at reduction, and that reduce_ensemble(axis=...) applies them to a kept axis while a plain .sum()/.mean() does not. hrtem_quickstart: pass the 1/e focal-spread width (sqrt(2) times the standard deviation) to focal_spread, and correct the Cc comment. Re-executed against abTEM at abTEM/abTEM#466 (e3d0d47b). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Docs for abTEM#466, which applies distribution weights as probabilities when an ensemble is reduced. abTEM#466 is now merged (f14de11e). The notebooks were executed against its branch (e3d0d47b) and checked again against the merged
dev:ensemblesandpartial_coherencegive identical outputs there.hrtem_quickstartuses unseeded frozen phonons and Poisson noise, so its figures differ from run to run on any version.Changes
.weights.tutorials/partial_coherence.ipynb:reduce_ensemble(). They used.sum(0)/.mean(0), which now ignore the weights, and the.mean(0)was already a top-hat average before #466.appendix/ensembles.ipynb: explains that weights are probabilities, and thatreduce_ensemble(axis=...)applies them to a kept axis while a plain.sum()/.mean()does not. The printed weights now sum to one.examples/notebooks/hrtem_quickstart.ipynb: an older bug, not caused by #466. It passed the standard deviation of the defocus spread asfocal_spread, which expects the 1/e width √2·σ, so its envelope was too narrow. Its Cc comment also said 1.2 mm while the code uses 1.0 mm. The thumbnail is regenerated by the notebook.Checks
scripts/check_notebook_widgets.pypasses, and only the recorded Python version changed in the notebook metadata.Not included
tutorials/time_resolved.ipynbhas the samefocal_spreadσ-vs-1/e mistake ashrtem_quickstart, but it importsase.md.velocitydistribution.thermalize_momenta, which no locally installed ASE (up to 3.27) provides, so it could not be re-executed here. It will follow separately.🤖 Generated with Claude Code