pygsti.tools.remove_duplicates_in_place

pygsti.tools.remove_duplicates_in_place(l, indexToTest=None)

Remove duplicates from the list passed as an argument.

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:

Return type:

None