2020-01-21 14:37:08 +00:00
|
|
|
{ lib
|
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
2020-05-11 22:32:41 +01:00
|
|
|
, python
|
2020-01-21 14:37:08 +00:00
|
|
|
, numpy
|
|
|
|
, qiskit-terra
|
2020-04-10 21:35:54 +01:00
|
|
|
, scikitlearn
|
2020-01-21 14:37:08 +00:00
|
|
|
, scipy
|
|
|
|
# Check Inputs
|
2020-04-10 21:35:54 +01:00
|
|
|
, ddt
|
2020-01-21 14:37:08 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, qiskit-aer
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qiskit-ignis";
|
2020-04-10 21:35:54 +01:00
|
|
|
version = "0.3.0";
|
2020-01-21 14:37:08 +00:00
|
|
|
|
2020-04-10 21:35:54 +01:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-01-21 14:37:08 +00:00
|
|
|
|
|
|
|
# Pypi's tarball doesn't contain tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Qiskit";
|
2020-04-10 21:35:54 +01:00
|
|
|
repo = "qiskit-ignis";
|
2020-01-21 14:37:08 +00:00
|
|
|
rev = version;
|
2020-04-10 21:35:54 +01:00
|
|
|
sha256 = "16h04n9hxw669nq2ii16l6h75x8afisvp3j062n4c62kcqci0x4x";
|
2020-01-21 14:37:08 +00:00
|
|
|
};
|
|
|
|
|
2020-04-10 21:35:54 +01:00
|
|
|
# Fixed qiskit-ignis PR #385, figured this is easier than fetchpatch
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace qiskit/ignis/logging/ignis_logging.py --replace "self.configure_logger" "self._configure_logger"
|
|
|
|
'';
|
2020-01-21 14:37:08 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
qiskit-terra
|
2020-04-10 21:35:54 +01:00
|
|
|
scikitlearn
|
2020-01-21 14:37:08 +00:00
|
|
|
scipy
|
|
|
|
];
|
2020-05-11 22:32:41 +01:00
|
|
|
postInstall = "rm -rf $out/${python.sitePackages}/docs"; # this dir can create conflicts
|
2020-01-21 14:37:08 +00:00
|
|
|
|
|
|
|
# Tests
|
|
|
|
pythonImportsCheck = [ "qiskit.ignis" ];
|
|
|
|
dontUseSetuptoolsCheck = true;
|
2020-05-11 22:32:41 +01:00
|
|
|
preCheck = "export HOME=$TMPDIR";
|
2020-01-21 14:37:08 +00:00
|
|
|
checkInputs = [
|
2020-04-10 21:35:54 +01:00
|
|
|
ddt
|
2020-01-21 14:37:08 +00:00
|
|
|
pytestCheckHook
|
|
|
|
qiskit-aer
|
|
|
|
];
|
2020-04-10 21:35:54 +01:00
|
|
|
# Test is in test/verification/test_entanglemet.py. test fails due to out-of-date calls & bad logic with this file since qiskit-ignis#328
|
|
|
|
# see qiskit-ignis#386 for all issues. Should be able to re-enable in future.
|
|
|
|
disabledTests = [ "TestEntanglement" ];
|
2020-01-21 14:37:08 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Qiskit tools for quantum hardware verification, noise characterization, and error correction";
|
2020-04-10 21:35:54 +01:00
|
|
|
homepage = "https://qiskit.org/ignis";
|
|
|
|
downloadPage = "https://github.com/QISKit/qiskit-ignis/releases";
|
2020-01-21 14:37:08 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|