From e2d6ad1b64f29d385fa46768828441b539141bb8 Mon Sep 17 00:00:00 2001 From: James Clark <70290797+jamesclark-Zapata@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:52:50 +0100 Subject: [PATCH] chore: Remove Python 3.11 upper bound (#14) * chore: Remove Python 3.11 upper bound * chore: Bump pyquil to latest * fix: SQRT-X test by using existing DefGet pattern --- .github/workflows/coverage.yml | 2 +- .github/workflows/style.yml | 2 +- setup.cfg | 4 ++-- .../forest/circuit_conversions_test.py | 23 ++++++++++++------- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b013625..33a5739 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -22,7 +22,7 @@ jobs: # Run jobs for a couple of Python versions. strategy: matrix: - python: ["3.8", "3.9", "3.10"] + python: ["3.9", "3.10", "3.11"] name: TestCoverage - Python ${{ matrix.python }} diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 77b1ae8..2103465 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -22,7 +22,7 @@ jobs: # Run jobs for a couple of Python versions. strategy: matrix: - python: ["3.8", "3.9", "3.10"] + python: ["3.9", "3.10", "3.11"] name: Style - Python ${{ matrix.python }} diff --git a/setup.cfg b/setup.cfg index 96c99d7..ae762d7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,10 +21,10 @@ include_package_data = True package_dir = = src packages = find_namespace: -python_requires = >=3.8,!=3.9.7,<3.11 +python_requires = >=3.9,!=3.9.7 install_requires = - pyquil>=2.25, <=3.3 + pyquil~=4.0 orquestra-quantum diff --git a/tests/orquestra/integrations/forest/circuit_conversions_test.py b/tests/orquestra/integrations/forest/circuit_conversions_test.py index 4d6e172..5fdfa87 100644 --- a/tests/orquestra/integrations/forest/circuit_conversions_test.py +++ b/tests/orquestra/integrations/forest/circuit_conversions_test.py @@ -135,9 +135,22 @@ def pyquil_u3_definition(): ) +def pyquil_sqrt_x_definition(): + return pyquil.quil.DefGate( + "SQRT-X", + np.array( + [ + [0.5 + 0.5j, 0.5 - 0.5j], + [0.5 - 0.5j, 0.5 + 0.5j], + ] + ), + ) + + PYQUIL_XX = pyquil_xx_definition() PYQUIL_RH = pyquil_rh_definition() PYQUIL_U3 = pyquil_u3_definition() +PYQUIL_SQRT_X = pyquil_sqrt_x_definition() EQUIVALENT_CIRCUITS = [ @@ -196,14 +209,8 @@ def pyquil_u3_definition(): _circuit.Circuit( [SQRT_X_DEF()(3)], ), - pyquil.Program([("SQRT-X", 3)]).defgate( - "SQRT-X", - np.array( - [ - [0.5 + 0.5j, 0.5 - 0.5j], - [0.5 - 0.5j, 0.5 + 0.5j], - ] - ), + pyquil.Program( + [PYQUIL_SQRT_X, PYQUIL_SQRT_X.get_constructor()(3)], ), ), (