Skip to content
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

Bugfix/madx misalignments #306

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kparasch
Copy link
Contributor

@kparasch kparasch commented Feb 23, 2023

Description

Order of dx/dy and dpsi when importing from madx error tables was wrong.
Added test to check, and reversed the order.

Fixes xsuite Issue # 302 (xsuite/xsuite#302)

tests/test_prebuild_kernels.py does not pass, but was also not passing before.

Checklist

Mandatory:

  • I have added tests to cover my changes
  • [] All the tests are passing, including my new ones
  • I described my changes in this PR description

Optional:

  • The code I wrote follows good style practices (see PEP 8 and PEP 20).
  • I have updated the docs in relation to my changes, if applicable
  • I have tested also GPU contexts

@rdemaria
Copy link
Contributor

Please make sure not to break the ealign logic.

@kparasch
Copy link
Contributor Author

Doesn't work if thin multipole has angle...

@kparasch kparasch marked this pull request as draft February 23, 2023 17:24
@rdemaria rdemaria marked this pull request as ready for review February 23, 2023 21:10
@rdemaria
Copy link
Contributor

Doesn't work if thin multipole has angle...

Multipoles with angle are a bit special and we were considering changing the behaviour (as it is not documented yet). Have a look here for more details:
MethodicalAcceleratorDesign/MAD-X#911

@kparasch
Copy link
Contributor Author

kparasch commented Feb 24, 2023

Multipoles with angle are a bit special and we were considering changing the behaviour (as it is not documented yet). Have a look here for more details: MethodicalAcceleratorDesign/MAD-X#911

Until (and if) behaviour is changed, should we replicate the track of mad-x?

A particle entering a multipole (knl,ksl = 0, angle=a), and with an ealign diplacement dx, exits with a shift in the x coordinate equal to "dx * (a * sin(a) + cos(a) - 1 + O(1.e-5))". Since there can't be a change in the actual position of the particle, this change must be happening in the reference orbit.

@rdemaria
Copy link
Contributor

The matter is a bit tricky. Thin elements do not exist, (si)xtrack elements are indeed integration steps. I am not sure it makes sense to rotate an integration step in the general case, but it can work in specific cases.

@giadarol
Copy link
Member

@rdemaria and @paraschou
What is the state of this PR? Is it ready to be merged?

@kparasch kparasch marked this pull request as draft May 5, 2023 07:30
@giadarol giadarol deleted the branch xsuite:main October 17, 2023 15:18
@giadarol giadarol closed this Oct 17, 2023
@giadarol
Copy link
Member

Closed by mistake

@giadarol giadarol reopened this Oct 18, 2023
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.

3 participants