Skip to main content

PASS

English | 中文

PASS (Particle Accelerator Simulation Studio) is a Python program for six-dimensional particle tracking and beam-dynamics analysis. It supports element-based and Twiss-map transport, injection, RF systems, space charge, wakefields, and beam diagnostics, with CPU and optional NVIDIA GPU execution.

User manual · Examples · Releases · Issues

Install

Use Python 3.11 or newer. The default installation includes CPU computation and the GUI. The cpu extra explicitly selects the same dependencies; the gpu extra adds NVIDIA GPU support while retaining CPU and GUI functionality. All configurations install the GUI dependencies, including Qt. Command-line CPU execution does not load Qt or require a graphical display or CUDA.

Install from PyPI

Default installation (CPU + GUI):

python -m pip install pass-sim

Explicit CPU installation (also includes the GUI):

python -m pip install "pass-sim[cpu]"

GPU installation (CPU + GPU + GUI):

python -m pip install "pass-sim[gpu]"

python -m pip install "pass-sim[cpu,gpu]" is equivalent to the GPU installation. The former gui, cuda, and conversion extras are no longer provided; use the commands above.

After installation, run pass-run --version to display the installed PASS version, or pass-gui to launch the interface.

Install from GitHub

First clone the source and enter the repository:

git clone https://github.com/changmx/PASS.git
cd PASS

Alternatively, open the GitHub repository, select Code → Download ZIP, and extract it. Enter the directory containing pyproject.toml. From that directory, select one of the following configurations:

Default installation (CPU + GUI):

python -m pip install --editable .

Explicit CPU installation (also includes the GUI):

python -m pip install --editable ".[cpu]"

GPU installation (CPU + GPU + GUI):

python -m pip install --editable ".[gpu]"

python -m pip install --editable ".[cpu,gpu]" is equivalent to the GPU installation. An editable installation uses the code in this source directory directly; Python source edits take effect in subsequent runs. After installation, use pass-run --version to display the installed PASS version, or pass-gui to launch the interface.

Both installation methods also support python -m PASS --version. Run pass-run --help or pass-run -h to see input modes, options, path rules, and examples.

GPU requirements and backend selection

Installing GPU dependencies does not select the simulation backend. Choose cpu or gpu using backend (gpu/cpu) in the input configuration. GPU execution requires a compatible NVIDIA GPU, driver, and CUDA environment; the current GPU dependencies target CUDA 13.x. The GPU extra does not install an NVIDIA driver or guarantee a complete CUDA Toolkit installation. On a supported platform, GPU packages may install without a GPU, but installation success does not establish GPU availability. CPU computation and the GUI can still be used without CUDA. Explicit GPU execution fails with a diagnostic if CuPy, device discovery, or device initialization is unavailable; PASS does not silently fall back to CPU. CUDA library or kernel-compilation errors can also occur later when a particular GPU feature is first used.

Run a simulation

Example project

The examples below assume that /home/myprojpath contains a valid PASS input beam0.json and this project description:

/home/myprojpath/
├── myproject.passproj
├── beam0.json
├── quadrupole_ramp.tfs    # optional: include it if beam0.json references it
└── output/               # created when a simulation runs

myproject.passproj is an ordinary JSON text file. For a single-beam project, its contents can be:

{
  "format": "pass-project",
  "format_version": 3,
  "name": "My simulation",
  "configs": ["beam0.json"],
  "active_config": "beam0.json",
  "run": {
    "beam0": "beam0.json",
    "beam1": null,
    "output_directory": "output"
  }
}

Project-description paths are relative to /home/myprojpath. File references inside beam0.json are relative to that JSON's directory; for example, "Ramping file": "quadrupole_ramp.tfs" refers to /home/myprojpath/quadrupole_ramp.tfs. There is no required configs/ directory. Replace /home/myprojpath with your actual project path.

Command-line execution

There are three input modes: one JSON for a single beam, two JSON files for two beams, and a project selecting its saved beam inputs. A project can be specified by its .passproj file or by its directory. Command-line execution does not require the GUI or Qt.

With the example directory above, each of the following commands can be run from any working directory:

# Run beam0.json directly, using the settings in that JSON.
pass-run /home/myprojpath/beam0.json

# Run the beam selection and output settings saved in myproject.passproj.
pass-run /home/myprojpath/myproject.passproj

# Open the project description in this directory, then run its saved selection.
pass-run /home/myprojpath

For a directory argument, PASS first uses project.passproj if it exists. Otherwise, it uses the only .passproj file directly in that directory, so the example above selects myproject.passproj. If there are several .passproj files and no project.passproj, specify the intended project file explicitly. PASS does not search subdirectories.

After entering the project directory, the equivalent relative-path commands are:

cd /home/myprojpath
pass-run beam0.json
pass-run myproject.passproj
pass-run .

