Skip to main content

High-performance Causal Set matrix operations using memory-mapped files

Project description

PyCauset Logo PyCauset Text



Documentation PyPI version License: MIT

PyCauset is a high-performance Python library for Causal Set Theory.

PyCauset is NumPy for causal sets. Any programmer familiar with NumPy will automatically also know how to operate PyCauset. Like NumPy, PyCauset is backed by a strong C++ engine for efficient numerical linear algebra, while storage, hardware dispatch (CPU/GPU), and performance optimizations happen automatically behind the scenes.

PyCauset allows for handling of humongous matrices, as the module efficiently balances storage through both RAM and disk. The only limit to how large matrices you can work with is your disk storage. Example: with a 4TB external SSD, you can work with dense $N\times N$ float64 matrices of $N \sim 10^6$ (check this claim!).

Explore the Full Documentation »

Installation

From PyPI (Recommended)

pip install pycauset

We provide pre-compiled binary wheels for Windows, macOS, and Linux.

From Source

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

Development Status and Roadmap

PyCauset is currently in pre-alpha. Here is the three-step roadmap plan for the future version 1.0:

  1. (WIP) High-performance C++ backed numerical linear algebra library. First focus is to build a robust, reliable and highly efficient linear algebra module that is designed with causal sets in mind. It is to behave like NumPy
  2. (PLANNED) Physics enginge and causal sets. With a robust linear algebra system in place, we will implement efficient methods for researchers to work with causal sets. Examples include: sprinkling methods, Pauli-Jordan eigenvalues, vev and propagator calculations, visualizations. Focus is on user experience and ease of use.
  3. (PLANNED) Documentation, guides, tests and benchmarks. Create an extensive suite of documentation and guides to help people use PyCauset and show its power and potential. Also perform extensive tests and squash bugs and perform benchmarks to illustrate proficiency.

Version 1.0 will feature the above and more.

Key Features

  • Hybrid Storage Architecture: PyCauset automatically manages memory. Small matrices live in RAM for speed, while massive datasets spill seamlessly to memory-mapped disk storage (single-file .pycauset containers).
  • GPU Acceleration: Built-in NVIDIA CUDA backend for matrix multiplication, inversion, and eigenvalue problems. Includes custom kernels for accelerated bit-matrix operations.
  • Smart Precision: Automatically selects Float64 or Float32 based on matrix size and hardware capabilities to maximize throughput.
  • Physics Engines:
    • Spacetimes: Minkowski Diamond, Cylinder, and Box manifolds.
    • Fields: Scalar field propagators ($K_R$) and path integrals.
  • Visualization: Interactive 3D visualization of embeddings and causal structures using Plotly.
  • Pausing Calculations: A long-winded and tedious calculation may be paused at any time and continued later. The calculation may also be exported and continued on another machine (WIP).

Quick Start

1. Simulating Spacetime

The CausalSet class is the main entry point for physics simulations.

import pycauset as pc
from pycauset.vis import plot_embedding

# 1. Sprinkle 5000 points into a 2D Minkowski Diamond
c = pc.CausalSet(n=5000, density=100, seed=42)

# 2. Access the Causal Matrix (TriangularBitMatrix)
# Stored efficiently (1 bit per element)
C = c.C

# 3. Visualize the embedding
fig = plot_embedding(c)
fig.show()

2. Quantum Field Theory

Compute the Retarded Propagator ($K_R$) for a scalar field.

from pycauset.field import ScalarField

# Define a massive scalar field (m=1.5) on the causal set
field = ScalarField(c, mass=1.5)

# Compute the propagator K = aC(I - b aC)^-1
# This uses GPU acceleration if available
K = field.propagator()

3. Pure Linear Algebra

You can use PyCauset as a high-performance sparse/dense matrix library.

# Create random causal matrices (10k x 10k)
A = pc.causal_matrix(10000, populate=True)
B = pc.causal_matrix(10000, populate=True)

# Fast GPU-accelerated BitMatrix multiplication
# Returns an IntegerMatrix of path counts
Paths = A @ B 

# Invert a dense float matrix
M = pc.zeros((2000, 2000), dtype=pc.float32)  # also accepts np.float32 or "float32" (case-insensitive)
M_inv = ~M # or M.inverse()

License information

PyCauset is published under the MIT license.

