Conversation
Atomic relaxation followed the full vacancy cascade down to the outermost shells, sampling a transition and an isotropic direction at every step. Fluorescence photons below the photon energy cutoff are never created and Auger electrons below it produce no bremsstrahlung photons, so for heavy elements most of this work had no effect: for W and Pb roughly 80-85% of the vacancies in a K- or L-shell cascade have binding energies below the default 1 keV cutoff. Since every particle emitted while filling a vacancy, and every vacancy left behind, has an energy below the binding energy of the vacancy shell, vacancies below the cutoff are now skipped along with the rest of their cascade, and directions are only sampled for emissions above the cutoff. This does not change the physics but does change the random number sequence. On a Cs-137 source in a W/Pb cask this reduces the transport time by about 22%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
Skipping atomic relaxation emissions below the photon energy cutoff changes the random number sequence for problems with photon transport. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
test_weightwindows compares the source bin of an analog run and a weight window run with uncertainties estimated from only two batches, and required the difference to be within two combined standard deviations. With the random number sequence changed by the atomic relaxation change, the shared secondary bank case fails this check at the default seed (2.5 sigma). Higher statistics runs of the same model (40 times as many histories) show no bias between the analog and weight window results, and a 2 sigma check on two quantities in each of two cases is expected to fail regularly. Use three standard deviations, as other tests comparing Monte Carlo results do (e.g. test_torus and test_filter_mesh). Rerunning on failure would not help since the test uses a fixed seed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
GuySten
marked this pull request as ready for review
October 2, 2026 23:20
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.
Description
After a photoelectric or Compton interaction, atomic relaxation follows the full vacancy cascade down to the outermost shells, sampling a transition and an isotropic direction (with
sin,cosandsqrt) at every step. For heavy elements most of this work has no effect on the simulation:create_secondaryreturns before banking them), andthick_target_bremsstrahlungreturns immediately), and with local energy deposition electrons produce nothing at all.Every particle emitted while filling a vacancy, and every vacancy left behind, has an energy below the binding energy of the vacancy shell. This PR therefore:
The physics is unchanged, but the random number sequence changes for any problem with atomic relaxation, so some photon regression results need to be updated.
For W and Pb with the default 1 keV photon cutoff, roughly 80–85% of the vacancies in a K- or L-shell cascade lie below the cutoff (for example, a Pb K-shell cascade visits about 23 vacancies, of which about 3.5 are above 1 keV). Profiling the gamma shielding model from this Discourse thread (Cs-137 source in a W/Pb cask, analog, single thread) showed atomic relaxation taking 26% of the run time. With this change, transport time dropped by about 22% (22.4 s to 17.4 s for 10⁶ histories), and the tally results agreed with the original within statistical uncertainty.
I also added a paragraph describing this to the atomic relaxation section of the photon physics methods documentation.
Checklist
I have followed the style guidelines for Python source files (if applicable)I have added tests that prove my fix is effective or that my feature works (if applicable)