Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyCauset Logo PyCauset Text



Documentation PyPI version License: MIT

A High-Performance Toolset for Causal Set Theory in Python.

Causal set theory is a discrete proposal for quantum gravity. PyCauset is a low-compromise numerical tool for causal sets ("causets"), built from the ground up to be fast, flexible, and easy to use.

PyCauset is made of two main components:

  • The PyCauset Engine is built to be NumPy for causal sets. If you know NumPy, you already know the engine: the same shapes, dtypes, operators, and conventions, backed by a C++ core for speed. It is specifically made for causal sets: bit-packed causal matrices, metadata that lets the math skip unnecessary work, storage that spills to disk when RAM runs out, and CPU dispatch handled behind the scenes.

  • The PyCauset Physics Tool Suite is an extensive collection of tools for working with causal sets: a library of spacetimes, sprinkling routines, field-theoretic machinery and visualizations.

Read the documentation.

Quick start

Sprinkle a causal set into a 2D Minkowski diamond:

import pycauset as pc
from pycauset.vis import plot_embedding

c = pc.CausalSet(n=3000, seed=42)   # 3000 points in a 2D diamond (default geometry)

fig = plot_embedding(c)             # interactive Plotly figure
fig.show()
3000 points in a 2D Minkowski diamond

Define a field and compute a propagator:

from pycauset.field import ScalarField

field = ScalarField(c, mass=1.5)    # a massive scalar field on the same causet
K = field.propagator()              # retarded propagator K_R = aC(I - baC)^-1

Or use the engine on its own:

A = pc.causal_matrix(10000, populate=True)
B = pc.causal_matrix(10000, populate=True)
Paths = pc.dot(A, B)                       # alternatively, use `A @ B` 

M = pc.zeros((2000, 2000), dtype=pc.float32)
M_inv = M.invert()                          # inversion

Features

Numerical Engine

PyCauset has an optimized C++ core with Python bindings, which is built specifically for work with causal sets:

  • Work with matrices bigger than your RAM. Large matrices stream to disk and back, so the only limit to computation is your storage and time.
  • It speaks NumPy. Same shapes, dtypes, operators, and conventions. It is also compatible with NumPy arrays, so you can mix and match.
  • Bit-wise causal relations. The causal matrix elements are individual bits, which allows for 8x more efficient storage than a byte-based representation.
  • CPU (and soon GPU) optimized. It just works.
  • Storage and precision, handled. Memory, precision, and hardware are automatically chosen.

Physics Tool Suite

  • Spacetimes: Minkowski diamond, cylinder, box. Arbitrary dimensions, signatures, and curved geometries (de Sitter, anti-de Sitter, FLRW) are on the R2 roadmap.
  • Sprinkling: fixed-N or Poisson density, seeded and reproducible.
  • Fields: scalar fields with propagator and Pauli-Jordan functions.
  • Visualization: interactive 2D/3D embeddings and Hasse diagrams.

Performance

PyCauset's dense kernels use the same OpenBLAS/LAPACK backend as NumPy, so the goal is parity rather than a large speedup, with a goal of all PyCauset operations being at least 0.90x the speed of NumPy for in-memory operations, (see BENCHMARKS.md). However, the biggest reason to use PyCauset is that it memory-maps past RAM, where NumPy raises MemoryError.

Both images come straight from the public API. Reproduce them with scripts/make_r1_gallery.py.

Hasse diagram of an 80-point diamond *The causal links of an 80-point diamond (Hasse diagram).* 3000 points on a Minkowski cylinder *3000 points sprinkled onto a Minkowski cylinder, rendered as a 3D tube.*

Installation

pip install pycauset

Pre-compiled wheels for Windows, macOS, and Linux. From source:

git clone https://github.com/BrorH/pycauset.git
cd pycauset
pip install .

GPU acceleration (optional)

The default install is CPU-only. To add GPU support:

pip install "pycauset[gpu]"

This also downloads the CUDA runtime, about 500 MB. It needs an NVIDIA GPU with Compute Capability 6.0 or newer, on Linux or Windows. macOS is not supported.

If you have an NVIDIA GPU but are on the CPU-only build, the first import pycauset prints a short note with the install command. Set PYCAUSET_GPU_HINT=0 to silence it.

Status

Pre-alpha. Release 1 (v0.6.1, the Foundation Release) shipped the numerical core, matrices, storage, and linear algebra, CPU-only (GPU parity is deferred). Release 2 (the Physics Release) adds the physics suite, arbitrary-dimension and curved spacetimes, fields, and the Sorkin-Johnston vacuum, and folds in the deferred optimization program. The current plan is tracked in the documentation.

Documentation

Guides, API reference, and the roadmap: brorh.github.io/pycauset

License

MIT. If you use PyCauset in your research, please cite the repository.

Questions and ideas: bror dot hjemgaard at gmail dot com

This repository contains AI-generated code.

Metadata

Release files for pycauset 0.6.2.dev54

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

Built distribution (wheel)

Table of built distributions (wheels) for pycauset 0.6.2.dev54
File Interpreter ABI Platform Actions
pycauset-0.6.2.dev54-cp310-cp310-macosx_15_0_arm64.whl CPython 3.10 CPython 3.10 macOS 15.0+ ARM64 Details for pycauset-0.6.2.dev54-cp310-cp310-macosx_15_0_arm64.whl

Release files / pycauset-0.6.2.dev54-cp310-cp310-macosx_15_0_arm64.whl

Download URL pycauset-0.6.2.dev54-cp310-cp310-macosx_15_0_arm64.whl
Size 9.8 MB
Tags CPython 3.10 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
bcc11051c4b2f773c27cbc62088fb8ca8237f015853e9b056267cdb620004192
BLAKE2b-256 checksum
How to use checksums
a093afd13f81b4e00a82f89b2ed0f5ca5e14c57482ef5533329d724846ea78cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 30, 2026.

Transparency log

Security for pycauset 0.6.2.dev54

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

1 file in this release has been uploaded with provenance metadata.

Attestation for pycauset-0.6.2.dev54-cp310-cp310-macosx_15_0_arm64.whl

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 Aug 30, 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.

Release history Release notifications | RSS feed

This release
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