From 1f18c5a79b3d7ea6f685c69fef1189cce53c8e3d Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Tue, 21 Jan 2020 09:37:08 -0500 Subject: [PATCH] pythonPackages.qiskit-ignis: init at 0.2.0 Qiskit Ignis is a toolbox for quantum hardware verification, noise characterization, and error correction. This commit follows the new Qiskit scheme of breaking one large package into smaller packages (terra, aer, etc), and then having a single meta-package "qiskit" that comprises them. --- .../python-modules/qiskit-ignis/default.nix | 62 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 64 insertions(+) create mode 100644 pkgs/development/python-modules/qiskit-ignis/default.nix diff --git a/pkgs/development/python-modules/qiskit-ignis/default.nix b/pkgs/development/python-modules/qiskit-ignis/default.nix new file mode 100644 index 0000000000000..2f0a99dc0f82d --- /dev/null +++ b/pkgs/development/python-modules/qiskit-ignis/default.nix @@ -0,0 +1,62 @@ +{ lib +, pythonOlder +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, numpy +, qiskit-terra +, scipy + # Check Inputs +, pytestCheckHook +, qiskit-aer +}: + +buildPythonPackage rec { + pname = "qiskit-ignis"; + version = "0.2.0"; + + disabled = pythonOlder "3.5"; + + # Pypi's tarball doesn't contain tests + src = fetchFromGitHub { + owner = "Qiskit"; + repo = pname; + rev = version; + sha256 = "08a60xk5dq5wmqc23r4hr2v2nsf9hs0ybz832vbnd6d80dl6izyc"; + }; + + patches = [ + # Update tests for compatibility with qiskit-aer 0.4 (#342). Remove in version > 0.2.0 + (fetchpatch { + url = "https://github.com/Qiskit/qiskit-ignis/commit/d78c494579f370058e68e360f10149db81b52477.patch"; + sha256 = "0ygkllf95c0jfvjg7gn399a5fd0wshsjpcn279kj7855m8j306h6"; + }) + # Fix statevector test over-eager validation (PR #333) + (fetchpatch { + url = "https://github.com/Qiskit/qiskit-ignis/commit/7cc8eb2e852b383ea429233fa43d3728931f1707.patch"; + sha256 = "0mdygykilg4qivdaa731z3y56l3ax4jp1sil9npqv0gn4p03c9g5"; + }) + ]; + + propagatedBuildInputs = [ + numpy + qiskit-terra + scipy + ]; + + # Tests + pythonImportsCheck = [ "qiskit.ignis" ]; + dontUseSetuptoolsCheck = true; + preCheck = ''export HOME=$TMPDIR''; + checkInputs = [ + pytestCheckHook + qiskit-aer + ]; + + meta = with lib; { + description = "Qiskit tools for quantum hardware verification, noise characterization, and error correction"; + homepage = "https://github.com/QISKit/qiskit-ignis"; + license = licenses.asl20; + maintainers = with maintainers; [ drewrisinger ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2331f447f19ed..bdf662e9e6bad 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7062,6 +7062,8 @@ in { qiskit-ibmq-provider = callPackage ../development/python-modules/qiskit-ibmq-provider { }; + qiskit-ignis = callPackage ../development/python-modules/qiskit-ignis { }; + qiskit-terra = callPackage ../development/python-modules/qiskit-terra { }; qasm2image = callPackage ../development/python-modules/qasm2image { };