These are alternative commands; choose one to launch a run. Projects use run.beam0 and optional run.beam1, falling back to active_config when Beam 0 is unset. They do not run every configuration in configs. Tracking validates and archives the selected inputs and their dependencies before execution.

Named input options provide another spelling of the same commands:

pass-run --beam0 /home/myprojpath/beam0.json
pass-run --passproj /home/myprojpath/myproject.passproj
pass-run --passproj /home/myprojpath

For two-beam execution, first provide a second valid input /home/myprojpath/beam1.json. Then use either of these equivalent commands:

pass-run /home/myprojpath/beam0.json /home/myprojpath/beam1.json
pass-run --beam0 /home/myprojpath/beam0.json --beam1 /home/myprojpath/beam1.json

To run both through the project instead, add "beam1.json" to its configs list and set run.beam1 to "beam1.json", then run pass-run /home/myprojpath/myproject.passproj. A project supplies its own beam selection and cannot be combined with a second input argument. Choose positional arguments or named input options for each command; do not mix them. --beam1 requires --beam0, and --passproj cannot be combined with either beam option.

pass-run and python -m PASS are two launchers for the same execution logic, with the same arguments. Use the module form to select a particular Python environment:

python -m PASS /home/myprojpath/beam0.json
python -m PASS /home/myprojpath/myproject.passproj
python -m PASS /home/myprojpath

Relative command-line paths use the terminal's working directory. Quote paths containing spaces. Run pass-run --help or python -m PASS --help for all options.

Override JSON parameters for one run

pass-run beam0.json --backend=gpu --device-id=1 --task-name=test
pass-run beam0.json --number-of-turns=100 --timing.log-interval=20
pass-run beam0.json '--sequence[QF1_s1.000].length=0.5'

Use JSON key names with spaces replaced by hyphens and parentheses (including units) removed. Values retain the JSON units and types. Dots separate nested fields; [exact name] preserves element names containing dots. A single device ID may be an integer (--device-id=1) or an array (--device-id="[1]"); execution snapshots always store an array. Unqualified overrides target Beam 0; use --beam1.<path> for Beam 1. Shared simulation settings must still agree between beams. Task names and output directories apply to the whole run; --output-directory is equivalent to --output.

Overrides are validated before execution and saved in the execution input snapshots; source files remain unchanged. Command-line file paths are relative to the caller's working directory. Duplicate or overlapping overrides, unknown fields and invalid values are rejected. For exact paths, objects, arrays and supported scope, see the command-line input guide.

The RF injection key is now RF S Position Refer to Injection Point (m); older inputs using the abbreviated spelling must be regenerated or renamed.

Outputs and editing

For the project description above, results go under /home/myprojpath/output/<YYYY_MM_DD_HH_MM>/ by default, regardless of the directory from which you launch it. Running beam0.json directly uses its own Output directory setting; if it is omitted or set to default (case-insensitive), the output root is also /home/myprojpath/output.

Launch mode Output root Default results beneath that root
JSON through pass-run, python -m PASS, or the Python API The first JSON's Output directory, relative to that JSON's directory; if omitted or set to default (case-insensitive), use output beside that JSON <YYYY_MM_DD_HH_MM>/
Project file or directory through the command line The project's run.output_directory, or output if unset; relative paths are resolved beside the project description <YYYY_MM_DD_HH_MM>/
GUI The Run page's Output root directory, initially output; relative paths use the JSON/project directory (the working directory for an unsaved project) <YYYY_MM_DD_HH_MM>/

--output DIR overrides the output root for any input mode, only for that run. An absolute path works from any working directory:

pass-run /home/myprojpath/myproject.passproj --output /home/myprojpath/results

The result root is /home/myprojpath/results. A relative override uses the terminal's working directory, as this example makes explicit:

cd /home/myprojpath
pass-run myproject.passproj --output "results/test run"

This writes beneath /home/myprojpath/results/test run/<YYYY_MM_DD_HH_MM>/ when no custom output name is set. --output takes precedence over the JSON/project settings without changing their files. python -m PASS supports the same option.

To use a task name for the run folder instead of an automatic timestamp, set "Task name": "capture_sc" in Beam 0's JSON (MainConfig(task_name="capture_sc")), set the project's run.task_name, or edit Task name on Run. This field initially displays the actual value default; saved custom names are preserved. Output directory / output_dir continues to select the parent output root. The command-line override is:

pass-run myproject.passproj --output results --task-name capture_sc

Results then go into results/capture_sc/, preserving internal subdirectories and the existing HHMM_SS time labels in result filenames. Omitted, null, blank or default task names use a single folder at minute precision, for example output/2026_10_30_18_39/. Both automatic and custom names use unpadded collision suffixes _1, _2, _3, and so on, such as 2026_10_30_18_39_1 or capture_sc_1; default is case-insensitive after trimming whitespace, so " DEFAULT " has the same effect. There is no automatic Beam 0 filename default. run.task_name, when present, overrides the Beam 0 field; --task-name overrides both. Use a single folder name, not a path. The Python API accepts main(..., task_name="capture_sc"); an explicit empty or default override restores the single-level timestamp layout even when the saved name is custom, for example --task-name default or main(..., task_name="default").

