Skip to main content

Cheetah

Cheetah is a particle tracking accelerator we built specifically to speed up the training of reinforcement learning models.

Installation

Simply install Cheetah from PyPI by running the following command.

pip install cheetah-accelerator

How To Use

A sequence of accelerator elements (or a lattice) is called a Segment in Cheetah. You can create a Segment as follows

segment = Segment([
    BPM(name="BPM1SMATCH"),
    Drift(length=1.0),
    BPM(name="BPM6SMATCH"),
    Drift(length=1.0),
    VerticalCorrector(length=0.3, name="V7SMATCH"),
    Drift(length=0.2),
    HorizontalCorrector(length=0.3, name="H10SMATCH"),
    Drift(length=7.0),
    HorizontalCorrector(length=0.3, name="H12SMATCH"),
    Drift(length=0.05),
    BPM(name="BPM13SMATCH"),
])

Alternatively you can create a segment from an Ocelot cell by running

segment = Segment.from_ocelot(cell)

All elements can be accesses as a property of the segment via their name. The strength of a quadrupole named AREAMQZM2 for example, may be set by running

segment.AREAMQZM2.k1 = 4.2

In order to track a beam through the segment, simply call the segment like so

outgoing_beam = segment(incoming_beam)

You can choose to track either a beam defined by its parameters (fast) or by its particles (precise). Cheetah defines two different beam classes for this purpose and beams may be created by

beam1 = ParameterBeam.from_parameters()
beam2 = ParticleBeam.from_parameters()

It is also possible to load beams from Ocelot ParticleArray or Astra particle distribution files for both types of beam

ocelot_beam = ParticleBeam.from_ocelot(parray)
astra_beam = ParticleBeam.from_astra(filepath)

You may plot a segment with reference particle traces bay calling

segment.plot_overview(beam=beam)

Overview Plot

where the optional keyword argument beam is the incoming beam represented by the reference particles. Cheetah will use a default incoming beam, if no beam is passed.

Cite Cheetah

To cite Cheetah in publications:

@inproceedings{stein2022accelerating,
    author = {Stein, Oliver and
              Kaiser, Jan and
              Eichler, Annika},
    title = {Accelerating Linear Beam Dynamics Simulations for Machine Learning Applications},
    booktitle = {Proceedings of the 13th International Particle Accelerator Conference},
    year = {2022},
    url = {https://github.com/desy-ml/cheetah},
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cheetah-accelerator-0.5.18.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cheetah_accelerator-0.5.18-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file cheetah-accelerator-0.5.18.tar.gz.

File metadata

  • Download URL: cheetah-accelerator-0.5.18.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for cheetah-accelerator-0.5.18.tar.gz
Algorithm Hash digest
SHA256 02297a7edf72ae1411172ac8e901a61f19dc23c7c61952232b04e1b7a0acacd4
MD5 19d6c2de2a7fa0b6e401664378d1b741
BLAKE2b-256 f1630dd6a360b66f1eaa5134bcf9ce0afc5db92e0070ffc87e8b586e7478c1a8

See more details on using hashes here.

File details

Details for the file cheetah_accelerator-0.5.18-py3-none-any.whl.

File metadata

File hashes

Hashes for cheetah_accelerator-0.5.18-py3-none-any.whl
Algorithm Hash digest
SHA256 70f0b8817155262261908118f95a93fadb39a75629d8d9124aa35e1553e4f2ff
MD5 c50275eeefa97cd1074edca32802c1a9
BLAKE2b-256 ead1d966e5e7f11ba2c6eef73b183fab9812d3082e9c871e17e4303743212e28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page