Skip to main content

Nicole: a symmetry-aware tensor library

Project description

Nicole Tensor Library

PyPI Version License Documentation Python Version PyTorch Coverage Status

Nicole is a Python library for symmetry-aware tensor computations, specifically designed for quantum many-body physics and tensor network algorithms. It provides efficient block-sparse tensor operations that respect both Abelian (U(1), Z₂) and non-Abelian (SU(2)) symmetries, enabling memory-efficient and computationally optimized tensor network calculations with exact quantum number conservation.

With the assistance of various AI coding agents, Nicole reimagines the block-symmetric tensor approach with a Python-native API built upon PyTorch, making it accessible to the broader scientific Python ecosystem while maintaining the mathematical rigor needed for quantum physics applications.

Key Features

  • Block-Sparse Tensors: Memory-efficient representation of tensors with conserved quantum numbers
  • Abelian Symmetries: Built-in support for U(1) (particle number, magnetization) and Z₂ (parity), etc.
  • Non-Abelian SU(2): Full SU(2) spin symmetry via Clebsch-Gordan intertwiners powered by Yuzuha
  • Charge Conservation: Automatic enforcement of selection rules through symmetry-aware indices
  • PyTorch Backend: Python implementation using PyTorch for high-performance dense block operations
  • GPU Acceleration: Optional GPU support (CUDA/MPS) for accelerated computations on large tensors
  • Autograd Control: Optional automatic gradient tracking for efficient optimization tasks
  • Tensor Operations: Essential operations including contraction, decompositions, and more
  • Type-Safe API: Modern Python with type hints for better IDE/AI support and fewer runtime errors
  • Extensible Design: Clean abstractions for adding custom symmetry groups (following Yuzuha protocol)

Contributing

We welcome contributions from the community! Whether you're fixing bugs, adding features, implementing new symmetry groups, or improving documentation, your help is appreciated. You can also contribute by requesting new features or reporting performance bottlenecks.

Ways to contribute:

  • Report issues and request features via GitHub Issues
  • Submit pull requests with bug fixes or enhancements
  • Improve documentation and add examples
  • Share your use cases and provide constructive feedback

Development guidelines:

  • Ensure all contributions include appropriate tests
  • Follow the existing code style (enforced by ruff)
  • Add type hints for new functions and classes
  • Update documentation for user-facing changes

Authors and Maintainers:

Nicole is created and maintained by Changkai Zhang as part of the Ideogenesis-AI effort in studying quantum many-body systems. If you have questions about contributing to the project or are interested in collaboration opportunities, please feel free to open an issue on GitHub or contact the maintainer directly.

Acknowledgments

Nicole is inspired by the QSpace tensor library developed for MATLAB. While QSpace excels in complex symmetries (e.g. SU(N), Sp(N), SO(N)) with a C++ backend, Nicole focuses on providing a Python implementation supporting both Abelian (U(1), Z₂) and non-Abelian (SU(2)) symmetries, with an emphasis on clarity, extensibility, and integration with the scientific Python ecosystem.

License

Nicole is licensed under the GNU General Public License v3.0 (GPL-3.0). This means you are free to use, modify, and distribute this software under the terms of the GPL-3.0 license. We encourage you to share any improvements you make back to the community, helping Nicole grow and benefit all users. See the LICENSE file for the full license text. For more information about GPL-3.0, visit https://www.gnu.org/licenses/gpl-3.0.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nicole-0.3.0.tar.gz (4.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nicole-0.3.0-py3-none-any.whl (122.0 kB view details)

Uploaded Python 3

File details

Details for the file nicole-0.3.0.tar.gz.

File metadata

  • Download URL: nicole-0.3.0.tar.gz
  • Upload date:
  • Size: 4.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nicole-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8b68a5fa18e40a2e92a184b716359131047f7cec939bf87f4b9e219f5a8cd7f0
MD5 92e5a59fd83d4f7b264396d62d1a8f7e
BLAKE2b-256 6d22d9443711b06bdb9a511f7dbd5ff80613679b082673b441a33ba3ce929ed2

See more details on using hashes here.

File details

Details for the file nicole-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: nicole-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 122.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nicole-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f3e276a0e8c9f428f7e22abb40afacd84f97e048d80d9700e2331d31ec69c28
MD5 06c424261b2853a717cf076612bde3a5
BLAKE2b-256 1525df23f88ef3e41ab0dcdaf6687e458062829f4e1ba9d75104c856e2857870

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page