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 fnal booster input files #408

Open
wants to merge 49 commits into
base: development
Choose a base branch
from

Conversation

cemitch99
Copy link
Member

@cemitch99 cemitch99 commented Jul 31, 2023

Added MAD-X + SXF input files for a reduced thin-multipole model of the Fermilab Booster lattice for space charge studies in ImpactX. For this simplified example, space charge is turned off. A follow-up PR will include the corresponding example with space charge turned on.

Contains a placeholder draft of a script for parsing the SXF input file (testparse.py), to be developed.

  • Develop Python script for parsing MAD-X + SXF input file.
  • Modify the above Python script to run ImpactX.
  • Add parsing of thin dipoles as a special case of multipole m = 0.
  • Add "tilt" parameter to Python element specifications where needed.
  • Add basic test of execution.
  • Double-check all element input definitions.
  • Benchmark Twiss functions, tunes, etc.
  • Update docs.
  • Upload fermi-booster-madx-sxf_corr_new (1.4MB text) to Zenodo
  • Set up CI to download Zenodo data on the fly (as in ML example)

Complete data located on Zenodo: https://doi.org/10.5281/zenodo.11645618

cemitch99 and others added 5 commits July 31, 2023 10:23
- Modified the initial beam size in the IOTA lens benchmark example.
- Added 2 benchmarks of 3D space charge for initial testing.
- Add documentation for 2 benchmarks with space charge.
- Add a benchmark example with space charge and periodic s-dependent focusing.
- Added an s-dependent example using a Kurth beam without space charge.
- Modified tolerance for IOTA lens benchmark example.
  Reduced tolerance to account for smaller initial beam size and
  improved preservation of invariants of motion.
- Modified tolerances of space charge examples to allow CI tests to
  pass when space charge is not active.

- Modified tolerance for space charge examples.
  These should fail unless space charge is turned on.
Selected numerical values for amr.n_cell, lattice.nslice, and geometry.prob_relative.
This is not part of this PR.
@cemitch99 cemitch99 requested review from ax3l and qianglbl July 31, 2023 17:52
examples/fnal_booster/testparse.py Fixed Show resolved Hide resolved
@ax3l ax3l added component: elements Elements/external fields component: tests examples, tests and benchmarks and removed component: elements Elements/external fields labels Aug 1, 2023
ax3l and others added 2 commits August 3, 2023 12:56
Parse all elements.

Co-authored-by: Chad Mitchell <[email protected]>
# Basic function for parsing a single element


def parse_one_group(element, key):

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note test

Mixing implicit and explicit returns may indicate an error as implicit returns always return None.
if match:
return match.group(key).strip()
else:
None

Check notice

Code scanning / CodeQL

Statement has no effect Note test

This statement has no effect.
examples/fnal_booster/fnal_booster.py Fixed Show fixed Hide fixed
examples/fnal_booster/fnal_booster.py Fixed Show fixed Hide fixed
examples/fnal_booster/fnal_booster.py Fixed Show fixed Hide fixed
@cemitch99
Copy link
Member Author

There are a large number of MAD-X files here that are not used by ImpactX. Here, we use only the SXF file. I am tempted to delete these for clarity, and keep them on the Google Drive for later use by us if needed.

cemitch99 and others added 11 commits February 20, 2024 19:23
Correct ThinDipole bend angle to reflect input degrees.
Correct index of multipole coefficients (+1).
Modify ThinDipole and DipEdge parameters to set unknown parameters to reasonable default values.
Modified initial beam moments to match 1) emittance in MADX initial input line & 2) sigx, sigy from initial space charge element in SXF input.
Modified filenames for input and SXF files in CMakeLists.txt
Deleted obsolete version of input file.
# Basic function for parsing a single element


def parse_one_group(element, key):

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error as implicit returns always return None.
if match:
return match.group(key).strip()
else:
None

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tests examples, tests and benchmarks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants