We are trying to solve the following optimization problem using ADMM:

$$ \begin{aligned} & \min _{\left\{y_{i j}^{m}\right\}} \sum_{i \in I_{m}} f_{i j}^{m}\left(y_{i j}^{m}\right)+\sum_{j \in J} \Phi^{m}\left(z_{i j}^{m}\right) \\ & \text { subject to } y_{i j}^{m}-z_{i j}^{m}=0 \quad \forall i, j, m \end{aligned} $$

Where $\Phi^{m}\left(z_{i j}^{m}\right)$ is an indicator function such that, if the value of $z_{i j}^{m}$ is greater than 0, the value of the function is equal to 1, otherwise, 0.

I am trying to solve this optimization function using the Qiskit Ecosystem:

# construct model using docplex
mdl = Model("ex6")

v = mdl.binary_var(name="v")
w = mdl.binary_var(name="w")
t = mdl.binary_var(name="t")
u = mdl.continuous_var(name="u")

mdl.minimize(v + w + t + 5 * (u - 2) ** 2)
mdl.add_constraint(v + 2 * w + t + u <= 3, "cons1")
mdl.add_constraint(v + w + t >= 1, "cons2")
mdl.add_constraint(v + w == 1, "cons3")

# load quadratic program from docplex model
qp = from_docplex_mp(mdl)

In the above code, I am unable to understand how to define the mdl.minimize() function, given that the indicator function $\Phi^{m}\left(z_{i j}^{m}\right)$ is a step function.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.