I am trying to write code for thr dual part. However I have minus G value: I dont understand why.
Could you please kindly look at and let me know?
function [G,W,S] = TD_P_inv_Dual(P_exp,B,A_ax,B_by)
d = size(P_exp,1); %dimentions
m = size(P_exp,3); %number of operators
%d = size(B_by,1);
%m = size(B_by,3);
W=sum(sum(sum(sum(B.*P_exp)))); %This is W
for b =1:d
for y =1:m
if a ~= b
S = sum(B(a,b,x,y));
(S.*W_hat-kron(squeeze(A_ax(:,:,1,e)),eye(d)))==semidefinite(d^2,d^2); %this part is the following part of eq. 19
Now the problem has been solved. I mean at least G is non negative and status is solved.
The thing is that I could not find any explanation for gamma so I just ignore that. However When I saw your message I thought that this gamma should be a variable in the code so I added gamma as a variable to code and now it seems ok
Thank you very mych Mark_L_Stone :)