Spin push for TaperedPL#1433
Merged
cemitch99 merged 5 commits intoMay 7, 2026
Merged
Conversation
for more information, see https://pre-commit.ci
ax3l
reviewed
Apr 24, 2026
Member
Author
|
Thanks @carlandreaslindstrom . This one is just awaiting a benchmark test, which is almost ready and being finalized now. |
Member
Author
|
@ax3l Actually, the benchmark that I had in mind requires implementing the spin push in |
ax3l
requested changes
May 6, 2026
Comment on lines
+218
to
+222
| // compute multipole magnetic field normalized by q/mc: | ||
| amrex::ParticleReal gamma_ref = refpart.gamma(); | ||
| T_Real const Bx = m_g * ( y + m_taper * x * y ) * gamma_ref * m_beta; | ||
| T_Real const By = -m_g * ( x + m_taper*0.5_prt * (powi<2>(x) + powi<2>(y)) ) * gamma_ref * m_beta; | ||
| T_Real const Bz = 0_prt; |
Member
There was a problem hiding this comment.
Codex:
The magnetic field signs look opposite to the phase-space kick. The
ordinary push applies:dpx = -g * A;dpy = -g * B;
Following the convention used in Multipole.H, the normalized fields should be proportional to Bx = dpy * beta*gamma and By = -dpx * beta*gamma, so I’d expect: Bx = -m_g * (y + m_taper * x * y) * gamma_ref * m_beta; By = m_g * (x + 0.5_prt * m_taper * (powi<2>(x) + powi<2>(y))) * gamma_ref * m_beta; As written, the spin precession for taper=0 corresponds to the field sign of a defocusing plasma lens while the particle kick is focusing for m_g > 0.
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Member
|
I see CI is failing. Merging #1454 now which will fix it. |
Member
Author
|
This PR will be tested using #1452 |
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.
This PR adds the spin push for the thin tapered plasma lens element. Close #1154
Follow-up: add spin push for ChrPlasmaLens and benchmark against TaperedPL (with taper=0) for consistency check