Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

[Stable] Fix fitter selection logic in process tomography (#431) #435

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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))
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cvxpy>=1.0.15
pylint==2.4.4
pycodestyle
qiskit-aer>=0.3.0
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 qiskit-terra
pip install -U -c constraints.txt -r{toxinidir}/requirements-dev.txt
Expand Down