MAD/X/NG/PTC and Xsuite
10/12/2021 LNO meeting on MAD/X/NG/PTC and Xsuite
News : the IPAC paper deadline for CERN is now : abstracts should be on CERNBOX.
The main subject of this meeting was the status and planning of software, joined by experts from other sections
(Giovanni Iadarola, Andrea Latina, Frank Schmidt).
Latest plan for MAD-X, Tobias Persson, slides
---------------------------------------------
Tobias describes the many changes that are included in the coming new MAD-X version 5.08.00, planned to be released very soon. This includes the wire implementation, optional exact drift using the actual rather than ideal orbit, updated tapering, bug fixes and use of a unified atomic mass AMASS. Spin from PTC can be used for tests and is not yet generally advertised. A more recent PTC version (from October) is included.
Tobias, who will change group (from ABP to OP on 1. of January) said the new version could still be released this year.
Giovanni Iadarola says this would impact CPyMad and could break the Xcode interface to MAD-X.
In the following discussion, it was decided to basically freeze the new MAD-X release just before the holiday period and provid it for testing, but only make it the new default production version early next year.
Tobias also lists the many existing proposals and requests for further MAD-X changes and upgrades, with priorities ranging from low to high. Rogelio says the priority to include fringes (bend, quad) should be increased : this is important for FCC and currently a main candidate for differences observed between MAD-X and SAD. Laurent will look into the unification of fringe fields in MAD-X/PTC for TWISS and tracking and Rogelio would like that the efforts start with a modification of the documentation and proposes a discussion on this with a presentation by Laurent for early 2022. Other planned FCC-ee motivated MAD-X upgrades include Beamstrahlung, solenoids and overlapping elements with slicing. It is also planned to improve the combined function magnets based on the work of Malte, motivated by the PS (with lower priority).
MAD-NG Normal Form, Laurent Deniau. slides
------------------------------------------
Laurent discusses the normal form algorithms and output in MAD-NG, in continuation of his earlier presentations.
He shows numerical values for resonance driving terms (RDT) for two test cases. The first test case provided by Piotr compares with PTC and analytical results from Andrea Franchi, as described in https://arxiv.org/abs/1402.1461 and gives consistent results.
The second test case, based on a proposal by Rogelio of a test lattice with strong non-linear octupolar and dodecapolar components, is more tricky. Some differences between MAD-NG and PTC are currently observed. A factor of -2 seen in comparisons is likely the result of different conventions used. Some numerical instabilities have also been observed. Eigenvector/eigenvalue calculations in PTC are still based on EISPACK from 1971, superseded by LAPACK that is used in MAD-NG. Some of the discrepancies could be attributed to PTC lack of accuracy.
As a next step, a comparison with amplitude detuning determined by tracking is planned.
Status of space charge and CFM, Frank Schmidt
---------------------------------------------
Frank Schmidt presents the status of space charge and combined function magnets (CFM) as relevant for MAD-X/PTC.
Frank shows the history of the space charge model implementation in MAD-X/PTC. The model has already been available for several years and should be at present in a rather mature state. Good results were obtained for the modeling of the PS emittance increase and halo generation verified by machine studies. The model incorporates various techniques including subroutines for SODD ( Second Order Detuning and Distortion ) and adaptive intensity and sigma calculations. Frank says the documentation of the space charge module is written and will be made generally available very soon. Some substantial work is still needed for the final release of space charge in MADX. Andrea Latina volunteers to help Frank but expects a strong contribution from Frank. Rogelio clarifies that the priority on Andrea's MADX tasks would be on identifying the bug in the radiation of the tilted solenoid.
Modeling of combined function magnets has been studied in detail by Malte Tietze, who proposed models with different complexity. Frank proposes to use the model 3 employing first order symplectic slice maps. The improved modeling is important to better reproduce the chromaticity of the combined function PS.
Xsuite, Xdep status, extra lattice input in MAD-X/python and MAD-X goals, Riccardo de Maria
-----------------------------------------------------------------------------------------
Riccardo said he was asked by Rogelio to report about the plans and status of four topics: 1) Xsuite, 2) Xdep, 3) extra lattice input and 4) MAD-X goals. Since the meeting was already running late it was decided to move the topic of extra lattice input to another meeting early in 2022.
Concerning the first topic, Riccardo reported that Xsuite was written together with Giovanni Iadarola and that it works already well for the LHC and injectors. Work for the FCC-ee is in progress in collaboration with Andrea Latina for radiation benchmarked with PLACET. A sequence manager is being integrated in Xsuite and works with xtrack, pyAT and MAD-X lattices and is being extended to also process SAD and BMAD input.
For the second topic, Riccardo describes the dedicated python module Xdep that has been written to deal with MAD-X deferred expressions on the Python level. The critical issue at the moment is the time it takes for Python to load all the deferred expressions, in particular from cpymad, but there is zero overhead during simulations, differently from MAD-X and MAD-NG. Also a good fraction of expressions are not actually relevant for the simulations and could be skipped. Laurent comments that in MAD-NG this is much faster in loading expressions as it benefits from just-in-time compilation available in LUAJIT. Improvements on the python side should be explored.
Concerning MAD-X goals, Riccardo reminds that MAD-X will not only be maintained but also further developed as needed for the foreseeable future, both on a code and documentation level. Riccardo takes over the main MAD-X responsibilities from Tobias (who will continue as collaborator). MAD-X will continue to be managed as collaborative effort. Module testing relies on the module keepers. Future plans were already discussed in the presentation today by Tobias. Not all proposals and modules have the same priority. MAD-X plotting for example has just been kept alive over the last 10 years and not been further developed and could become obsolete in future (depending on interest and support).