Feature: Implement NonlinearKicker element#745
Open
senyue-hub wants to merge 3 commits intoxsuite:mainfrom
Open
Feature: Implement NonlinearKicker element#745senyue-hub wants to merge 3 commits intoxsuite:mainfrom
senyue-hub wants to merge 3 commits intoxsuite:mainfrom
Conversation
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
This PR adds a new beam element NonlinearKicker for beam injection studies. It is based on the existing Wire element logic.
Key Features:
Vectorized Calculation: Allows simulating multiple wire sources in a single element
C Implementation: Core logic implemented in C with an optimized loop over wires, including singularity protection for numerical stability.
Validation: Verified against a reference sequence of standard xt.Wire elements in tests/test_nonlinearkicker.py.
Cross-Context: Compatibility (CPU/GPU) has been verified using xobjects test helpers.
Note on Physics Consistency: I noticed a potential discrepancy between the current Wire element code and the Physics Guide. It appears that the current implementation does not account for the wire tilt effect on the B field. I have kept the NonlinearKicker logic consistent with the existing Wire element for now to ensure a direct benchmark, but this might be worth investigating in a future update.
Checklist
Mandatory:
Optional: