From e8d9e1da54c04ed9e87e33bd00f749c0d3df9696 Mon Sep 17 00:00:00 2001 From: Alec Edgington <54802828+cqc-alec@users.noreply.github.com> Date: Fri, 5 Jan 2024 09:02:09 +0000 Subject: [PATCH] Update to quantum-pecos 0.5dev6 (#11) --- pyproject.toml | 4 ++-- test/test_emulator.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 56de0fe..d63df9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "pytket_pecos" -version = "0.1.6" +version = "0.1.7" description = "This package enables emulation of pytket circuits using the PECOS emulator." authors = [{name = "Alec Edgington", email = "alec.edgington@quantinuum.com"}] license = {file = "LICENSE"} @@ -20,7 +20,7 @@ dependencies = [ "pytket >= 1.22.0", "pytket-phir >= 0.2.0", "projectq >= 0.8.0", - "quantum-pecos >= 0.5.dev5" + "quantum-pecos >= 0.5.dev6" ] [project.urls] diff --git a/test/test_emulator.py b/test/test_emulator.py index c0f3cbf..964dca8 100644 --- a/test/test_emulator.py +++ b/test/test_emulator.py @@ -70,6 +70,17 @@ def test_conditional(self): results = emu.run(n_shots=n_shots) self.assertTrue(all(n in [0, 3] for n in results.to_intlist())) + def test_setbits(self): + # https://github.com/CQCL/pytket-pecos/issues/9 + c = Circuit(1) + a = c.add_c_register("a", 3) + b = c.add_c_register("b", 3) + c.add_c_setbits([True, True, False], a) + c.add_c_copyreg(a, b) + emu = Emulator(c) + result = emu.run(n_shots=1).to_intlist()[0] + assert result == 0b110110 + if __name__ == "__main__": unittest.main()