Difference between revisions of "Ttclass/diag.m"

From Spinach Documentation Wiki
Jump to: navigation, search
m (Add missing Version/authors metadata and remove raw author emails)
m (Repair ttclass function page template)
Line 1: Line 1:
−
Mimics the diag behavior for tensor train matrix. Syntax:
+
{{DISPLAYTITLE:ttclass/diag.m}} __NOTOC__
 +
Mimics the diag behaviour for tensor train matrix.
 +
 
 +
==Syntax==
  
 
     tt=diag(tt)
 
     tt=diag(tt)
  
−
If tt is a square matrix, return a vector by computing diag of every core.
+
==Arguments==
−
If tt is a vector (one mode size is ones), return a diagonal matrix.
+
 
 +
    tt - a tensor train representation of a matrix
 +
 
 +
==Outputs==
 +
 
 +
    tt - if the input is a square matrix, returns a
 +
          vector by computing diag of every core; if
 +
          the input is a vector (one mode size is
 +
          ones), returns a diagonal matrix
  
 
==See also==
 
==See also==

Revision as of 17:04, 5 June 2026

Mimics the diag behaviour for tensor train matrix.

Syntax

    tt=diag(tt)

Arguments

    tt - a tensor train representation of a matrix

Outputs

    tt - if the input is a square matrix, returns a
         vector by computing diag of every core; if
         the input is a vector (one mode size is
         ones), returns a diagonal matrix

See also

ttclass.m, ttclass/trace.m, ttclass/full.m, Tensor train functions

Version 2.1, authors: Dmitry Savostyanov