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