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

Fix the batch execution for elements with tilts or misalignments #157

Conversation

cr-xu
Copy link
Member

@cr-xu cr-xu commented May 14, 2024

Description

  • Add batch dimensions for the rotation matrix, now the batched tracking works properly with tilted elements.
  • Add batch dimensions for the misalignment matrix. Now the batched tracking works for misaligned Quadrupole and Solenoids.

Motivation and Context

Closes #154.

  • 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

@cr-xu cr-xu changed the title Fix the batch execution for elements with tilts Fix the batch execution for elements with tilts or misalignments May 15, 2024
@cr-xu cr-xu marked this pull request as ready for review May 15, 2024 12:58
@cr-xu cr-xu requested a review from jank324 May 15, 2024 13:00
@@ -0,0 +1,51 @@
import torch
Copy link
Member

Choose a reason for hiding this comment

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

@cr-xu Is there a reason you didn't just put these into test_quadrupole.py? That seems more logical to me.

CHANGELOG.md Outdated
@@ -15,6 +15,7 @@

- Now all `Element` have a default length of `torch.zeros((1))`, fixing occasional issues with using elements without length, such as `Marker`, `BPM`, `Screen`, and `Aperture`. (see #143) (@cr-xu)
- Fix bug in `Cavity` `_track_beam` (see [#150](https://github.com/desy-ml/cheetah/issues/150)) (@jp-ga)
- Fix bugs when tracking elements with `tilt` or `misalignment`. (see #157) (@cr-xu)
Copy link
Member

Choose a reason for hiding this comment

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

@cr-xu Did you fix anything other than the vectorisation? I guess because the changelog is with respect to the previous release (and not master), rather than adding a bug fix, we should add the issue and your name to the breaking vectorisation change entry. Does that make sense?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, that's only with the vectorisation. Yes it makes sense to move it in the vectorisation entry.

@cr-xu cr-xu requested a review from jank324 May 21, 2024 09:17
@jank324 jank324 merged commit 5db7e40 into master May 21, 2024
9 checks passed
@jank324 jank324 deleted the 154-missing-batch-execution-compatibility-in-dipole-rotation-matrix-etc branch May 21, 2024 10:05
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.

Missing batch-execution compatibility in Dipole, Rotation matrix, etc.
2 participants