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.5.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.5.0
File Size Uploaded Provenance Actions
symmray-0.5.0.tar.gz 800.9 kB With provenance Details for symmray-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / symmray-0.5.0.tar.gz

Download URL symmray-0.5.0.tar.gz
Size 800.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5952a85899e102e61825f1a23f1fa675d6fba66d5f78ba47c12db372ae67b1c5
BLAKE2b-256 checksum
How to use checksums
737e71baba852c3b91aac9c070afb1c425f3b503b80612b5a16948c47a00717c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 9, 2026.

Transparency log

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

Download URL symmray-0.5.0-py3-none-any.whl
Size 207.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e360ad621468a929fd82e42d550111261d5d2b9dbd30d46f61cb13f06aed1c1
BLAKE2b-256 checksum
How to use checksums
a5758f19572d4f72093ff7c2e0a6d8598e3b0938eee5cabe3b52d3d57dd15d32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 9, 2026.

Transparency log

Security for symmray 0.5.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for symmray-0.5.0.tar.gz

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 Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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