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

Tweaks for BackendV1 #250

Merged
merged 2 commits into from
Oct 23, 2024
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
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