2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
cirq-core,
|
|
|
|
fetchFromGitHub,
|
|
|
|
matplotlib,
|
|
|
|
networkx,
|
|
|
|
numpy,
|
|
|
|
pandas,
|
|
|
|
pybind11,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
scipy,
|
|
|
|
setuptools,
|
|
|
|
wheel,
|
2022-08-21 13:32:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "stim";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.13.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-08-21 13:32:41 +00:00
|
|
|
owner = "quantumlib";
|
|
|
|
repo = "Stim";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-anJvDHLZ470iNw0U7hq9xGBacDgqYO9ZcmmdCt9pefg=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
# asked to relax this in https://github.com/quantumlib/Stim/issues/623
|
|
|
|
substituteInPlace pyproject.toml \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-quiet "pybind11~=" "pybind11>="
|
2023-10-09 19:29:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pybind11
|
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ numpy ];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-21 13:32:41 +00:00
|
|
|
cirq-core
|
|
|
|
matplotlib
|
|
|
|
networkx
|
|
|
|
pandas
|
2024-01-02 11:29:13 +00:00
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
scipy
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "stim" ];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
2024-01-02 11:29:13 +00:00
|
|
|
# Don't test sample
|
|
|
|
"glue/sample/"
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool for high performance simulation and analysis of quantum stabilizer circuits, especially quantum error correction (QEC) circuits";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "stim";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/quantumlib/stim";
|
|
|
|
changelog = "https://github.com/quantumlib/Stim/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ chrispattison ];
|
|
|
|
};
|
2022-08-21 13:32:41 +00:00
|
|
|
}
|