Skip to content

0.8.0

Latest

Choose a tag to compare

@jank324 jank324 released this 03 Dec 12:35
· 2 commits to master since this release
d9090b0

This major release comes with significant overhauls of some core components of Cheetah. Highlights include an overhaul of the tracking system to support second-order tracking and transfer map/tensor caching; clearer tracking methods names; improved reliability of the gradients computed through Cheetah; a more PyTorch-like typing behaviour; and overall speed improvements of up to 7x in some cases.

🚨 Breaking Changes

  • Segment.set_attrs_on_every_element_of_type has been renamed to Segment.set_attrs_on_every_element, and made more general, with the element_type argument being optional and renamed to filter_type. (see #476) (@jank324, @cr-xu)
  • Cheetah Modules (Element, Beam, Species) no longer automatically change the device and dtype of passed parameters. Instead, the user is expected to make sure that the device and dtype of parameters and Modules match. This is more in line with how Modules included in PyTorch operate. (see #538, #552) (@jank324, @Hespe)
  • Add support for Python 3.14, and remove support for Python 3.10, as well as increase the minimum required versions for some dependencies. (see #582) (@jank324)
  • The tracking system has been widely overhauled. As part of this overhaul we renamed the tracking method "cheetah" to "linear" and "bmadx" to "drift_kick_drift". The existing methods "cheetah" and "bmadx" have been fully deprecated and will no longer work. Cheetah will raise an informative error for a number of releases to give users time to adapt their code. (see #476, #596) (@jank324, @Hespe, @cr-xu)

🚀 Features

  • Implement second-order tracking for Drift, Dipole and Quadrupole elements, and add a convenient method to set tracking methods for an entire segment. This comes with an overhaul of the overall tracking system. (see #476) (@cr-xu, @jank324, @Hespe)
  • Cavity now supports travelling wave cavities in addition to standing wave cavities via the cavity_type argument (see #286) (@zihan-zh, @jank324)
  • Documented PyTorch compile for improved speed (see #390) (@ax3l)
  • Beam classes now account for dispersion. Dispersion correction is included in the Twiss and emittance computations. Dispersion arguments are added to from_parameters and from_twiss beam initialisation methods. (see #540) (@cr-xu)
  • Add convenience methods to Segment for getting an ordered list of all element names and the index of a specific element by its name (see #534) (@roussel-ryan, @jank324)
  • First- and second-order transfer maps are now cached resulting in potential speed-ups of up to 10x and more (see #532, #565) (@jank324)
  • Methods for creating ParticleBeam instances from distributions via stochastic sampling now make sure that the statistics of the generated particles match the desired distribution (see #546) (@cr-xu)
  • BPM elements now support misalignments (see #533) (@roussel-ryan, @jank324)
  • Speed up tracking by replacing some PyTorch operations with faster alternatives (see #538, #558, #555, #556, #563, #561) (@jank324, @Hespe)
  • New CombinedCorrector element that combines the functionality of HorizontalCorrector and VerticalCorrector (see #589) (@jank324, @amylizzle)

🐛 Bug fixes

  • Shorten __repr__ of Segment for large lattices to prevent debugging slowdowns (see #529) (@Hespe)
  • Fix typo saying Bmad in Elegant import method docstring (see #531) (@jank324)
  • Remove division by zero in Cavity for off-crest phase (see #549, #550) (@Hespe)
  • Fix issue with SpaceChargeKick where the particle species was not preserved (see #560) (@austin-hoover, @jank324)
  • Fix bug that caused beams to revert to electron species when tracking through Cavity element, resulting in unexpected acceleration behaviour when tracking non-electron species through multiple Cavity elements. (see #570) (@jank324, @hjkim-iris, @Copilot)
  • Fix issue where branching in the computations could "hide" gradients w.r.t. to some inputs under certain conditions, leading to incorrect gradient computations. (see #553) (@jank324, @Hespe)

🐆 Other

  • Add a speed benchmarking workflow of tracking through the ARES lattice (see #527) (@Hespe)
  • Add tests that track through every subclass of Element for all permissible dtypes and device combinations (see #499) (@Hespe)
  • Fix false dtype in Screen documentation (see #544) (@jp-ga)
  • Fix an issue where running the plot tests on Windows (most notably on the recently upgraded GitHub Actions Windows runners) would sporadically fail with a _tkinter.TclError: Can't find a usable init.tcl in the following directories error, by forcing the matplotlib backend to Agg when running tests on Windows. (see #567) (@jank324)
  • Temporarily removed flake8-black from format Action because it causes issues with the latest black version. This has since been reinstated. (see #569, #575) (@jank324)
  • Fix typo in README (see #581) (@jank324)
  • Update ARES LatticeJSON file to match the latest properties in Cheetah (see #588) (@cr-xu, @jank324)

🌟 First Time Contributors