Introduction to Xsuite
Giovanni Iadarola
- Xsuite begun at the beginning of 2021
Motivation
- There were many independently developed multi-particle tracking softwares with different features
- The learning curves are long and specific
- Difficult to define a consistent strategy with future challenges - such as FCC, muon collider
- Opted to start with a new design considering all requirements
- No need to start from scratch - reuse experience and sometimes source code
Requirements
- Sustainable
- The community is relatively small
- Need something easy to maintain and develop
- Favoured mainstream technology: python
- Keep the code simple and slim: student friendly
- Easy and flexible to use: scriptable
- Speed matters
- Maintain performance with sixtrack on CPU and sixtracklib on GPU
- Provide GPU interface
Structure
- A set of python packages
- Already used in BE-ABP
- Newcomers are often aware of python, a short learning curve
- Python is easily extended with C, C++, and FORTRAN
- Support GPUs, as some simulations can only be done on GPUs
- Complicated market situation
- Multiplatform code: support multiple vendors
- New standards are already expected
- Open source GPU packages leveraged
Development
- Demonstrated a short learning curve
- Already used in production for some studies
- Users encouraged to contribute with code, tests, documentation etc
Collective Effects
- Xsuite can handle collective elements - impedance, space-charge etc
- The code is aware of these elements, where the action on one particle depends on the coordinates on the other
- No special action required by the user - the code automatically handles asynchronicity
Interface
- Built to be as extensible as possible
- Any element that has a tracking method is a valid element for Xtrack
- In particular, PyHEADTAIL elements are valid - but currently need a compatibility mode
Comparison and Advanced Features
- Extremely small errors when checking against SixTrack (machine precision)
- Similar compilation time to SixTrack
- Already used in Dynamic Aperture studies (with a fully pythonic approach)
- Use of ML for smart sampling of phase space
- Feedback: Xsuite was fundamental for these projects
How it works
- Searches 6D closed orbit
- First order turn matrix
- Eigenvector tracking of particles
- Compute twiss parameters from eigenvalues (bonus)
- Repeat off-momentum for chromaticity
- Tested for HL-LHC, PSB, ELENA, Elettra, CLIC-DR, FCC-ee
Xdeps
- Deferred expressions from MAD-X
- Knobs imported from MAD-X can be easily changed before the simulation or during the simulation
- Variables can also be inspected - very powerful
Synchrotron Radiation
- Not available in SixTrack
- Full quantum description
- Xtrack twiss computes energy loss
Xcoll
- Installs collimators in Xsuite beamlines
- Configures the gaps based on user configuratoin
- Different particle-matter simulation engines
- K2 ported from sixtrack
- Geant4-BDSIM tested in full loss-map studies
- FLUKA
- More modules for precisely locating particle loss
- still not implemented
Experience
- Modular code is feasible
- Different computing platforms can be supported under the same codebase
- Gently moving towards production
Questions
- Pulling in geometry from CAD files is not currently available
- This can be done with FLUKA
- Does the code interface or link with many existing libraries?
- Single particle: ported from SixTrackLib directly
- Space charge: written from scratch, but inspired by PyHEADTAIL
- Collected effects: interface with PyHEADTAIL
- Elements: thintracking, so in the end everything is a multipole
- Sequences can be imported from MAD-X
- It is imported from cpymad sequence object
- Any disadvantages with MAD-X?
- MAD-X is limited with space charge
- No real disadvantages
- MAD-X might take longer to import files
- Do the import once, and export
- MAD-X imports - do deferred expressions impact performance
- We do pull, not push
- The deferred expressions are not read every time, they are requested
- They do not impact performance during tracking
- What does the ‘X’ stand for?
- PyOrbit - what are the prospects of using it? Is it being phased out?
- Trying to phase applications out of pyOrbit
- Investment has been made into Xtrack
- Can the variations of components be saved in Xdeps
- The idea is that things can be changed with complex rules while the simulation is running
- Xtrack does not use the same API as MAD-X, but in principle they are equivalent in capabilities
- How are you handling support?
- Documentation
- GitHub issues, classified as blocking or feature requests
- Might be nice to have a tutorial for the next workshop?