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.4.0

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.4.0
File Size Uploaded
symmray-0.4.0.tar.gz 726.5 kB Details

Built distribution (wheel)

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

Total release size: 871.2 kB

Release files / symmray-0.4.0.tar.gz

Download URL symmray-0.4.0.tar.gz
Size 726.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0a23646b72ff670bfb23022a2dbbb1b12b62e8d600aa9b758c2c23fd616f59f8
BLAKE2b-256 checksum
How to use checksums
a6cde83fae52f8d53ecc2e0f2d3fa436981d30ed254504be7d18010945144f8d
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 Sep 17, 2026.

Transparency log

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

Download URL symmray-0.4.0-py3-none-any.whl
Size 144.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5cec9171fd5270d6e71ccdc04563e6cb6fcee84969a1f43897375fa2580ffd94
BLAKE2b-256 checksum
How to use checksums
be1c66887a438fb4b29343bd70bab259f975130f7ef152c89fd41f8119647463
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 Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.1

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