Skip to main content

Slipstream

Native accelerator beam-dynamics and tracking tools built on PyTorch.

Slipstream provides native ring, linac, and injector tracking. It reads elegant .lte lattice files and ASTRA input/distribution files directly; it does not launch elegant or ASTRA.

Installation

Requires Python 3.10 or newer. The default install can run on CPU; no GPU, compiler, elegant or ASTRA executable is needed for a first run:

python -m pip install slipstream-accel

From a checkout, install the package for local development with:

python -m pip install -e .

requirements.txt is the CUDA-oriented development setup, including Warp and pytest. See getting started for virtual environments and common installation problems.

Optional SDDS support is available with:

python -m pip install "slipstream-accel[sdds]"

Quick start

The Python import name is slipstream. This complete example generates its own bunch and runs on CPU:

from slipstream import BeamlineStudy, ElementSpec

study = BeamlineStudy(
    [ElementSpec("D", "drift", length=1.0)], energy_eV=100e6, device="cpu", always_change_p0=False,
)
particles = study.generate_bunch(
    n=1024, beta_x0=2.0, alpha_x0=0.0, epsx_m=1e-8,
    beta_y0=2.0, alpha_y0=0.0, epsy_m=1e-8,
    sigma_tau_m=1e-4, sigma_delta=1e-3, seed=42,
)
result = study.track(particles)
print(result.particles_out.shape)  # (1024, 6)
print(result.energy_eV_out / 1e6)  # 100.0 MeV total energy

Particle states use the canonical (x, px, y, py, tau, delta) layout; tau is in metres and energies include rest energy. generate_bunch() returns canonical momenta ready for tracking. See docs/tracking_native.md for ring, linac, and injector usage, and docs/formats.md for supported input formats.

Run a complete synthetic beamline study from a portable YAML configuration:

python -m slipstream.beamline_cli examples/beamline/study.yaml -o result.h5

See beamline studies for generated, HDF5, SDDS, and native ASTRA sources. Change settings without editing YAML, for example:

python -m slipstream.beamline_cli docs/examples/csr.yaml --set tracker.csr_transient=true --set tracker.csr_drift_model=retarded

The model settings guide explains CSR choices and other switches. The examples index lists runnable starting points. The documentation index links physics explanations, usage guides and the reference for every module.

For frozen-energy ring maps, normal modes, loss locations, and spectral analysis, see docs/nonlinear_dynamics.md. RF-on dynamic aperture, frequency maps, and sampled momentum acceptance are documented in docs/ring6d.md.

Compilation and CUDA

Start with eager CPU tracking, as above. When enabling torch.compile, see compilation.md for toolchains, caches and optional Warp acceleration. On Windows, set $env:CXX = "clang-cl" in PowerShell before starting Python; clang-cl and the Windows SDK must be available.

For the CUDA-accelerated backend, install the cuda extra and select the CUDA 13.2 PyTorch index. The extra adds NVIDIA Warp; if Warp is unavailable, Slipstream falls back to its PyTorch implementation:

python -m pip install \
  --index-url https://download.pytorch.org/whl/cu132 \
  --extra-index-url https://pypi.org/simple \
  "slipstream-accel[cuda]"

Scope

For opt-in photocathode/injector intrabeam scattering, see local binary collisions. InjectorIBSSettings configures the collision cells, angular model, cutoff and seed independently of storage-ring IBS growth-rate models.

  • NativeTracker models ring transport and turn-by-turn effects.
  • LinacTracker models one-pass element-by-element transport.
  • Injector models ASTRA-style gun, cavity, solenoid, space-charge, and aperture transport. An optional Photocathode derives its emission from laser energy, quantum efficiency (with the Schottky effect) and the space-charge-limited surface field.
  • warp-lang accelerates supported CUDA paths; it is not required for CPU execution.

Ring reference tables and plots are described in docs/ring_outputs.md. Install the optional slipstream-accel[plot] extra to render the figures.

Metadata

Release files for slipstream-accel 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slipstream-accel 1.1.0
File Size Uploaded Provenance Actions
slipstream_accel-1.1.0.tar.gz 536.1 kB Without provenance Details for slipstream_accel-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for slipstream-accel 1.1.0
File Interpreter ABI Platform Actions
slipstream_accel-1.1.0-py3-none-any.whl Python 3 none any Details for slipstream_accel-1.1.0-py3-none-any.whl

Total release size: 789.3 kB

Release files / slipstream_accel-1.1.0.tar.gz

Download URL slipstream_accel-1.1.0.tar.gz
Size 536.1 kB
Tags Source
SHA-256 checksum
How to use checksums
985ef021c7b56ac03796c9a72e684b061fe375d6fa23fdfd966e3fe020db036d
BLAKE2b-256 checksum
How to use checksums
f30cbdea146bb61fe6e532480ea927542c2f7ac0d2331ae4e92a021f5dee0f6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / slipstream_accel-1.1.0-py3-none-any.whl

Download URL slipstream_accel-1.1.0-py3-none-any.whl
Size 253.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7394d7416db636d2011e3daf093596b53d5d5f6e05b2e34acb408276ae652847
BLAKE2b-256 checksum
How to use checksums
52ca212b88384fe01ff0c580eddd7216853a95e5c9c692a153670ddaa112574f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for slipstream-accel 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page