From aa2b025f8f7e11ab0837ba4190f0f1d62784c7d0 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Thu, 6 Mar 2025 11:50:16 -0800 Subject: [PATCH 1/4] Avoid broken wheels for qcs-sdk-python (#7126) * Avoid broken wheels for qcs-sdk-python The installation of `qcs-sdk-python==0.21.13` fails on Linux Python 3.10 with `zipfile.BadZipFile: Bad CRC-32 for file 'qcs_sdk/qcs_sdk.cpython-310-x86_64-linux-gnu.so'` Block new versions of qcs-sdk-python until this is fixed. Ref: https://github.com/rigetti/qcs-sdk-rust/issues/531 * Also adjust Dockerfile to avoid the bad wheel --- Dockerfile | 12 +++++++----- cirq-rigetti/requirements.txt | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6f9ef227ef0..aa45ee075ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,17 +10,19 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteract # Configure UTF-8 encoding. RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 # Make python3 default RUN rm -f /usr/bin/python \ && ln -s /usr/bin/python3 /usr/bin/python #cirq stable image FROM cirq_base AS cirq_stable -RUN pip3 install cirq +# TODO: adjust after the fix of https://github.com/rigetti/qcs-sdk-rust/issues/531 +RUN pip3 install cirq "qcs-sdk-python<=0.21.12" ##cirq pre_release image FROM cirq_base AS cirq_pre_release -RUN pip3 install cirq~=1.0.dev +# TODO: adjust after the fix of https://github.com/rigetti/qcs-sdk-rust/issues/531 +RUN pip3 install cirq~=1.0.dev "qcs-sdk-python<=0.21.12" diff --git a/cirq-rigetti/requirements.txt b/cirq-rigetti/requirements.txt index 48211460476..836a644be6b 100644 --- a/cirq-rigetti/requirements.txt +++ b/cirq-rigetti/requirements.txt @@ -1 +1,4 @@ pyquil>=4.14.3,<5.0.0 + +# TODO: remove after the fix of https://github.com/rigetti/qcs-sdk-rust/issues/531 +qcs-sdk-python<=0.21.12 From 82c3c5ea1df64f34c3922d00956c591f8fed0055 Mon Sep 17 00:00:00 2001 From: Benno Bielmeier Date: Thu, 6 Mar 2025 22:12:06 +0100 Subject: [PATCH 2/4] Fix typo in README (#7125) Co-authored-by: Pavol Juhas --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 66ba6934c3b..c3d860732d9 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ develop quantum programs for a variety of applications. [Qualtran]: https://github.com/quantumlib/qualtran [qsim]: https://github.com/quantumlib/qsim -[Stim]: https://github.com/quantumlib/ssim +[Stim]: https://github.com/quantumlib/stim [OpenFermion]: https://github.com/quantumlib/openfermion [OpenFermion-FQE]: https://github.com/quantumlib/OpenFermion-FQE [OpenFermion-PySCF]: https://github.com/quantumlib/OpenFermion-PySCF From 78d30e7094847b6c0609222d6067abd03ed0456a Mon Sep 17 00:00:00 2001 From: Renyi Chen Date: Thu, 6 Mar 2025 14:04:01 -0800 Subject: [PATCH 3/4] Remove sweep_must_pass. (#7124) --- .../cirq/transformers/gauge_compiling/cphase_gauge_test.py | 5 ----- cirq-core/cirq/transformers/gauge_compiling/cz_gauge_test.py | 1 - .../gauge_compiling/spin_inversion_gauge_test.py | 4 ---- .../cirq/transformers/gauge_compiling/sqrt_cz_gauge_test.py | 2 -- 4 files changed, 12 deletions(-) diff --git a/cirq-core/cirq/transformers/gauge_compiling/cphase_gauge_test.py b/cirq-core/cirq/transformers/gauge_compiling/cphase_gauge_test.py index 87f00de0a4b..0156f02d103 100644 --- a/cirq-core/cirq/transformers/gauge_compiling/cphase_gauge_test.py +++ b/cirq-core/cirq/transformers/gauge_compiling/cphase_gauge_test.py @@ -20,28 +20,23 @@ class TestCPhaseGauge_0_3(GaugeTester): two_qubit_gate = cirq.CZ**0.3 gauge_transformer = CPhaseGaugeTransformer - sweep_must_pass = True class TestCPhaseGauge_m0_3(GaugeTester): two_qubit_gate = cirq.CZ ** (-0.3) gauge_transformer = CPhaseGaugeTransformer - sweep_must_pass = True class TestCPhaseGauge_0_1(GaugeTester): two_qubit_gate = cirq.CZ**0.1 gauge_transformer = CPhaseGaugeTransformer - sweep_must_pass = True class TestCPhaseGauge_m0_1(GaugeTester): two_qubit_gate = cirq.CZ ** (-0.1) gauge_transformer = CPhaseGaugeTransformer - sweep_must_pass = True class TestCPhaseGauge_0_7(GaugeTester): two_qubit_gate = cirq.CZ**0.7 gauge_transformer = CPhaseGaugeTransformer - sweep_must_pass = True diff --git a/cirq-core/cirq/transformers/gauge_compiling/cz_gauge_test.py b/cirq-core/cirq/transformers/gauge_compiling/cz_gauge_test.py index db4eb236c99..5f4869f30b2 100644 --- a/cirq-core/cirq/transformers/gauge_compiling/cz_gauge_test.py +++ b/cirq-core/cirq/transformers/gauge_compiling/cz_gauge_test.py @@ -21,4 +21,3 @@ class TestCZGauge(GaugeTester): two_qubit_gate = cirq.CZ gauge_transformer = CZGaugeTransformer - sweep_must_pass = True diff --git a/cirq-core/cirq/transformers/gauge_compiling/spin_inversion_gauge_test.py b/cirq-core/cirq/transformers/gauge_compiling/spin_inversion_gauge_test.py index 6630b37d5b5..c599b328316 100644 --- a/cirq-core/cirq/transformers/gauge_compiling/spin_inversion_gauge_test.py +++ b/cirq-core/cirq/transformers/gauge_compiling/spin_inversion_gauge_test.py @@ -20,22 +20,18 @@ class TestSpinInversionGauge_0(GaugeTester): two_qubit_gate = cirq.ZZ gauge_transformer = SpinInversionGaugeTransformer - sweep_must_pass = True class TestSpinInversionGauge_1(GaugeTester): two_qubit_gate = cirq.ZZ**0.1 gauge_transformer = SpinInversionGaugeTransformer - sweep_must_pass = True class TestSpinInversionGauge_2(GaugeTester): two_qubit_gate = cirq.ZZ**-1 gauge_transformer = SpinInversionGaugeTransformer - sweep_must_pass = True class TestSpinInversionGauge_3(GaugeTester): two_qubit_gate = cirq.ZZ**0.3 gauge_transformer = SpinInversionGaugeTransformer - sweep_must_pass = True diff --git a/cirq-core/cirq/transformers/gauge_compiling/sqrt_cz_gauge_test.py b/cirq-core/cirq/transformers/gauge_compiling/sqrt_cz_gauge_test.py index 25450fd2f29..e6e871cf938 100644 --- a/cirq-core/cirq/transformers/gauge_compiling/sqrt_cz_gauge_test.py +++ b/cirq-core/cirq/transformers/gauge_compiling/sqrt_cz_gauge_test.py @@ -20,10 +20,8 @@ class TestSqrtCZGauge(GaugeTester): two_qubit_gate = cirq.CZ**0.5 gauge_transformer = SqrtCZGaugeTransformer - sweep_must_pass = True class TestAdjointSqrtCZGauge(GaugeTester): two_qubit_gate = cirq.CZ**-0.5 gauge_transformer = SqrtCZGaugeTransformer - sweep_must_pass = True From 34b9c818830ff45930041f3ae6863b8bd8d7a6b1 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Thu, 6 Mar 2025 17:55:26 -0800 Subject: [PATCH 4/4] Also avoid broken wheels when testing notebooks (#7127) Preinstall a working version of qcs-sdk-python package. Ref: https://github.com/rigetti/qcs-sdk-rust/issues/531 Ref: https://github.com/quantumlib/Cirq/pull/7126 --- dev_tools/notebooks/isolated_notebook_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev_tools/notebooks/isolated_notebook_test.py b/dev_tools/notebooks/isolated_notebook_test.py index 239acfd87fa..5d68e1306e6 100644 --- a/dev_tools/notebooks/isolated_notebook_test.py +++ b/dev_tools/notebooks/isolated_notebook_test.py @@ -85,6 +85,9 @@ "jupyter", # assumed to be part of colab "seaborn~=0.12", + # TODO: remove after the fix of https://github.com/rigetti/qcs-sdk-rust/issues/531 + "qcs-sdk-python<=0.21.12", + "numpy~=1.25", ]