about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/stim/default.nix
blob: 0e779f3850a44a13364bf157647eab5fdb6e99b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{ lib
, buildPythonPackage
, cirq-core
, fetchFromGitHub
, matplotlib
, networkx
, numpy
, pandas
, pybind11
, pytest-xdist
, pytestCheckHook
, pythonOlder
, scipy
, setuptools
, wheel
}:

buildPythonPackage rec {
  pname = "stim";
  version = "1.12.1";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "quantumlib";
    repo = "Stim";
    rev = "refs/tags/v${version}";
    hash = "sha256-vDpW8cn1JPARDIXpLyK9uenhHmva0FwnWIDV7dSHbIY=";
  };

  postPatch = ''
    # asked to relax this in https://github.com/quantumlib/Stim/issues/623
    substituteInPlace pyproject.toml \
      --replace "pybind11==" "pybind11>="
  '';

  nativeBuildInputs = [
    pybind11
    setuptools
    wheel
  ];

  propagatedBuildInputs = [
    numpy
  ];

  nativeCheckInputs = [
    cirq-core
    matplotlib
    networkx
    pandas
    pytest-xdist
    pytestCheckHook
    scipy
  ];

  pythonImportsCheck = [
    "stim"
  ];

  enableParallelBuilding = true;

  disabledTestPaths = [
    # Don't test sample
    "glue/sample/"
  ];

  meta = with lib; {
    description = "A tool for high performance simulation and analysis of quantum stabilizer circuits, especially quantum error correction (QEC) circuits";
    homepage = "https://github.com/quantumlib/stim";
    changelog = "https://github.com/quantumlib/Stim/releases/tag/v${version}";
    license = licenses.asl20;
    maintainers = with maintainers; [ chrispattison ];
  };
}