2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2021-06-04 09:07:49 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, numpy
|
|
|
|
, qiskit-terra
|
2021-05-20 23:08:51 +00:00
|
|
|
, scikit-learn
|
2020-04-24 23:36:52 +00:00
|
|
|
, scipy
|
2020-12-03 08:41:04 +00:00
|
|
|
# Optional package inputs
|
|
|
|
, withVisualization ? false
|
|
|
|
, matplotlib
|
|
|
|
, withCvx ? false
|
|
|
|
, cvxpy
|
|
|
|
, withJit ? false
|
|
|
|
, numba
|
2020-04-24 23:36:52 +00:00
|
|
|
# Check Inputs
|
|
|
|
, pytestCheckHook
|
2020-09-25 04:45:31 +00:00
|
|
|
, ddt
|
|
|
|
, pyfakefs
|
2020-04-24 23:36:52 +00:00
|
|
|
, qiskit-aer
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qiskit-ignis";
|
2021-04-13 19:44:15 +00:00
|
|
|
version = "0.6.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
# Pypi's tarball doesn't contain tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Qiskit";
|
|
|
|
repo = "qiskit-ignis";
|
|
|
|
rev = version;
|
2021-04-13 19:44:15 +00:00
|
|
|
hash = "sha256-L5fwCMsN03ojiDvKIyqsGfUnwej1P7bpyHlL6mu7nh0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
qiskit-terra
|
2021-05-20 23:08:51 +00:00
|
|
|
scikit-learn
|
2020-04-24 23:36:52 +00:00
|
|
|
scipy
|
2020-12-03 08:41:04 +00:00
|
|
|
] ++ lib.optionals (withCvx) [ cvxpy ]
|
|
|
|
++ lib.optionals (withVisualization) [ matplotlib ]
|
|
|
|
++ lib.optionals (withJit) [ numba ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Tests
|
|
|
|
pythonImportsCheck = [ "qiskit.ignis" ];
|
|
|
|
dontUseSetuptoolsCheck = true;
|
2021-06-04 09:07:49 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
2020-09-25 04:45:31 +00:00
|
|
|
ddt
|
|
|
|
pyfakefs
|
2020-04-24 23:36:52 +00:00
|
|
|
qiskit-aer
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_tensored_meas_cal_on_circuit" # Flaky test, occasionally returns result outside bounds
|
2021-06-04 09:07:49 +00:00
|
|
|
] ++ lib.optionals stdenv.isAarch64 [
|
|
|
|
"test_fitters" # Fails check that arrays are close. Might be due to aarch64 math issues.
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Qiskit tools for quantum hardware verification, noise characterization, and error correction";
|
|
|
|
homepage = "https://qiskit.org/ignis";
|
|
|
|
downloadPage = "https://github.com/QISKit/qiskit-ignis/releases";
|
2020-09-25 04:45:31 +00:00
|
|
|
changelog = "https://qiskit.org/documentation/release_notes.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|