Skip to content

Commit d449c05

Browse files
fixed problem with SV masking shape
1 parent 5c1c42f commit d449c05

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pygsti/modelmembers/povms/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def calc_physical_subspace(dense_ideal_povm, epsilon = 1e-9):
579579

580580
_,S,Vt = _np.linalg.svd(J)
581581
#Only return nontrivial singular vectors
582-
non_zero_mask = _np.abs(S) > 1e-13
582+
non_zero_mask = _np.where(_np.abs(S) > 1e-13)
583583
non_trivial_vecs = Vt[non_zero_mask]
584584
non_trivial_vecs = non_trivial_vecs.reshape(-1, Vt.shape[1]) # Reshape to ensure it's 2D
585585
return non_trivial_vecs

pygsti/modelmembers/states/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def calc_physical_subspace(ideal_prep, epsilon = 1e-9):
289289
_,S,Vt = _np.linalg.svd(J)
290290

291291
#Only return nontrivial singular vectors
292-
non_zero_mask = _np.abs(S) > 1e-13
292+
non_zero_mask = _np.where(_np.abs(S) > 1e-13)
293293
non_trivial_vecs = Vt[non_zero_mask]
294294
non_trivial_vecs = non_trivial_vecs.reshape(-1, Vt.shape[1]) # Reshape to ensure it's 2D
295295
return non_trivial_vecs

0 commit comments

Comments
 (0)