2020-01-21 19:29:57 +00:00
|
|
|
{ lib
|
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2020-11-04 17:37:48 +00:00
|
|
|
# C Inputs
|
|
|
|
, blas
|
|
|
|
, catch2
|
2020-01-21 19:29:57 +00:00
|
|
|
, cmake
|
|
|
|
, cython
|
2020-12-09 19:53:17 +00:00
|
|
|
, fmt
|
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";
|
2021-02-25 16:43:35 +00:00
|
|
|
version = "0.7.6";
|
|
|
|
format = "pyproject";
|
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;
|
2021-02-25 16:43:35 +00:00
|
|
|
sha256 = "0595as4rxjrd5dqx54ywz3rjsjk0z7r41bq0z9r8y1h7zgvvlrmn";
|
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-12-09 19:53:17 +00:00
|
|
|
fmt
|
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
|
|
|
|
];
|
|
|
|
|
2021-02-10 17:01:21 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py --replace "'cmake!=3.17,!=3.17.0'," ""
|
|
|
|
'';
|
|
|
|
|
2021-02-25 16:43:35 +00:00
|
|
|
# Disable using conan for build
|
2021-02-10 17:01:21 +00:00
|
|
|
preBuild = ''
|
|
|
|
export DISABLE_CONAN=1
|
|
|
|
'';
|
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 ];
|
|
|
|
};
|
|
|
|
}
|