2020-01-21 14:37:08 +00:00
|
|
|
{ lib
|
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
2020-05-11 22:32:41 +01:00
|
|
|
, python
|
2020-01-21 14:37:08 +00:00
|
|
|
, numpy
|
|
|
|
, qiskit-terra
|
2020-04-10 21:35:54 +01:00
|
|
|
, scikitlearn
|
2020-01-21 14:37:08 +00:00
|
|
|
, scipy
|
2020-11-04 17:40:08 +00:00
|
|
|
# Optional package inputs
|
|
|
|
, withVisualization ? false
|
|
|
|
, matplotlib
|
|
|
|
, withCvx ? false
|
|
|
|
, cvxpy
|
|
|
|
, withJit ? false
|
|
|
|
, numba
|
2020-01-21 14:37:08 +00:00
|
|
|
# Check Inputs
|
|
|
|
, pytestCheckHook
|
2020-08-10 23:42:31 +01:00
|
|
|
, ddt
|
|
|
|
, pyfakefs
|
2020-01-21 14:37:08 +00:00
|
|
|
, qiskit-aer
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qiskit-ignis";
|
2020-11-04 17:40:08 +00:00
|
|
|
version = "0.5.1";
|
2020-01-21 14:37:08 +00:00
|
|
|
|
2020-04-10 21:35:54 +01:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-01-21 14:37:08 +00:00
|
|
|
|
|
|
|
# Pypi's tarball doesn't contain tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Qiskit";
|
2020-04-10 21:35:54 +01:00
|
|
|
repo = "qiskit-ignis";
|
2020-01-21 14:37:08 +00:00
|
|
|
rev = version;
|
2020-11-04 17:40:08 +00:00
|
|
|
sha256 = "17kplmi17axcbbgw35dzfr3d5bzfymxfni9sf6v14223c5674p4y";
|
2020-01-21 14:37:08 +00:00
|
|
|
};
|
|
|
|
|
2020-11-04 17:40:08 +00:00
|
|
|
# hacky, fix https://github.com/Qiskit/qiskit-ignis/issues/532.
|
|
|
|
# TODO: remove on qiskit-ignis v0.5.1
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace qiskit/ignis/mitigation/expval/base_meas_mitigator.py --replace "plt.axes" "'plt.axes'"
|
|
|
|
'';
|
|
|
|
|
2020-01-21 14:37:08 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
qiskit-terra
|
2020-04-10 21:35:54 +01:00
|
|
|
scikitlearn
|
2020-01-21 14:37:08 +00:00
|
|
|
scipy
|
2020-11-04 17:40:08 +00:00
|
|
|
] ++ lib.optionals (withCvx) [ cvxpy ]
|
|
|
|
++ lib.optionals (withVisualization) [ matplotlib ]
|
|
|
|
++ lib.optionals (withJit) [ numba ];
|
|
|
|
postInstall = "rm -rf $out/${python.sitePackages}/docs"; # this dir can create conflicts
|
2020-01-21 14:37:08 +00:00
|
|
|
|
|
|
|
# Tests
|
|
|
|
pythonImportsCheck = [ "qiskit.ignis" ];
|
|
|
|
dontUseSetuptoolsCheck = true;
|
2020-05-11 22:32:41 +01:00
|
|
|
preCheck = "export HOME=$TMPDIR";
|
2020-01-21 14:37:08 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
2020-08-10 23:42:31 +01:00
|
|
|
ddt
|
|
|
|
pyfakefs
|
2020-01-21 14:37:08 +00:00
|
|
|
qiskit-aer
|
|
|
|
];
|
2020-08-10 23:42:31 +01:00
|
|
|
disabledTests = [
|
|
|
|
"test_tensored_meas_cal_on_circuit" # Flaky test, occasionally returns result outside bounds
|
2020-11-04 17:40:08 +00:00
|
|
|
"test_qv_fitter" # execution hangs, ran for several minutes
|
2020-08-10 23:42:31 +01:00
|
|
|
];
|
2020-01-21 14:37:08 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Qiskit tools for quantum hardware verification, noise characterization, and error correction";
|
2020-04-10 21:35:54 +01:00
|
|
|
homepage = "https://qiskit.org/ignis";
|
|
|
|
downloadPage = "https://github.com/QISKit/qiskit-ignis/releases";
|
2020-08-10 23:42:31 +01:00
|
|
|
changelog = "https://qiskit.org/documentation/release_notes.html";
|
2020-01-21 14:37:08 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|