PECOS-packages / PECOS

A Python framework, library, and set of tools for exploring, developing, and evaluating quantum error-correction protocols.
Other
29 stars 6 forks source link

Cumulative development update #54

Closed ciaranra closed 8 months ago

ciaranra commented 8 months ago

Cumulative updates: Introduce SLR + Auto-detecting Cliffords

qciaran commented 8 months ago

LGTM. You might want to run make build-all once which will update the docs among other things. Also, the suggestions for updates in pre-commit config can be automated as well using pre-commit autoupdate, perhaps in the make update-reqs target.

Ah k. Thanks for the tip!

qartik commented 8 months ago

With numeric typing being enforced more strictly starting https://github.com/CQCL/phir/releases/tag/v0.3.2, the tests need to be updated a bit, such as:

diff --git a/tests/integration/test_phir_setting_cregs.py b/tests/integration/test_phir_setting_cregs.py
index 0451641..1e63261 100644
--- a/tests/integration/test_phir_setting_cregs.py
+++ b/tests/integration/test_phir_setting_cregs.py
@@ -8,7 +8,7 @@ def test_setting_bits1():
         "ops": [
             {"data": "cvar_define", "data_type": "u32", "variable": "c", "size": 3},
             # c[0], c[1], c[2] = True, False, True
-            {"cop": "=", "returns": [["c", 0], ["c", 1], ["c", 2]], "args": [True, False, True]},
+            {"cop": "=", "returns": [["c", 0], ["c", 1], ["c", 2]], "args": [1, 0, 1]},
         ],
     }
ciaranra commented 8 months ago

With numeric typing being enforced more strictly starting https://github.com/CQCL/phir/releases/tag/v0.3.2, the tests need to be updated a bit, such as:

diff --git a/tests/integration/test_phir_setting_cregs.py b/tests/integration/test_phir_setting_cregs.py
index 0451641..1e63261 100644
--- a/tests/integration/test_phir_setting_cregs.py
+++ b/tests/integration/test_phir_setting_cregs.py
@@ -8,7 +8,7 @@ def test_setting_bits1():
         "ops": [
             {"data": "cvar_define", "data_type": "u32", "variable": "c", "size": 3},
             # c[0], c[1], c[2] = True, False, True
-            {"cop": "=", "returns": [["c", 0], ["c", 1], ["c", 2]], "args": [True, False, True]},
+            {"cop": "=", "returns": [["c", 0], ["c", 1], ["c", 2]], "args": [1, 0, 1]},
         ],
     }

Thanks for figuring out what is going on! Hmmm, True/False is a tket-ism that I am not sure I agree with being aherent to. Lol. I wonder how this handles if I am setting a register value using an int...

ciaranra commented 8 months ago

With numeric typing being enforced more strictly starting https://github.com/CQCL/phir/releases/tag/v0.3.2, the tests need to be updated a bit, such as:

diff --git a/tests/integration/test_phir_setting_cregs.py b/tests/integration/test_phir_setting_cregs.py
index 0451641..1e63261 100644
--- a/tests/integration/test_phir_setting_cregs.py
+++ b/tests/integration/test_phir_setting_cregs.py
@@ -8,7 +8,7 @@ def test_setting_bits1():
         "ops": [
             {"data": "cvar_define", "data_type": "u32", "variable": "c", "size": 3},
             # c[0], c[1], c[2] = True, False, True
-            {"cop": "=", "returns": [["c", 0], ["c", 1], ["c", 2]], "args": [True, False, True]},
+            {"cop": "=", "returns": [["c", 0], ["c", 1], ["c", 2]], "args": [1, 0, 1]},
         ],
     }

Oooohhh I read too quickly. Okay, it is taking binary and not bool. Okay, I am happy with that. Fixing! Thanks!