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.5.1.dev2.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.5.1.dev2-cp313-cp313-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.13Windows x86-64

pycauset-0.5.1.dev2-cp313-cp313-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pycauset-0.5.1.dev2-cp313-cp313-macosx_15_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

pycauset-0.5.1.dev2-cp312-cp312-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.12Windows x86-64

pycauset-0.5.1.dev2-cp312-cp312-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pycauset-0.5.1.dev2-cp312-cp312-macosx_15_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

pycauset-0.5.1.dev2-cp311-cp311-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pycauset-0.5.1.dev2-cp311-cp311-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pycauset-0.5.1.dev2-cp311-cp311-macosx_15_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

pycauset-0.5.1.dev2-cp310-cp310-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.10Windows x86-64

pycauset-0.5.1.dev2-cp310-cp310-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pycauset-0.5.1.dev2-cp310-cp310-macosx_15_0_arm64.whl (10.9 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

pycauset-0.5.1.dev2-cp39-cp39-win_amd64.whl (26.8 MB view details)

Uploaded CPython 3.9Windows x86-64

pycauset-0.5.1.dev2-cp39-cp39-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

pycauset-0.5.1.dev2-cp39-cp39-macosx_15_0_arm64.whl (10.9 MB view details)

Uploaded CPython 3.9macOS 15.0+ ARM64

pycauset-0.5.1.dev2-cp38-cp38-win_amd64.whl (26.7 MB view details)

Uploaded CPython 3.8Windows x86-64

pycauset-0.5.1.dev2-cp38-cp38-manylinux_2_28_x86_64.whl (14.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

pycauset-0.5.1.dev2-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.5.1.dev2.tar.gz.

File metadata

  • Download URL: pycauset-0.5.1.dev2.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.5.1.dev2.tar.gz
Algorithm Hash digest
SHA256 1af9fee5406185c687b55f4af3f76029c97287a1257085d864120d1acbe1ab87
MD5 ecf06fc00477f82bacd25a49ba850cd9
BLAKE2b-256 77aebd613a227f33441cb475519f46fcb922b0d7c6d9ef7eda602c7e65bedebd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2.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.5.1.dev2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ae069083a18dace3dd14c85710d09add37c9a79ead54186be306e069f7819e3b
MD5 c54bb4f29f4a5538b2159649b14f6aea
BLAKE2b-256 636c371fa176ec31781504665a8a9841e8f0c20d64c7c53c7f6cc8e9540472e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 88c57e9c79a8a46c42300f941ab93da131ff4d81fc334eab7ac253f70b1d321a
MD5 bc4879cda85eae8cadd2e7c325879623
BLAKE2b-256 e6d27b492e7d937d4a9ee10dc5e0727db1066f7820cb178186ac73c30caed5e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f6da4fee51f2c785595d27cbfd65593c578c593fe4d0c4d20d6acbe14dde1c16
MD5 2d747bb3d8b432247975e9a48dc83836
BLAKE2b-256 a89e9b02dc807386ecd8394b0cf9ff4a1627288065ad1279c018c611eb93ee16

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bec8e5ae4a300d5ecc21db364e0adebd8974eae250f62f1a3b67975d5f12de23
MD5 154a48fbefbce71cf01c0e1b0ae258c3
BLAKE2b-256 5e4e011f3484610bdf3a609afebc1ebe2b64c67bf884aa21f66dfd2d49ed97d2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a750dc299841bb0e529399656cdbefd523e5786a2d0627cf3f894e3fb6c4f080
MD5 30a351bdd18d828c936293d267b6eeda
BLAKE2b-256 606bea710a38008177957aa7c66a95ba4574a3e099b5f9dd0e8bbe6caecdbf14

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 cee3d617b1af0baa8e161e0b9489c0c3c1e351da6ab9d2b03db5300c2b644f58
MD5 c5299a30e47f5224c734c4be02727ffa
BLAKE2b-256 0432d890fabfef80ca46095d284f5e0e93525cb5af57648627a650a8737c3d59

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 594d6f5b9465a8650d1fdc08e3a25a86d185eab7fd03943b26f176e3ffd08660
MD5 2754da4070500079525e650b165aedc5
BLAKE2b-256 6c3dc7961074df81badce3ed4180e06199796ac06252a68284a922ccb79ae125

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 43fff7e3715eb4f97f5cabf99f39c5f2a8233a924f149f19217c4c569d106214
MD5 6f2074ffa8d3ec2676f0be583893f336
BLAKE2b-256 7a9dd73c89ae660505463a93d562270f013c706200112b1c0823cd2f0442f7c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8684ac5cd241fb2a3c6c4adb06cfdc284cb5d163ff0a5b86caa93969d975f38c
MD5 a589dff230f744b8c366fd1762dee542
BLAKE2b-256 8a3fad69da282647a461a7c1a9c1118da12aa6640af2cf6cdca77ab7dab868cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e5850b682a149a1aaa999747d0453a8ddb46c26574177221bacd12eb40a0d71c
MD5 6ae8955882d8a5c4c67e493e0df808ea
BLAKE2b-256 1132deb24db626bca0aa08070c2a390f172c2a748ba8e6b4a296f49d3919936a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cf1c61834253239b3f2f416abb262b8813910af3a07ccb8ff37beb218297b5e6
MD5 698d15d980c70138a9992d8264834c13
BLAKE2b-256 29d0eece12dba73cc63c740c8bc45c04424493283f8746e1c13b7360cee93946

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 5c7f4d5d98016b5c174143bfd2483f442a96f82872853dd311c91bc257f65542
MD5 38bdd51a74ad6d210328b5c47ed2f526
BLAKE2b-256 9ada9b8dc34c625d28d5938f4af1022c4d53b4bee1c5d7bbee5238dd650d520e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 cc3e431e7f26e848091b2cbc184cdc93bbcb921755f443ccb7183cecc63bbb25
MD5 c1b3a590229e48abe008d2a628ec52f8
BLAKE2b-256 54c430f2ca794817b9f0e175fd1fa5ea15ed38036f1245dd74473d4cfe91ba2b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fdb1c9a585a9da0176725bfa9fd2ceed473b37fcda6fd667a136ad193dca4a7f
MD5 3b2a2197bb84c38a5d7c010de9c0e898
BLAKE2b-256 14f1c61102572abb8f4b96180ef5e5d097c0300a1f53806a2daee8db606e5612

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp39-cp39-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp39-cp39-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 15633834dbc39cdf16fbb069020daa019929a99baaf2df30dee16ab3c29fcda7
MD5 c7bab5d265e3a0b129ed4fc317187388
BLAKE2b-256 3dc4cff64ff86ef3be64be83e35ba25de573d1fe5a337006e7f15e97ed1af0b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 39880285461fd61c2b5c16fb0ac2d7ee5f8a57904a35fb63214d40b6a0480c9c
MD5 06b2ef8b8395d3cca7ec6bba9b6ce437
BLAKE2b-256 434b83dadf5436c01647699bf74557745d1fecbd41378f12ff73802deabc3991

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 58e972c4691d2ee3e2ed7a7f7d5be547647d9079354a317f11ac4b453f4a5feb
MD5 db57c071445c115841600cb0accaae22
BLAKE2b-256 d36029820945344430d9ec3ec1c0d0ebd06cf7e4194cb7ddfa70f4c395adcedb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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.5.1.dev2-cp38-cp38-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pycauset-0.5.1.dev2-cp38-cp38-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bd44dda21a313a4bf3e7a698188e60b046d9410066d08e783297ac73a88d3ba4
MD5 d21b720aba89d7f854d6b980ac2ccdba
BLAKE2b-256 e867055944cf626c2a8392da2a7acf3f06fb5a7c7f7bc3aaa83095f930da0713

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycauset-0.5.1.dev2-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