%% function [cvx_optval,X] = Lambda(rho,T)
% computes the dyadic negativity of magic of the state rho
% requires as second argument the matrix T whose columns are pure stabilizer states
%
% based on Seddon et al., arXiv:2002.06181

function [cvx_optval,X] = Lambda(rho,T)

k = size(T,2);

cvx_begin quiet

variable X(k,k) complex
rho == T*X*T'
minimize sum(sum(abs(X)))

cvx_end

end