Skip to content

Commit

Permalink
Merge pull request #250 from nonhermitian/backendv1-support
Browse files Browse the repository at this point in the history
Tweaks for BackendV1
  • Loading branch information
nonhermitian authored Oct 23, 2024
2 parents cf341a2 + 6c1a7a1 commit 1764d3a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,4 @@ is set too low.

.. jupyter-execute::

quasis = mit.apply_correction(raw_counts, range(6), method='iterative', tol=1e-6)
quasis = mit.apply_correction(raw_counts, range(6), method='iterative', tol=1e-5)
9 changes: 7 additions & 2 deletions mthree/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"""
Helper functions
"""
from qiskit.providers.backend import BackendV1


def system_info(backend):
Expand All @@ -27,12 +28,16 @@ def system_info(backend):
info_dict = {}
info_dict["inoperable_qubits"] = []
config = backend.configuration()
info_dict["name"] = backend.name
if isinstance(backend, BackendV1):
name = backend.name()
else:
name = backend.name
info_dict["name"] = name
info_dict["num_qubits"] = config.num_qubits
_max_shots = config.max_shots
info_dict["max_shots"] = _max_shots if _max_shots else int(1e6)
info_dict["simulator"] = config.simulator
if "fake" in backend.name:
if "fake" in info_dict["name"]:
info_dict["simulator"] = True
# max_circuits can be set a couple of ways
max_circuits = getattr(config, "max_experiments", 1)
Expand Down
4 changes: 2 additions & 2 deletions mthree/mitigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def apply_correction(
distance=None,
method="auto",
max_iter=25,
tol=1e-3,
tol=1e-4,
return_mitigation_overhead=False,
details=False,
):
Expand All @@ -451,7 +451,7 @@ def apply_correction(
distance (int): Distance to correct for. Default=num_bits
method (str): Solution method: 'auto', 'direct' or 'iterative'.
max_iter (int): Max. number of iterations, Default=25.
tol (float): Convergence tolerance of iterative method, Default=1e-3.
tol (float): Convergence tolerance of iterative method, Default=1e-4.
return_mitigation_overhead (bool): Returns the mitigation overhead, default=False.
details (bool): Return extra info, default=False.
Expand Down

0 comments on commit 1764d3a

Please sign in to comment.