I'm trying to get a function that calculates schmidt decomposition of bipartite states (tensor of two density matrices) to print a sum of the schmidt number (X) and the basis vectors (e_i, e_j) side by side for each iteration of the for loop. ex:(x'*'e_1'\otimes' e_1+ ... + x'*'e_i'\otimes' e_j). The commented out fprintf statements are things i've already tried.
Code:
function [u, v] = Schmidt(m,n,v)
m = 3 %size of basis vector
n = 4 %size of basis vector
e_m = eye(m)
e_n = eye(n)
%can have a = input('enter an array>');
v = [1
2
3
4
5
6
7
8
9
10
11
12]
for i = 1:m
for j = 1:n
e_i = e_m(:,i)
e_j = e_n(:,j)
K = kron(e_i, e_j)
x = ctranspose(K)*v
W(i,j) = x
%fprintf('%d %f %f %f\n',j,e_i,e_j,x);
%fprintf(1,'Header 1\tHeader 2\n');
%fprintf(1,'%f\t%f\n','e_i e_j');
%fprintf('the basis are %d\n',e_i, e_j)
end
end
end