From a5d5578cb2fb0535ad99db8a70f727dedfb44823 Mon Sep 17 00:00:00 2001 From: Marquess Valdez Date: Mon, 1 Jul 2024 14:52:50 -0700 Subject: [PATCH 1/5] chore: Remove rewrite_arithmetic and special handling for translation backend V1 --- poetry.lock | 46 ++++++++++++++++---------------- pyproject.toml | 2 +- pyquil/api/_abstract_compiler.py | 3 --- pyquil/api/_compiler.py | 7 ----- pyquil/api/_qpu.py | 8 +----- test/unit/test_qpu.py | 1 - 6 files changed, 25 insertions(+), 42 deletions(-) diff --git a/poetry.lock b/poetry.lock index 80ff4fdad..e5a0eaf97 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2298,32 +2298,32 @@ cffi = {version = "*", markers = "implementation_name == \"pypy\""} [[package]] name = "qcs-sdk-python" -version = "0.17.9" +version = "0.18.0" description = "Python interface for the QCS Rust SDK" optional = false python-versions = "*" files = [ - {file = "qcs_sdk_python-0.17.9-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:5797c1db68b4194f0729fe56e93a7d25dbcf752989fbf26d9d6709d020e8d367"}, - {file = "qcs_sdk_python-0.17.9-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:7b9ee8171ae1c396ba4de4897098cff95131f803dde11692201288dea17bacb5"}, - {file = "qcs_sdk_python-0.17.9-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:b03cc65f1981f76460163946f65e2c5522754dfe95cba3bf2bde595474bcdac6"}, - {file = "qcs_sdk_python-0.17.9-cp310-none-win_amd64.whl", hash = "sha256:640ebc07b5422cf1d2cefea78f676c1bab6bb4d83bf379e0e88ecd6538136755"}, - {file = "qcs_sdk_python-0.17.9-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:d94992e4dacb4d3684448222e7931ec55567d7ca3c09a9e13c19e9a7a00ddc80"}, - {file = "qcs_sdk_python-0.17.9-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:c26dbc0c61dcac5a7a54486f07579de87dbaa793a6946f1a9c6302d77ec129a2"}, - {file = "qcs_sdk_python-0.17.9-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:7b31a0b33b3d955edcfecd6a4e495342f0d06947dc6b96fb7787578ecd91db38"}, - {file = "qcs_sdk_python-0.17.9-cp311-none-win_amd64.whl", hash = "sha256:979d03e5f6bcbfb9265504bf513d7f165d3d6dc8324708c1f602440caa7992fb"}, - {file = "qcs_sdk_python-0.17.9-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:b477a51a6ee8e2680aa54f1fc68264fd9825100c303ce954ea29e466d9a546a3"}, - {file = "qcs_sdk_python-0.17.9-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:a19e6260d546419861548f3fdad8ebf5c9f1ab23cf4540b574b809ba3c02f253"}, - {file = "qcs_sdk_python-0.17.9-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:13c2fe8998d4018cc3e3fc4f87a2a4edc2845eadcab6aea220b8ff698627b96c"}, - {file = "qcs_sdk_python-0.17.9-cp312-none-win_amd64.whl", hash = "sha256:6139a0623436fa4612b6e3586fab1d6fd9b844f6aedc2de54447a5e14ed136d8"}, - {file = "qcs_sdk_python-0.17.9-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:24df93b80a581a8bce61dc680a4c64bf99d93f7e806aca82534f3c7d6b66a0ca"}, - {file = "qcs_sdk_python-0.17.9-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:223eaa736cdd9c6fef968c9acc6b811ecd7acb0b38e27a9ff5963bf2f0feba21"}, - {file = "qcs_sdk_python-0.17.9-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:3d02f3e2b49f8dda967e26cce093534cb5d22a0193f5f069d2f748190fc6b700"}, - {file = "qcs_sdk_python-0.17.9-cp38-none-win_amd64.whl", hash = "sha256:e88d7f9f4456514f27b29252e4d0d11d29719d28519e7d0fdc9028bafe67737f"}, - {file = "qcs_sdk_python-0.17.9-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:7669291e25da0c8e303b02463805d7a2233fd4ea7192acee2b1585617b17dd09"}, - {file = "qcs_sdk_python-0.17.9-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:5712843c42cf9a5d7e66d379d50eae66674307368ec93c84b54fad074ba83ce9"}, - {file = "qcs_sdk_python-0.17.9-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:c5dae0c688c39dff49a0424a6397ff67e0f3ca9821eab498f50ec0df04c2b42d"}, - {file = "qcs_sdk_python-0.17.9-cp39-none-win_amd64.whl", hash = "sha256:90a89f935d3898a770a91c6f0361cb9ec901e87a3ca2d35d7b01a915a9482eac"}, - {file = "qcs_sdk_python-0.17.9.tar.gz", hash = "sha256:acb5ad02fc924bb9ce3e037b2c6df3f12562ea26f7ed9908e72cbcae0680b5c2"}, + {file = "qcs_sdk_python-0.18.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:c0682bedc623d2874d1dd120c4322ffc352d9b4c9fe67ea931456cf20db3f207"}, + {file = "qcs_sdk_python-0.18.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:ba70ed036cb7391f43eb4ef51fed0da43fae2d33a8587c0d2608f2d3ad7cf38c"}, + {file = "qcs_sdk_python-0.18.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:a73b54f4878edbb3b1e5c6b054e4f8944e8cbe8f56d41e91b820a2525993a529"}, + {file = "qcs_sdk_python-0.18.0-cp310-none-win_amd64.whl", hash = "sha256:94e4b2f0647f657d856194c4e195758139945dae1aa415018ab07810b8b431f8"}, + {file = "qcs_sdk_python-0.18.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:06230f62aa2d67e3de31d642b4c62a7415ef49c34fda116611db241e24eeeeed"}, + {file = "qcs_sdk_python-0.18.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:5d8315ff1ac54cf124adbd6a8f0ac7a2eb9b342d4bd79f5d904e6248ba157fad"}, + {file = "qcs_sdk_python-0.18.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:5a071854bf50fcc1a1c90f5eed69670cb0b5572f1808be21d6cb1c5da30fe7b2"}, + {file = "qcs_sdk_python-0.18.0-cp311-none-win_amd64.whl", hash = "sha256:88f6b9476059efb4917ea7f6811c1970efa452f6eb2d4324fe17f4e1295d91a7"}, + {file = "qcs_sdk_python-0.18.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:75613a9e1ace9b37c76a0c57d48b2cb8855dd042ba39f2b6d9d912771023df0a"}, + {file = "qcs_sdk_python-0.18.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:909d1f3824412f04f4a093e2cbd6e109863076603deeec61b5977b20ee5c1b40"}, + {file = "qcs_sdk_python-0.18.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:da830cb0d37206e10d946547308c0820c4cc9e99798809b46eb55bf21f285952"}, + {file = "qcs_sdk_python-0.18.0-cp312-none-win_amd64.whl", hash = "sha256:81412fb6a2d236aacfda0ffed8cb20385bb249abe24bd963502fc8ad2c052c5e"}, + {file = "qcs_sdk_python-0.18.0-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:e34a5b86e0b16e29a877ccf77b9802d86c4192021b027c7b26a7a91d9122d987"}, + {file = "qcs_sdk_python-0.18.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:4cc0e965ff3accf599e3ae08f4cb71b5c269b9d53947506dc00a8a0a8710064c"}, + {file = "qcs_sdk_python-0.18.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:e4ded9f51a91f84495afcc9b34c94ba0dd5ef360e8b6554340f58a3ef8f65621"}, + {file = "qcs_sdk_python-0.18.0-cp38-none-win_amd64.whl", hash = "sha256:eee181ccc512c0911e348f683332ce6270beef2296b34704515f51daee4b7014"}, + {file = "qcs_sdk_python-0.18.0-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:17145a7e1947309195f68d02eff5119f761e2c660d852c13766a213fbed638ab"}, + {file = "qcs_sdk_python-0.18.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:cc282ebe332b744bc15780322d1f8c02c67324b5619e5ed90d337b9eb57de7d6"}, + {file = "qcs_sdk_python-0.18.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:5732e9fedbd6ad9b6862d820dc2f1578a2254626ba0575491079384f718901e4"}, + {file = "qcs_sdk_python-0.18.0-cp39-none-win_amd64.whl", hash = "sha256:658555f6cadae51cc303b1ab01ef3810ad42cbd97ad74f472c4aee144efa3f6d"}, + {file = "qcs_sdk_python-0.18.0.tar.gz", hash = "sha256:2df1952193f70093f74999c7c962f3679ad919b439313bc9ac959b17f53e5fe7"}, ] [package.dependencies] @@ -3204,4 +3204,4 @@ latex = ["ipython"] [metadata] lock-version = "2.0" python-versions = "^3.9,<=3.14" -content-hash = "aa08be6cc81654a552ea596c6c9e355c3df38fe7165a6164299d70e540a095dd" +content-hash = "28bcd28104df449b32cfe48a425c71d11213d7003358bd69429540106fbc3286" diff --git a/pyproject.toml b/pyproject.toml index 26d84151a..a308bfaf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ numpy = "^1.25" scipy = "^1.11" rpcq = "^3.11.0" networkx = ">=2.5" -qcs-sdk-python = "0.17.9" +qcs-sdk-python = "0.18.0" packaging = "^23.1" deprecated = "^1.2.14" types-deprecated = "^1.2.9.3" diff --git a/pyquil/api/_abstract_compiler.py b/pyquil/api/_abstract_compiler.py index a39969eeb..f471ea374 100644 --- a/pyquil/api/_abstract_compiler.py +++ b/pyquil/api/_abstract_compiler.py @@ -55,9 +55,6 @@ class EncryptedProgram: ro_sources: dict[MemoryReference, str] """Readout sources, mapped by memory reference.""" - recalculation_table: list[str] - """A mapping from memory references to the original gate arithmetic.""" - def copy(self) -> "EncryptedProgram": """Return a deep copy of this EncryptedProgram.""" return dataclasses.replace(self) diff --git a/pyquil/api/_compiler.py b/pyquil/api/_compiler.py index bc23802d8..2729fa612 100644 --- a/pyquil/api/_compiler.py +++ b/pyquil/api/_compiler.py @@ -18,7 +18,6 @@ from qcs_sdk import QCSClient from qcs_sdk.compiler.quilc import QuilcClient -from qcs_sdk.qpu.rewrite_arithmetic import rewrite_arithmetic from qcs_sdk.qpu.translation import ( TranslationBackend, get_quilt_calibrations, @@ -115,13 +114,8 @@ def native_quil_to_executable( If `api_options` is provided, it overrides the options set on `self`. """ program = nq_program.out() - recalculation_table = [] backend = api_options.backend if api_options is not None else None backend = select_backend_for_quantum_processor_id(self.quantum_processor_id, backend) - if backend is TranslationBackend.V1: - rewrite_response = rewrite_arithmetic(nq_program.out()) - program = rewrite_response.program - recalculation_table = list(rewrite_response.recalculation_table) translated_program = translate( native_quil=program, @@ -136,7 +130,6 @@ def native_quil_to_executable( program=translated_program.program, memory_descriptors=_collect_memory_descriptors(nq_program), ro_sources={parse_mref(mref): source for mref, source in ro_sources.items() or []}, - recalculation_table=recalculation_table, ) def _fetch_calibration_program(self) -> Program: diff --git a/pyquil/api/_qpu.py b/pyquil/api/_qpu.py index b82290aa0..0fc6fae6d 100644 --- a/pyquil/api/_qpu.py +++ b/pyquil/api/_qpu.py @@ -32,7 +32,6 @@ retrieve_results, submit_with_parameter_batch, ) -from qcs_sdk.qpu.rewrite_arithmetic import build_patch_values from rpcq.messages import ParameterSpec from pyquil.api import EncryptedProgram, QuantumExecutable @@ -205,16 +204,11 @@ def execute_with_memory_map_batch( if not isinstance(executable, EncryptedProgram): raise ValueError("QPU#execute requires an rpcq.EncryptedProgram. Create one with QuantumComputer#compile") - patch_values = [] - for memory_map in memory_maps: - memory_map = memory_map or {} - patch_values.append(build_patch_values(executable.recalculation_table, memory_map)) - effective_execution_options = execution_options or self.execution_options job_ids = submit_with_parameter_batch( program=executable.program, - patch_values=patch_values, + patch_values=memory_maps, quantum_processor_id=self.quantum_processor_id, client=self._client_configuration, execution_options=effective_execution_options, diff --git a/test/unit/test_qpu.py b/test/unit/test_qpu.py index 4b6e477b8..964722ff7 100644 --- a/test/unit/test_qpu.py +++ b/test/unit/test_qpu.py @@ -31,7 +31,6 @@ def mock_encrypted_program(): MemoryReference("ro", 1): "q1", MemoryReference("ro"): "q0", }, - recalculation_table=[], ) From 1e81a75be74982cc744d0326d0d920a7d99b1005 Mon Sep 17 00:00:00 2001 From: Marquess Valdez Date: Mon, 1 Jul 2024 14:57:19 -0700 Subject: [PATCH 2/5] update vulnerable deps --- poetry.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/poetry.lock b/poetry.lock index e5a0eaf97..7ff8607ae 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2998,22 +2998,22 @@ files = [ [[package]] name = "tornado" -version = "6.4" +version = "6.4.1" description = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed." optional = true -python-versions = ">= 3.8" +python-versions = ">=3.8" files = [ - {file = "tornado-6.4-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:02ccefc7d8211e5a7f9e8bc3f9e5b0ad6262ba2fbb683a6443ecc804e5224ce0"}, - {file = "tornado-6.4-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:27787de946a9cffd63ce5814c33f734c627a87072ec7eed71f7fc4417bb16263"}, - {file = "tornado-6.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f7894c581ecdcf91666a0912f18ce5e757213999e183ebfc2c3fdbf4d5bd764e"}, - {file = "tornado-6.4-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e43bc2e5370a6a8e413e1e1cd0c91bedc5bd62a74a532371042a18ef19e10579"}, - {file = "tornado-6.4-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f0251554cdd50b4b44362f73ad5ba7126fc5b2c2895cc62b14a1c2d7ea32f212"}, - {file = "tornado-6.4-cp38-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:fd03192e287fbd0899dd8f81c6fb9cbbc69194d2074b38f384cb6fa72b80e9c2"}, - {file = "tornado-6.4-cp38-abi3-musllinux_1_1_i686.whl", hash = "sha256:88b84956273fbd73420e6d4b8d5ccbe913c65d31351b4c004ae362eba06e1f78"}, - {file = "tornado-6.4-cp38-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:71ddfc23a0e03ef2df1c1397d859868d158c8276a0603b96cf86892bff58149f"}, - {file = "tornado-6.4-cp38-abi3-win32.whl", hash = "sha256:6f8a6c77900f5ae93d8b4ae1196472d0ccc2775cc1dfdc9e7727889145c45052"}, - {file = "tornado-6.4-cp38-abi3-win_amd64.whl", hash = "sha256:10aeaa8006333433da48dec9fe417877f8bcc21f48dda8d661ae79da357b2a63"}, - {file = "tornado-6.4.tar.gz", hash = "sha256:72291fa6e6bc84e626589f1c29d90a5a6d593ef5ae68052ee2ef000dfd273dee"}, + {file = "tornado-6.4.1-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:163b0aafc8e23d8cdc3c9dfb24c5368af84a81e3364745ccb4427669bf84aec8"}, + {file = "tornado-6.4.1-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:6d5ce3437e18a2b66fbadb183c1d3364fb03f2be71299e7d10dbeeb69f4b2a14"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e2e20b9113cd7293f164dc46fffb13535266e713cdb87bd2d15ddb336e96cfc4"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ae50a504a740365267b2a8d1a90c9fbc86b780a39170feca9bcc1787ff80842"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:613bf4ddf5c7a95509218b149b555621497a6cc0d46ac341b30bd9ec19eac7f3"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:25486eb223babe3eed4b8aecbac33b37e3dd6d776bc730ca14e1bf93888b979f"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:454db8a7ecfcf2ff6042dde58404164d969b6f5d58b926da15e6b23817950fc4"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a02a08cc7a9314b006f653ce40483b9b3c12cda222d6a46d4ac63bb6c9057698"}, + {file = "tornado-6.4.1-cp38-abi3-win32.whl", hash = "sha256:d9a566c40b89757c9aa8e6f032bcdb8ca8795d7c1a9762910c722b1635c9de4d"}, + {file = "tornado-6.4.1-cp38-abi3-win_amd64.whl", hash = "sha256:b24b8982ed444378d7f21d563f4180a2de31ced9d8d84443907a0a64da2072e7"}, + {file = "tornado-6.4.1.tar.gz", hash = "sha256:92d3ab53183d8c50f8204a51e6f91d18a15d5ef261e84d452800d4ff6fc504e9"}, ] [[package]] @@ -3066,13 +3066,13 @@ files = [ [[package]] name = "urllib3" -version = "2.2.0" +version = "2.2.2" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = true python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.0-py3-none-any.whl", hash = "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224"}, - {file = "urllib3-2.2.0.tar.gz", hash = "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20"}, + {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, + {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, ] [package.extras] From 3abc0a48e4616b15534ef2e3df55974d765ec1e5 Mon Sep 17 00:00:00 2001 From: Marquess Valdez Date: Tue, 2 Jul 2024 07:55:32 -0700 Subject: [PATCH 3/5] deprecate recalculation_table --- pyquil/api/_abstract_compiler.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/pyquil/api/_abstract_compiler.py b/pyquil/api/_abstract_compiler.py index f471ea374..8f0d557bd 100644 --- a/pyquil/api/_abstract_compiler.py +++ b/pyquil/api/_abstract_compiler.py @@ -15,11 +15,13 @@ ############################################################################## import dataclasses import json +import warnings from abc import ABC, abstractmethod from collections.abc import Sequence -from dataclasses import dataclass +from dataclasses import dataclass, field, fields from typing import Any, Optional, Union +from deprecated.sphinx import deprecated from qcs_sdk import QCSClient from qcs_sdk.compiler.quilc import CompilationResult, CompilerOpts, QuilcClient, TargetDevice, compile_program from rpcq.messages import ParameterSpec @@ -55,10 +57,37 @@ class EncryptedProgram: ro_sources: dict[MemoryReference, str] """Readout sources, mapped by memory reference.""" + _recalculation_table: list[str] = field(default_factory=list, repr=False, init=False) + """A mapping from memory references to the original gate arithmetic.""" + def copy(self) -> "EncryptedProgram": """Return a deep copy of this EncryptedProgram.""" return dataclasses.replace(self) + def __post_init__(self) -> None: + if any(f.name == 'recalculation_table' for f in fields(self)): + warnings.warn( + "The recalculation_table field is no longer used. It will be removed in future versions.", + DeprecationWarning, + stacklevel=2 + ) + + @property + @deprecated( + version="4.12.0", + reason="The recalculation_table field is no longer used. It will be removed in future versions.", + ) + def recalculation_table(self) -> list[str]: + return self._recalculation_table + + @recalculation_table.setter + @deprecated( + version="4.12.0", + reason="The recalculation_table field is no longer used. It will be removed in future versions.", + ) + def recalculation_table(self, value: list[str]) -> None: + self._recalculation_table = value + QuantumExecutable = Union[EncryptedProgram, Program] From 2139ef83bd602839214fe59033af5c6c12e3d7d7 Mon Sep 17 00:00:00 2001 From: Marquess Valdez Date: Tue, 2 Jul 2024 08:05:22 -0700 Subject: [PATCH 4/5] format --- pyquil/api/_abstract_compiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyquil/api/_abstract_compiler.py b/pyquil/api/_abstract_compiler.py index 8f0d557bd..c0df3996c 100644 --- a/pyquil/api/_abstract_compiler.py +++ b/pyquil/api/_abstract_compiler.py @@ -65,11 +65,11 @@ def copy(self) -> "EncryptedProgram": return dataclasses.replace(self) def __post_init__(self) -> None: - if any(f.name == 'recalculation_table' for f in fields(self)): + if any(f.name == "recalculation_table" for f in fields(self)): warnings.warn( "The recalculation_table field is no longer used. It will be removed in future versions.", DeprecationWarning, - stacklevel=2 + stacklevel=2, ) @property From 82c70ba9e57fbc401216810245edd168ef5b329c Mon Sep 17 00:00:00 2001 From: Marquess Valdez Date: Tue, 2 Jul 2024 15:02:03 -0700 Subject: [PATCH 5/5] Update pyquil/api/_abstract_compiler.py Co-authored-by: Kalan <22137047+kalzoo@users.noreply.github.com> --- pyquil/api/_abstract_compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyquil/api/_abstract_compiler.py b/pyquil/api/_abstract_compiler.py index c0df3996c..880845054 100644 --- a/pyquil/api/_abstract_compiler.py +++ b/pyquil/api/_abstract_compiler.py @@ -83,7 +83,7 @@ def recalculation_table(self) -> list[str]: @recalculation_table.setter @deprecated( version="4.12.0", - reason="The recalculation_table field is no longer used. It will be removed in future versions.", + reason="The recalculation_table field is no longer used. Recalculation is now performed by the execution service. This field will be removed in future versions.", ) def recalculation_table(self, value: list[str]) -> None: self._recalculation_table = value