anchor.diff:  , buildPythonPackage
   , pythonOlder
   , fetchFromGitHub
  -, google_api_python_client
  +, fetchpatch
  +, freezegun
  +, google_api_core
   , matplotlib
   , networkx
   , numpy
  
positive.code:     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
    postPatch = ''
      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"
  
      # Fix pandas >= 1.0 error, #2886
      substituteInPlace cirq/experiments/t1_decay_experiment.py --replace "del tab.columns.name" 'tab.rename_axis(None, axis="columns", inplace=True)'
    '';
  
    propagatedBuildInputs = [
      google_api_python_client
      numpy
      matplotlib
      networkx
  
negative.code:   dontUseSetuptoolsCheck = true;
    checkInputs = [
      pytestCheckHook
      pytest-asyncio
      pytest-benchmark
      ply
      pydot
      pyyaml
      pygraphviz
    ];
  
    pytestFlagsArray = [
      "--ignore=dev_tools"  # Only needed when developing new code, which is out-of-scope
    ];
    disabledTests = [
      "test_serialize_sympy_constants"  # fails due to small error in pi (~10e-7)
      "test_convert_to_ion_gates" # fails due to rounding error, 0.75 != 0.750...2
  
      # Newly disabled tests on cirq 0.8
      # TODO: test & figure out why failing
      "engine_job_test"
      "test_health"
      "test_run_delegation"
    ] ++ lib.optionals stdenv.isAarch64 [
      # Seem to fail due to math issues on aarch64?
      "expectation_from_wavefunction"
  