2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2020-05-15 21:57:56 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, cmake
|
|
|
|
, cvxpy
|
|
|
|
, cython
|
2020-09-25 04:45:31 +00:00
|
|
|
, muparserx
|
|
|
|
, ninja
|
|
|
|
, nlohmann_json
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
|
|
|
, openblas
|
|
|
|
, pybind11
|
|
|
|
, scikit-build
|
|
|
|
, spdlog
|
|
|
|
# Check Inputs
|
|
|
|
, qiskit-terra
|
|
|
|
, pytestCheckHook
|
|
|
|
, python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qiskit-aer";
|
2020-09-25 04:45:31 +00:00
|
|
|
version = "0.6.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.5";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Qiskit";
|
|
|
|
repo = "qiskit-aer";
|
|
|
|
rev = version;
|
2020-09-25 04:45:31 +00:00
|
|
|
sha256 = "1fnv11diis0as8zcc57mamz0gbjd6vj7nw3arxzvwa77ja803sr4";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2020-09-25 04:45:31 +00:00
|
|
|
ninja
|
2020-04-24 23:36:52 +00:00
|
|
|
scikit-build
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openblas
|
|
|
|
spdlog
|
2020-09-25 04:45:31 +00:00
|
|
|
nlohmann_json
|
|
|
|
muparserx
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cvxpy
|
|
|
|
cython # generates some cython files at runtime that need to be cython-ized
|
|
|
|
numpy
|
|
|
|
pybind11
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
patches = [
|
|
|
|
# TODO: remove in favor of qiskit-aer PR #877 patch once accepted/stable
|
|
|
|
./remove-conan-install.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_TESTS=True"
|
|
|
|
"-DAER_THRUST_BACKEND=OMP"
|
|
|
|
];
|
|
|
|
|
|
|
|
# *** Testing ***
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"qiskit.providers.aer"
|
|
|
|
"qiskit.providers.aer.backends.qasm_simulator"
|
|
|
|
"qiskit.providers.aer.backends.controller_wrappers" # Checks C++ files built correctly. Only exists if built & moved to output
|
|
|
|
];
|
|
|
|
checkInputs = [
|
|
|
|
qiskit-terra
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
dontUseSetuptoolsCheck = true; # Otherwise runs tests twice
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Tests include a compiled "circuit" which is auto-built in $HOME
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
# move tests b/c by default try to find (missing) cython-ized code in /build/source dir
|
2020-05-15 21:57:56 +00:00
|
|
|
cp -r $TMP/$sourceRoot/test $HOME
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Add qiskit-aer compiled files to cython include search
|
|
|
|
pushd $HOME
|
|
|
|
'';
|
|
|
|
postCheck = ''
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "High performance simulators for Qiskit";
|
|
|
|
homepage = "https://qiskit.org/aer";
|
|
|
|
downloadPage = "https://github.com/QISKit/qiskit-aer/releases";
|
2020-09-25 04:45:31 +00:00
|
|
|
changelog = "https://qiskit.org/documentation/release_notes.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|