Skip to content

Commit

Permalink
work around not being able to filter global gates by qubit
Browse files Browse the repository at this point in the history
  • Loading branch information
ajavadia committed Oct 18, 2022
1 parent 5963dd0 commit 7917f7e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,11 @@ def _error(circuit, target, qubit):
else:
if isinstance(circuit, list):
gate_errors = [
1 - getattr(target[node.name][(qubit,)], "error", 0.0) for node in circuit
1 - getattr(target[node.name].get((qubit,)), "error", 0.0) for node in circuit
]
else:
gate_errors = [
1 - getattr(target[inst.operation.name][(qubit,)], "error", 0.0) for inst in circuit
1 - getattr(target[inst.operation.name].get((qubit,)), "error", 0.0)
for inst in circuit
]
return 1 - np.product(gate_errors)

0 comments on commit 7917f7e

Please sign in to comment.