Skip to main content

Tools for the decomposition of tensors

Project description

The Tensor Toolbox provides functionalities for the decomposition of tensors in tensor-train format [1] and spectral tensor-train format [2].

The toolbox provides the following tools:

  • TT-svd

  • TT-cross

  • TT-dmrg

  • TT-vectors

  • TT-matrices

  • Quatics TT-vectors/matrices (cross and dmrg)

  • TT-integration

  • Basic operations in TT format

  • Multi-linear algebra in TT format (Steepest descent, CG and GMRES)

  • STT-construction

  • STT-projection/interpolation

  • STT for single quantities and for fields

Status

PyPi:

http://southpacific.no-ip.org:8080/buildStatus/icon?job=pypi-TensorToolbox

LaunchPad:

http://southpacific.no-ip.org:8080/buildStatus/icon?job=TensorToolbox

TestPyPi:

http://southpacific.no-ip.org:8080/buildStatus/icon?job=testpypi-TensorToolbox

Installation

Make sure to have the latest version of pip installed:

$ pip install –upgrade pip

Automatic installation

You can first try the out-of-the-box installation using

$ pip install TensorToolbox

If this doesn’t work, proceed with the step by step installation

Step-by-step installation

For everything to go smooth, I suggest that you first install some dependencies separately: numpy, scipy, matplotlib can be installed by:

$ pip install numpy scipy matplotlib

If you need MPI support in the TensorToolbox, you need to have an MPI back-end installed on your machine and add the right path on the $LD_LIBRARY_PATH, so that mpi4py can link to it. You should install mpi4py manually by

$ pip install mpi4py

TensorToolbox now stores data in both cPickle files and hd5 through the python package h5py. You need then to have the necessary library package libhdf5 and libhdf5-dev, or similar on your machine. Click here for more detailed information about the manual installation of h5py.

Once the hdf5 dependency is satisfied, we can proceed further. The package depends on Cython and requires to link to an mpi backend, and find the file mpi.h. In order to manually solve the dependencies do:

$ pip install cython

$ C_INCLUDE_PATH=<path-to-mpi.h-folder> pip install h5py

When everything is set, you can install the TensorToolbox using:

$ pip install TensorToolbox

Some users might want to install the toolbox without MPI support. This is possible, but not through the pip command:

$ pip download TensorToolbox

$ cd /pth/to/downloaded/files

$ tar xzf TensorToolbox-x.x.x.tar.gz

$ cd TensorToolbox-x.x.x

$ python setup.py install –without-mpi4py

Test Installation

You can test whether all the functionalities work by running the unit tests.

>>> import TensorToolbox
>>> TensorToolbox.RunUnitTests(maxprocs=None)

where maxprocs defines the number of processors to be used if MPI support is activated. Be patient. The number of unit tests grows with the number of functionalities implemented in the software.

Examples

Examples can be found inside the package. To find them, download the source:

$ pip download TensorToolbox

$ cd /pth/to/downloaded/files

$ tar xzf TensorToolbox-x.x.x.tar.gz

$ cd TensorToolbox-x.x.x

$ cd Examples

References

[1] Oseledets, I. (2011). Tensor-train decomposition. SIAM Journal on Scientific Computing, 33(5), 2295–2317. Retrieved from http://epubs.siam.org/doi/pdf/10.1137/090752286

[2] Bigoni, D. and Marzouk, Y.M. and Engsig-Karup, A.P. (2014) Spectral tensor-train decomposition. (Submitted) ArXiv: http://arxiv.org/abs/1405.5713

Change Log

1.0.2:
  • Fixed bug in TensorWrapper

1.0.1:
  • Fixed TensorWrapper unit tests

1.0.0:
  • Added support for Python3. Updated interface to SpectralToolbox 0.2.0.

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

TensorToolbox-1.0.20.tar.gz (278.3 kB view details)

Uploaded Source

Built Distribution

TensorToolbox-1.0.20-py3-none-any.whl (179.0 kB view details)

Uploaded Python 3

File details

Details for the file TensorToolbox-1.0.20.tar.gz.

File metadata

  • Download URL: TensorToolbox-1.0.20.tar.gz
  • Upload date:
  • Size: 278.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for TensorToolbox-1.0.20.tar.gz
Algorithm Hash digest
SHA256 1042dcf131a408ddd488afc59efeb21351bb0664aa2035d66d6d9f139a808951
MD5 4e070e77862877402fe96cd106eec769
BLAKE2b-256 23bdba7bd96445af81d616eaac66d81dc46388f7eda13141b95962fcbfc2779e

See more details on using hashes here.

File details

Details for the file TensorToolbox-1.0.20-py3-none-any.whl.

File metadata

  • Download URL: TensorToolbox-1.0.20-py3-none-any.whl
  • Upload date:
  • Size: 179.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for TensorToolbox-1.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 41db4aedf9574f0fb264213b2a15b0ca9f629c6eed3607f6592a6965e0d6fbec
MD5 ba2125345e0d8554f7751eda0857034a
BLAKE2b-256 65769b39b535e06090e39e26ab38e6403a4417ff34b8e58772430b58aa2deebb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page