Native CPU execution
x86_64 wheels support runtime selection between AVX2 and AVX-512. Linux ARM64 uses NEON; Apple Silicon uses NEON and Accelerate.
Dense and structured linear algebra on CPU and CUDA, with a flat Python API for NumPy, CuPy and PyTorch arrays.
OVERVIEW
Hyperfold is a C++23 high-performance computing library for dense and structured linear algebra. Its Python API supports NumPy host arrays and CUDA arrays from CuPy and PyTorch, with explicit dtype, device and output ownership.
x86_64 wheels support runtime selection between AVX2 and AVX-512. Linux ARM64 uses NEON; Apple Silicon uses NEON and Accelerate.
The CUDA distribution combines CPU and CUDA backends with explicit device placement. Install Linux x86_64 wheels or build locally for Windows AMD64.
Results stay in NumPy, CuPy or PyTorch and remain on the originating device.
INSTALLATION
CPython 3.11–3.14 · NumPy 1.26+ · ml_dtypes 0.5.3+
Install hyperfold or hyperfold-cuda from PyPI for CPU execution on Linux, Windows and Apple Silicon, or CPU + CUDA on Linux x86_64. Windows CUDA is available through a local source build. This reference covers Hyperfold 0.1.1.
The CPU and CUDA distributions use the same hyperfold import and are
mutually exclusive. See the full platform matrix
and Windows CUDA build instructions.
API REFERENCE
All 32 built-in operations support float16, bfloat16,
float32, float64, complex32,
complex64 and complex128 on CPU and CUDA.
| Group | Operations | Dtypes | Backends |
|---|---|---|---|
| Vector arithmetic | addsubtractmultiplyscale | All supported floating dtypes | AVX2 · AVX-512 · ARM NEON · Apple Silicon CUDA |
| Reductions / matmul | summatmul | All supported floating dtypes | AVX2 · AVX-512 · ARM NEON · Apple Silicon CUDA |
| Vector transforms | sqrtconjugatedivideinnernormvector_equal | All supported floating dtypes | AVX2 · AVX-512 · ARM NEON · Apple Silicon CUDA |
| Matrix operations | transposeadjointmatveckronoutertraceeyematrix_poweris_unitary | All supported floating dtypes | AVX2 · AVX-512 · ARM NEON · Apple Silicon CUDA |
| Solvers / quantum | lu_factorLUFactor.solveLUFactor.logdetsolveeigeigheigvalshslogdetlogdet_positive_definiteprincipal_eigenvectorpartial_trace | All supported floating dtypes | AVX2 · AVX-512 · ARM NEON · Apple Silicon CUDA |
| Input storage | Compute, reductions and solve | Ordinary array results | General eig / LU logdet results |
|---|---|---|---|
float16, bfloat16 |
float32 |
Input dtype | complex64 |
float32 |
float32 |
float32 |
complex64 |
float64 |
float64 |
float64 |
complex128 |
complex32 |
complex64 |
complex32 |
complex64 |
complex64 |
complex64 |
complex64 |
complex64 |
complex128 |
complex128 |
complex128 |
complex128 |
Low-precision LU factors, solve results and structured-solver arrays use compute precision. Norms and Hermitian eigenvalues use the real component dtype; predicates return booleans. Inputs to multi-array operations must have matching dtypes.
NumPy bfloat16 support is supplied by the required
ml_dtypes>=0.5.3 dependency; CUDA dtype availability also depends on the
installed framework.
Select an operation for its full signature, shapes, output, examples and errors.