Skip to content

Indicator constraint support for complex-valued equality constraints #2920

@wickyw

Description

@wickyw

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions