function [Mcell,M]=krausdata(n,k)
% [Mcell,M]=krausdata(n,k)
%
% Randomly generated Kraus data
% Mcell has dimensions [n; n; ...;n] by n
%
% Mi is n by n
%
% M = [M1;
%      M2;
%     ...
%      Mk]
%
% normalized so that Sum Mi* Mi = I

M=randn(n*k,n);
W=sqrtm(M'*M);
M=M*inv(W);

Mcell=mat2cell(M,n*ones(k,1),n);
end