Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta-ticket: Efficient numerical computations with tensor trains #31991

Open
honglizhaobob mannequin opened this issue Jun 16, 2021 · 19 comments
Open

Meta-ticket: Efficient numerical computations with tensor trains #31991

honglizhaobob mannequin opened this issue Jun 16, 2021 · 19 comments

Comments

@honglizhaobob
Copy link
Mannequin

honglizhaobob mannequin commented Jun 16, 2021

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:

CC: @mkoeppe @egourgoulhon @dimpase

Component: linear algebra

Issue created by migration from https://trac.sagemath.org/ticket/31991

@honglizhaobob honglizhaobob mannequin added this to the sage-9.4 milestone Jun 16, 2021
@honglizhaobob

This comment has been minimized.

@honglizhaobob

This comment has been minimized.

@mkoeppe
Copy link
Contributor

mkoeppe commented Jun 16, 2021

comment:5

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)

@mkoeppe
Copy link
Contributor

mkoeppe commented Jun 16, 2021

comment:6

(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)

@honglizhaobob
Copy link
Mannequin Author

honglizhaobob mannequin commented Jun 16, 2021

comment:7

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.

@honglizhaobob

This comment has been minimized.

@egourgoulhon
Copy link
Member

comment:9

Waouh! This looks promising!

@mkoeppe
Copy link
Contributor

mkoeppe commented Jun 16, 2021

comment:10

I have opened an upstream issue for the compilation errors: oseledets/ttpy#82

@egourgoulhon
Copy link
Member

comment:11

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 ;-)

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Efficient numerical computations with tensor trains Meta-ticket: Efficient numerical computations with tensor trains Jun 17, 2021
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@honglizhaobob

This comment has been minimized.

@honglizhaobob
Copy link
Mannequin Author

honglizhaobob mannequin commented Jun 19, 2021

comment:18

slightly modified description

@honglizhaobob

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 14, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 1, 2022
@mkoeppe mkoeppe removed this from the sage-9.7 milestone Aug 31, 2022
@mkoeppe mkoeppe added this to the sage-9.8 milestone Aug 31, 2022
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.8, sage-9.9 Jan 7, 2023
@mkoeppe mkoeppe removed this from the sage-10.0 milestone Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants