1{
2 lib,
3 pythonOlder,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 setuptools,
9
10 # Python Inputs
11 fastdtw,
12 numpy,
13 psutil,
14 qiskit-terra,
15 scikit-learn,
16 sparse,
17 torch,
18 # Check Inputs
19 pytestCheckHook,
20 ddt,
21 pytest-timeout,
22 qiskit-aer,
23}:
24
25buildPythonPackage rec {
26 pname = "qiskit-machine-learning";
27 version = "0.8.2";
28 pyproject = true;
29
30 disabled = pythonOlder "3.6";
31
32 src = fetchFromGitHub {
33 owner = "qiskit";
34 repo = pname;
35 tag = version;
36 hash = "sha256-dvGUtB7R44B+DYZKl4R2Q0GdvLTjVKWD0KmuyCoaOSc=";
37 };
38
39 nativeBuildInputs = [ setuptools ];
40
41 propagatedBuildInputs = [
42 fastdtw
43 numpy
44 psutil
45 torch
46 qiskit-terra
47 scikit-learn
48 sparse
49 ];
50
51 doCheck = false; # TODO: enable. Tests fail on unstable due to some multithreading issue?
52 nativeCheckInputs = [
53 pytestCheckHook
54 pytest-timeout
55 ddt
56 qiskit-aer
57 ];
58
59 pythonImportsCheck = [ "qiskit_machine_learning" ];
60
61 pytestFlagsArray = [
62 "--durations=10"
63 "--showlocals"
64 "-vv"
65 "--ignore=test/connectors/test_torch_connector.py" # TODO: fix, get multithreading errors with python3.9, segfaults
66 ];
67 disabledTests = [
68 # Slow tests >10 s
69 "test_readme_sample"
70 "test_vqr_8"
71 "test_vqr_7"
72 "test_qgan_training_cg"
73 "test_vqc_4"
74 "test_classifier_with_circuit_qnn_and_cross_entropy_4"
75 "test_vqr_4"
76 "test_regressor_with_opflow_qnn_4"
77 "test_qgan_save_model"
78 "test_qgan_training_analytic_gradients"
79 "test_qgan_training_run_algo_numpy"
80 "test_ad_hoc_data"
81 "test_qgan_training"
82 ];
83
84 meta = with lib; {
85 description = "Software for developing quantum computing programs";
86 homepage = "https://qiskit.org";
87 downloadPage = "https://github.com/QISKit/qiskit-optimization/releases";
88 changelog = "https://qiskit.org/documentation/release_notes.html";
89 license = licenses.asl20;
90 maintainers = with maintainers; [ drewrisinger ];
91 };
92}