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.dev12.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.dev12-cp312-cp312-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.12Windows x86-64

pycauset-0.4.18.dev12-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.dev12-cp312-cp312-macosx_11_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

pycauset-0.4.18.dev12-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.dev12-cp311-cp311-macosx_11_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

pycauset-0.4.18.dev12-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.dev12-cp310-cp310-macosx_11_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

pycauset-0.4.18.dev12-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.dev12-cp39-cp39-macosx_11_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.8Windows x86-64

pycauset-0.4.18.dev12-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.dev12-cp38-cp38-macosx_11_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pycauset-0.4.18.dev12.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.dev12.tar.gz
Algorithm Hash digest
SHA256 66502d2864681d0cda14ecf3042cdccc838530ad54d19d85c299fb5d8e13f598
MD5 825c2e708c8026f3bd8a3f75fcc2e6e3
BLAKE2b-256 7954586e5307c05ccfc80a346e2b91fe16209bbffaf983ceaef734eba29132ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12.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.dev12-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e8404d4f55f71b7693d65d29c0dabcad40a1f9953ba14cbdba600510b89302b1
MD5 6a69a767b4886dc7ddf7eba26b844ee8
BLAKE2b-256 c23414185a84c4b23dbd517a6ee623459a38742bd50adb0c6514ebae725b39cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-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.dev12-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 08c36b7a7a04ceb15678ca147d0b6721bba161fa9bfa0d9fc63b1e9d2273ae8a
MD5 b86af2f6e6b6e01df9a14b4519ce64dd
BLAKE2b-256 2284edd349a4140737f4f6f799fb8fdf462c84c20ac596c33157dae31c8129e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-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.dev12-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bd375f8f7192ee8a1980098a4bd9c9af3e1be48476b4ff519c8f24965babdfdd
MD5 af67c66265f2e186b5f5f860a3c03706
BLAKE2b-256 79f46c9f615713e5597d11618748a691ad7fb23a926d6e070bec7e16ce8f4a4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-cp312-cp312-macosx_11_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.dev12-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1407d6e1c5d4e5e8c8c45bc269a39de95fdd73ed0c54cff67f4923a970e82f7c
MD5 881c172919aedfa993fc2b5292914696
BLAKE2b-256 55f6b237efa421851445032b0a9718b69078ace86e210b885fbb894858b1cddb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-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.dev12-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30ccca458384bb6cca046f0397f4890989fb069ca7b320253661d52f2cb7c587
MD5 a7290c07298cc87a4dbc80857bf6665d
BLAKE2b-256 c74630faf2db70f062b619bb04e1a5dbc7ef12afbedc004c437f61417a2e43b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-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.dev12-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7c6f46fd8f73d3b371cf6049ac686bf31e199e76a81e9f1330821d30ddeceb7
MD5 34573e3e0f88129f5145b50c3cf61ebe
BLAKE2b-256 3b887663faab052ccd6105da7df854235930772871df2962c13334982b7f5160

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-cp311-cp311-macosx_11_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.dev12-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6242ea7dc9380adf99e5347834b537d604b1e45781d3130227df471be3dabc32
MD5 ef97b93d4167bf9304933367c36cf8cc
BLAKE2b-256 f9c131f94877156f450c787e9276f0f6791c10faa20280630dd827d958a37b73

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-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.dev12-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 531197ce3e741f039f257e0105c5aa7cabb8f32aa116279d633daba6f07df559
MD5 4b6f402f5b9b31d72530750c165c1b71
BLAKE2b-256 7d00874760ba88c2489618cc33062f501d78ec538fdc49a113e5dcffa8f57c39

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-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.dev12-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c69398c323c0d87e582b0a4029b5c04e08e1a6cfdccac776c5721b9b6f55bcf
MD5 7e707c60df7ccf7657eb7ff09c18a28c
BLAKE2b-256 45e541d3eb531fd4bddfbedc16277bac657496161ea05516dd1abc586d619507

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-cp310-cp310-macosx_11_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.dev12-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 db58bf60a54e942d246954237fb8b71037ba873e9a9f0079697f1997b2d389f5
MD5 9d78a6b0bf7fb0baac1a0ef094e38a3d
BLAKE2b-256 6695d9b89a5ad1d4446458fbb1b5eb7b8d7b6095e1dfafb7001163403e58c2ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-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.dev12-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3242b0cb4d3a631839809f0b57a4c17eef694b92709feec6b26df54fa489b068
MD5 1393dbbee5c69d70dadd6d0b441dfa30
BLAKE2b-256 f691c6bf76b32f3dfe59bea37568a90fbbac0b787ae3623d9f3cea46fc29ebd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-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.dev12-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a2a17822b8ad5702f8ceee3d06c7f75f8a090e9b697ec181d4660be1474ef6ae
MD5 65a44a238dd0bf861c6525b5de8eec04
BLAKE2b-256 710eb644ceb9053c991dfb2c0266a6fac4151922a1b4360656a83ddc25773fdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-cp39-cp39-macosx_11_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.dev12-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d7d24a178f8822138a845101d8225915609420cca8de129ffb898cd323b071db
MD5 bef3eaae0026cb6af1f63bb8ea3aa7cc
BLAKE2b-256 887c03e7cb5bee20d2e28a6d334b84782b36c29f15fb090434cc0c641a788b18

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-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.dev12-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4d5a3300b5ac3352d8eb1dad02795e43d75e9b073269ea816dfe9cd8d8206815
MD5 590af4e2c35b2296f9908a4b5c8b69bf
BLAKE2b-256 b3ecee69f3f7976f652a819326b157700e512528cdec83c1c9bf65adcbd283cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-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.dev12-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.4.18.dev12-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04bfae3bf043ebe03ba96540d076f0c0f64f1b12f07bfe14ccc3bdfe4d19b791
MD5 7ed2b11e32ecb4a88fa3f22a5ffe147b
BLAKE2b-256 d6b6cd3f03bfd42160a31956d6492285371625553696480d2e29977c33106339

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.4.18.dev12-cp38-cp38-macosx_11_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