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.3";
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-XnLCejK6m8p/OC5gKCoP1UXVblISChu3lKF8BnrnRbk=";
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 pytestFlags = [
62 "--durations=10"
63 "--showlocals"
64 "-vv"
65 ];
66 disabledTestPaths = [
67 "test/connectors/test_torch_connector.py" # TODO: fix, get multithreading errors with python3.9, segfaults
68 ];
69 disabledTests = [
70 # Slow tests >10 s
71 "test_readme_sample"
72 "test_vqr_8"
73 "test_vqr_7"
74 "test_qgan_training_cg"
75 "test_vqc_4"
76 "test_classifier_with_circuit_qnn_and_cross_entropy_4"
77 "test_vqr_4"
78 "test_regressor_with_opflow_qnn_4"
79 "test_qgan_save_model"
80 "test_qgan_training_analytic_gradients"
81 "test_qgan_training_run_algo_numpy"
82 "test_ad_hoc_data"
83 "test_qgan_training"
84 ];
85
86 meta = with lib; {
87 description = "Software for developing quantum computing programs";
88 homepage = "https://qiskit.org";
89 downloadPage = "https://github.com/QISKit/qiskit-optimization/releases";
90 changelog = "https://qiskit.org/documentation/release_notes.html";
91 license = licenses.asl20;
92 maintainers = with maintainers; [ drewrisinger ];
93 };
94}