Skip to main content
symmray logo

Tests Code Coverage Docs PyPI Anaconda-Server Badge Pixi Badge

symmray provides block-sparse arrays with abelian symmetries and fermionic signs. Its arrays follow the NumPy interface where possible and can store blocks using NumPy, PyTorch, JAX, or another autoray backend.

Key features include:

  • sparse and flat storage layouts
  • Z2, U1, Z2Z2, U1U1, and finite cyclic symmetries
  • local fermionic phase handling for arbitrary tensor-network geometries
  • contraction, fusion, reshaping, and blockwise linear algebra
  • tensor-network and Hamiltonian constructors for quimb
import symmray as sr

# some U(1) indices
a, b, c, d, e = [
    sr.utils.rand_index("U1", size, dual=False, seed=seed)
    for seed, size in enumerate((4, 6, 8, 5, 7))
]

# some fermionic arrays
X = sr.utils.get_rand(
    "U1",
    shape=(a, b, c.conj()),
    fermionic=True,
    seed=6,
)
Y = sr.utils.get_rand(
    "U1",
    shape=(c, d.conj(), e.conj()),
    fermionic=True,
    seed=7,
)

# contract them
Z = sr.einsum("abc,cde->abde", X, Y)

# fuse into a matrix
matrix = Z.reshape((4 * 6, 5 * 7))

# decompose
U, s, VH = sr.linalg.svd(matrix)
print(U)
# U1FermionicArray(ndim=2, charge=0, indices=[
#     (24 = 2+4+6+6+4+2 : +[-2,-1,0,1,2,3])
#         -2 ; (2) : [(-1, -1)]
#         -1 ; (2+2) : [(-1, 0),(0, -1)]
#         0 ; (2+2+2) : [(-1, 1),(0, 0),(1, -1)]
#         1 ; (2+2+2) : [(0, 1),(1, 0),(2, -1)]
#         2 ; (2+2) : [(1, 1),(2, 0)]
#         3 ; (2) : [(2, 1)]
#     (23 = 2+4+5+6+4+2 : -[-2,-1,0,1,2,3])
# ], num_blocks=6, backend=numpy, dtype=float64)

See the documentation for installation, guides, examples, and the API reference. Contributions are welcome; see the development guide and GitHub issues.

Metadata

Release files for symmray 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for symmray 0.3.1
File Size Uploaded
symmray-0.3.1.tar.gz 709.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for symmray 0.3.1
File Interpreter ABI Platform
symmray-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 849.5 kB

Release files / symmray-0.3.1.tar.gz

Download URL symmray-0.3.1.tar.gz
Size 709.4 kB
Tags Source
SHA-256 checksum
How to use checksums
89029ea61e7b6645a75e9938d44bbe543c421e43d7d90e07fdd834016098c79f
BLAKE2b-256 checksum
How to use checksums
567b2f7f1b9f637df66e8bdc27b3ebb24a381f96693ee128e5c8a88181851351
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / symmray-0.3.1-py3-none-any.whl

Download URL symmray-0.3.1-py3-none-any.whl
Size 140.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6dd3f7e4806fbb7d0620af3d64e3fec1bf5b16fb3bec134a604b3d2f801fa031
BLAKE2b-256 checksum
How to use checksums
700008d3ee592ff875f7f75b149a896fedb1a59eaf6a0facba281ddb33623fee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page