Skip to main content

Low memory hypercube triangulations and sub-triangulations

Project description

hyperct

Low memory simplicial complex structures via hypercube triangulations and sub-triangulations.

When to use hyperct

  • Dynamic meshes with changing topologies: The library is based on efficiently tracking vertex-vertex connections only which avoids the computational expense of storing simplexes while still allowing many important operations that are applied on simplicial complex structures. Generation-based refinement lets you locally refine and split simplices without rebuilding the entire complex.
  • Computing homologies of very high-dimensional spaces: the hypercube triangulation scales to hundreds of dimensions while symmetric space reduction cuts complexity by up to O(n!).
  • Working with connectivity of high-dimensional data: the simplicial complex exposes vertex adjacency, cell membership, and dual mesh structure directly.

When not to use hyperct

If you need fast conventional computational geometry in low dimensions, dedicated libraries will outperform hyperct:

Features

  • Triangulates high-dimensional domains (10D+)
  • Symmetry constraints to reduce complexity by O(n!)
  • Scalar and vector field associations
  • Inequality constraints for non-convex domains
  • Multiple refinement strategies (local, global, generation-based)
  • Optional GPU acceleration via PyTorch

Installation

pip install hyperct

Optional dependencies

  • hyperct[gpu] — PyTorch backend for GPU-accelerated field evaluation and batch vertex processing. Auto-detects CUDA; falls back to CPU when unavailable.
  • hyperct[plotting] — Matplotlib-based visualization of triangulations, scalar fields, and dual meshes (1D/2D/3D). Includes Polyscope for interactive 3D dual mesh visualization.
  • hyperct[dev] — pytest, coverage, and benchmark tooling.
pip install hyperct[gpu]
pip install hyperct[plotting]
pip install hyperct[gpu,plotting]

Quick start

from hyperct import Complex

# Triangulate a 3D unit hypercube
C = Complex(3)
C.triangulate()
C.split_generation()
C.split_generation()

GPU-accelerated field evaluation

from hyperct import Complex

def my_field(x):
    return sum(xi**2 for xi in x)

C = Complex(3, func=my_field, backend='gpu')
C.triangulate()
C.split_generation()

Requirements

  • Python >= 3.7
  • NumPy >= 1.16.0
  • Optional: PyTorch >= 2.0 (GPU backend)
  • Optional: matplotlib >= 3.0, polyscope (plotting)

License

MIT

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

hyperct-0.3.6.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

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

hyperct-0.3.6-py3-none-any.whl (152.9 kB view details)

Uploaded Python 3

File details

Details for the file hyperct-0.3.6.tar.gz.

File metadata

  • Download URL: hyperct-0.3.6.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for hyperct-0.3.6.tar.gz
Algorithm Hash digest
SHA256 c07da51b13b7897527d02d1aaa7b9e24fd01e52a4cd7af94c7a322be28ef0bf3
MD5 96725e8c6c3a598d36183cba3408035c
BLAKE2b-256 5b5f3924beb2d74dd8c7282bd97ec71d2fcb8c1e31a7a1ed60d25dc065436c17

See more details on using hashes here.

File details

Details for the file hyperct-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: hyperct-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 152.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for hyperct-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 99d126a6b69c7a935311c139b8c0ea7e875ec700881b73228b55a66acfad0053
MD5 e3c9ce2d01c458aabd53d5b8c317b708
BLAKE2b-256 f2cd4adf948a1eff84aca2ad823d628497bdfa232cddc39a3fb181481bafddb0

See more details on using hashes here.

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