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 numpy
42 qiskit-terra
43 scikit-learn
44 scipy
45 ]
46 ++ lib.optionals (withCvx) [ cvxpy ]
47 ++ lib.optionals (withVisualization) [ matplotlib ]
48 ++ lib.optionals (withJit) [ numba ];
49
50 # Tests
51 pythonImportsCheck = [ "qiskit.ignis" ];
52 preCheck = ''
53 export HOME=$TMPDIR
54 '';
55 nativeCheckInputs = [
56 pytestCheckHook
57 ddt
58 pyfakefs
59 qiskit-aer
60 ];
61 disabledTests = [
62 "test_tensored_meas_cal_on_circuit" # Flaky test, occasionally returns result outside bounds
63 ]
64 ++ lib.optionals stdenv.hostPlatform.isAarch64 [
65 "test_fitters" # Fails check that arrays are close. Might be due to aarch64 math issues.
66 ];
67
68 meta = with lib; {
69 description = "Qiskit tools for quantum hardware verification, noise characterization, and error correction";
70 homepage = "https://qiskit.org/ignis";
71 downloadPage = "https://github.com/QISKit/qiskit-ignis/releases";
72 changelog = "https://qiskit.org/documentation/release_notes.html";
73 license = licenses.asl20;
74 maintainers = with maintainers; [ drewrisinger ];
75 };
76}