2020-01-21 19:29:57 +00:00
|
|
|
{ lib
|
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2020-05-11 22:29:38 +01:00
|
|
|
, fetchpatch
|
2020-11-04 17:37:48 +00:00
|
|
|
# C Inputs
|
|
|
|
, blas
|
|
|
|
, catch2
|
2020-01-21 19:29:57 +00:00
|
|
|
, cmake
|
|
|
|
, cython
|
2020-08-10 23:41:37 +01:00
|
|
|
, muparserx
|
|
|
|
, ninja
|
|
|
|
, nlohmann_json
|
2020-11-04 17:37:48 +00:00
|
|
|
, spdlog
|
|
|
|
# Python Inputs
|
|
|
|
, cvxpy
|
2020-01-21 19:29:57 +00:00
|
|
|
, numpy
|
|
|
|
, pybind11
|
|
|
|
, scikit-build
|
|
|
|
# Check Inputs
|
|
|
|
, pytestCheckHook
|
2020-11-04 17:37:48 +00:00
|
|
|
, ddt
|
|
|
|
, fixtures
|
2020-11-04 18:03:00 +00:00
|
|
|
, pytest-timeout
|
2020-11-04 17:37:48 +00:00
|
|
|
, qiskit-terra
|
2020-01-21 19:29:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qiskit-aer";
|
2020-11-04 17:37:48 +00:00
|
|
|
version = "0.7.1";
|
2020-01-21 19:29:57 +00:00
|
|
|
|
2020-11-04 17:37:48 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-01-21 19:29:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Qiskit";
|
2020-04-10 19:54:23 +01:00
|
|
|
repo = "qiskit-aer";
|
2020-01-21 19:29:57 +00:00
|
|
|
rev = version;
|
2020-11-04 17:37:48 +00:00
|
|
|
sha256 = "07l0wavdknx0y4vy0hwgw24365sg4nb6ygl3lpa098np85qgyn4y";
|
2020-01-21 19:29:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2020-08-10 23:41:37 +01:00
|
|
|
ninja
|
2020-01-21 19:29:57 +00:00
|
|
|
scikit-build
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2020-11-04 17:37:48 +00:00
|
|
|
blas
|
|
|
|
catch2
|
2020-08-10 23:41:37 +01:00
|
|
|
muparserx
|
2020-11-04 17:37:48 +00:00
|
|
|
nlohmann_json
|
|
|
|
spdlog
|
2020-01-21 19:29:57 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cvxpy
|
|
|
|
cython # generates some cython files at runtime that need to be cython-ized
|
|
|
|
numpy
|
|
|
|
pybind11
|
|
|
|
];
|
|
|
|
|
2020-08-10 23:41:37 +01:00
|
|
|
patches = [
|
|
|
|
# TODO: remove in favor of qiskit-aer PR #877 patch once accepted/stable
|
|
|
|
./remove-conan-install.patch
|
|
|
|
];
|
2020-01-21 19:29:57 +00:00
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
# *** 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
|
|
|
|
];
|
2020-11-04 17:37:48 +00:00
|
|
|
# Slow tests
|
|
|
|
disabledTests = [
|
|
|
|
"test_paulis_1_and_2_qubits"
|
|
|
|
"test_3d_oscillator"
|
|
|
|
];
|
2020-01-21 19:29:57 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
2020-11-04 17:37:48 +00:00
|
|
|
ddt
|
|
|
|
fixtures
|
2020-11-04 18:03:00 +00:00
|
|
|
pytest-timeout
|
2020-11-04 17:37:48 +00:00
|
|
|
qiskit-terra
|
2020-01-21 19:29:57 +00:00
|
|
|
];
|
2020-11-04 18:03:00 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--timeout=30"
|
|
|
|
"--durations=10"
|
|
|
|
];
|
2020-01-21 19:29:57 +00:00
|
|
|
|
|
|
|
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-11 22:29:38 +01:00
|
|
|
cp -r $TMP/$sourceRoot/test $HOME
|
2020-01-21 19:29:57 +00:00
|
|
|
|
|
|
|
# Add qiskit-aer compiled files to cython include search
|
|
|
|
pushd $HOME
|
|
|
|
'';
|
2020-11-04 17:37:48 +00:00
|
|
|
postCheck = "popd";
|
2020-01-21 19:29:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "High performance simulators for Qiskit";
|
2020-04-10 19:54:23 +01:00
|
|
|
homepage = "https://qiskit.org/aer";
|
|
|
|
downloadPage = "https://github.com/QISKit/qiskit-aer/releases";
|
2020-08-10 23:41:37 +01:00
|
|
|
changelog = "https://qiskit.org/documentation/release_notes.html";
|
2020-01-21 19:29:57 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|