Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch aer version bug #2144

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions qiskit_ibm_runtime/utils/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

"""Utility functions for the runtime service."""

import re
import base64
import copy
import importlib
Expand All @@ -39,7 +38,6 @@

try:
import qiskit_aer
from qiskit_aer.version import __version__ as _aer_version_string

HAS_AER = True
except ImportError:
Expand Down Expand Up @@ -87,10 +85,6 @@

SERVICE_MAX_SUPPORTED_QPY_VERSION = 13

_AER_VERSION = tuple(
int(x) for x in re.match(r"\d+\.\d+\.\d", _aer_version_string).group(0).split(".")[:3]
)


def to_base64_string(data: str) -> str:
"""Convert string to base64 string.
Expand Down Expand Up @@ -508,7 +502,7 @@ def object_hook(self, obj: Any) -> Any:
if obj_type == "to_json":
return obj_val
if obj_type == "NoiseModel":
if HAS_AER and _AER_VERSION[1] >= 16:
if HAS_AER:
return qiskit_aer.noise.NoiseModel.from_dict(obj_val)
warnings.warn("Qiskit Aer is needed to restore noise model.")
return obj_val
Expand Down
2 changes: 2 additions & 0 deletions release-notes/unreleased/2144.bug.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed an issue where having ``qiskit-aer`` not installed would
cause an import error.