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.3.tar.gz (22.1 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.3-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqutree-0.1.3.tar.gz
  • Upload date:
  • Size: 22.1 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.3.tar.gz
Algorithm Hash digest
SHA256 66fca4e18f95200ae972a6dd7b33c450d2e0dd9f4520b48535e2ba6662666b01
MD5 41410b1bc953bfd8d60aed0b6eeb46ac
BLAKE2b-256 2404aa50f9ec38cdea0daff1255fb151be3fb8933ac20f0423aa393c88a5edc4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqutree-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cdb62a1af4ae12bd36a037d7f00f103c8d88ab469ecbfc14d044982dc789fc56
MD5 41b17ee02c8c8d640bf1f612a9bb3447
BLAKE2b-256 85d6d33414d2e6fd1f11fc38fd4ce50e46e8528960a75ed9cb8dd4d13d78306f

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