pygsti.circuits.circuitconstruction.manipulate_circuits

pygsti.circuits.circuitconstruction.manipulate_circuits#

manipulate_circuits(circuits, rules, line_labels='auto')#

Applies manipulate_circuit() to each element of circuits.

This creates a new list of Circuit objects from an existing one by performing replacements according to rules (see manipulate_circuit()).

Parameters:
  • circuits (list of Circuits) – The list of circuits to use as the base for find & replace operations.

  • rules (list) – A list of (find,replace) 2-tuples which specify the replacement rules. Both find and replace are tuples of operation labels (or Circuit objects). If rules is None then circuits is returned.

  • line_labels ("auto" or tuple, optional) – The line labels to use when creating output Circuit objects. If “auto” then the line labels are determined automatically based on the line-labels which are present in the corresponding layer labels.

Return type:

list of Circuits