Difference between revisions of "Ttclass/amensum.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Normalise sequential blank lines)
m (Repair ttclass function page template)
Line 1: Line 1:
−
{{DISPLAYTITLE:ttclass/amensum.m}}
+
{{DISPLAYTITLE:ttclass/amensum.m}} __NOTOC__
−
Tensor train summation without loss of accuracy.
+
Sums buffered tensor trains in a single tensor train using
 +
AMEn algorithm.
  
 
==Syntax==
 
==Syntax==
  
 
     y=amensum(x,tol,opts)
 
     y=amensum(x,tol,opts)
−
 
−
==Description==
 
−
Sums buffered tensor trains in a single tensor train using AMEn algorithm.
 
  
 
==Arguments==
 
==Arguments==
  
−
    x   - ttclass with buffered rank-one tensors
+
    x                   - ttclass with buffered rank-one tensors
 
   
 
   
−
    tol - relative tolerance parameter, e.g. 1e-10
+
    tol                 - relative tolerance parameter, e.g. 1e-10
 
   
 
   
−
The opts field is optional:
+
    The opts field is optional:
 
   
 
   
−
    opts.max_swp - maximum number of iterations
+
    opts.max_swp         - maximum number of iterations
 
   
 
   
−
    opts.init_guess_rank - rank of the initial guess
+
    opts.init_guess_rank - rank of the initial guess
 
   
 
   
−
    opts.enrichment_rank - rank of the enrichment
+
    opts.enrichment_rank - rank of the enrichment
 
   
 
   
−
    opts.verb            - verbosity switch
+
    opts.verb            - verbosity switch
  
 
==Outputs==
 
==Outputs==
  
−
    y   - ttclass with a single tensor train, such
+
    y - ttclass with a single tensor train, such
−
          that |x-y|<tol*|x| in Frobenius norm
+
        that |x-y|<tol*|x| in Frobenius norm
  
 
==Notes==
 
==Notes==

Revision as of 17:04, 5 June 2026

Sums buffered tensor trains in a single tensor train using AMEn algorithm.

Syntax

    y=amensum(x,tol,opts)

Arguments

    x                    - ttclass with buffered rank-one tensors

    tol                  - relative tolerance parameter, e.g. 1e-10

    The opts field is optional:

    opts.max_swp         - maximum number of iterations

    opts.init_guess_rank - rank of the initial guess

    opts.enrichment_rank - rank of the enrichment

    opts.verb            - verbosity switch

Outputs

    y - ttclass with a single tensor train, such
        that |x-y|<tol*|x| in Frobenius norm

Notes

Summation is a messy operation in TT format. Spinach buffers tensor train sums and processes them in batches using this function.

See also

ttclass.m, ttclass/plus.m, ttclass/pack.m

Version 2.1, authors: Dmitry Savostyanov, Sergey Dolgov