Skip to content

Commit

Permalink
Bugfix for np.array type identity check in fidsel
Browse files Browse the repository at this point in the history
  • Loading branch information
sserita committed Dec 16, 2022
1 parent d83670a commit b634639
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pygsti/algorithms/fiducialselection.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ def find_fiducials(target_model, omit_identity=True, eq_thresh=1e-6,
Identity = _np.identity(target_model.dim, 'd')

for gate in fidOps:
if frobeniusdist_squared(target_model.operations[gate], Identity) < eq_thresh:
mx = target_model.operations[gate]
if not isinstance(mx, _np.ndarray):
mx = mx.to_dense()
if frobeniusdist_squared(mx, Identity) < eq_thresh:
fidOps.remove(gate)

availableFidList = []
Expand Down

0 comments on commit b634639

Please sign in to comment.