Skip to content

implement zero phase tdc for parameter beam tracking - #447

Draft
roussel-ryan wants to merge 2 commits into
desy-ml:masterfrom
roussel-ryan:thick-lens-tdc
Draft

implement zero phase tdc for parameter beam tracking#447
roussel-ryan wants to merge 2 commits into
desy-ml:masterfrom
roussel-ryan:thick-lens-tdc

Conversation

@roussel-ryan

@roussel-ryan roussel-ryan commented May 21, 2025

Copy link
Copy Markdown
Contributor

Implements zero-phase, first order transverse deflecting cavity tracking for ParameterBeam class using thick lens transport matrix

Description

This pull request introduces functionality for tracking and transfer map computation in the TransverseDeflectingCavity class using the "cheetah" tracking method. It also adds a corresponding unit test to ensure consistency with the "bmadx" tracking method. Below are the most important changes grouped by theme:

New functionality for "cheetah" tracking:

  • Added a transfer_map method to compute the transfer map for a thick lens transverse deflecting cavity using a drift-kick-drift approach. This method restricts usage to zero phase and calculates drift and kick matrices before combining them into the total transfer matrix. (cheetah/accelerator/transverse_deflecting_cavity.py, cheetah/accelerator/transverse_deflecting_cavity.pyR114-R152)
  • Updated the track method to support the "cheetah" tracking method by delegating to the parent class implementation. Previously, this raised a NotImplementedError. (cheetah/accelerator/transverse_deflecting_cavity.py, cheetah/accelerator/transverse_deflecting_cavity.pyL101-R102)

Unit tests for "cheetah" tracking:

  • Added a new test, test_transverse_deflecting_cavity_cheetah_tracking, to verify that the results of the "cheetah" tracking method match those of the "bmadx" method. The test checks the transfer map and performs tracking on a sample beam. (tests/test_transverse_deflecting_cavity.py, tests/test_transverse_deflecting_cavity.pyR41-R91)

Motivation and Context

Looking to do scalarized uncertainty quantification using RMS beam moments with transverse deflecting cavities.

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Checklist

  • I have updated the changelog accordingly (required).
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.
  • I have reformatted the code and checked that formatting passes (required).
  • I have have fixed all issues found by flake8 (required).
  • I have ensured that all pytest tests pass (required).
  • I have run pytest on a machine with a CUDA GPU and made sure all tests pass (required).
  • I have checked that the documentation builds (required).

Note: We are using a maximum length of 88 characters per line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants