diff --git a/docs/advanced.rst b/docs/advanced.rst index aa86939..645443a 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -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) diff --git a/mthree/_helpers.py b/mthree/_helpers.py index 650a2e9..bb6b2c8 100644 --- a/mthree/_helpers.py +++ b/mthree/_helpers.py @@ -13,6 +13,7 @@ """ Helper functions """ +from qiskit.providers.backend import BackendV1 def system_info(backend): @@ -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) diff --git a/mthree/mitigation.py b/mthree/mitigation.py index 15a2a03..11d526c 100644 --- a/mthree/mitigation.py +++ b/mthree/mitigation.py @@ -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, ): @@ -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.