about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/science/math/scs/default.nix8
-rw-r--r--pkgs/development/python-modules/cirq/default.nix86
-rw-r--r--pkgs/development/tools/misc/scc/default.nix4
3 files changed, 92 insertions, 6 deletions
diff --git a/pkgs/development/libraries/science/math/scs/default.nix b/pkgs/development/libraries/science/math/scs/default.nix
index 51a72585c0cf..db808b093fee 100644
--- a/pkgs/development/libraries/science/math/scs/default.nix
+++ b/pkgs/development/libraries/science/math/scs/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "scs";
-  version = "2.0.2";
+  version = "2.1.1";
 
   src = fetchFromGitHub {
     owner = "cvxgrp";
     repo = "scs";
-    rev = "v${version}";
-    sha256 = "17lbcmcsniqlyzgbzmjipfd0rrk25a8hzh7l5wl2wp1iwsd8c3a9";
+    rev = version;
+    sha256 = "14g5m3lcvrbwpq1bq0liq00jh0gm1947lg3z4jfsp43f6p5alb20";
   };
 
   # Actually link and add libgfortran to the rpath
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     longDescription = ''
       Numerical optimization package for solving large-scale convex cone problems
     '';
-    homepage = https://github.com/cvxgrp/scs;
+    homepage = "https://github.com/cvxgrp/scs";
     license = licenses.mit;
     platforms = platforms.all;
     maintainers = [ maintainers.bhipple ];
diff --git a/pkgs/development/python-modules/cirq/default.nix b/pkgs/development/python-modules/cirq/default.nix
new file mode 100644
index 000000000000..d6109e8aabac
--- /dev/null
+++ b/pkgs/development/python-modules/cirq/default.nix
@@ -0,0 +1,86 @@
+{ lib
+, buildPythonPackage
+, pythonOlder
+, fetchFromGitHub
+, google_api_python_client
+, matplotlib
+, networkx
+, numpy
+, pandas
+, pythonProtobuf  # pythonPackages.protobuf
+, requests
+, scipy
+, sortedcontainers
+, sympy
+, typing-extensions
+  # test inputs
+, pytestCheckHook
+, pytest-benchmark
+, ply
+, pydot
+, pyyaml
+, pygraphviz
+}:
+
+buildPythonPackage rec {
+  pname = "cirq";
+  version = "0.6.1";
+
+  disabled = pythonOlder "3.5";
+
+  src = fetchFromGitHub {
+    owner = "quantumlib";
+    repo = "cirq";
+    rev = "v${version}";
+    sha256 = "0lhr2dka7vpz9xd6akxphrcv2b3ni2cgjywpc1r7qpqa5mrq1q7f";
+  };
+
+  # Cirq 0.6 requires networkx==2.3 only for optional qiskit dependency/test, disable this to avoid networkx version conflicts. https://github.com/quantumlib/Cirq/issues/2368
+  # Cirq locks protobuf==3.8.0, but tested working with default pythonPackages.protobuf (3.7). This avoids overrides/pythonPackages.protobuf conflicts
+  prePatch = ''
+    substituteInPlace requirements.txt --replace "networkx==2.3" "networkx" \
+      --replace "protobuf==3.8.0" "protobuf"
+
+    # Fix sympy 1.5 test failures. Should be fixed in v0.7
+    substituteInPlace cirq/optimizers/eject_phased_paulis_test.py --replace "phase_exponent=0.125 + x / 8" "phase_exponent=0.125 + x * 0.125"
+    substituteInPlace cirq/contrib/quirk/cells/parse_test.py --replace "parse_formula('5t') == 5 * t" "parse_formula('5t') == 5.0 * t"
+  '';
+
+  propagatedBuildInputs = [
+    google_api_python_client
+    numpy
+    matplotlib
+    networkx
+    pandas
+    pythonProtobuf
+    requests
+    scipy
+    sortedcontainers
+    sympy
+    typing-extensions
+  ];
+
+  doCheck = true;
+  # pythonImportsCheck = [ "cirq" "cirq.Ciruit" ];  # cirq's importlib hook doesn't work here
+  dontUseSetuptoolsCheck = true;
+  checkInputs = [
+    pytestCheckHook
+    pytest-benchmark
+    ply
+    pydot
+    pyyaml
+    pygraphviz
+  ];
+  # TODO: enable op_serializer_test. Error is type checking, for some reason wants bool instead of numpy.bool_. Not sure if protobuf or internal issue
+  pytestFlagsArray = [
+    "--ignore=dev_tools"  # Only needed when developing new code, which is out-of-scope
+    "--ignore=cirq/google/op_serializer_test.py"  # investigating in https://github.com/quantumlib/Cirq/issues/2727
+  ];
+
+  meta = with lib; {
+    description = "A framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.";
+    homepage = "http://github.com/quantumlib/cirq";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ drewrisinger ];
+  };
+}
diff --git a/pkgs/development/tools/misc/scc/default.nix b/pkgs/development/tools/misc/scc/default.nix
index 47a914823273..7a6a060464e1 100644
--- a/pkgs/development/tools/misc/scc/default.nix
+++ b/pkgs/development/tools/misc/scc/default.nix
@@ -2,13 +2,13 @@
 
 buildGoPackage rec {
   pname = "scc";
-  version = "2.10.1";
+  version = "2.11.0";
 
   src = fetchFromGitHub {
     owner = "boyter";
     repo = "scc";
     rev = "v${version}";
-    sha256 = "1g55aahr8j93jc1k2zgpnyxgp7ddn5137vjf8dafsmqp4m2qjq6g";
+    sha256 = "1wk6s9ga9rkywgqys960s6fz4agwzh3ac2l6cpcr7kca4379s28k";
   };
 
   goPackagePath = "github.com/boyter/scc";