diff --git a/qiskit/ignis/verification/tomography/fitters/process_fitter.py b/qiskit/ignis/verification/tomography/fitters/process_fitter.py index 38f944948..13ecfb0e8 100644 --- a/qiskit/ignis/verification/tomography/fitters/process_fitter.py +++ b/qiskit/ignis/verification/tomography/fitters/process_fitter.py @@ -21,7 +21,7 @@ from qiskit import QiskitError from qiskit.quantum_info.operators import Choi from .base_fitter import TomographyFitter -from .cvx_fit import cvxpy, cvx_fit +from .cvx_fit import cvx_fit from .lstsq_fit import lstsq_fit @@ -137,10 +137,11 @@ def fit(self, # pylint: disable=arguments-differ "to a process matrix.") # Choose automatic method if method == 'auto': - if cvxpy is None: - method = 'lstsq' - else: + self._check_for_sdp_solver() + if self._HAS_SDP_SOLVER: method = 'cvx' + else: + method = 'lstsq' if method == 'lstsq': return Choi(lstsq_fit(data, basis_matrix, weights=weights, trace=dim, **kwargs)) diff --git a/requirements-dev.txt b/requirements-dev.txt index 03c4550ee..18fbbe5c9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,3 @@ -cvxpy>=1.0.15 pylint==2.4.4 pycodestyle qiskit-aer>=0.3.0 diff --git a/tox.ini b/tox.ini index d4328aa45..95c9fd2bc 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,7 @@ setenv = deps = numpy>=1.13 Cython>=0.27.1 setuptools>=40.1.0 + cvxpy>=1.0.15 commands = pip install -U -c constraints.txt git+https://github.com/Qiskit/qiskit-terra.git pip install -U -c constraints.txt -r{toxinidir}/requirements-dev.txt