I’m writing an SDP for a traditional problem in quantum information, state discrimination. When I constrain the variables to real symmetric, it works. But the problem really needs them to be complex Hermitian. The code is
using JuMP
import LinearAlgebra
import Random
import SCS
function random_state(d)
x = randn(ComplexF64, (d,d))
y = x*adjoint(x)
rho = Hermitian(y/tr(y))
return rho
end
function discriminate(d,n)
model = Model(SCS.Optimizer)
rho = Array{ComplexF64}(undef,d, d, n)
for i=1:n
rho[:,:,i] = random_state(d)
end
E = model[:E] = reshape(
hcat([
@variable(model, [1:d, 1:d] in PSDCone(), base_name = "E$(i)")
for i in 1:n-1
]...),
d, d, n-1,
)
lastE = I - sum(E[:,:,i] for i in 1:n-1)
@constraint(model, lastE in PSDCone())
obj = real(sum(dot(rho[:,:,i],E[:,:,i]) for i in 1:n-1)+dot(rho[:,:,n],lastE))/n
@objective(model, Max, obj)
optimize!(model)
print(value(obj))
end
When I change “PSDCone()” to “HermitianPSDCone()” I get the error “Unrecognized constraint building format.” Is this a bug? Is there a way to make it work?
A bit unrelated, but is there a more convenient way to declare a set of Hermitian variables? With YALMIP I can just do
E = sdpvar(d,d,n-1,'hermitian','complex');
which is much more concise and readable.