Skip to main content

QuTree: A tree tensor network package

Project description

pyQuTree

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

Installation

Install pyQuTree from PyPI:

pip install pyqutree

Or install the latest development version from GitHub:

pip install git+https://github.com/roman-ellerbrock/pyQuTree.git

For developers, create a conda environment via:

conda env {create, update} --file environment.yml
conda activate qutree

Usage

You can use a tree tensor network version of cross interpolation[^2] via

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.

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

pyqutree-0.1.2.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

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

pyqutree-0.1.2-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file pyqutree-0.1.2.tar.gz.

File metadata

  • Download URL: pyqutree-0.1.2.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for pyqutree-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9504b69198ed7de85364bf034e240182f14e111d6ca49e239cbc63d5490ec3fe
MD5 151d43b11f84828819dcbb0a79ac50ac
BLAKE2b-256 0f17416c2caade8afbab6becb0f666b35b634436fd260d0d65821382c13f01d3

See more details on using hashes here.

File details

Details for the file pyqutree-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pyqutree-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for pyqutree-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cfd9f3e803180532945778f1d0f659ef3f0595513a6fbad5cc5d1d5bbab8e74e
MD5 3e8cf07f26b6dd7d2de9af203bf23532
BLAKE2b-256 79417c9c2d804b723476fd8624b73778c2be68dd1dc8fd76c6dbb396e0face6a

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