Opened 18 months ago

Last modified 3 months ago

#31991 new enhancement

Meta-ticket: Efficient numerical computations with tensor trains

Reported by: Hongli (Bob) Zhao Owned by:
Priority: major Milestone: sage-9.8
Component: linear algebra Keywords:
Cc: Matthias Köppe, Eric Gourgoulhon, Dima Pasechnik Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Matthias Köppe)

Following the progress with Ticket #30307, we propose to add computational functionalities with tensors via the tensor train decomposition, which is an idea originally named Matrix Product States in the quantum physics community and later popularized by Prof. Ivan Oseledets. As a computational tool, it represents tensors in compressed formats that would enable tensor operations with cost scaling only linearly in the number of dimensions.

This functionality is especially useful for high dimensional tasks to prevent the curse of dimensionality (such as in Riemannian optimization). Numerical packages are currently supported in MATLAB, Python, and C++. The MATLAB version is currently most versatile and robust.

We may consider internalizing this computational library for Sage, as an effort to formalize the currently available implementations. This addition can either be an additional child class under tensor, and overwrite the arithmetics; or a separate module. The backend is currently proposed to be tensorflow, however this may change / be flexible based on how the refactoring of Components progresses.

One can look at this github page for an example implementation in MATLAB (https://github.com/oseledets/TT-Toolbox).

Ideally after the implementation of this ticket, users can specify a fixed rank tensor for a general manifold using tensor.modules, specify a ring and a frame, and perform useful and normally computationally intractable tasks using tensor train as a backend. Based on the progress of this ticket, one may also consider implementing other backends for storing a numerical tensor such as tensor rings and quantized tensor train.

For alternative tensor decomposition formats, please see the following survey papers:

Other implementations:

Tickets:

  • #31998 Package ttpy (tensor trains)
  • #31992 FiniteRankFreeModuleMorphism: Add method SVD (singular value decomposition)
  • #31997 Topological tensor spaces (modules)
  • #29619 tensors should have a sparse iterator
  • #30373 Parent methods tensor vs. tensor_product
  • #30235 Add construction methods to FiniteRankFreeModule and CombinatorialFreeModule
  • #30309 Meta-ticket: Unify free module elements API: methods dict, monomial_coefficients, etc.
  • #32034 Graphical representations of tensors

Change History (24)

comment:1 Changed 18 months ago by Hongli (Bob) Zhao

Description: modified (diff)

comment:2 Changed 18 months ago by Matthias Köppe

Cc: Eric Gourgoulhon added

comment:3 Changed 18 months ago by Hongli (Bob) Zhao

Cc: Eric Gourgoulhon removed
Description: modified (diff)

comment:4 Changed 18 months ago by Hongli (Bob) Zhao

Cc: Eric Gourgoulhon added

comment:5 Changed 18 months ago by Matthias Köppe

Is ttpy still being maintained? I tried to install it (using sage -pip install ttpy) and ran into a Fortran issue:

    Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/COMPLEX(8)).
    tt/tt-fort/ort.f90:271:22:
    
      271 |    call dgemv('t',n,r,1.d0,yy,n,x,1, 0.d0,gv,1)

comment:6 Changed 18 months ago by Matthias Köppe

Cc: Dima Pasechnik added

(This is with gfortran 11.1 on macOS; this may be similar to the many issues that we had when gfortran 10 came along - #29456)

comment:7 in reply to:  6 Changed 18 months ago by Hongli (Bob) Zhao

Replying to mkoeppe:

(This is with gfortran 11.1 on macOS; this may be similar to the many issues that we had when gfortran 10 came along - #29456)

I didn't have an issue with downloading since I wasn't using pip but directly cloned the code on github. Based on their github's commit history it doesn't seem to be frequently maintained.. The MATLAB version is what I now use for my projects. I will update the MATLAB link in the ticket description.

comment:8 Changed 18 months ago by Hongli (Bob) Zhao

Description: modified (diff)

comment:9 Changed 18 months ago by Eric Gourgoulhon

Waouh! This looks promising!

comment:10 Changed 18 months ago by Matthias Köppe

I have opened an upstream issue for the compilation errors: https://github.com/oseledets/ttpy/issues/82

comment:11 in reply to:  9 Changed 18 months ago by Eric Gourgoulhon

Replying to egourgoulhon:

Waouh! This looks promising!

To make it clear: the above comment was about the ticket main goal and was not some ironical statement about the ttpy issue with gfortran ;-)

comment:12 Changed 18 months ago by Matthias Köppe

Description: modified (diff)

comment:13 Changed 18 months ago by Matthias Köppe

Description: modified (diff)
Summary: Efficient numerical computations with tensor trainsMeta-ticket: Efficient numerical computations with tensor trains

comment:14 Changed 18 months ago by Matthias Köppe

Description: modified (diff)

comment:15 Changed 18 months ago by Matthias Köppe

Description: modified (diff)

comment:16 Changed 18 months ago by Matthias Köppe

Description: modified (diff)

comment:17 Changed 18 months ago by Matthias Köppe

Description: modified (diff)

comment:18 Changed 18 months ago by Hongli (Bob) Zhao

Description: modified (diff)

slightly modified description

comment:19 Changed 18 months ago by Hongli (Bob) Zhao

Description: modified (diff)

comment:20 Changed 17 months ago by Matthias Köppe

Milestone: sage-9.4sage-9.5

comment:21 Changed 12 months ago by Matthias Köppe

Milestone: sage-9.5sage-9.6

comment:22 Changed 8 months ago by Matthias Köppe

Milestone: sage-9.6sage-9.7

comment:23 Changed 3 months ago by Matthias Köppe

Milestone: sage-9.7sage-9.8

comment:24 Changed 3 months ago by Matthias Köppe

Description: modified (diff)
Note: See TracTickets for help on using tickets.