From 585edb69774147ff2f3b12be77ce99c14dff15ad Mon Sep 17 00:00:00 2001 From: Jesus Talavera Date: Mon, 9 Dec 2024 16:22:18 +0100 Subject: [PATCH 1/8] Change requirements-dev.txt --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 55218a3..fd3f2e1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -qiskit==1.2.4 +qiskit~=1.0 backoff~=2.0 qiskit_ibm_runtime>=0.23.0 qiskit-qasm3-import~=0.4 From eb3e7e9aa5c782983b8d5b28a63eed6ec14ee4b4 Mon Sep 17 00:00:00 2001 From: Jesus Talavera Date: Tue, 10 Dec 2024 11:04:46 +0100 Subject: [PATCH 2/8] Version endpoint only available in base_url --- qiskit_ibm_transpiler/wrappers/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_ibm_transpiler/wrappers/base.py b/qiskit_ibm_transpiler/wrappers/base.py index aae401f..dca8d00 100644 --- a/qiskit_ibm_transpiler/wrappers/base.py +++ b/qiskit_ibm_transpiler/wrappers/base.py @@ -79,6 +79,7 @@ def __init__( url_env_param = f"{path_param.upper()}_" if path_param else "" url_env_var = f"QISKIT_IBM_TRANSPILER_{url_env_param}URL" + self.base_url = base_url self.url = os.environ.get(url_env_var, url_with_path).rstrip("/") token = token if token else _get_token_from_system() @@ -93,7 +94,7 @@ def __init__( } def get_versions(self): - url = f"{self.url}/version" + url = f"{self.base_url}/version" resp = requests.get( url, headers=self.headers, From dd10787d41aebb3658e0efb6c60820a8e7bba105 Mon Sep 17 00:00:00 2001 From: Jesus Talavera Date: Tue, 10 Dec 2024 13:07:34 +0100 Subject: [PATCH 3/8] Fix compatibility issues --- qiskit_ibm_transpiler/ai/routing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_ibm_transpiler/ai/routing.py b/qiskit_ibm_transpiler/ai/routing.py index 18a1fc7..44b79af 100644 --- a/qiskit_ibm_transpiler/ai/routing.py +++ b/qiskit_ibm_transpiler/ai/routing.py @@ -324,10 +324,10 @@ def copy_dag_metadata(dag, target_dag): DAGCircuit: An empty copy of self. """ target_dag.name = dag.name - target_dag._global_phase = dag._global_phase + target_dag.global_phase = dag.global_phase target_dag.duration = dag.duration target_dag.unit = dag.unit target_dag.metadata = dag.metadata - target_dag._key_cache = dag._key_cache + # target_dag._key_cache = dag._key_cache return target_dag From 4cbf45a68cfa1ae89051a36b6c2196d94b4406e4 Mon Sep 17 00:00:00 2001 From: Jesus Talavera Date: Thu, 12 Dec 2024 14:43:48 +0100 Subject: [PATCH 4/8] Pin qiskit_ibm_ai_local_transpiler to 2.0 --- requirements-dev.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a12936a..b5733f8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,4 +12,4 @@ sphinx==7.2.6; python_version >= '3.9' qiskit-sphinx-theme==1.16.1 sphinxcontrib-katex==0.9.9 networkx==2.8.5 -qiskit_ibm_ai_local_transpiler==0.1.3 \ No newline at end of file +qiskit_ibm_ai_local_transpiler==0.2.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 40ff241..023d3f6 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ install_requires=requirements, extras_require={ "ai-local-mode": [ - "qiskit_ibm_ai_local_transpiler==0.1.3", + "qiskit_ibm_ai_local_transpiler==0.2.0", "qiskit-ibm-runtime>=0.23.0", ], }, From b9a1d4234518dfc94647aaa567855280d3d0c2bd Mon Sep 17 00:00:00 2001 From: Jesus Talavera Date: Thu, 12 Dec 2024 15:30:07 +0100 Subject: [PATCH 5/8] Add release-notes and pin qiskit version to 1.3 --- release-notes/unreleased/144.upgrade.rst | 1 + requirements-dev.txt | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 release-notes/unreleased/144.upgrade.rst diff --git a/release-notes/unreleased/144.upgrade.rst b/release-notes/unreleased/144.upgrade.rst new file mode 100644 index 0000000..28ebdc1 --- /dev/null +++ b/release-notes/unreleased/144.upgrade.rst @@ -0,0 +1 @@ +Update Qiskit to v1.3.0. diff --git a/requirements-dev.txt b/requirements-dev.txt index b5733f8..d34e96e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -qiskit~=1.0 +qiskit~=1.3 backoff~=2.0 qiskit_ibm_runtime>=0.23.0 qiskit-qasm3-import~=0.4 diff --git a/setup.py b/setup.py index 023d3f6..270aa4d 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ # putting multiple requirements on the same line will prevent qiskit-bot # from correctly updating the versions for the qiskit packages. requirements = [ - "qiskit==1.2.4", + "qiskit~=1.3", "backoff~=2.0", "qiskit-qasm3-import~=0.4", "requests~=2.0", From a06f885a06ff60ffbc00f0c9114942a6a923f823 Mon Sep 17 00:00:00 2001 From: Jesus Talavera Date: Tue, 17 Dec 2024 14:27:26 +0100 Subject: [PATCH 6/8] Use lower qpy version between local qiskit and cloud service --- qiskit_ibm_transpiler/utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qiskit_ibm_transpiler/utils.py b/qiskit_ibm_transpiler/utils.py index 39ac4da..46d8e86 100644 --- a/qiskit_ibm_transpiler/utils.py +++ b/qiskit_ibm_transpiler/utils.py @@ -50,6 +50,14 @@ } +def _get_qpy_version(qiskit_version: str): + service_qpy_version = QPY_QISKIT_VERSION_MAPPING.get( + qiskit_version, common.QPY_VERSION + ) + # Return lower version between local qiskit and service to keep compatibility + return min(common.QPY_VERSION, service_qpy_version) + + def get_metrics(qc: QuantumCircuit) -> Dict[str, int]: """Returns a dict with metrics from a QuantumCircuit""" qcd = qc.decompose(reps=3) @@ -238,7 +246,7 @@ def get_qpy_from_circuit( qpy.dump( input_circ, output_b, - version=QPY_QISKIT_VERSION_MAPPING.get(qiskit_version, common.QPY_VERSION), + version=_get_qpy_version(qiskit_version), ) qpy_string = base64.b64encode(output_b.getvalue()).decode("utf-8") else: From 92d7938477257cd15a1023d353edf464a5f4ddad Mon Sep 17 00:00:00 2001 From: Jesus Talavera Date: Thu, 19 Dec 2024 11:53:34 +0100 Subject: [PATCH 7/8] Make more flexible qiskit_ibm_ai_local_transpiler version requirement --- requirements-dev.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d34e96e..1e82fb3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,4 +12,4 @@ sphinx==7.2.6; python_version >= '3.9' qiskit-sphinx-theme==1.16.1 sphinxcontrib-katex==0.9.9 networkx==2.8.5 -qiskit_ibm_ai_local_transpiler==0.2.0 \ No newline at end of file +qiskit_ibm_ai_local_transpiler~=0.2.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 564cb65..d47ba6f 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ install_requires=requirements, extras_require={ "ai-local-mode": [ - "qiskit_ibm_ai_local_transpiler==0.2.0", + "qiskit_ibm_ai_local_transpiler~=0.2.0", "qiskit-ibm-runtime>=0.23.0", ], }, From c2dece2fd6840b5fb988e97a88079d9a49e7da7f Mon Sep 17 00:00:00 2001 From: Jesus Talavera Date: Thu, 19 Dec 2024 11:54:32 +0100 Subject: [PATCH 8/8] Make more flexible qiskit_ibm_ai_local_transpiler version requirement (2) --- requirements-dev.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1e82fb3..a2f1eaa 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,4 +12,4 @@ sphinx==7.2.6; python_version >= '3.9' qiskit-sphinx-theme==1.16.1 sphinxcontrib-katex==0.9.9 networkx==2.8.5 -qiskit_ibm_ai_local_transpiler~=0.2.0 \ No newline at end of file +qiskit_ibm_ai_local_transpiler~=0.2 \ No newline at end of file diff --git a/setup.py b/setup.py index d47ba6f..2f09907 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ install_requires=requirements, extras_require={ "ai-local-mode": [ - "qiskit_ibm_ai_local_transpiler~=0.2.0", + "qiskit_ibm_ai_local_transpiler~=0.2", "qiskit-ibm-runtime>=0.23.0", ], },