python312Packages.{cirq,cirq-core,cirq-google,cirq-rigetti,quil,pyquil}: cleanup & fix (#384232)
This commit is contained in:
@@ -1,31 +1,37 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
attrs,
|
||||
autoray ? null,
|
||||
buildPythonPackage,
|
||||
duet,
|
||||
fetchFromGitHub,
|
||||
freezegun,
|
||||
|
||||
# build-system
|
||||
setuptools,
|
||||
|
||||
# dependencies
|
||||
attrs,
|
||||
duet,
|
||||
matplotlib,
|
||||
networkx,
|
||||
numpy,
|
||||
opt-einsum,
|
||||
pandas,
|
||||
ply,
|
||||
pylatex ? null,
|
||||
pyquil ? null,
|
||||
pytest-asyncio,
|
||||
pytestCheckHook,
|
||||
pythonOlder,
|
||||
quimb ? null,
|
||||
requests,
|
||||
scipy,
|
||||
setuptools,
|
||||
sortedcontainers,
|
||||
sympy,
|
||||
tqdm,
|
||||
typing-extensions,
|
||||
autoray ? null,
|
||||
opt-einsum,
|
||||
ply,
|
||||
pylatex ? null,
|
||||
pyquil ? null,
|
||||
quimb ? null,
|
||||
|
||||
# tests
|
||||
freezegun,
|
||||
pytest-asyncio,
|
||||
pytestCheckHook,
|
||||
|
||||
withContribRequires ? false,
|
||||
}:
|
||||
|
||||
@@ -34,8 +40,6 @@ buildPythonPackage rec {
|
||||
version = "1.4.1-unstable-2024-09-21";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.10";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "quantumlib";
|
||||
repo = "cirq";
|
||||
@@ -77,9 +81,9 @@ buildPythonPackage rec {
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
pytest-asyncio
|
||||
freezegun
|
||||
pytest-asyncio
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
disabledTestPaths = lib.optionals (!withContribRequires) [
|
||||
@@ -99,12 +103,12 @@ buildPythonPackage rec {
|
||||
"test_prepare_two_qubit_state_using_sqrt_iswap"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
description = "Framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits";
|
||||
homepage = "https://github.com/quantumlib/cirq";
|
||||
changelog = "https://github.com/quantumlib/Cirq/releases/tag/v${version}";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [
|
||||
drewrisinger
|
||||
fab
|
||||
];
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
{
|
||||
buildPythonPackage,
|
||||
setuptools,
|
||||
cirq-core,
|
||||
freezegun,
|
||||
google-api-core,
|
||||
protobuf,
|
||||
freezegun,
|
||||
pytestCheckHook,
|
||||
setuptools,
|
||||
protobuf4,
|
||||
fetchpatch,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@@ -19,16 +17,6 @@ buildPythonPackage rec {
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
patches = [
|
||||
# https://github.com/quantumlib/Cirq/pull/6683 Support for protobuf5
|
||||
(fetchpatch {
|
||||
url = "https://github.com/quantumlib/Cirq/commit/bae02e4d83aafa29f50aa52073d86eb913ccb2d3.patch";
|
||||
hash = "sha256-MqHhKa38BTM6viQtWik0TQjN0OPdrwzCZkkqZsiyF5w=";
|
||||
includes = [ "cirq_google/serialization/arg_func_langs_test.py" ];
|
||||
stripLen = 1;
|
||||
})
|
||||
];
|
||||
|
||||
pythonRelaxDeps = [
|
||||
"protobuf"
|
||||
];
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
cirq-core,
|
||||
fetchpatch2,
|
||||
pyquil,
|
||||
pytestCheckHook,
|
||||
pythonOlder,
|
||||
qcs-sdk-python,
|
||||
setuptools,
|
||||
pyquil,
|
||||
qcs-sdk-python,
|
||||
pytestCheckHook,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@@ -15,18 +12,6 @@ buildPythonPackage rec {
|
||||
pyproject = true;
|
||||
inherit (cirq-core) version src;
|
||||
|
||||
disabled = pythonOlder "3.10";
|
||||
|
||||
patches = [
|
||||
# https://github.com/quantumlib/Cirq/pull/6734
|
||||
(fetchpatch2 {
|
||||
name = "fix-rigetti-check-for-aspen-family-device-kind.patch";
|
||||
url = "https://github.com/quantumlib/Cirq/commit/dd395fb71fb7f92cfd34f008bf2a98fc70b57fae.patch";
|
||||
stripLen = 1;
|
||||
hash = "sha256-EWB2CfMS2+M3zNFX5PwFNtEBdgJkNVUVNd+I/E6n9kI=";
|
||||
})
|
||||
];
|
||||
|
||||
sourceRoot = "${src.name}/${pname}";
|
||||
|
||||
pythonRelaxDeps = [ "pyquil" ];
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
{
|
||||
buildPythonPackage,
|
||||
|
||||
# build-system
|
||||
setuptools,
|
||||
|
||||
# dependencies
|
||||
cirq-aqt,
|
||||
cirq-core,
|
||||
cirq-google,
|
||||
@@ -7,11 +12,12 @@
|
||||
cirq-pasqal,
|
||||
cirq-rigetti,
|
||||
cirq-web,
|
||||
|
||||
# tests
|
||||
pytestCheckHook,
|
||||
setuptools,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
buildPythonPackage {
|
||||
pname = "cirq";
|
||||
pyproject = true;
|
||||
inherit (cirq-core) version src meta;
|
||||
@@ -21,10 +27,10 @@ buildPythonPackage rec {
|
||||
dependencies = [
|
||||
cirq-aqt
|
||||
cirq-core
|
||||
cirq-ionq
|
||||
cirq-google
|
||||
cirq-rigetti
|
||||
cirq-ionq
|
||||
cirq-pasqal
|
||||
cirq-rigetti
|
||||
cirq-web
|
||||
];
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
deprecated,
|
||||
fetchFromGitHub,
|
||||
|
||||
deprecated,
|
||||
ipython,
|
||||
matplotlib-inline,
|
||||
nest-asyncio,
|
||||
@@ -13,7 +14,6 @@
|
||||
pytest-asyncio,
|
||||
pytest-mock,
|
||||
pytestCheckHook,
|
||||
pythonOlder,
|
||||
qcs-sdk-python,
|
||||
respx,
|
||||
rpcq,
|
||||
@@ -25,21 +25,20 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyquil";
|
||||
version = "4.15.0";
|
||||
version = "4.16.0";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.9";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "rigetti";
|
||||
repo = "pyquil";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-zRXIMSgcFlTZQ5Y/1pSC30ZhvKj1Pn1+7SbTetEdzio=";
|
||||
hash = "sha256-6nJ0eozqbzHDF3e/Q/bVJnng1b+LUL2tsv4X7sWE9/0=";
|
||||
};
|
||||
|
||||
pythonRelaxDeps = [
|
||||
"lark"
|
||||
"networkx"
|
||||
"numpy"
|
||||
"packaging"
|
||||
"qcs-sdk-python"
|
||||
"rpcq"
|
||||
@@ -75,11 +74,11 @@ buildPythonPackage rec {
|
||||
|
||||
pythonImportsCheck = [ "pyquil" ];
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
description = "Python library for creating Quantum Instruction Language (Quil) programs";
|
||||
homepage = "https://github.com/rigetti/pyquil";
|
||||
changelog = "https://github.com/rigetti/pyquil/blob/v${version}/CHANGELOG.md";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ fab ];
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ fab ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,33 +1,32 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildPythonPackage,
|
||||
pythonOlder,
|
||||
pythonAtLeast,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
numpy,
|
||||
pytestCheckHook,
|
||||
syrupy,
|
||||
libiconv,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "quil";
|
||||
version = "0.13.2";
|
||||
version = "0.15.3";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.8";
|
||||
# error: the configured Python interpreter version (3.13) is newer than PyO3's maximum supported version (3.12)
|
||||
disabled = pythonAtLeast "3.13";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "rigetti";
|
||||
repo = "quil-rs";
|
||||
rev = "quil-py/v${version}";
|
||||
hash = "sha256-Hapj90F5IloyW7MyeTg95rlUfb4JiZdtz1HuJVxlk/c=";
|
||||
tag = "quil-py/v${version}";
|
||||
hash = "sha256-55NfQlpeqp0je9MpTeQdVyhZ8C16lZJKM43PTsQY5nc=";
|
||||
};
|
||||
|
||||
cargoDeps = rustPlatform.fetchCargoVendor {
|
||||
inherit pname version src;
|
||||
hash = "sha256-yfO1/ChiFYTB/LWCc9CR3lBzU71FEos+jjkHVoJyoeI=";
|
||||
hash = "sha256-hMvbbJulJaR5Qy7LS4H9CyiAoQWoPMNxxVzmwD9aYTQ=";
|
||||
};
|
||||
|
||||
buildAndTestSubdir = "quil-py";
|
||||
@@ -37,8 +36,6 @@ buildPythonPackage rec {
|
||||
rustPlatform.maturinBuildHook
|
||||
];
|
||||
|
||||
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
||||
|
||||
dependencies = [ numpy ];
|
||||
|
||||
pythonImportsCheck = [
|
||||
@@ -53,13 +50,8 @@ buildPythonPackage rec {
|
||||
syrupy
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
# Syrupy snapshot needs to be regenerated
|
||||
"test_filter_instructions"
|
||||
];
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/rigetti/quil-rs/blob/${src.rev}/quil-py/CHANGELOG.md";
|
||||
changelog = "https://github.com/rigetti/quil-rs/blob/quil-py/v${version}/quil-py/CHANGELOG.md";
|
||||
description = "Python package for building and parsing Quil programs";
|
||||
homepage = "https://github.com/rigetti/quil-rs/tree/main/quil-py";
|
||||
license = lib.licenses.asl20;
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
cirq-core,
|
||||
fetchFromGitHub,
|
||||
|
||||
# build-system
|
||||
pybind11,
|
||||
setuptools,
|
||||
|
||||
# dependencies
|
||||
numpy,
|
||||
|
||||
# tests
|
||||
cirq-core,
|
||||
matplotlib,
|
||||
networkx,
|
||||
numpy,
|
||||
pandas,
|
||||
pybind11,
|
||||
pytest-xdist,
|
||||
pytestCheckHook,
|
||||
pythonOlder,
|
||||
scipy,
|
||||
setuptools,
|
||||
wheel,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@@ -21,8 +25,6 @@ buildPythonPackage rec {
|
||||
version = "1.14.0";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "quantumlib";
|
||||
repo = "Stim";
|
||||
@@ -50,7 +52,6 @@ buildPythonPackage rec {
|
||||
build-system = [
|
||||
pybind11
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
dependencies = [ numpy ];
|
||||
@@ -75,6 +76,12 @@ buildPythonPackage rec {
|
||||
"glue/cirq"
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
# AssertionError: Sample rate 1.0 is over 5 standard deviations away from 1.0.
|
||||
"test_frame_simulator_sampling_noisy_gates_agrees_with_cirq_data"
|
||||
"test_tableau_simulator_sampling_noisy_gates_agrees_with_cirq_data"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Tool for high performance simulation and analysis of quantum stabilizer circuits, especially quantum error correction (QEC) circuits";
|
||||
mainProgram = "stim";
|
||||
|
||||
Reference in New Issue
Block a user