No project description provided
Project description
ChemTensor
Tensor network algorithms for chemical systems.
This library is written in C, offering a Python 3 interface for more straightforward accessibility.
Documentation is available at chemtensor.readthedocs.io.
Examples
The examples folder contains several demonstrations of the functionalities. Most examples use Jupyter notebooks and the Python interface.
Features
- Matrix product state and operator structures
- Represent common Hamiltonians as MPOs, including molecular Hamiltonians
- General MPO construction with optimized bond dimensions from a list of operator chains
- Block-sparse tensors based on additive quantum number conservation to implement abelian symmetries
- Single- and two-site DMRG algorithm
- Gradient computation with respect to MPO parameters
- Tensor hypercontraction form of molecular Hamiltonians
- Tree tensor network topologies (work in progress)
- Non-abelian symmetries (work in progress)
Installation
ChemTensor can be conveniently installed as a Python package (in a virtual environment) via
(venv) $ pip install chemtensor
This downloads and installs a pre-built Python "wheel" from PyPI; see pypi.org/project/chemtensor/.
Alternatively, you can build the project locally; see the instructions below.
Note that ChemTensor can also run as standalone C code.
Building
The code requires the BLAS, LAPACK, HDF5, and Python 3 development libraries with NumPy. These can be installed via
sudo apt install libblas-dev liblapacke-dev libhdf5-dev python3-dev python3-numpy(on Ubuntu Linux)brew install hdf5 python3 numpy(on arm64 macOS together with the Accelerate framework)
From the project directory, use cmake to build the project:
mkdir build_ct && cd build_ct
cmake ../
cmake --build .
Currently, this will compile the unit tests, which you can run via ./chemtensor_test, as well as the demo examples and Python module library.
To build the corresponding Python package directly, ensure that the Python build tool is installed, and run
python3 -m build . --wheel
pip3 install dist/chemtensor-...whl
The first line should run cmake in the background and create a Python "wheel" (.whl file) in the dist/ subfolder. This package file can then be installed locally via the second line.
Coding style conventions
- Generally, follow the current coding style of the project.
- Naming: lower_case_with_underscores in general (variable, function, and struct names); exceptionally CAPITALIZATION for preprocessor and enum constants.
- Tabs for indentation at the beginning of a line, otherwise whitespace. This ensures that vertical alignment (of, e.g., comments for struct members) is independent of tab size. Avoid trailing whitespace.
- Comments: // for normal comments, /// for Doxygen documentation.
- Put curly braces
{ }after everyifandelse(to avoid pitfalls). - Left-align pointers throughout:
int* pinstead ofint *p. - Keep the
structandenumkeywords in variable types:struct foo f;instead oftypedef struct foo { ... } foo_t; foo_t f;. - Use
constfor function arguments which are not modified by the function.
References
- U. Schollwöck
The density-matrix renormalization group in the age of matrix product states
Ann. Phys. 326, 96-192 (2011) (arXiv:1008.3477) - J. Haegeman, C. Lubich, I. Oseledets, B. Vandereycken, F. Verstraete
Unifying time evolution and optimization with matrix product states
Phys. Rev. B 94, 165116 (2016) (arXiv:1408.5056) - C. Krumnow, L. Veis, Ö. Legeza, J. Eisert
Fermionic orbital optimization in tensor network states
Phys. Rev. Lett. 117, 210402 (2016) (arXiv:1504.00042) - G. K.-L. Chan, A. Keselman, N. Nakatani, Z. Li, S. R. White
Matrix product operators, matrix product states, and ab initio density matrix renormalization group algorithms
J. Chem. Phys. 145, 014102 (2016) (arXiv:1605.02611) - J. Ren, W. Li, T. Jiang, Z. Shuai
A general automatic method for optimal construction of matrix product operators using bipartite graph theory
J. Chem. Phys. 153, 084118 (2020) (arXiv:2006.02056) - Yu Wang, Maxine Luo, Matthias Reumann, Christian B. Mendl
Enhanced Krylov methods for molecular Hamiltonians via tensor hypercontraction
(arXiv:2409.12708)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 chemtensor-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: chemtensor-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.4 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bc94410f49cbd5dde7876a29f1314aa6cc9e0a86a7d3e521f09fa8912052241
|
|
| MD5 |
d00711c6b58e67feb565a8e9c7deba0e
|
|
| BLAKE2b-256 |
4c50c229c3ba1e986a9355879d963d66044ac10f9808bf871202c14e724cd579
|
File details
Details for the file chemtensor-0.1.3-cp312-cp312-macosx_14_0_arm64.whl.
File metadata
- Download URL: chemtensor-0.1.3-cp312-cp312-macosx_14_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6297be916b381abc1e1bbf8759aa5eb75b4896f8e8817c8da311b6280748c99
|
|
| MD5 |
832b500035df80edcf6f45a41a66ae61
|
|
| BLAKE2b-256 |
4d5c3918fd68cba16600191681d8f993cc5d20fb7ddb361d40e3fb9d2a6ead23
|
File details
Details for the file chemtensor-0.1.3-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: chemtensor-0.1.3-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.4 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78bc9af5e7aa366f0aba91e247ac54c65ef71a1d01940d99c925bae98cdda92a
|
|
| MD5 |
05c7639f323d7e47d01d0edb5bf2e61a
|
|
| BLAKE2b-256 |
0b1eab629b0990faf31750dc70a88b743071b1e0048a607ba44ac5d503720379
|
File details
Details for the file chemtensor-0.1.3-cp311-cp311-macosx_14_0_arm64.whl.
File metadata
- Download URL: chemtensor-0.1.3-cp311-cp311-macosx_14_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.11, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce628c798dc4a37ad140b84956f86fc641f8e17f5db61e6dd9eac63a169fb397
|
|
| MD5 |
50dd2c6522ecd8fecdb6a5b7bf545775
|
|
| BLAKE2b-256 |
707020649f6913725399bc36ceddb4d7b84c9e66798c0dc890f45c524795ee6d
|
File details
Details for the file chemtensor-0.1.3-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: chemtensor-0.1.3-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.4 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96495ac38af49cfd7bab9021e5012397c57708141b8398aa8ff745261f02b4c0
|
|
| MD5 |
55bddecbe5de1c5065b926bf59d12228
|
|
| BLAKE2b-256 |
d84ba8d81c6ea46fbbd0d03eeb816ed0bcd4b20f7cfc67e9ae0dce5f33e82422
|
File details
Details for the file chemtensor-0.1.3-cp310-cp310-macosx_14_0_arm64.whl.
File metadata
- Download URL: chemtensor-0.1.3-cp310-cp310-macosx_14_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.10, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17e876ab74c0e2d80ceae3f135626eb894a5f7bb1a0f9c269b10d6f94632c3b9
|
|
| MD5 |
b0dc4d64240fde50b3abbd1a279a00fc
|
|
| BLAKE2b-256 |
56c96f62acba80fa1943549cb907e96480cf287b5b7e7561dfafc109cb8a1298
|
File details
Details for the file chemtensor-0.1.3-cp39-cp39-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: chemtensor-0.1.3-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.4 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2816012e8bb0739f423e92323df49aadad326f89f3cedab373cb3f2c606d5735
|
|
| MD5 |
71938b90f176ce9f28900e984b9d4662
|
|
| BLAKE2b-256 |
7408c1e2e15aeb1209c8485465d5dea3aa118e29b430545bb4217ff856628878
|
File details
Details for the file chemtensor-0.1.3-cp38-cp38-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: chemtensor-0.1.3-cp38-cp38-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.4 MB
- Tags: CPython 3.8, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db01717bc647a670a6182eae42eda825c37dc28ccee9c89864083e285194c4a3
|
|
| MD5 |
09e6b77f705d5cbd952f9fd2aca76be8
|
|
| BLAKE2b-256 |
6a84ae66d2302c9f294873f07569739c37aebc4a53cd7239a62c6b9358a35a0f
|