-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add traveling-wave cavity model #286
base: master
Are you sure you want to change the base?
Conversation
…01 line too long (134 > 88 characters) ./cheetah/accelerator/cavity.py:391:89: E501 line too long (101 > 88 characters)
Just to keep some notes:
|
@@ -116,6 +116,7 @@ def convert_element_to_cheetah( | |||
voltage=torch.tensor(element.v, dtype=torch.float32) * 1e9, | |||
frequency=torch.tensor(element.freq, dtype=torch.float32), | |||
phase=torch.tensor(element.phi, dtype=torch.float32), | |||
cavity_type="standing_wave", | |||
name=element.id, | |||
device=device, | |||
dtype=dtype, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here we should also include the conversion for ocelot.TWCacity
as it's implemented now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cr-xu like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly.
I think the proper test for TWCavity is still missing though. It would be nice to have a benchmark against both OCELOT and Bmad tracking results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. There is a test for the standing wave already that I think can just be parameterised to cover travelling wave as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added the test, comparing the results to Ocelot. Weirdly, it seems the TWCavity
implementation in Ocelot is broken. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well... indeed the OCELOT TWCavity seems to be broken, both for the stable 22.12.0
version and the unreleased one in the master branch now 24.12.0
. I already opened an Issue there: ocelot-collab/ocelot#268
Let's see if that can be resolved soon. Otherwise I would suggest to have a static bmad test case and compare the result, so that we can have the PR merged soon-ish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a side note, the Ocelot master branch did merge my PR, so now we can also point to its official master instead of my fork for the CI/CD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked @zihan-zh to provide results from a Bmad tracking, so we can use those for a static comparison.
Description
cavity_type
parameter to the Cheetah Cavity element.Cavity._cavity_rmatrix
method to accommodate the new parameter.cavity_type
property.Motivation and Context
This change is required to provide users with more versatility when configuring RF cavities in Cheetah.
Types of changes
Checklist
flake8
(required).pytest
tests pass (required).pytest
on a machine with a CUDA GPU and made sure all tests pass (required).Note: We are using a maximum length of 88 characters per line.