Skip to main content

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

Metadata

Release files for nicole 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nicole 0.4.1
File Size Uploaded
nicole-0.4.1.tar.gz 8.6 MB Details

Built distribution (wheel)

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

Total release size: 8.8 MB

Release files / nicole-0.4.1.tar.gz

Download URL nicole-0.4.1.tar.gz
Size 8.6 MB
Tags Source
SHA-256 checksum
How to use checksums
c708bb70326d4d04e5539d3d41bf26687784d36513cd997647dd2510143f644c
BLAKE2b-256 checksum
How to use checksums
72094a4ed16fda41cbed00d7e77bd733887795a4e115ee5c6d1311f5fb042d73
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / nicole-0.4.1-py3-none-any.whl

Download URL nicole-0.4.1-py3-none-any.whl
Size 135.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9eb6f650c889dae4a5a9927495dcb72a6fa99682a98bde5fd8272bfdd4864aed
BLAKE2b-256 checksum
How to use checksums
9920e99fca1827868ad9c4a1030823c0a19f11916f60b1b82b7eda0adb5f33af
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

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