1{ lib 2, pythonOlder 3, buildPythonPackage 4, fetchFromGitHub 5 # Python Inputs 6, h5py 7, numpy 8, psutil 9, qiskit-terra 10, retworkx 11, scikit-learn 12, scipy 13, withPyscf ? false 14, pyscf 15 # Check Inputs 16, pytestCheckHook 17, ddt 18, pylatexenc 19}: 20 21buildPythonPackage rec { 22 pname = "qiskit-nature"; 23 version = "0.2.2"; 24 25 disabled = pythonOlder "3.6"; 26 27 src = fetchFromGitHub { 28 owner = "qiskit"; 29 repo = pname; 30 rev = version; 31 sha256 = "sha256-nQbvH911Gt4KddG23qwmiXfRJTWwVEsrzPvuTQfy4FY="; 32 }; 33 34 postPatch = '' 35 substituteInPlace requirements.txt --replace "h5py<3.3" "h5py" 36 ''; 37 38 propagatedBuildInputs = [ 39 h5py 40 numpy 41 psutil 42 qiskit-terra 43 retworkx 44 scikit-learn 45 scipy 46 ] ++ lib.optional withPyscf pyscf; 47 48 checkInputs = [ 49 pytestCheckHook 50 ddt 51 pylatexenc 52 ]; 53 54 pythonImportsCheck = [ "qiskit_nature" ]; 55 56 pytestFlagsArray = [ 57 "--durations=10" 58 ] ++ lib.optionals (!withPyscf) [ 59 "--ignore=test/algorithms/excited_state_solvers/test_excited_states_eigensolver.py" 60 ]; 61 62 disabledTests = [ 63 # small math error < 0.05 (< 9e-6 %) 64 "test_vqe_uvccsd_factory" 65 # unsure of failure reason. Might be related to recent cvxpy update? 66 "test_two_qubit_reduction" 67 ] ++ lib.optionals (!withPyscf) [ 68 "test_h2_bopes_sampler" 69 "test_potential_interface" 70 ]; 71 72 meta = with lib; { 73 description = "Software for developing quantum computing programs"; 74 homepage = "https://qiskit.org"; 75 downloadPage = "https://github.com/QISKit/qiskit-optimization/releases"; 76 changelog = "https://qiskit.org/documentation/release_notes.html"; 77 license = licenses.asl20; 78 maintainers = with maintainers; [ drewrisinger ]; 79 }; 80}