This repository is used to manage the lattices shown on the lattice-summaries website. Every time a new lattice file is pushed to this repository, it automatically gets converted into serval lattice file formats. The resulting lattice files are stored on the generated
branch. The orignal lattice file is stored in the originals
folder on the main
branch.
The lattices are converted using the LatticeJSON package. To convert all lattice files into the different formats run: (requires Python 3.8+ and Poetry)
poetry install
poetry run doit
The resulting lattices files are saved to the generated
folder and can be published by pushing this folder to the generated
branch.
- Clone this repository
- Create a new branch (e.g.
goslawski/add-mls2-lattice
) - Check if your lattice file meets all the requirements. (see lattice file requirements)
- Add your lattice file to the
originals/<namespace>
folder. (see naming scheme) - Add an entry in the
info.toml
file. (see below) - Commit your changes to your new branch.
- The commit summary should be
add goslawski/mls2_<family>_v_<version>
for a newly added lattice. - The commit summary should be
update goslawski/mls2_<family>_v_<version>
in case a lattice file is updated.
- The commit summary should be
- Push your branch and create a pull request.
- All pull request must be reviewed by someone else before merged.
- All pull request must be squash merged.
Meta information on the lattices is listed in the info.toml
file. If you add a new lattice to this repo don't forget to add an entry to this file:
# example entry
[[lattices]]
namespace = "goslawski"
name = "mls2_scaled-from-bessy2_v_1"
machine = "mls2"
title = "mls2 based on bessy2"
authors = ["Goslawski", "Max Mustermann"]
energy = 1200
simulations = ["apace", "elegant", "madx"]
labels = []
description = """
A possible design lattice for the MLS2 based on a scaled down version of BESSY 2
"""
Most of the attributes should be self-explanatory. A list of available labels is listed below:
📝 TODO@michael: add list of useful labels
To leverage multiple simulation tools we have to convert lattice files into different formats. As these lattice file formats can contain tool-specific elements/attributes (and somethings are turing-complete scripting languages), a 1:1 translation between the different lattice file formats is not always possible.
We agree on a restricted set of generic elements, which should be available in every simulation software and define a 1:1 mapping between these generic elements and the different lattice file formats. We should also avoid simulation-specific attributes (e.g. nkicks
), which should be included in the run files. Control-flow like if
statements or for
loops are also not allowed. Only basic variable assigned and basic sequence manipulation (reflection and repetition) is permissiable. A detailed specification of allowed elements/attributes can be found below.
Generic Element | MAD-X | elegant | TRACY | OPA |
---|---|---|---|---|
Drift | drift | drif | ||
Dipole | sbend | csbend | ||
Quadrupole | quadrupole | kquad | ||
Sextupole | sextupole | ksext | ||
Octupole | octupole | koct | ||
Cavity | rfcavity | rfca |
Generic Attribute | MAD-X | elegant | elegant | TRACY | OPA | description |
---|---|---|---|---|---|---|
length | l | l | length | |||
angle | angle | angle | deflection angle | |||
e1 | e1 | e1 | entrance angle | |||
e2 | e2 | e2 | exit angle | |||
k1 | k1 | k1 | geometric quadrupole strength |
Generic Element | MAD-X | elegant | TRACY | OPA |
---|---|---|---|---|
Drift | drift | drif | ||
Dipole | sbend | csbend | ||
Quadrupole | quadrupole | kquad | ||
Sextupole | sextupole | ksext | ||
Octupole | octupole | koct | ||
Cavity | rfcavity | rfca |
Generic Attribute | MAD-X | elegant | TRACY | OPA | description |
---|---|---|---|---|---|
length | l | l | length | ||
angle | angle | angle | deflection angle | ||
e1 | e1 | e1 | entrance angle | ||
e2 | e2 | e2 | exit angle | ||
k1 | k1 | k1 | geometric quadrupole strength |
Generic Attribute | MAD-X | elegant | TRACY | OPA | description |
---|---|---|---|---|---|
length | l | l | length | ||
k1 | k1 | k1 | geometric quadrupole strength |
Generic Attribute | MAD-X | elegant | TRACY | OPA | description |
---|---|---|---|---|---|
length | l | l | length | ||
k2 | k2 | k2 | geometric sextupole strength |
Generic Attribute | MAD-X | elegant | TRACY | OPA | description |
---|---|---|---|---|---|
length | l | l | length | ||
k3 | k2 | k3 | geometric octupole strength |
Information like the energy, periodicity, number of bends per cell and other details (e.g. longitudinal gradients bend) which characterize a lattice will be included in the info.toml
file, so it is not necessary that they are present in the filename.
As we want to distribute the lattice files over the web we have restrict us to the unreserved URL characters A-Za-z0-9.~-_
.
The naming schema of a lattice file is given by:
<namespace> / <machine>_<familiy>_v_<version>
A name is built up out of different <identifiers>
which are separated by a _
. Allowed characters within an <identifier>
are therefore A-Za-z0-9.~-
.
⚠️ Note that_
is not allowed!
<namespace>
is a subfolder, which prevents naming conflicts in case people come up with the same lattice file name. All contributors of lattice-summaries repo will have their own namespace and have to make sure that all<family>
names are unique within their namespace. Note that the<namespace>
can be different from the author(s) of a lattice. The actual author(s) of a lattice are listed ininfo.toml
file and are also included as comment at the top of automatically generated lattice files. I decided it this way, because we may want to include lattices from other facilities. If Paul would upload the SLS2 lattice, the name would be something likegoslawski / sls2_design_v_std-user
even though Paul is not the author of the SLS2 lattice. The same would be true for a LOCO-measured BESSY II lattice file. In case a lattice<family>
is maintained by multiple people an acronym likegaa
forGoslawski
,Abo-Bakr
andAndreas
would also be fine.<machine>
Name of the machine (e.g.bessy2
,bessy3
,mls
,mls2
)<familiy>
The goal of a<family>
identifier is to make different versions of a lattice easier to compare on the lattice-summaries website. The name of the lattice family must be unique within YOUR<namespace>
. Lattices within a family should belong logically together. For example Paul created several MLS2 lattices based on a scaled down version of BESSY II. In this case the family name should be something likescaled-bessy2
. As during the B3 development presumably many lattices will be called5ba-20p
, you could also choose a more memorable name likejupiter
,bravo
orfalcon
, which will make it easy to refer to a specific lattice during discussions.<version>
The version name uniquely identifies a lattice within a<family>
. It can be a simple number like1
or2
or a more descriptive name likestd-user
,low-alpha
orreference
. To please Paul it is also possible to use something like1200mev-8p-2ba-new-wp-x909125-y909125
.
Even there are no technical limitation, I would recommend to stick with lowercase characters and avoid using the ~
and .
characters. This will make it easier on the command line and also provides some consistency. There recommended character to use are therefore a-z0-9-
.
kuske/bessy3_5ba-20p_v_reference
kuske/bessy3_5ba-20p_v_long-bend-tgrb
abo-bakr/bessy3_jupiter_v_2
goslawski/mls2_scaled-bessy2_v_100m-1200mev-8p-2ba-new-wp-x909125-y909125
mertens/bessy2_loco_v_std-user-2020-08-10
andreas/bessy2_q5t2-off_v_4