How can I decompose a matrix Z into two matrices X and Y as below:
$$ Z=X\otimes Y $$
in which $\otimes$ is the kroncker product. Is there any function in matlab or any other library which decomposes the kroncker product?
How can I decompose a matrix Z into two matrices X and Y as below:
$$ Z=X\otimes Y $$
in which $\otimes$ is the kroncker product. Is there any function in matlab or any other library which decomposes the kroncker product?
On
i didn't use any assumption for it, but tested my code for some real valued matrices and it worked. maybe it can be proofed but i am not sure about this . by the way i changed my mind and i don't use kroncker product any more but i will send the code here. it is a general function which can be used for any matrix. please let me know if there is any exception for it.
%implemented by Sahar
%use the below codes for decomposition
% A1=[4 1 7;1 10 3; 5 9 2];
% B1=[2 2 3 ;2 5 1; 7 1 4];
% C=kron(A1,B1);
% [outA,outB]=decomposeKronecker(A1,B1,C)
function [outA,outB]=decomposeKronecker(A1,B1,C) C=triu(C); A_sym = sym('A', size(A1)); B_sym = sym('B', size(B1)); C_sym=kron(A_sym,B_sym); C_sym=triu(C_sym); indx=find(C_sym); equations=(C_sym(indx)==C(indx)); result=solve( equations); A = sym('A',size(A1)); A=triu(A); A_tril_sym=transpose(triu(A,1)); A=A+A_tril_sym; outA=subs(A,result); B = sym('B',size(B1)); B=triu(B); B_tril_sym=transpose(triu(B,1)); B=B+B_tril_sym; outB=subs(B,result); kron(outA,outB) end
it can be decomposed a matrix into X and Y. i don't have any proof for it but implemented a matlab code which do it. send me a message if u need it.