1{ lib
2, stdenv
3, pythonOlder
4, buildPythonPackage
5, fetchFromGitHub
6, numpy
7, qiskit-terra
8, scikit-learn
9, scipy
10 # Optional package inputs
11, withVisualization ? false
12, matplotlib
13, withCvx ? false
14, cvxpy
15, withJit ? false
16, numba
17 # Check Inputs
18, pytestCheckHook
19, ddt
20, pyfakefs
21, qiskit-aer
22}:
23
24buildPythonPackage rec {
25 pname = "qiskit-ignis";
26 version = "0.6.0";
27
28 disabled = pythonOlder "3.6";
29
30 # Pypi's tarball doesn't contain tests
31 src = fetchFromGitHub {
32 owner = "Qiskit";
33 repo = "qiskit-ignis";
34 rev = version;
35 hash = "sha256-L5fwCMsN03ojiDvKIyqsGfUnwej1P7bpyHlL6mu7nh0=";
36 };
37
38 propagatedBuildInputs = [
39 numpy
40 qiskit-terra
41 scikit-learn
42 scipy
43 ] ++ lib.optionals (withCvx) [ cvxpy ]
44 ++ lib.optionals (withVisualization) [ matplotlib ]
45 ++ lib.optionals (withJit) [ numba ];
46
47 # Tests
48 pythonImportsCheck = [ "qiskit.ignis" ];
49 dontUseSetuptoolsCheck = true;
50 preCheck = ''
51 export HOME=$TMPDIR
52 '';
53 checkInputs = [
54 pytestCheckHook
55 ddt
56 pyfakefs
57 qiskit-aer
58 ];
59 disabledTests = [
60 "test_tensored_meas_cal_on_circuit" # Flaky test, occasionally returns result outside bounds
61 ] ++ lib.optionals stdenv.isAarch64 [
62 "test_fitters" # Fails check that arrays are close. Might be due to aarch64 math issues.
63 ];
64
65 meta = with lib; {
66 description = "Qiskit tools for quantum hardware verification, noise characterization, and error correction";
67 homepage = "https://qiskit.org/ignis";
68 downloadPage = "https://github.com/QISKit/qiskit-ignis/releases";
69 changelog = "https://qiskit.org/documentation/release_notes.html";
70 license = licenses.asl20;
71 maintainers = with maintainers; [ drewrisinger ];
72 };
73}