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

Add particle species in Beam classes and update tracking methods #276

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

cr-xu
Copy link
Member

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

Description

Add the option to track with different particle species.

Changes:

  • Introduce a new Species Class, containing the name, charge, and mass information for the particles. Some basic species are pre-defined, with the possibility to define custom mass-to-charge ratio particles.
  • Now the transfer_map methods and the compute_relativistic_factors need two arguments:[energy, particle_mass_eV] with particle_mass_eV default to electron mass
  • Beam classes now have a new attribute species and a new property mass_eV
  • Added new benchmark tests by running bmad simulations directly
  • Updated the CI/CD pipelines to install bmad with conda; separated Windows tests to run only the tests without bmad.

Motivation and Context

  • 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 linked an issue Oct 14, 2024 that may be closed by this pull request
@cr-xu cr-xu changed the title 231 Add particle species in particlebeam 231 Add particle species in Beam classes and update tracking methods Oct 14, 2024
@jank324 jank324 changed the title 231 Add particle species in Beam classes and update tracking methods Add particle species in Beam classes and update tracking methods Oct 15, 2024
@cr-xu cr-xu self-assigned this Oct 15, 2024
@jank324 jank324 added the enhancement New feature or request label Oct 15, 2024
@cr-xu cr-xu requested a review from jank324 October 16, 2024 07:55
@cr-xu cr-xu marked this pull request as ready for review October 16, 2024 07:55
@cr-xu cr-xu marked this pull request as draft October 16, 2024 14:18
@cr-xu
Copy link
Member Author

cr-xu commented Oct 16, 2024

I just realized that I still need to take the particle charges into account for the cavities/elements with electric fields. So this should probably wait until #278 is merged.

@cr-xu cr-xu marked this pull request as ready for review October 22, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add particle species in ParticleBeam
2 participants