Build TT-tensor from the QTT-Tucker representation [TT] = TUCKER_TO_TT(FC, CORE) Given QTT-Tucker representation, compute the TT-tensor representation TT-Toolbox 2.2, 2009-2012 This is TT Toolbox, written by Ivan Oseledets et al. Institute of Numerical Mathematics, Moscow, Russia webpage: http://spring.inm.ras.ru/osel For all questions, bugs and suggestions please mail ivan.oseledets@gmail.com ---------------------------
0001 function [tt] = tucker_to_tt(fc, core) 0002 %Build TT-tensor from the QTT-Tucker representation 0003 %[TT] = TUCKER_TO_TT(FC, CORE) Given QTT-Tucker representation, compute the 0004 %TT-tensor representation 0005 % 0006 % 0007 % TT-Toolbox 2.2, 2009-2012 0008 % 0009 %This is TT Toolbox, written by Ivan Oseledets et al. 0010 %Institute of Numerical Mathematics, Moscow, Russia 0011 %webpage: http://spring.inm.ras.ru/osel 0012 % 0013 %For all questions, bugs and suggestions please mail 0014 %ivan.oseledets@gmail.com 0015 %--------------------------- 0016 0017 d = core.d; 0018 n = zeros(d,1); rtuck = zeros(d,1); 0019 for i=1:d 0020 n(i) = size(fc{i},1); 0021 rtuck(i) = size(fc{i},2); 0022 end; 0023 0024 rcr = core.r; 0025 tt = core; 0026 % keyboard; 0027 0028 for i=1:d 0029 cr1 = core{i}; 0030 cr1 = permute(cr1, [2, 1,3]); 0031 cr1 = reshape(cr1, [rtuck(i), rcr(i)*rcr(i+1)]); 0032 cr1 = fc{i}*cr1; % size n(i), rc1*rc2 0033 cr1 = reshape(cr1, n(i), rcr(i), rcr(i+1)); 0034 cr1 = permute(cr1, [2, 1, 3]); 0035 tt{i} = cr1; 0036 end; 0037 0038 end