accelmo

accelmo estimates accelerator magnet errors (strengths, misalignments and tilts) from beam measurements by gradient-based optimisation of MAD-NG models. Supported machines are the LHC, PSB, SPS and FCC.

Two families of fit are provided:

Fit

Data

Entry points

Tracking

Turn-by-turn BPM data tracked through the model

ArcByArcFitter, ACDMarkerFitter, KickerFitter

Closed orbit

Closed orbit and phase advance, at one or more machine states

ClosedOrbitFitter, CalibratedClosedOrbitFitter

Closed twiss

Closed orbit, phase advance, beta and dispersion

ClosedOrbitFitter with closed_twiss_series()

All fitters return a FitResult.

Installation

Python 3.11 or later is required.

git clone https://github.com/jgray-19/accelmo.git
cd accelmo
uv sync --extra test --extra docs --extra tracking

Optional dependency groups:

Extra

Contents

tracking

omc3, cpymad, pyarrow, psutil (required by the tracking workflows)

monitor

Panel, for the live fit monitor (python -m accelmo.monitor)

test

pytest, pytest-cov, pytest-xdist

docs

Sphinx and theme

dev

ruff, pre-commit

Build this documentation with:

uv sync --extra docs
cd docs && make html

Companion packages

Package

Purpose

pymadng-utils

Shared accelerator abstractions, dp/p and pt conversion (pymadng_utils.physics), knob-file I/O.

xtrack_tools

Tracking helpers and dataframe conversion, used by the tests.

pymadng-utils is a normal dependency. xtrack_tools is pinned in the dev dependency group, so uv sync installs both.

The measurement and campaign workflows built on this package are maintained in separate repositories (lhc_measurements, psb_md, psb_loco, lhc_loco and fcc_loco) and are not documented here.