Each normal run saves an input snapshot in its result directory's input/ subdirectory. It contains original configuration values, execution JSON, copied dependencies, and the run.json record. JSON, project, and GUI runs share these layout rules. Existing result trees are unchanged; rerunning old inputs or snapshots creates a fresh directory using the new single-level layout. See the input guide and project guide for details.

Edit myproject.passproj, beam0.json, and text dependencies with a text editor. In the GUI, use File → Reload project after external edits and before saving or running; external-change checks protect against overwriting or running stale inputs. Move or share the directory with all referenced files, because the .passproj description alone is not a complete project. Export runnable input bundle can package the selected inputs and dependencies for sharing.

Automatic plotting

Set "Is plot figure": true in the beam input to generate figures after successful tracking. Each StatMonitor history produces a nine-panel figure, each distribution snapshot a six-panel figure, and each ParticleMonitor file a twelve-panel figure using all recorded particles and valid samples. Figures are saved in the run's plot/ directory.

You can also plot an existing result directory without repeating the simulation:

python -m PASS.plot output/2026_10_30_18_39
python -m PASS.plot output/2026_10_30_18_39 --format png pdf

The default is 300 dpi PNG. Repeated plotting preserves existing figures by choosing unused filenames. See automatic plotting for layouts, units, options, and the plotting manifest.

Graphical interface

Install the gui extra, then launch with either pass-gui or python -m PASS.gui. For the example above, select File → Open project and choose /home/myprojpath/myproject.passproj, or File → Open project folder and choose /home/myprojpath. To work with just the beam input, use File → Open JSON and choose /home/myprojpath/beam0.json.

Apply parameter changes, select Validate, and start the simulation from Run. Use Plot to inspect results. See the GUI workflow and project guide.

Python workflow

The input guide covers input generation, validation, execution, and output. Example scripts are provided in the source repository. If you installed from PyPI, first download or clone the repository to obtain the examples. Then run the distribution example from the repository root:

cd example/01_generate_distribution
python generate_input.py --case longi-gaussian
pass-run --beam0 beam0_longi_gaussian.json
python analyze_results.py --case longi-gaussian

The generator writes the case input; pass-run saves results under the example's output/ directory; the analyzer uses the latest run for that case. The distribution and RF examples also provide run_simulation.py --case all helpers for running their predefined cases serially through the same CLI. See the example README for parameters, other cases, and output files.

An existing input can also be checked before execution:

python -m PASS.validation /home/myprojpath/beam0.json --report /home/myprojpath/validation-report.json

Reference

WakeField file models accept canonical wake TFS only. Convert CSV/TXT/HEADTAIL data with python -m PASS.tool.wake_conversion or Import wake… in the GUI conversion tool; the wakefield guide explains units, physical conventions and examples.

With the docs extra installed, run this command from the repository root to build both languages:

python -m sphinx -b html -W --keep-going docs/source docs/build/html

Open docs/build/html/index.html after a successful build.

Contributing

Follow AGENTS.md for physics, documentation, and formatting conventions. Install .[dev] and use YAPF 0.43.0 with pyproject.toml; embedded CUDA is checked with python PASS/tool/format_cuda.py --check from the source checkout. The tests/ directory is maintained locally and excluded from Git, so a fresh clone does not contain the test suite.

PASS is distributed under the Apache License 2.0.

Metadata

Release files for pass-sim 0.6.3

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

Source distribution (sdist)

Source distribution for pass-sim 0.6.3
File Size Uploaded Provenance Actions
pass_sim-0.6.3.tar.gz 1.3 MB With provenance Details for pass_sim-0.6.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pass-sim 0.6.3
File Interpreter ABI Platform Actions
pass_sim-0.6.3-py3-none-any.whl Python 3 none any Details for pass_sim-0.6.3-py3-none-any.whl

Total release size: 2.7 MB

Release files / pass_sim-0.6.3.tar.gz

Download URL pass_sim-0.6.3.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
4759b9e47d051ed0a1e25051c6543ce87f1a6ef3101ea7cbb92ff9acec657f1f
BLAKE2b-256 checksum
How to use checksums
36fbb92370cb6a3fce7a037bc770266448f32ec0f38b60bb88011a0aef230287
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / pass_sim-0.6.3-py3-none-any.whl

Download URL pass_sim-0.6.3-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8c77cbe7b30c6f19f0c23c4dcc829d1f77761f289c5ea9a5743bf6a8611af38f
BLAKE2b-256 checksum
How to use checksums
c7a24822418f68c71c47b30403629a42a9244fc54f2d10c87b429e3c72c2e06f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for pass-sim 0.6.3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pass_sim-0.6.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

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.

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