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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file symmray-0.3.0.tar.gz.
File metadata
- Download URL: symmray-0.3.0.tar.gz
- Upload date:
- Size: 704.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a479d12f95b5e724e8955aa45cb2c2e7808b38a039455c8b3241369885db7fd
|
|
| MD5 |
2ba13b8df38a7e2d19cc73d4a78d6e40
|
|
| BLAKE2b-256 |
90d81142e180b1fbfc6da598a04d9b72b75bc76a417ca4edd438dd480a0f6a17
|
Provenance
The following attestation bundles were made for symmray-0.3.0.tar.gz:
Publisher:
pypi-release.yml on jcmgray/symmray
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
symmray-0.3.0.tar.gz -
Subject digest:
3a479d12f95b5e724e8955aa45cb2c2e7808b38a039455c8b3241369885db7fd - Sigstore transparency entry: 2569281394
- Sigstore integration time:
-
Permalink:
jcmgray/symmray@7a011826c526112fc49536f6c4fd1545eb7095a0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/jcmgray
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@7a011826c526112fc49536f6c4fd1545eb7095a0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file symmray-0.3.0-py3-none-any.whl.
File metadata
- Download URL: symmray-0.3.0-py3-none-any.whl
- Upload date:
- Size: 138.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b93ead54e439238033e8632a63a2fa023f807ce4ec0111fc5f080935231dcda
|
|
| MD5 |
afeff4957ec45c00a4b9bab7747d6860
|
|
| BLAKE2b-256 |
2c9b7a28db3609f251fbcbf73abd0b98a5703619aa0b141b2ec23195cad4903a
|
Provenance
The following attestation bundles were made for symmray-0.3.0-py3-none-any.whl:
Publisher:
pypi-release.yml on jcmgray/symmray
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
symmray-0.3.0-py3-none-any.whl -
Subject digest:
2b93ead54e439238033e8632a63a2fa023f807ce4ec0111fc5f080935231dcda - Sigstore transparency entry: 2569281442
- Sigstore integration time:
-
Permalink:
jcmgray/symmray@7a011826c526112fc49536f6c4fd1545eb7095a0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/jcmgray
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@7a011826c526112fc49536f6c4fd1545eb7095a0 -
Trigger Event:
release
-
Statement type: