Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yastn/yastn
Yet another symmetric tensor network
https://github.com/yastn/yastn
Last synced: 11 days ago
JSON representation
Yet another symmetric tensor network
- Host: GitHub
- URL: https://github.com/yastn/yastn
- Owner: yastn
- License: apache-2.0
- Created: 2023-04-02T10:50:38.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-30T09:31:54.000Z (11 days ago)
- Last Synced: 2024-10-30T10:30:05.740Z (11 days ago)
- Language: Python
- Homepage: https://yastn.github.io/yastn/
- Size: 3.52 MB
- Stars: 24
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Authors: AUTHORS.txt
Awesome Lists containing this project
README
# YASTN - Yet Another Symmetric Tensor Network
![Test status](https://github.com/yastn/yastn/actions/workflows/main.yml/badge.svg?branch=master)
![Docs status](https://github.com/yastn/yastn/actions/workflows/docs.yml/badge.svg?branch=master)
### Python library for differentiable linear algebra with block-sparse tensors, supporting abelian symmetries
##### YASTN tensors can be defined with both discrete and continuous abelian groups
- Z2 for parity conservation
- U(1) for particle number conservation
- direct product of abelian groups such as Z3xU(1) or U(1)xU(1)xZ2 and so on##### YASTN can run with different backends
- NumPy
- [PyTorch](https://pytorch.org/)allowing for automatic differentiation (autograd) on backends which provide it.
##### To see YASTN in action, check
- Matrix product states (MPS) and algorithms powered by YASTN
Explore the entire [MPS module](https://yastn.github.io/yastn/yastn.mps.html) or
try out code examples running [DMRG](https://yastn.github.io/yastn/examples/mps/algorithms.html#dmrg)
or [TDVP](https://yastn.github.io/yastn/examples/mps/algorithms.html#tdvp) optimizations
- Two-dimensional tensor networks library [peps-torch](https://github.com/jurajHasik/peps-torch) powered by YASTN
Try variational optimization of iPEPS with abelian symmetries for spin models
### Jump to [full Documentation](https://yastn.github.io/yastn/index.html) or get started with [Examples](https://yastn.github.io/yastn/yastn.tensor.html#examples-basics-of-usage)
### Installation
Install using
```
git clone https://github.com/yastn/yastn.git && cd yastn
pip install .
```
or just clone and add YASTN root to your Python import path to sucessfully ``import yastn``.##### YASTN depends on
- Python 3.9+
- NumPyand optionally
- PyTorch 1.11+ (for PyTorch backend)
- SciPy (for sparse linear algebra solvers)
- ...### Run the tests
Tests, which are also a good source of examples of usage, can be found in the folder `tests`.
To verify that everything works, get `pytest`. See [Installing pytest](https://docs.pytest.org/en/6.2.x/getting-started.html)
or `conda install -c conda-forge pytest`. Then you can test base yastn.Tensor and also yastn.mps modules```
cd tests
pytest -v ./tensor
pytest -v ./mps
```To test YASTN on PyTorch backend and integration of autograd features
```
cd tests
pytest --backend torch -v ./tensor
pytest --backend torch -v ./mps
```### Building docs locally
You can build documentation using `sphinx`. The prerequisites are
* sphinx
* pydata-sphinx-themeGet them with your favourite Python package manager. For example, using conda as `conda install -c conda-forge sphinx pydata-sphinx-theme`.
Then```
cd docs && make html
```The generated documentation can be found at `docs/build/html/index.html`