From 34f8334d2637df71ab508ff2deeaa861061edd62 Mon Sep 17 00:00:00 2001 From: Takashi Imamichi Date: Fri, 5 Feb 2021 01:07:34 +0900 Subject: [PATCH] Fix for docplex 2.20 --- qiskit_optimization/applications/ising/docplex.py | 2 +- qiskit_optimization/problems/quadratic_program.py | 2 +- requirements.txt | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qiskit_optimization/applications/ising/docplex.py b/qiskit_optimization/applications/ising/docplex.py index 43c7e8c19..e5149c821 100644 --- a/qiskit_optimization/applications/ising/docplex.py +++ b/qiskit_optimization/applications/ising/docplex.py @@ -64,7 +64,7 @@ import numpy as np from docplex.mp.constants import ComparisonType from docplex.mp.constr import LinearConstraint, QuadraticConstraint -from docplex.mp.linear import Var +from docplex.mp.dvar import Var from docplex.mp.model import Model from qiskit.quantum_info import Pauli from qiskit.opflow import PauliSumOp diff --git a/qiskit_optimization/problems/quadratic_program.py b/qiskit_optimization/problems/quadratic_program.py index 068c5f81d..9182edbf5 100644 --- a/qiskit_optimization/problems/quadratic_program.py +++ b/qiskit_optimization/problems/quadratic_program.py @@ -24,7 +24,7 @@ from docplex.mp.constr import LinearConstraint as DocplexLinearConstraint from docplex.mp.constr import NotEqualConstraint from docplex.mp.constr import QuadraticConstraint as DocplexQuadraticConstraint -from docplex.mp.linear import Var +from docplex.mp.dvar import Var from docplex.mp.model import Model from docplex.mp.model_reader import ModelReader from docplex.mp.quad import QuadExpr diff --git a/requirements.txt b/requirements.txt index 2eeb5cdc9..9b8b573bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ qiskit-terra>=0.17.0 scipy>=1.4 numpy>=1.17 psutil>=5 -docplex<2.20.204 +docplex setuptools>=40.1.0 retworkx>=0.5.0 dataclasses; python_version < '3.7' diff --git a/setup.py b/setup.py index 2db05fb5b..80ae61ad5 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ "scipy>=1.4", "numpy>=1.17", "psutil>=5", - "docplex<2.20.204", + "docplex", "setuptools>=40.1.0", "retworkx>=0.5.0", "dataclasses; python_version < '3.7'"