I have got a bunch of linear constraints for a positive semidefinite matrix rho like Tr(rho*Gamma{i})=gamma(i), where Gamma is a set of Povm operators, and gamma is the corresponding array of expectation values. I want to get a rho which is close enough to that which satisfies these constraints. And here y is the benchmark

of closeness.

function [rho,y]=closest(dim,Gamma,gamma)

```
n=size(Gamma,1);
cvx_begin sdp quiet
cvx_precision best
variable rho(dim,dim) hermitian
variable y=(n,1)
minimize norm(y,1)
trace(rho)==1
for i=1:n
abs(trace(rho*Gamma{i})-gamma(i))<=y(i)
end
cvx_end
```

end

Error using variable (line 57)

Invalid structure specification: y=(n,1)

Error in closest (line 6)

variable rho(dim,dim) hermitian y=(n,1)