# Tensor Toolbox for MATLAB, Version 3.7-dev

The Tensor Toolbox for MATLAB provides a suite of tools for working with multidimensional or N-way arrays. Tensor analysis can be used for data understanding and visualization as well as data compression. Tensors are used in a variety of applications including chemometrics, network analysis, hyperspectral image analysis, latent topic modeling, etc. This toolbox provides many standard methods for decomposing tensors as well as fundamental kernels for writing new methods.

## Downloading

This toolbox is open source and hosted on GITLAB. See `LICENSE.txt` for the terms of the license (2-clause BSD).

- Tensor Toolbox for MATLAB v3.6 (current release)
- Tensor Toolbox for MATLAB v3.5
- Tensor Toolbox for MATLAB v3.4
- Tensor Toolbox for MATLAB v3.3
- Tensor Toolbox for MATLAB v3.2.1
- Tensor Toolbox for MATLAB v3.1
- Current development version from GITLAB repository

Be advised that a recent version of MATLAB is required. Once you have downloaded or cloned the Tensor Toolbox, use `addpath` to add the `tensor_toolbox` directory to your path. Type `help tensor_toolbox` for a list of functions and classes provided by the toolbox. Type `doc tensor_toolbox` to access this documentation. For more information, see `README.md`

## Functionality

The Tensor Toolbox provides the classes and functions for manipulating dense, sparse, and structured tensors using MATLAB's object-oriented features.

- Tensor Types - The Tensor Toolbox supports multiple tensor types, including dense, sparse, and symmetric tensors as well as specially structured tensors, such as Tucker format (core tensor plus factor matrices), Krusal format (stored as factor matrices), and sum format (sum of different types of tensors such as sparse plus rank-1 tensor in Kruskal format).
- CP Decompositions - CP methods such as alternating least squares, direct optimization, and weighted optimization (for missing data). Also alternative decompositions such as Poisson Tensor Factorization via alternating Poisson regression (APR), Generalized CP (GCP) tensor factorization, and symmetric CP tensor factorization.
- Tucker Decomposition - Tucker methods including as the higher-order SVD (HOSVD), the sequentially-truncated HOSVD (ST-HOSVD), and the higher-order orthogonal iteration (HOOI).
- Eigenproblems - Methods to solve the tensor eigenproblem including the shifted higher-order power method (SSHOPM) and the adaptive shift version (GEAP).
- Working with Tensors - Creating test problems, tensor multiplication, collapsing and scaling tensors (useful in preprocessing), and more.
- Optimization Methods - Standardized wrappers to make it simple to switch between several different optimization methods, including limited-memory BFGS quasi-Newton method and Adam (stochastic optimization).

## How to Cite

To support this toolbox and its authors, please cite the appropriate works. The primary references are given below. Additionally, please cite the specific references mentioned in the help for the functions you are using. Thanks very much for your support.

- General software, latest release: Brett W. Bader, Tamara G. Kolda and others, Tensor Toolbox for MATLAB, Version 3.6, www.tensortoolbox.org, September 28, 2023.
- General software, development version: Brett W. Bader, Tamara G. Kolda and others, Tensor Toolbox for MATLAB, development version [hash], available online at https://www.tensortoolbox.org, date.
  - Replace the hash and date to match the current development version. Generate the appropriate hash via `git log --pretty=format:'%h' -n 1`.
- Dense tensors: B. W. Bader and T. G. Kolda, Algorithm 862: MATLAB Tensor Classes for Fast Algorithm Prototyping, ACM Trans. Mathematical Software, 32(4):635-653, 2006, http://dx.doi.org/10.1145/1186785.1186794.
- Sparse, Kruskal, and Tucker tensors: B. W. Bader and T. G. Kolda, Efficient MATLAB Computations with Sparse and Factored Tensors, SIAM J. Scientific Computing, 30(1):205-231, 2007, http://dx.doi.org/10.1137/060676489.

## How to Contribute

Your bug reports and code contributions are warmly welcomed. This is an open-source project hosted on GITLAB at http://gitlab.com/tensors/tensor_toolbox.

- Report issues here: https://gitlab.com/tensors/tensor_toolbox/issues
- Please see the `CONTRIBUTION_GUIDE.md` for information on contributing to the project.
- Thanks to all contributors, listed in `CONTRIBUTORS.md`.

## More information

This documentation is provided via the MATLAB Help interface under "Supplemental Software" and online at www.tensortoolbox.org.

## Contact

The Tensor Toolbox for MATLAB is supported by Sandia National Labs and MathSci.ai. Please email help@tensortoolbox.org with any questions about the toolbox that cannot be resolved via issue reporting.