From 8820d5b05f42268f646767c93c671767c16594a7 Mon Sep 17 00:00:00 2001 From: David Plankensteiner Date: Mon, 7 Apr 2025 16:56:59 +0200 Subject: [PATCH 1/3] Fix CI by pinning pydantic version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 439993b2..1cea5ea6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ dependencies = [ "scipy>=1.13.1", "kirin-toolchain~=0.14.0", "rich>=13.9.4", - "pydantic>=1.3.0", + "pydantic>=1.3.0,<2.11.0", "pandas>=2.2.3", ] From 5f6a1c33a3d3d898018379cf81f88c44ce7ad456 Mon Sep 17 00:00:00 2001 From: David Plankensteiner Date: Mon, 7 Apr 2025 17:02:07 +0200 Subject: [PATCH 2/3] Rename TestNoise class to NoiseTestModel to make pytest happy --- test/qasm2/passes/test_heuristic_noise.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/qasm2/passes/test_heuristic_noise.py b/test/qasm2/passes/test_heuristic_noise.py index dc714030..553a2058 100644 --- a/test/qasm2/passes/test_heuristic_noise.py +++ b/test/qasm2/passes/test_heuristic_noise.py @@ -1,16 +1,17 @@ from kirin import ir, types +from kirin.dialects import func, ilist +from kirin.dialects.py import constant + from bloqade import qasm2 from bloqade.noise import native -from kirin.dialects import func, ilist from bloqade.analysis import address -from kirin.dialects.py import constant from bloqade.test_utils import assert_nodes from bloqade.qasm2.dialects import uop, core, glob, parallel from bloqade.qasm2.passes.noise import NoisePass from bloqade.qasm2.rewrite.heuristic_noise import NoiseRewriteRule -class TestNoise(native.MoveNoiseModelABC): +class NoiseTestModel(native.MoveNoiseModelABC): def parallel_cz_errors(cls, ctrls, qargs, rest): return {(0.01, 0.01, 0.01, 0.01): ctrls + qargs + rest} @@ -24,7 +25,7 @@ def test_single_qubit_noise(): noise_params = native.GateNoiseParams( local_px=px, local_py=py, local_pz=pz, local_loss_prob=p_loss ) - model = TestNoise() + model = NoiseTestModel() test_qubit = ir.TestValue(type=qasm2.QubitType) address_analysis = {test_qubit: address.AddressQubit(0)} @@ -59,7 +60,7 @@ def test_parallel_qubit_noise(): noise_params = native.GateNoiseParams( local_px=px, local_py=py, local_pz=pz, local_loss_prob=p_loss ) - model = TestNoise() + model = NoiseTestModel() test_qubit = ir.TestValue(type=qasm2.QubitType) qubit_list = ilist.New(values=[test_qubit]) @@ -119,7 +120,7 @@ def test_cz_gate_noise(): cz_unpaired_loss_prob=p_loss, ) - model = TestNoise() + model = NoiseTestModel() ctrl_qubit = ir.TestValue(type=qasm2.QubitType) qarg_qubit = ir.TestValue(type=qasm2.QubitType) @@ -193,7 +194,7 @@ def test_parallel_cz_gate_noise(): cz_unpaired_loss_prob=p_loss, ) - model = TestNoise() + model = NoiseTestModel() ctrl_qubit = ir.TestValue(type=qasm2.QubitType) qarg_qubit = ir.TestValue(type=qasm2.QubitType) @@ -273,7 +274,7 @@ def test_method(): global_loss_prob=p_loss, global_px=px, global_py=py, global_pz=pz ) - model = TestNoise() + model = NoiseTestModel() test_method.print() From 6130b17eb1995467ea08b6c85e72987fb34b94a0 Mon Sep 17 00:00:00 2001 From: David Plankensteiner Date: Mon, 7 Apr 2025 16:56:59 +0200 Subject: [PATCH 3/3] Fix CI by pinning pydantic version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 439993b2..1cea5ea6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ dependencies = [ "scipy>=1.13.1", "kirin-toolchain~=0.14.0", "rich>=13.9.4", - "pydantic>=1.3.0", + "pydantic>=1.3.0,<2.11.0", "pandas>=2.2.3", ]