pygsti.tools.remove_duplicates¶
-
pygsti.tools.
remove_duplicates
(l, indexToTest=None)¶ Remove duplicates from the a list and return the result.
In the special case when l contains WeightedGateString instances, the duplicates are removed in such a way that the largest weight instance of any set of duplicates is kept.
Parameters: - l (list) – The list to remove duplicates from.
- indexToTest (int, optional) – If not None, the index within the elements of l to test. For example, if all the elements of l contain 2 tuples (x,y) then set indexToTest == 1 to remove tuples with duplicate y-values.
Returns: the list after duplicates have been removed.
Return type: list