function X = tangspace_to_matrixspace(gam,weight_op)
%tangspace_to_matrixspace Corresponds to operator "P_{T_k}".
U = weight_op.U;
V = weight_op.V;
% [d1,r]=size(U);
% d2    =size(V,1);
[~,M1,M3,M2] = get_Tk_matrices(gam,weight_op);%d1,d2,r);
UM3 = U'*M3;
M2V = M2*V;
X = (U*M1-U*M2V)*V'+U*M2;%(U*M1+U*M2V)*V'-U*M2;
X = X + (M3-U*UM3)*V';%U*(M3-M3V*V);
end

