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 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: 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, 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 c46d74e..a2f1eaa 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -qiskit==1.2.4 +qiskit~=1.3 backoff~=2.0 qiskit_ibm_runtime>=0.23.0 qiskit-qasm3-import~=0.4 @@ -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 \ No newline at end of file diff --git a/setup.py b/setup.py index 0748ccd..2f09907 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", @@ -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", "qiskit-ibm-runtime>=0.23.0", ], },