Skip to content

Commit 7e3b14c

Browse files
commented out label function that is still not working, implementing quick fix that should be reverted later
1 parent 0e24e2d commit 7e3b14c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: pygsti/baseobjs/errorgenbasis.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,15 @@ def label_index(self, label, ok_if_missing=False, identity_label='I'):
740740
identity_label : str, optional (default 'I')
741741
An optional string specifying the label used to denote the identity in basis element labels.
742742
"""
743+
try:
744+
return self.labels.index(label)
745+
except ValueError as error:
746+
747+
if ok_if_missing:
748+
return None
749+
else:
750+
raise error
751+
'''
743752
if isinstance(label, _LocalElementaryErrorgenLabel):
744753
label = _GlobalElementaryErrorgenLabel.cast(label, self.sslbls, identity_label=identity_label)
745754
@@ -774,7 +783,7 @@ def label_index(self, label, ok_if_missing=False, identity_label='I'):
774783
775784
return base + indices[label]
776785
return base + indices[elemgen_label]
777-
786+
'''
778787

779788
#@property
780789
#def sslbls(self):

0 commit comments

Comments
 (0)