2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
# Python Inputs
|
|
|
|
, h5py
|
|
|
|
, numpy
|
|
|
|
, psutil
|
|
|
|
, qiskit-terra
|
|
|
|
, retworkx
|
|
|
|
, scikit-learn
|
|
|
|
, scipy
|
|
|
|
, withPyscf ? false
|
|
|
|
, pyscf
|
|
|
|
# Check Inputs
|
|
|
|
, pytestCheckHook
|
|
|
|
, ddt
|
|
|
|
, pylatexenc
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qiskit-nature";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "0.3.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qiskit";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "1lr198l2z9j1hw389vv6mgz6djkq4bw91r0hif58jpg8w6kmzsx9";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt --replace "h5py<3.3" "h5py"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
h5py
|
|
|
|
numpy
|
|
|
|
psutil
|
|
|
|
qiskit-terra
|
|
|
|
retworkx
|
|
|
|
scikit-learn
|
|
|
|
scipy
|
|
|
|
] ++ lib.optional withPyscf pyscf;
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
ddt
|
|
|
|
pylatexenc
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "qiskit_nature" ];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"--durations=10"
|
|
|
|
] ++ lib.optionals (!withPyscf) [
|
|
|
|
"--ignore=test/algorithms/excited_state_solvers/test_excited_states_eigensolver.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# small math error < 0.05 (< 9e-6 %)
|
|
|
|
"test_vqe_uvccsd_factory"
|
|
|
|
# unsure of failure reason. Might be related to recent cvxpy update?
|
|
|
|
"test_two_qubit_reduction"
|
|
|
|
] ++ lib.optionals (!withPyscf) [
|
|
|
|
"test_h2_bopes_sampler"
|
|
|
|
"test_potential_interface"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Software for developing quantum computing programs";
|
|
|
|
homepage = "https://qiskit.org";
|
|
|
|
downloadPage = "https://github.com/QISKit/qiskit-optimization/releases";
|
|
|
|
changelog = "https://qiskit.org/documentation/release_notes.html";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|