2020-01-21 14:37:08 +00:00
|
|
|
{ lib
|
2021-05-04 17:06:19 +00:00
|
|
|
, stdenv
|
2020-01-21 14:37:08 +00:00
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, numpy
|
|
|
|
, qiskit-terra
|
2021-05-14 18:46:36 +00:00
|
|
|
, scikit-learn
|
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 22:42:31 +00:00
|
|
|
, ddt
|
|
|
|
, pyfakefs
|
2020-01-21 14:37:08 +00:00
|
|
|
, qiskit-aer
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qiskit-ignis";
|
2021-04-06 15:10:06 +00:00
|
|
|
version = "0.6.0";
|
2020-01-21 14:37:08 +00:00
|
|
|
|
2020-04-10 20:35:54 +00: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 20:35:54 +00:00
|
|
|
repo = "qiskit-ignis";
|
2020-01-21 14:37:08 +00:00
|
|
|
rev = version;
|
2021-04-06 15:10:06 +00:00
|
|
|
hash = "sha256-L5fwCMsN03ojiDvKIyqsGfUnwej1P7bpyHlL6mu7nh0=";
|
2020-01-21 14:37:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
qiskit-terra
|
2021-05-14 18:46:36 +00:00
|
|
|
scikit-learn
|
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 ];
|
2020-01-21 14:37:08 +00:00
|
|
|
|
|
|
|
# Tests
|
|
|
|
pythonImportsCheck = [ "qiskit.ignis" ];
|
|
|
|
dontUseSetuptoolsCheck = true;
|
2021-05-04 17:06:19 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
2020-01-21 14:37:08 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
2020-08-10 22:42:31 +00:00
|
|
|
ddt
|
|
|
|
pyfakefs
|
2020-01-21 14:37:08 +00:00
|
|
|
qiskit-aer
|
|
|
|
];
|
2020-08-10 22:42:31 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_tensored_meas_cal_on_circuit" # Flaky test, occasionally returns result outside bounds
|
2021-05-04 17:06:19 +00:00
|
|
|
] ++ lib.optionals stdenv.isAarch64 [
|
|
|
|
"test_fitters" # Fails check that arrays are close. Might be due to aarch64 math issues.
|
2020-08-10 22:42:31 +00: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 20:35:54 +00:00
|
|
|
homepage = "https://qiskit.org/ignis";
|
|
|
|
downloadPage = "https://github.com/QISKit/qiskit-ignis/releases";
|
2020-08-10 22:42:31 +00:00
|
|
|
changelog = "https://qiskit.org/documentation/release_notes.html";
|
2020-01-21 14:37:08 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|