Metadata-Version: 2.4
Name: pyTensorlab
Version: 2025.12.0
Summary: A Python package for tensor computations.
License-File: LICENSE.md
Keywords: tensor,array,tensor decomposition,visualization,complex optimization
Author: Nico Vervliet
Author-email: Nico.Vervliet@kuleuven.be
Maintainer: Nico Vervliet
Maintainer-email: Nico.Vervliet@kuleuven.be
Requires-Python: >=3.10
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Typing :: Typed
Requires-Dist: multipledispatch (>=0.6)
Requires-Dist: numba (>=0.57.0)
Requires-Dist: numpy (>=2.0)
Requires-Dist: pymanopt (>=2.0.1)
Requires-Dist: scipy (>=1.13)
Requires-Dist: typing-extensions (>=4.3.0)
Requires-Dist: vedo (>=2023.4.5)
Project-URL: Bug Tracker, https://gitlab.esat.kuleuven.be/tensorgroup-public/pytensorlab-public/-/issues
Project-URL: Documentation, https://www.pytensorlab.net/docs/
Project-URL: Homepage, https://www.pytensorlab.net/
Project-URL: Repository, https://gitlab.esat.kuleuven.be/tensorgroup-public/pytensorlab-public
Description-Content-Type: text/markdown

# pyTensorlab

pyTensorlab is a Python package for tensor computations and complex optimization. The
packages provides the following:

- data types to represent sparse, incomplete, structured and decomposed tensors
  efficiently;
- tools to generate and work with these data types effectively and efficiently;
- algorithms for computing the canonical polyadic decomposition, the multilinear
  singular value decomposition, the Tucker decomposition or low multilinear rank
  approximation and the tensor-train decomposition;
- tensorization techniques relying on statistics or Hankelization;
- visualization routines;
- preconditioned Gauss-Newton type optimization methods for complex variables;
- fully typed code, which facilitates development.

pyTensorlab is a reimplementation of the Matlab toolbox
[Tensorlab](https://www.tensorlab.net). Currently, the feature set is not identical. The
Matlab toolbox also supports block term decompositions and has a structured data fusion
framework which relies on a domain specific language to easily model coupled matrix and
tensor decompositions and prior knowledge. On the other hand, pyTensorlab provides basic
support for the TT decomposition and a more complete set of complex Gauss-Newton type
optimization algorithms.

## Getting Started

To install pyTensorlab, use:

```console
$ pip install pytensorlab
```

pyTensorlab requires Python 3.10 to take advantage of new typing features. NumPy, SciPy
and Numba for underly the main computations. Pymanopt is used for manifold-based
optimization for low multilinear rank approximation and Vedo for visualization.

As an example, the canonical polyadic decomposition of a noisy rank-3 tensor can be
computed as follows:

```python
>>> import pytensorlab as tl
>>> import numpy as np
>>> shape = (10, 11, 12)
>>> Tpd = tl.PolyadicTensor.random(shape, 3)
>>> Tn = tl.noisy(np.array(Tpd), snr=20)
>>> Tres, info = tl.cpd(Tn, nterm=3)
```
## Citation

If you are using pyTensorlab, please consider citing:

N. Vervliet, S. Hendrikx, R. Widdershoven, N. Govindarajan, S. Sofi, L. De Lathauwer,
_"pyTensorlab 2025.10,"_ Oct. 2025. Available online at
[www.pytensorlab.net](https://www.pytensorlab.net).

## Contributors

We would like to thank all contributors:

- Ayvaz, Muzaffer
- Boussé, Martijn
- De Lathauwer, Lieven
- Devogel, Andreas
- Govindarajan, Nithin
- Hendrikx, Stijn
- Iannacito, Martina
- Seeuws, Nick
- Sofi, Shakir
- Vermeylen, Charlotte
- Vervliet, Nico
- Widdershoven, Raphaël

