Skip to content

Spin push in ChrPlasmaLens#1452

Merged
ax3l merged 15 commits into
BLAST-ImpactX:developmentfrom
cemitch99:add_spin_chr_pl
May 11, 2026
Merged

Spin push in ChrPlasmaLens#1452
ax3l merged 15 commits into
BLAST-ImpactX:developmentfrom
cemitch99:add_spin_chr_pl

Conversation

@cemitch99
Copy link
Copy Markdown
Member

@cemitch99 cemitch99 commented May 4, 2026

This PR adds the spin push in a ChrPlasmaLens element.

  • add draft of spin push logic
  • finalize the spin push
  • add consistency benchmark against TaperedPL

The benchmark step relies on PR#1433.

@cemitch99 cemitch99 requested a review from ax3l May 4, 2026 23:51
@cemitch99 cemitch99 added component: elements Elements/maps/external fields component: spin tracking Spin tracking labels May 4, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 5, 2026

Merging this PR will not alter performance

✅ 35 untouched benchmarks
🆕 4 new benchmarks
⏩ 2 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 test_ChrPlasmaLens[nospin] N/A 1.6 ms N/A
🆕 test_TaperedPL[nospin] N/A 285.4 µs N/A
🆕 test_TaperedPL[spin] N/A 1.7 ms N/A
🆕 test_ChrPlasmaLens[spin] N/A 3.2 ms N/A

Comparing cemitch99:add_spin_chr_pl (fe46392) with development (7ba9694)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cemitch99 cemitch99 mentioned this pull request May 7, 2026
1 task
Comment thread tests/python/test_plasma_lens_spin.py Fixed
Comment thread tests/python/test_plasma_lens_spin.py Fixed
Comment thread tests/python/test_plasma_lens_spin.py Fixed
Comment thread tests/python/test_plasma_lens_spin.py Fixed
Comment thread tests/python/test_plasma_lens_spin.py Fixed
Comment thread tests/python/test_plasma_lens_spin.py Fixed
Comment thread tests/python/test_plasma_lens_spin.py Fixed
Comment thread tests/python/test_plasma_lens_spin.py Fixed
Comment thread tests/python/test_plasma_lens_spin.py Fixed
Comment thread tests/python/test_plasma_lens_spin.py Fixed
Comment thread src/elements/TaperedPL.H Fixed
@ax3l ax3l self-assigned this May 10, 2026
Comment thread src/elements/ChrPlasmaLens.H Outdated
Comment thread src/elements/TaperedPL.H
Comment on lines +218 to +219
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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legit fix, follow-up to #1433

Comment thread examples/spin_tracking/run_plasma_lens_spin.py Outdated
Comment thread tests/python/test_plasma_lens_spin.py Outdated
Comment thread src/elements/ChrPlasmaLens.H
ax3l added 3 commits May 11, 2026 09:11
- bug: cmath missing
- style: declaration misleading (used)
- ChrPlasmaLens
- TaperedPL
ids=["madx", "si"],
)
def test_ChrPlasmaLens(sim, unit, k):
kwargs = {} if sim.spin else PIPE_KWARGS
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1455

@pytest.mark.parametrize("sim", [True, False], indirect=True, ids=["spin", "nospin"])
@pytest.mark.parametrize(("unit", "k"), [(0, 1.0 / 0.5), (1, 6.0)], ids=["madx", "si"])
def test_TaperedPL(sim, unit, k):
kwargs = {} if sim.spin else ALIGNMENT_KWARGS
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1455

@ax3l ax3l merged commit 9f5be4c into BLAST-ImpactX:development May 11, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: elements Elements/maps/external fields component: spin tracking Spin tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants