Registry / analytics / xsuite

xsuite

JSON →
library0.51.4pypypi✓ verified 83d ago

Xsuite is an integrated suite for particle accelerator simulations, combining tracking, beam dynamics, and analysis tools. Current version 0.51.4 (released 2025), with regular updates. Requires Python >=3.11.

pip install xsuite
INSTALL
IMPORT
SIG · XSUITE
X
xsuite
analyticspythonv0.51.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

xtrack
import xtrack
import xsuite.xtrack
xtrack is a top-level package, not a submodule of xsuite.
xpart
import xpart
from xsuite import xpart
xpart is a standalone package.
xfields
import xfields
from xsuite import xfields
xfields is its own package.

Create a simple accelerator line with a drift and track a particle for 10 turns.

import xtrack as xt import xpart as xp import xobjects as xo # Create a simple line with a drift line = xt.Line(elements=[xt.Drift(length=1.0)]) line.particle_ref = xp.Particles(mass0=xp.ELECTRON_MASS_EV, q0=1, gamma0=100) line.build_tracker() # Track one particle particles = line.particles.copy() line.track(particles, num_turns=10) print('Tracking completed.')
Debug
Known issues
breakingXsuite v0.50.0 removed the `xline` package. Use `xtrack` instead.
fix
Replace `import xline` with `import xtrack` and update API calls.
affects: >=0.50.0
gotchaDo not attempt to import top-level packages as submodules of `xsuite`. Each subpackage (xtrack, xpart, xfields, xobjects) is a separate PyPI package but shares the namespace.
fix
Use direct imports: `import xtrack`, `import xpart`, etc.
affects: all
deprecatedThe `xpart.Particles` constructor arguments `mass0` and `q0` are being deprecated in favor of `mass` and `charge`.
fix
Use `mass0=xp.ELECTRON_MASS_EV` -> `mass=xp.ELECTRON_MASS_EV`, `q0=1` -> `charge=1`.
affects: >=0.49.0
gotchaThe `build_tracker()` method must be called after setting `line.particle_ref`. Forgetting leads to cryptic errors.
fix
Always assign `line.particle_ref` before calling `line.build_tracker()`.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'xline'
xline was removed in Xsuite v0.50.0.
fix
Use `import xtrack` instead. Replace `xline.Line` with `xt.Line`.
AttributeError: module 'xsuite' has no attribute 'xtrack'
Trying to import subpackage as a submodule of xsuite.
fix
Import directly: `import xtrack` (not `from xsuite import xtrack`).
ValueError: Particle reference not set. Cannot build tracker.
`build_tracker()` called before setting `line.particle_ref`.
fix
Set `line.particle_ref = xp.Particles(...)` before calling `line.build_tracker()`.
Upgrade
Version history
0.51.4latest on PyPI · released Jun 1, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
32 hits · last 30 days
node
30
Resources

No resource links recorded.

xsuite — pip install xsuite · libregistry