Skip to main content

Real-Time GPU Particle Physics Simulation with PDG-accurate particle catalog

Project description

Real-Time GPU Particle Physics Simulation with PDG-accurate particle catalog. 40 observable particles, real masses, lifetimes, decay channels, and proper relativistic kinematics.

Quantum Collider Sandbox screenshot

Quick Start

Clone and run in four steps:

git clone https://github.com/ml3m/quantum-collider-sandbox.git
cd quantum-collider-sandbox
python -m venv .venv && source .venv/bin/activate   # Linux/macOS
make install && make run

On Windows, activate with .venv\Scripts\activate instead.

Requirements

System

  • Python 3.10 to 3.12 (3.12.2 recommended)

  • GPU with Vulkan support (NVIDIA, AMD, Intel)

  • Vulkan drivers installed and working

Python dependencies (installed via make install):

  • numpy ≥ 1.24

  • scipy ≥ 1.10

  • taichi ≥ 1.7.0

  • h5py ≥ 3.8

Installation

  1. Clone the repository

    git clone https://github.com/ml3m/quantum-collider-sandbox.git
    cd quantum-collider-sandbox
  2. Create and activate a virtual environment (recommended)

    python -m venv .venv
    source .venv/bin/activate          # Linux / macOS
    # .venv\Scripts\activate           # Windows
  3. Install the package in editable mode with dev tools

    make install

    Or manually:

    pip install -e ".[dev]"
  4. Run the simulation

    make run

Makefile Targets

Target

Description

run

Start the particle physics simulation

install

Install package in editable mode with dev dependencies

lint

Run pylint on the source code

test

Run pytest test suite

test-cov

Run pytest with coverage report

format-check

Check code formatting (ruff + black)

format

Auto-fix formatting (ruff + black)

Command-Line Usage

make run                              # Default demo
python -m quantum_collider_sandbox --particles 100    # Start with N random particles
python -m quantum_collider_sandbox --data event.h5    # Load from HDF5 file
python -m quantum_collider_sandbox --log-physics      # Log physics to data/logs/

Keyboard Controls

Key

Action

SPACE

Pause / Resume

R

Reset to selected preset (or default if none selected)

C

Spawn proton–antiproton collision

T

Toggle trails

F

Toggle collision flashes

Y

Toggle photon visibility

E

Export state and time series to HDF5

B

Toggle black hole

G

Toggle particle gun

TAB

Cycle inspector to next particle

P

Pin / freeze selected particle

1–9, 0

Presets (1=Default, 2=Rutherford, 3=Cyclotron, …, 0=N-body)

RMB

Orbit camera (drag)

Scroll

Zoom

ESC

Quit

Vulkan / GPU Troubleshooting

The simulation uses Taichi with the Vulkan backend. If you see Vulkan-related errors:

  • NVIDIA: Install the latest proprietary drivers; Vulkan is usually included.

  • AMD: Use Mesa (Linux) or AMD Adrenalin (Windows) with Vulkan support.

  • Intel: Ensure Mesa or Intel drivers with Vulkan are installed.

Verify Vulkan with:

vulkaninfo

If Vulkan is unavailable, use the QUANTUM_COLLIDER_ARCH environment variable:

QUANTUM_COLLIDER_ARCH=cpu python -m quantum_collider_sandbox   # CPU fallback
QUANTUM_COLLIDER_ARCH=gpu python -m quantum_collider_sandbox    # Auto-detect GPU

Supported values: vulkan (default), cuda, cpu, gpu.

License

MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantum_collider_sandbox-1.0.4.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quantum_collider_sandbox-1.0.4-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file quantum_collider_sandbox-1.0.4.tar.gz.

File metadata

  • Download URL: quantum_collider_sandbox-1.0.4.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quantum_collider_sandbox-1.0.4.tar.gz
Algorithm Hash digest
SHA256 2a17996c8d64b38f04913e98bd7534066536ed1f4ebac86e1cde6f892927168b
MD5 14060a8194a9a05e091c18925a4fd3aa
BLAKE2b-256 fab6441659ddd725f67a7808352281f3d326b70a274c1d70ceb8286bc9b1ee7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantum_collider_sandbox-1.0.4.tar.gz:

Publisher: python-publish.yml on ml3m/quantum-collider-sandbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantum_collider_sandbox-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for quantum_collider_sandbox-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a63516b472f134e1c718deaf3f4c52246241b38bcedbd4a55744f209ed1cd569
MD5 4419a913cef22fc564b4fb8f7666b72b
BLAKE2b-256 20528c6070daa0f15a1f1c2c845e632240ea41207ab44aa383680ed6f6770770

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantum_collider_sandbox-1.0.4-py3-none-any.whl:

Publisher: python-publish.yml on ml3m/quantum-collider-sandbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page