Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
itoko committed Dec 1, 2023
1 parent 8604ffc commit 2cfe61c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,5 @@ def _transpiled_circuits(self) -> List[QuantumCircuit]:

def _metadata(self):
metadata = super()._metadata()
# Store measurement level and meas return if they have been
# set for the experiment
for run_opt in ["meas_level", "meas_return"]:
if hasattr(self.run_options, run_opt):
metadata[run_opt] = getattr(self.run_options, run_opt)

metadata["two_qubit_layers"] = self.experiment_options["two_qubit_layers"]
metadata["two_qubit_layers"] = self.experiment_options.two_qubit_layers
return metadata
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
from typing import List, Tuple, Union

import lmfit
import logging
import traceback
import numpy as np

import qiskit_experiments.curve_analysis as curve
import qiskit_experiments.database_service.device_component as device
from qiskit_experiments.exceptions import AnalysisError
from qiskit_experiments.framework import CompositeAnalysis, AnalysisResultData, ExperimentData

LOG = logging.getLogger(__name__)


class _ProcessFidelityAnalysis(curve.CurveAnalysis):
r"""A class to estimate process fidelity from one of 1Q/2Q simultaneous direct RB experiments
Expand Down Expand Up @@ -159,6 +163,7 @@ def _run_analysis(
try:
return super()._run_analysis(experiment_data)
except Exception:
LOG.error(f"{self.__class__.__name__}({self._physical_qubits}) failed: {traceback.format_exc()}")
failed_result = AnalysisResultData(
name="ProcessFidelity",
value=None,
Expand Down Expand Up @@ -212,6 +217,7 @@ def _run_analysis(
analysis_results = [slf_result] + analysis_results
return analysis_results, figures
except Exception:
LOG.error(f"{self.__class__.__name__} failed: {traceback.format_exc()}")
failed_result = AnalysisResultData(
name="SingleLF",
value=None,
Expand Down Expand Up @@ -273,6 +279,7 @@ def _run_analysis(
analysis_results = [lf_result, eplg_result] + analysis_results
return analysis_results, figures
except Exception:
LOG.error(f"{self.__class__.__name__} failed: {traceback.format_exc()}")
failed_results = [
AnalysisResultData(
name="LF",
Expand Down

0 comments on commit 2cfe61c

Please sign in to comment.