-
Notifications
You must be signed in to change notification settings - Fork 98
Description
Dear all,
Recently, I found out that JuMP supports complex-valued equality constraints (which made me very happy, since that makes my models read a lot nicer!). The manual states the following:
JuMP reformulates complex-valued equality constraints into two real-valued constraints: one representing the real part, and one representing the imaginary part. Thus, complex-valued equality constraints can be solved any solver that supports the real-valued constraint type.
However, it does not seem to reformulate indicator constraints with complex-valued equality constraints in them. A mininum working example:
using JuMP, HiGHS
model = Model(HiGHS.Optimizer)
@variable(model, x, Bin)
@variable(model, y in ComplexPlane(), lower_bound=-1.0 + im*-1.0, upper_bound=1.0 + im*1.0)
@constraint(model, x --> {y == 0})
@objective(model, Max, real(y))
optimize!(model)Output:
ERROR: Constraints of type MathOptInterface.VectorAffineFunction{ComplexF64}-in-MathOptInterface.Indicator{MathOptInterface.ACTIVATE_ON_ONE, MathOptInterface.EqualTo{ComplexF64}} are not supported by the solver.
Of course, the equivalent "noncomplex" indicator constraint does work:
using JuMP, HiGHS
model = Model(HiGHS.Optimizer)
@variable(model, x, Bin)
@variable(model, y in ComplexPlane(), lower_bound=-1.0 + im*-1.0, upper_bound=1.0 + im*1.0)
# @constraint(model, x --> {y == 0})
@constraint(model, x --> {real(y) == 0})
@constraint(model, x --> {imag(y) == 0})
@objective(model, Max, real(y))
optimize!(model)Would it be possible to have JuMP interpret the former as the latter?