If you use PyCauset in your research, please cite: https://github.com/BrorH/pycauset

If you wish to contribute or have any questions, please contact me at bror[dot]hjemgaard[you can probably guess which symbol comes here]gmail(another dot)com

This repo contains AI-genetated code

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

pycauset-0.4.18.dev25.tar.gz (2.4 MB view details)

Uploaded Source

Built Distributions

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

pycauset-0.4.18.dev25-cp313-cp313-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.13Windows x86-64

pycauset-0.4.18.dev25-cp313-cp313-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pycauset-0.4.18.dev25-cp313-cp313-macosx_15_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

pycauset-0.4.18.dev25-cp312-cp312-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.12Windows x86-64

pycauset-0.4.18.dev25-cp312-cp312-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pycauset-0.4.18.dev25-cp312-cp312-macosx_15_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

pycauset-0.4.18.dev25-cp311-cp311-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pycauset-0.4.18.dev25-cp311-cp311-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pycauset-0.4.18.dev25-cp311-cp311-macosx_15_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

pycauset-0.4.18.dev25-cp310-cp310-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.10Windows x86-64

pycauset-0.4.18.dev25-cp310-cp310-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pycauset-0.4.18.dev25-cp310-cp310-macosx_15_0_arm64.whl (10.9 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

pycauset-0.4.18.dev25-cp39-cp39-win_amd64.whl (26.8 MB view details)

Uploaded CPython 3.9Windows x86-64

pycauset-0.4.18.dev25-cp39-cp39-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

pycauset-0.4.18.dev25-cp39-cp39-macosx_15_0_arm64.whl (10.9 MB view details)

Uploaded CPython 3.9macOS 15.0+ ARM64

pycauset-0.4.18.dev25-cp38-cp38-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.8Windows x86-64

pycauset-0.4.18.dev25-cp38-cp38-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

pycauset-0.4.18.dev25-cp38-cp38-macosx_15_0_arm64.whl (10.9 MB view details)

Uploaded CPython 3.8macOS 15.0+ ARM64

File details

Details for the file pycauset-0.4.18.dev25.tar.gz.

File metadata

  • Download URL: pycauset-0.4.18.dev25.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycauset-0.4.18.dev25.tar.gz
Algorithm Hash digest
SHA256 b1dde5c4c86675ec644bd13cc52bc55fc191ff6a358ec02992839f718433730a
MD5 b31a37518f7808338f389fd01c166c49
BLAKE2b-256 77493ed4d3d5c7238ba93cc3e3b0a1c834c3fb6f5986a2534e8db4be342dbc36

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25.tar.gz:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bbfe896b166a43192f84e59aa953c090c58d46320e478689963909db25d69846
MD5 361bfbabb7866eb98b962a4994af07d3
BLAKE2b-256 aaaae52f1bacce411f39fae4a3bb816d102015a8c920b459482da01cbcf23ac3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bf18ca8f175f41b738b75d595fccbcc0b25b7347d9701952dabeeb387f7ac53b
MD5 d9c8812f6f6c74e4afcbd95f062537cc
BLAKE2b-256 d186928ade9ab7de3b5d53e1a2b17f16ef04c9b16aade897783d8573541f0250

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 57e534bb3d3b0cc4c7d617385224321b0b27835079cb7efda20a7208bfc32270
MD5 83f259b6a33e2bf1a1845cb971dec643
BLAKE2b-256 e75a097086587cee436fd8484dc654aed394227e722919c59571a84718414c3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1a0668ccab3aa7b9c9a16e81f483b97efbae0757d878115f02c6a84013c93221
MD5 e7be1de6f919083beb1e820fe1f737a0
BLAKE2b-256 ee63a0598fd26e10c3705424ec5f2299790b17a3b56ad3904615d209ae54ce24

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b5bfcf6c75adecd8e696a6047b1322ee65d161755e07c52f617b29adeb964d82
MD5 72838ee42f22442d7dbc6d966e6f95b8
BLAKE2b-256 38b557ef76f395c7cec812f45ef4bccacb60b4430e6d20e1005755c4157ebb6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d5473cf76cd1a767ce2f9a948f6291097eb3da24b190257cf0e50ab621021d85
MD5 6c2132888444ae82636bc5a1c8973f61
BLAKE2b-256 8d0b3763016d55cba4c4458ab85416fb71e3d53ec397789ef48ed375d2b816ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6821e91d00efbd8694629f148a641f313e2dbb9dccf05bcdb4fc0220abc1718e
MD5 7fc1bea570e39b812b86f4e2b82e8668
BLAKE2b-256 48d299e99832fb145e12a01203554744b56a6892fb818b3c5a771fcbdaf98258

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 df77a79dcb7af0e59dc6911dc4a31827a02a62ca05494f9cfe2cd0eaf57e8a38
MD5 81ab8592769c0730d866a22188b3e1da
BLAKE2b-256 bba74200fd68d1e7c55760f42cb3273e44d0eaf0522afd8cb09924c28a7da7a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e8c950a1f97604f64b2953174a7eadde29d868d8254e3543051de2d3ca802d7d
MD5 da2cd133607bc37bcf91d7bb56f1682c
BLAKE2b-256 bbdd253623359f0e315ebfc99f0333669cd6843ded69f370a9f8f18e1748a372

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2ee1aad1e95261071bbae0c25bf0ab254285d7a8e11b789702d627a75f9d101b
MD5 30b185bc3f181aae750acf534764353d
BLAKE2b-256 641b4a04399ccda24e606e8863fb518ef9cc981e0a855ad9cdc515f013dd9c26

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6842468b7214dce7133579eebcbc699df2c63276aac225f694ec58987f544f83
MD5 837cc0dfb840481fecec26764a0138a8
BLAKE2b-256 3fbd7486f4f18c164d8e9b58be4ec540657a509dc3e51f1b5d6d5a443f398d8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 0302c06dec1b76b95e80932d5d0a6fc9324bc7d3849397635055b519939eb97e
MD5 22cf9e0612550733d38b4ae148c3f275
BLAKE2b-256 d8a6b5a05cb3d3f11a35bd3bef8167ea6c122997919bf0d678bddf1a3267ff73

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp310-cp310-macosx_15_0_arm64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8a72b16af61b90361dfc1426e6dc1b6e25cf3f9aedea476c98fc88cc4bd7a8a3
MD5 b41eed47ab16bd92f9e6c6f4794e9370
BLAKE2b-256 09ccd865ce9d442cc9df7ecd39b481251cc0df3a8ac207bde7b59fa87d3691e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp39-cp39-win_amd64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3cc5856e18275c3efc99091b1066b6836130adcb92e72464ae48f906a39921f4
MD5 5ccba5a7c00a8d50d9bb990d96aed9f1
BLAKE2b-256 2560a6dca0474584f0921a72d131a37f0b14d99c22351b63d8e5dba1d542fed1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp39-cp39-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp39-cp39-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp39-cp39-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 75e8b9c2ef9e9fe5e70e215e3146acf4b2a915d755e8421a7047ea3d24596c02
MD5 17c0dcf093a5b80e8744e5e19019a399
BLAKE2b-256 c6676d6ff2f49615b37bb185960d720b999452ba5585f61b69db9c48b1d7ecd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp39-cp39-macosx_15_0_arm64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 55198faecea0caccd7c9fc9a294b3f00c551c32aa07ee359348b1bb1337d043c
MD5 0efc41631775a4c1130189fe2cef56f7
BLAKE2b-256 4060181e311c9b2c0383cf2cd2d82f3b4e9a6cddf89f6115199c2fecaaac88ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp38-cp38-win_amd64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6b3a0b3232159cc006600e18c5965746ab437f90f540478ef55dd2cb441b6d43
MD5 0404cb7a88b31bbe81ad3d9dee18a254
BLAKE2b-256 301f548c509dc49ea9593386d51c0d88eb21a3d7be26872125af7f1e752bdfec

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp38-cp38-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on BrorH/pycauset

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

File details

Details for the file pycauset-0.4.18.dev25-cp38-cp38-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev25-cp38-cp38-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2a5289a66163be41050c5a69392f68310fc8af300d78095bb26c1aee198cc74b
MD5 bf6a8dff38e434186ff969de1511bc05
BLAKE2b-256 f65d6ceded6265b9d0f8fa83bed6a91ff7d53b419fdbfc913d55e6ac6ae19ba4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev25-cp38-cp38-macosx_15_0_arm64.whl:

Publisher: publish.yml on BrorH/pycauset

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