Metadata-Version: 2.1
Name: pyqutree
Version: 0.1.0
Summary: QuTree: A tree tensor network package
License: BSD-3-Clause
Keywords: tensor network,chemistry,optimization,cross approximation
Author: Roman Ellerbrock
Author-email: romanellerbrock@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Physics
Provides-Extra: all
Provides-Extra: chem
Provides-Extra: gpu
Provides-Extra: viz
Requires-Dist: ase (>=3.22,<4.0) ; extra == "chem" or extra == "all"
Requires-Dist: imageio (>=2.9,<3.0)
Requires-Dist: kaleido (>=0.2,<0.3) ; extra == "viz" or extra == "all"
Requires-Dist: matplotlib (>=3.5,<4.0)
Requires-Dist: networkx (>=2.6,<3.0)
Requires-Dist: numpy (>=1.20,<2.0)
Requires-Dist: pandas (>=1.3,<2.0)
Requires-Dist: plotly (>=5.0,<6.0)
Requires-Dist: pydot (>=4.0.1,<5.0.0)
Requires-Dist: pyscf (>=2.9.0,<3.0.0)
Requires-Dist: scipy (>=1.7,<2.0)
Requires-Dist: torch (>=2.0,<3.0) ; extra == "gpu" or extra == "all"
Requires-Dist: tqdm (>=4.67.1,<5.0.0)
Project-URL: Bug Tracker, https://github.com/roman-ellerbrock/pyqutree/issues
Project-URL: Documentation, https://github.com/roman-ellerbrock/pyqutree
Project-URL: Homepage, https://github.com/roman-ellerbrock/pyqutree
Project-URL: Paper, https://doi.org/10.1063/5.0180233
Project-URL: Repository, https://github.com/roman-ellerbrock/pyqutree
Description-Content-Type: text/markdown

# pyQuTree

A smaller python version of the Tree Tensor Network library Qutree[^1]
currently centered around optimization.

Install pyQutree via pip using
```bash
pip install git+https://github.com/roman-ellerbrock/pyQuTree.git
```
or create a conda environment via
```bash
conda env {create, update} --file environment.yml
conda activate qutree
```

You can use a tree tensor network version of cross interpolation[^2] via
```python
from qutree import *

def V(x):
    # change with your objective function
    return np.sum((x-np.ones(x.shape[0]))**2)

N, r, f, nsweep = 21, 4, 3, 6

objective = Objective(V)

# create a tensor network, e.g. a balanced tree
tn = balanced_tree(f, r, N) 

# Create a primitive grid and tensor network grid
primitive_grid = [linspace(-1., 3., N)] * f

# tensor network optimization
tn_updated = ttnopt(tn, objective, nsweep, primitive_grid)
print(objective)
dataframe = objective.logger.df
print(dataframe)
```
More details can be found in `examples/ttopt_example.ipynb`.

If Qutree was useful in your work, please consider citing the paper[^1].

## References
[^1] Roman Ellerbrock, K. Grace Johnson, Stefan Seritan, Hannes Hoppe, J. H. Zhang, Tim Lenzen, Thomas Weike, Uwe Manthe, Todd J. Martínez; QuTree: A tree tensor network package. J. Chem. Phys. 21 March 2024; 160 (11): 112501. https://doi.org/10.1063/5.0180233

[^2] I created the present tree tensor network version which is currently unpublished. It is inspired by Ivan Oseledets, Eugene Tyrtyshnikov, TT-cross approximation for multidimensional arrays, Linear Algebra and its Applications, Volume 432, Issue 1, 2010, Pages 70-88, https://doi.org/10.1016/j.laa.2009.07.024.
