Skip to content

Commit

Permalink
Fix ZeroDivisionError in qiskit_backend_overview (#7260)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelishman authored Nov 11, 2021
1 parent e02119b commit 4bc5fb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qiskit/tools/jupyter/backend_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ def backend_widget(backend):
if param["value"] != 1.0:
sum_cx_err += param["value"]
num_cx += 1
avg_cx_err = round(sum_cx_err / (num_cx), 4)
if num_cx > 0:
avg_cx_err = round(sum_cx_err / num_cx, 4)

cx_widget = widgets.HTML(value=f"<h5>{avg_cx_err}</h5>", layout=widgets.Layout())

Expand Down

0 comments on commit 4bc5fb5

Please sign in to comment.