pygsti.tools.listtools.find_replace_tuple

pygsti.tools.listtools.find_replace_tuple#

find_replace_tuple(t, alias_dict)#

Replace elements of t according to rules in alias_dict.

Parameters:
  • t (tuple or list) – The object to perform replacements upon.

  • alias_dict (dictionary) – Dictionary whose keys are potential elements of t and whose values are tuples corresponding to a sub-sequence that the given element should be replaced with. If None, no replacement is performed.

Return type:

tuple